ossl_i2c_ASN1_BIT_STRING:
   22|  99.0k|{
   23|  99.0k|    int ret, j, bits, len;
   24|  99.0k|    unsigned char *p, *d;
   25|       |
   26|  99.0k|    if (a == NULL)
  ------------------
  |  Branch (26:9): [True: 0, False: 99.0k]
  ------------------
   27|      0|        return 0;
   28|       |
   29|  99.0k|    len = a->length;
   30|       |
   31|  99.0k|    if (len > 0) {
  ------------------
  |  Branch (31:9): [True: 25.6k, False: 73.3k]
  ------------------
   32|  25.6k|        if (a->flags & ASN1_STRING_FLAG_BITS_LEFT) {
  ------------------
  |  |  161|  25.6k|# define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  |  Branch (32:13): [True: 25.6k, False: 0]
  ------------------
   33|  25.6k|            bits = (int)a->flags & 0x07;
   34|  25.6k|        } 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|      0|            j = a->data[len - 1];
   40|      0|            if (j & 0x01)
  ------------------
  |  Branch (40:17): [True: 0, False: 0]
  ------------------
   41|      0|                bits = 0;
   42|      0|            else if (j & 0x02)
  ------------------
  |  Branch (42:22): [True: 0, False: 0]
  ------------------
   43|      0|                bits = 1;
   44|      0|            else if (j & 0x04)
  ------------------
  |  Branch (44:22): [True: 0, False: 0]
  ------------------
   45|      0|                bits = 2;
   46|      0|            else if (j & 0x08)
  ------------------
  |  Branch (46:22): [True: 0, False: 0]
  ------------------
   47|      0|                bits = 3;
   48|      0|            else if (j & 0x10)
  ------------------
  |  Branch (48:22): [True: 0, False: 0]
  ------------------
   49|      0|                bits = 4;
   50|      0|            else if (j & 0x20)
  ------------------
  |  Branch (50:22): [True: 0, False: 0]
  ------------------
   51|      0|                bits = 5;
   52|      0|            else if (j & 0x40)
  ------------------
  |  Branch (52:22): [True: 0, False: 0]
  ------------------
   53|      0|                bits = 6;
   54|      0|            else if (j & 0x80)
  ------------------
  |  Branch (54:22): [True: 0, False: 0]
  ------------------
   55|      0|                bits = 7;
   56|      0|            else
   57|      0|                bits = 0;       /* should not happen */
   58|      0|        }
   59|  25.6k|    } else
   60|  73.3k|        bits = 0;
   61|       |
   62|  99.0k|    ret = 1 + len;
   63|  99.0k|    if (pp == NULL)
  ------------------
  |  Branch (63:9): [True: 76.8k, False: 22.2k]
  ------------------
   64|  76.8k|        return ret;
   65|       |
   66|  22.2k|    p = *pp;
   67|       |
   68|  22.2k|    *(p++) = (unsigned char)bits;
   69|  22.2k|    d = a->data;
   70|  22.2k|    if (len > 0) {
  ------------------
  |  Branch (70:9): [True: 4.76k, False: 17.4k]
  ------------------
   71|  4.76k|        memcpy(p, d, len);
   72|  4.76k|        p += len;
   73|  4.76k|        p[-1] &= (0xff << bits);
   74|  4.76k|    }
   75|  22.2k|    *pp = p;
   76|  22.2k|    return ret;
   77|  99.0k|}
ossl_c2i_ASN1_BIT_STRING:
   81|   246k|{
   82|   246k|    ASN1_BIT_STRING *ret = NULL;
   83|   246k|    const unsigned char *p;
   84|   246k|    unsigned char *s;
   85|   246k|    int i = 0;
   86|       |
   87|   246k|    if (len < 1) {
  ------------------
  |  Branch (87:9): [True: 244, False: 246k]
  ------------------
   88|    244|        i = ASN1_R_STRING_TOO_SHORT;
  ------------------
  |  |  115|    244|# define ASN1_R_STRING_TOO_SHORT                          152
  ------------------
   89|    244|        goto err;
   90|    244|    }
   91|       |
   92|   246k|    if (len > INT_MAX) {
  ------------------
  |  Branch (92:9): [True: 0, False: 246k]
  ------------------
   93|      0|        i = ASN1_R_STRING_TOO_LONG;
  ------------------
  |  |  114|      0|# define ASN1_R_STRING_TOO_LONG                           151
  ------------------
   94|      0|        goto err;
   95|      0|    }
   96|       |
   97|   246k|    if ((a == NULL) || ((*a) == NULL)) {
  ------------------
  |  Branch (97:9): [True: 0, False: 246k]
  |  Branch (97:24): [True: 56.9k, False: 189k]
  ------------------
   98|  56.9k|        if ((ret = ASN1_BIT_STRING_new()) == NULL)
  ------------------
  |  Branch (98:13): [True: 0, False: 56.9k]
  ------------------
   99|      0|            return NULL;
  100|  56.9k|    } else
  101|   189k|        ret = (*a);
  102|       |
  103|   246k|    p = *pp;
  104|   246k|    i = *(p++);
  105|   246k|    if (i > 7) {
  ------------------
  |  Branch (105:9): [True: 223, False: 245k]
  ------------------
  106|    223|        i = ASN1_R_INVALID_BIT_STRING_BITS_LEFT;
  ------------------
  |  |   71|    223|# define ASN1_R_INVALID_BIT_STRING_BITS_LEFT              220
  ------------------
  107|    223|        goto err;
  108|    223|    }
  109|       |    /*
  110|       |     * We do this to preserve the settings.  If we modify the settings, via
  111|       |     * the _set_bit function, we will recalculate on output
  112|       |     */
  113|   245k|    ossl_asn1_string_set_bits_left(ret, i);
  114|       |
  115|   245k|    if (len-- > 1) {            /* using one because of the bits left byte */
  ------------------
  |  Branch (115:9): [True: 163k, False: 82.1k]
  ------------------
  116|   163k|        s = OPENSSL_malloc((int)len);
  ------------------
  |  |   97|   163k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   163k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   163k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  117|   163k|        if (s == NULL) {
  ------------------
  |  Branch (117:13): [True: 0, False: 163k]
  ------------------
  118|      0|            goto err;
  119|      0|        }
  120|   163k|        memcpy(s, p, (int)len);
  121|   163k|        s[len - 1] &= (0xff << i);
  122|   163k|        p += len;
  123|   163k|    } else
  124|  82.1k|        s = NULL;
  125|       |
  126|   245k|    ASN1_STRING_set0(ret, s, (int)len);
  127|   245k|    ret->type = V_ASN1_BIT_STRING;
  ------------------
  |  |   65|   245k|# define V_ASN1_BIT_STRING               3
  ------------------
  128|   245k|    if (a != NULL)
  ------------------
  |  Branch (128:9): [True: 245k, False: 0]
  ------------------
  129|   245k|        (*a) = ret;
  130|   245k|    *pp = p;
  131|   245k|    return ret;
  132|    467| err:
  133|    467|    if (i != 0)
  ------------------
  |  Branch (133:9): [True: 467, False: 0]
  ------------------
  134|    467|        ERR_raise(ERR_LIB_ASN1, i);
  ------------------
  |  |  401|    467|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    467|    (ERR_new(),                                                 \
  |  |  |  |  404|    467|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    467|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    467|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    467|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    467|     ERR_set_error)
  |  |  ------------------
  ------------------
  135|    467|    if ((a == NULL) || (*a != ret))
  ------------------
  |  Branch (135:9): [True: 0, False: 467]
  |  Branch (135:24): [True: 218, False: 249]
  ------------------
  136|    218|        ASN1_BIT_STRING_free(ret);
  137|    467|    return NULL;
  138|   245k|}

ASN1_item_d2i_bio_ex:
   60|  8.56k|{
   61|  8.56k|    BUF_MEM *b = NULL;
   62|  8.56k|    const unsigned char *p;
   63|  8.56k|    void *ret = NULL;
   64|  8.56k|    int len;
   65|       |
   66|  8.56k|    if (in == NULL)
  ------------------
  |  Branch (66:9): [True: 0, False: 8.56k]
  ------------------
   67|      0|        return NULL;
   68|  8.56k|    len = asn1_d2i_read_bio(in, &b);
   69|  8.56k|    if (len < 0)
  ------------------
  |  Branch (69:9): [True: 420, False: 8.14k]
  ------------------
   70|    420|        goto err;
   71|       |
   72|  8.14k|    p = (const unsigned char *)b->data;
   73|  8.14k|    ret = ASN1_item_d2i_ex(x, &p, len, it, libctx, propq);
   74|  8.56k| err:
   75|  8.56k|    BUF_MEM_free(b);
   76|  8.56k|    return ret;
   77|  8.14k|}
asn1_d2i_read_bio:
  110|   118k|{
  111|   118k|    BUF_MEM *b;
  112|   118k|    unsigned char *p;
  113|   118k|    int i;
  114|   118k|    size_t want = HEADER_SIZE;
  ------------------
  |  |  107|   118k|#define HEADER_SIZE   8
  ------------------
  115|   118k|    uint32_t eos = 0;
  116|   118k|    size_t off = 0;
  117|   118k|    size_t len = 0;
  118|   118k|    size_t diff;
  119|       |
  120|   118k|    const unsigned char *q;
  121|   118k|    long slen;
  122|   118k|    int inf, tag, xclass;
  123|       |
  124|   118k|    b = BUF_MEM_new();
  125|   118k|    if (b == NULL) {
  ------------------
  |  Branch (125:9): [True: 0, False: 118k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  127|      0|        return -1;
  128|      0|    }
  129|       |
  130|   118k|    ERR_set_mark();
  131|  8.06M|    for (;;) {
  132|  8.06M|        diff = len - off;
  133|  8.06M|        if (want >= diff) {
  ------------------
  |  Branch (133:13): [True: 8.06M, False: 0]
  ------------------
  134|  8.06M|            want -= diff;
  135|       |
  136|  8.06M|            if (len + want < len || !BUF_MEM_grow_clean(b, len + want)) {
  ------------------
  |  Branch (136:17): [True: 0, False: 8.06M]
  |  Branch (136:37): [True: 0, False: 8.06M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  138|      0|                goto err;
  139|      0|            }
  140|  8.06M|            i = BIO_read(in, &(b->data[len]), want);
  141|  8.06M|            if (i < 0 && diff == 0) {
  ------------------
  |  Branch (141:17): [True: 10.6k, False: 8.05M]
  |  Branch (141:26): [True: 81, False: 10.5k]
  ------------------
  142|     81|                ERR_raise(ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA);
  ------------------
  |  |  401|     81|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     81|    (ERR_new(),                                                 \
  |  |  |  |  404|     81|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     81|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     81|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     81|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     81|     ERR_set_error)
  |  |  ------------------
  ------------------
  143|     81|                goto err;
  144|     81|            }
  145|  8.06M|            if (i > 0) {
  ------------------
  |  Branch (145:17): [True: 8.02M, False: 39.8k]
  ------------------
  146|  8.02M|                if (len + i < len) {
  ------------------
  |  Branch (146:21): [True: 0, False: 8.02M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  148|      0|                    goto err;
  149|      0|                }
  150|  8.02M|                len += i;
  151|  8.02M|            }
  152|  8.06M|        }
  153|       |        /* else data already loaded */
  154|       |
  155|  8.06M|        p = (unsigned char *)&(b->data[off]);
  156|  8.06M|        q = p;
  157|  8.06M|        diff = len - off;
  158|  8.06M|        if (diff == 0)
  ------------------
  |  Branch (158:13): [True: 0, False: 8.06M]
  ------------------
  159|      0|            goto err;
  160|  8.06M|        inf = ASN1_get_object(&q, &slen, &tag, &xclass, diff);
  161|  8.06M|        if (inf & 0x80) {
  ------------------
  |  Branch (161:13): [True: 575k, False: 7.49M]
  ------------------
  162|   575k|            unsigned long e;
  163|       |
  164|   575k|            e = ERR_GET_REASON(ERR_peek_last_error());
  165|   575k|            if (e != ASN1_R_TOO_LONG)
  ------------------
  |  |  119|   575k|# define ASN1_R_TOO_LONG                                  155
  ------------------
  |  Branch (165:17): [True: 77, False: 574k]
  ------------------
  166|     77|                goto err;
  167|   574k|            ERR_pop_to_mark();
  168|   574k|        }
  169|  8.06M|        i = q - p;            /* header length */
  170|  8.06M|        off += i;               /* end of data */
  171|       |
  172|  8.06M|        if (inf & 1) {
  ------------------
  |  Branch (172:13): [True: 1.56M, False: 6.50M]
  ------------------
  173|       |            /* no data body so go round again */
  174|  1.56M|            if (eos == UINT32_MAX) {
  ------------------
  |  Branch (174:17): [True: 0, False: 1.56M]
  ------------------
  175|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  176|      0|                goto err;
  177|      0|            }
  178|  1.56M|            eos++;
  179|  1.56M|            want = HEADER_SIZE;
  ------------------
  |  |  107|  1.56M|#define HEADER_SIZE   8
  ------------------
  180|  6.50M|        } else if (eos && (slen == 0) && (tag == V_ASN1_EOC)) {
  ------------------
  |  |   62|  4.37M|# define V_ASN1_EOC                      0
  ------------------
  |  Branch (180:20): [True: 6.48M, False: 14.0k]
  |  Branch (180:27): [True: 4.37M, False: 2.11M]
  |  Branch (180:42): [True: 916k, False: 3.46M]
  ------------------
  181|       |            /* eos value, so go back and read another header */
  182|   916k|            eos--;
  183|   916k|            if (eos == 0)
  ------------------
  |  Branch (183:17): [True: 103k, False: 812k]
  ------------------
  184|   103k|                break;
  185|   812k|            else
  186|   812k|                want = HEADER_SIZE;
  ------------------
  |  |  107|   812k|#define HEADER_SIZE   8
  ------------------
  187|  5.58M|        } else {
  188|       |            /* suck in slen bytes of data */
  189|  5.58M|            want = slen;
  190|  5.58M|            if (want > (len - off)) {
  ------------------
  |  Branch (190:17): [True: 574k, False: 5.00M]
  ------------------
  191|   574k|                size_t chunk_max = ASN1_CHUNK_INITIAL_SIZE;
  ------------------
  |  |  108|   574k|#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024)
  ------------------
  192|       |
  193|   574k|                want -= (len - off);
  194|   574k|                if (want > INT_MAX /* BIO_read takes an int length */  ||
  ------------------
  |  Branch (194:21): [True: 39, False: 574k]
  ------------------
  195|   574k|                    len + want < len) {
  ------------------
  |  Branch (195:21): [True: 0, False: 574k]
  ------------------
  196|     39|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|     39|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     39|    (ERR_new(),                                                 \
  |  |  |  |  404|     39|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     39|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     39|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     39|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     39|     ERR_set_error)
  |  |  ------------------
  ------------------
  197|     39|                    goto err;
  198|     39|                }
  199|  1.15M|                while (want > 0) {
  ------------------
  |  Branch (199:24): [True: 577k, False: 574k]
  ------------------
  200|       |                    /*
  201|       |                     * Read content in chunks of increasing size
  202|       |                     * so we can return an error for EOF without
  203|       |                     * having to allocate the entire content length
  204|       |                     * in one go.
  205|       |                     */
  206|   577k|                    size_t chunk = want > chunk_max ? chunk_max : want;
  ------------------
  |  Branch (206:36): [True: 2.63k, False: 574k]
  ------------------
  207|       |
  208|   577k|                    if (!BUF_MEM_grow_clean(b, len + chunk)) {
  ------------------
  |  Branch (208:25): [True: 0, False: 577k]
  ------------------
  209|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  210|      0|                        goto err;
  211|      0|                    }
  212|   577k|                    want -= chunk;
  213|  1.15M|                    while (chunk > 0) {
  ------------------
  |  Branch (213:28): [True: 577k, False: 577k]
  ------------------
  214|   577k|                        i = BIO_read(in, &(b->data[len]), chunk);
  215|   577k|                        if (i <= 0) {
  ------------------
  |  Branch (215:29): [True: 232, False: 577k]
  ------------------
  216|    232|                            ERR_raise(ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA);
  ------------------
  |  |  401|    232|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    232|    (ERR_new(),                                                 \
  |  |  |  |  404|    232|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    232|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    232|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    232|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    232|     ERR_set_error)
  |  |  ------------------
  ------------------
  217|    232|                            goto err;
  218|    232|                        }
  219|       |                    /*
  220|       |                     * This can't overflow because |len+want| didn't
  221|       |                     * overflow.
  222|       |                     */
  223|   577k|                        len += i;
  224|   577k|                        chunk -= i;
  225|   577k|                    }
  226|   577k|                    if (chunk_max < INT_MAX/2)
  ------------------
  |  Branch (226:25): [True: 577k, False: 0]
  ------------------
  227|   577k|                        chunk_max *= 2;
  228|   577k|                }
  229|   574k|            }
  230|  5.58M|            if (off + slen < off) {
  ------------------
  |  Branch (230:17): [True: 0, False: 5.58M]
  ------------------
  231|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  232|      0|                goto err;
  233|      0|            }
  234|  5.58M|            off += slen;
  235|  5.58M|            if (eos == 0) {
  ------------------
  |  Branch (235:17): [True: 13.9k, False: 5.57M]
  ------------------
  236|  13.9k|                break;
  237|  13.9k|            } else
  238|  5.57M|                want = HEADER_SIZE;
  ------------------
  |  |  107|  5.57M|#define HEADER_SIZE   8
  ------------------
  239|  5.58M|        }
  240|  8.06M|    }
  241|       |
  242|   117k|    if (off > INT_MAX) {
  ------------------
  |  Branch (242:9): [True: 0, False: 117k]
  ------------------
  243|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  244|      0|        goto err;
  245|      0|    }
  246|       |
  247|   117k|    *pb = b;
  248|   117k|    return off;
  249|    429| err:
  250|    429|    ERR_clear_last_mark();
  251|    429|    BUF_MEM_free(b);
  252|    429|    return -1;
  253|   117k|}

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

ASN1_item_dup:
   51|  6.42k|{
   52|  6.42k|    ASN1_aux_cb *asn1_cb = NULL;
   53|  6.42k|    unsigned char *b = NULL;
   54|  6.42k|    const unsigned char *p;
   55|  6.42k|    long i;
   56|  6.42k|    ASN1_VALUE *ret;
   57|  6.42k|    OSSL_LIB_CTX *libctx = NULL;
   58|  6.42k|    const char *propq = NULL;
   59|       |
   60|  6.42k|    if (x == NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 6.42k]
  ------------------
   61|      0|        return NULL;
   62|       |
   63|  6.42k|    if (it->itype == ASN1_ITYPE_SEQUENCE || it->itype == ASN1_ITYPE_CHOICE
  ------------------
  |  |   81|  12.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
                  if (it->itype == ASN1_ITYPE_SEQUENCE || it->itype == ASN1_ITYPE_CHOICE
  ------------------
  |  |   82|  9.61k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (63:9): [True: 3.23k, False: 3.19k]
  |  Branch (63:45): [True: 0, False: 3.19k]
  ------------------
   64|  6.42k|        || it->itype == ASN1_ITYPE_NDEF_SEQUENCE) {
  ------------------
  |  |   86|  3.19k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (64:12): [True: 0, False: 3.19k]
  ------------------
   65|  3.23k|        const ASN1_AUX *aux = it->funcs;
   66|       |
   67|  3.23k|        asn1_cb = aux != NULL ? aux->asn1_cb : NULL;
  ------------------
  |  Branch (67:19): [True: 0, False: 3.23k]
  ------------------
   68|  3.23k|    }
   69|       |
   70|  6.42k|    if (asn1_cb != NULL) {
  ------------------
  |  Branch (70:9): [True: 0, False: 6.42k]
  ------------------
   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|  6.42k|    i = ASN1_item_i2d(x, &b, it);
   78|  6.42k|    if (b == NULL) {
  ------------------
  |  Branch (78:9): [True: 0, False: 6.42k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   80|      0|        return NULL;
   81|      0|    }
   82|  6.42k|    p = b;
   83|  6.42k|    ret = ASN1_item_d2i_ex(NULL, &p, i, it, libctx, propq);
   84|  6.42k|    OPENSSL_free(b);
  ------------------
  |  |  107|  6.42k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  6.42k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  6.42k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   85|       |
   86|  6.42k|    if (asn1_cb != NULL
  ------------------
  |  Branch (86:9): [True: 0, False: 6.42k]
  ------------------
   87|  6.42k|        && !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|  6.42k|    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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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|  6.42k|}

ASN1_item_i2d_bio:
   86|    955|{
   87|    955|    unsigned char *b = NULL;
   88|    955|    int i, j = 0, n, ret = 1;
   89|       |
   90|    955|    n = ASN1_item_i2d(x, &b, it);
   91|    955|    if (b == NULL) {
  ------------------
  |  Branch (91:9): [True: 0, False: 955]
  ------------------
   92|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   93|      0|        return 0;
   94|      0|    }
   95|       |
   96|    955|    for (;;) {
   97|    955|        i = BIO_write(out, &(b[j]), n);
   98|    955|        if (i == n)
  ------------------
  |  Branch (98:13): [True: 955, False: 0]
  ------------------
   99|    955|            break;
  100|      0|        if (i <= 0) {
  ------------------
  |  Branch (100:13): [True: 0, False: 0]
  ------------------
  101|      0|            ret = 0;
  102|      0|            break;
  103|      0|        }
  104|      0|        j += i;
  105|      0|        n -= i;
  106|      0|    }
  107|    955|    OPENSSL_free(b);
  ------------------
  |  |  107|    955|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    955|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    955|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  108|    955|    return ret;
  109|    955|}

ossl_i2c_ASN1_INTEGER:
  208|  51.5k|{
  209|  51.5k|    return i2c_ibuf(a->data, a->length, a->type & V_ASN1_NEG, pp);
  ------------------
  |  |   97|  51.5k|# define V_ASN1_NEG                      0x100
  ------------------
  210|  51.5k|}
ossl_c2i_ASN1_INTEGER:
  288|  83.5k|{
  289|  83.5k|    ASN1_INTEGER *ret = NULL;
  290|  83.5k|    size_t r;
  291|  83.5k|    int neg;
  292|       |
  293|  83.5k|    r = c2i_ibuf(NULL, NULL, *pp, len);
  294|       |
  295|  83.5k|    if (r == 0)
  ------------------
  |  Branch (295:9): [True: 1.32k, False: 82.1k]
  ------------------
  296|  1.32k|        return NULL;
  297|       |
  298|  82.1k|    if ((a == NULL) || ((*a) == NULL)) {
  ------------------
  |  Branch (298:9): [True: 0, False: 82.1k]
  |  Branch (298:24): [True: 17.0k, False: 65.0k]
  ------------------
  299|  17.0k|        ret = ASN1_INTEGER_new();
  300|  17.0k|        if (ret == NULL)
  ------------------
  |  Branch (300:13): [True: 0, False: 17.0k]
  ------------------
  301|      0|            return NULL;
  302|  17.0k|        ret->type = V_ASN1_INTEGER;
  ------------------
  |  |   64|  17.0k|# define V_ASN1_INTEGER                  2
  ------------------
  303|  17.0k|    } else
  304|  65.0k|        ret = *a;
  305|       |
  306|  82.1k|    if (ASN1_STRING_set(ret, NULL, r) == 0) {
  ------------------
  |  Branch (306:9): [True: 0, False: 82.1k]
  ------------------
  307|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  308|      0|        goto err;
  309|      0|    }
  310|       |
  311|  82.1k|    c2i_ibuf(ret->data, &neg, *pp, len);
  312|       |
  313|  82.1k|    if (neg != 0)
  ------------------
  |  Branch (313:9): [True: 8.62k, False: 73.5k]
  ------------------
  314|  8.62k|        ret->type |= V_ASN1_NEG;
  ------------------
  |  |   97|  8.62k|# define V_ASN1_NEG                      0x100
  ------------------
  315|  73.5k|    else
  316|  73.5k|        ret->type &= ~V_ASN1_NEG;
  ------------------
  |  |   97|  73.5k|# define V_ASN1_NEG                      0x100
  ------------------
  317|       |
  318|  82.1k|    *pp += len;
  319|  82.1k|    if (a != NULL)
  ------------------
  |  Branch (319:9): [True: 82.1k, False: 0]
  ------------------
  320|  82.1k|        (*a) = ret;
  321|  82.1k|    return ret;
  322|      0| err:
  323|      0|    if (a == NULL || *a != ret)
  ------------------
  |  Branch (323:9): [True: 0, False: 0]
  |  Branch (323:22): [True: 0, False: 0]
  ------------------
  324|      0|        ASN1_INTEGER_free(ret);
  325|      0|    return NULL;
  326|  82.1k|}
ASN1_INTEGER_to_BN:
  568|  7.21k|{
  569|  7.21k|    return asn1_string_to_bn(ai, bn, V_ASN1_INTEGER);
  ------------------
  |  |   64|  7.21k|# define V_ASN1_INTEGER                  2
  ------------------
  570|  7.21k|}
ASN1_ENUMERATED_get_int64:
  573|  1.33k|{
  574|  1.33k|    return asn1_string_get_int64(pr, a, V_ASN1_ENUMERATED);
  ------------------
  |  |   72|  1.33k|# define V_ASN1_ENUMERATED               10
  ------------------
  575|  1.33k|}
ASN1_ENUMERATED_get:
  588|  1.56k|{
  589|  1.56k|    int i;
  590|  1.56k|    int64_t r;
  591|  1.56k|    if (a == NULL)
  ------------------
  |  Branch (591:9): [True: 0, False: 1.56k]
  ------------------
  592|      0|        return 0;
  593|  1.56k|    if ((a->type & ~V_ASN1_NEG) != V_ASN1_ENUMERATED)
  ------------------
  |  |   97|  1.56k|# define V_ASN1_NEG                      0x100
  ------------------
                  if ((a->type & ~V_ASN1_NEG) != V_ASN1_ENUMERATED)
  ------------------
  |  |   72|  1.56k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (593:9): [True: 0, False: 1.56k]
  ------------------
  594|      0|        return -1;
  595|  1.56k|    if (a->length > (int)sizeof(long))
  ------------------
  |  Branch (595:9): [True: 224, False: 1.33k]
  ------------------
  596|    224|        return 0xffffffffL;
  597|  1.33k|    i = ASN1_ENUMERATED_get_int64(&r, a);
  598|  1.33k|    if (i == 0)
  ------------------
  |  Branch (598:9): [True: 703, False: 633]
  ------------------
  599|    703|        return -1;
  600|    633|    if (r > LONG_MAX || r < LONG_MIN)
  ------------------
  |  Branch (600:9): [True: 0, False: 633]
  |  Branch (600:25): [True: 0, False: 633]
  ------------------
  601|      0|        return -1;
  602|    633|    return (long)r;
  603|    633|}
ossl_c2i_uint64_int:
  618|  14.8k|{
  619|  14.8k|    unsigned char buf[sizeof(uint64_t)];
  620|  14.8k|    size_t buflen;
  621|       |
  622|  14.8k|    buflen = c2i_ibuf(NULL, NULL, *pp, len);
  623|  14.8k|    if (buflen == 0)
  ------------------
  |  Branch (623:9): [True: 43, False: 14.8k]
  ------------------
  624|     43|        return 0;
  625|  14.8k|    if (buflen > sizeof(uint64_t)) {
  ------------------
  |  Branch (625:9): [True: 298, False: 14.5k]
  ------------------
  626|    298|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|    298|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    298|    (ERR_new(),                                                 \
  |  |  |  |  404|    298|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    298|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    298|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    298|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    298|     ERR_set_error)
  |  |  ------------------
  ------------------
  627|    298|        return 0;
  628|    298|    }
  629|  14.5k|    (void)c2i_ibuf(buf, neg, *pp, len);
  630|  14.5k|    return asn1_get_uint64(ret, buf, buflen);
  631|  14.8k|}
ossl_i2c_uint64_int:
  634|  31.7k|{
  635|  31.7k|    unsigned char buf[sizeof(uint64_t)];
  636|  31.7k|    size_t off;
  637|       |
  638|  31.7k|    off = asn1_put_uint64(buf, r);
  639|  31.7k|    return i2c_ibuf(buf + off, sizeof(buf) - off, neg, &p);
  640|  31.7k|}
a_int.c:i2c_ibuf:
   99|  83.2k|{
  100|  83.2k|    unsigned int pad = 0;
  101|  83.2k|    size_t ret, i;
  102|  83.2k|    unsigned char *p, pb = 0;
  103|       |
  104|  83.2k|    if (b != NULL && blen) {
  ------------------
  |  Branch (104:9): [True: 83.2k, False: 0]
  |  Branch (104:22): [True: 83.2k, False: 0]
  ------------------
  105|  83.2k|        ret = blen;
  106|  83.2k|        i = b[0];
  107|  83.2k|        if (!neg && (i > 127)) {
  ------------------
  |  Branch (107:13): [True: 50.1k, False: 33.0k]
  |  Branch (107:21): [True: 5.27k, False: 44.9k]
  ------------------
  108|  5.27k|            pad = 1;
  109|  5.27k|            pb = 0;
  110|  77.9k|        } else if (neg) {
  ------------------
  |  Branch (110:20): [True: 33.0k, False: 44.9k]
  ------------------
  111|  33.0k|            pb = 0xFF;
  112|  33.0k|            if (i > 128) {
  ------------------
  |  Branch (112:17): [True: 4.64k, False: 28.4k]
  ------------------
  113|  4.64k|                pad = 1;
  114|  28.4k|            } else if (i == 128) {
  ------------------
  |  Branch (114:24): [True: 15.2k, False: 13.2k]
  ------------------
  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|  49.1k|                for (pad = 0, i = 1; i < blen; i++)
  ------------------
  |  Branch (119:38): [True: 33.9k, False: 15.2k]
  ------------------
  120|  33.9k|                    pad |= b[i];
  121|  15.2k|                pb = pad != 0 ? 0xffU : 0;
  ------------------
  |  Branch (121:22): [True: 3.12k, False: 12.0k]
  ------------------
  122|  15.2k|                pad = pb & 1;
  123|  15.2k|            }
  124|  33.0k|        }
  125|  83.2k|        ret += pad;
  126|  83.2k|    } else {
  127|      0|        ret = 1;
  128|      0|        blen = 0;   /* reduce '(b == NULL || blen == 0)' to '(blen == 0)' */
  129|      0|    }
  130|       |
  131|  83.2k|    if (pp == NULL || (p = *pp) == NULL)
  ------------------
  |  Branch (131:9): [True: 45.5k, False: 37.7k]
  |  Branch (131:23): [True: 27.5k, False: 10.1k]
  ------------------
  132|  73.1k|        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|  10.1k|    *p = pb;
  140|  10.1k|    p += pad;       /* yes, p[0] can be written twice, but it's little
  141|       |                     * price to pay for eliminated branches */
  142|  10.1k|    twos_complement(p, b, blen, pb);
  143|       |
  144|  10.1k|    *pp += ret;
  145|  10.1k|    return ret;
  146|  83.2k|}
a_int.c:twos_complement:
   78|  31.0k|{
   79|  31.0k|    unsigned int carry = pad & 1;
   80|       |
   81|       |    /* Begin at the end of the encoding */
   82|  31.0k|    if (len != 0) {
  ------------------
  |  Branch (82:9): [True: 31.0k, False: 0]
  ------------------
   83|       |        /*
   84|       |         * if len == 0 then src/dst could be NULL, and this would be undefined
   85|       |         * behaviour.
   86|       |         */
   87|  31.0k|        dst += len;
   88|  31.0k|        src += len;
   89|  31.0k|    }
   90|       |    /* two's complement value: ~value + 1 */
   91|  1.68M|    while (len-- != 0) {
  ------------------
  |  Branch (91:12): [True: 1.64M, False: 31.0k]
  ------------------
   92|  1.64M|        *(--dst) = (unsigned char)(carry += *(--src) ^ pad);
   93|  1.64M|        carry >>= 8;
   94|  1.64M|    }
   95|  31.0k|}
a_int.c:c2i_ibuf:
  156|   195k|{
  157|   195k|    int neg, pad;
  158|       |    /* Zero content length is illegal */
  159|   195k|    if (plen == 0) {
  ------------------
  |  Branch (159:9): [True: 473, False: 194k]
  ------------------
  160|    473|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  401|    473|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    473|    (ERR_new(),                                                 \
  |  |  |  |  404|    473|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    473|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    473|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    473|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    473|     ERR_set_error)
  |  |  ------------------
  ------------------
  161|    473|        return 0;
  162|    473|    }
  163|   194k|    neg = p[0] & 0x80;
  164|   194k|    if (pneg)
  ------------------
  |  Branch (164:9): [True: 96.7k, False: 97.9k]
  ------------------
  165|  96.7k|        *pneg = neg;
  166|       |    /* Handle common case where length is 1 octet separately */
  167|   194k|    if (plen == 1) {
  ------------------
  |  Branch (167:9): [True: 151k, False: 43.1k]
  ------------------
  168|   151k|        if (b != NULL) {
  ------------------
  |  Branch (168:13): [True: 75.7k, False: 75.7k]
  ------------------
  169|  75.7k|            if (neg)
  ------------------
  |  Branch (169:17): [True: 5.64k, False: 70.1k]
  ------------------
  170|  5.64k|                b[0] = (p[0] ^ 0xFF) + 1;
  171|  70.1k|            else
  172|  70.1k|                b[0] = p[0];
  173|  75.7k|        }
  174|   151k|        return 1;
  175|   151k|    }
  176|       |
  177|  43.1k|    pad = 0;
  178|  43.1k|    if (p[0] == 0) {
  ------------------
  |  Branch (178:9): [True: 2.87k, False: 40.2k]
  ------------------
  179|  2.87k|        pad = 1;
  180|  40.2k|    } else if (p[0] == 0xFF) {
  ------------------
  |  Branch (180:16): [True: 3.50k, False: 36.7k]
  ------------------
  181|  3.50k|        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|   751k|        for (pad = 0, i = 1; i < plen; i++)
  ------------------
  |  Branch (187:30): [True: 748k, False: 3.50k]
  ------------------
  188|   748k|            pad |= p[i];
  189|  3.50k|        pad = pad != 0 ? 1 : 0;
  ------------------
  |  Branch (189:15): [True: 3.10k, False: 404]
  ------------------
  190|  3.50k|    }
  191|       |    /* reject illegal padding: first two octets MSB can't match */
  192|  43.1k|    if (pad && (neg == (p[1] & 0x80))) {
  ------------------
  |  Branch (192:9): [True: 5.97k, False: 37.1k]
  |  Branch (192:16): [True: 890, False: 5.08k]
  ------------------
  193|    890|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING);
  ------------------
  |  |  401|    890|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    890|    (ERR_new(),                                                 \
  |  |  |  |  404|    890|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    890|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    890|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    890|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    890|     ERR_set_error)
  |  |  ------------------
  ------------------
  194|    890|        return 0;
  195|    890|    }
  196|       |
  197|       |    /* skip over pad */
  198|  42.2k|    p += pad;
  199|  42.2k|    plen -= pad;
  200|       |
  201|  42.2k|    if (b != NULL)
  ------------------
  |  Branch (201:9): [True: 20.9k, False: 21.2k]
  ------------------
  202|  20.9k|        twos_complement(b, p, plen, neg ? 0xffU : 0);
  ------------------
  |  Branch (202:37): [True: 5.97k, False: 15.0k]
  ------------------
  203|       |
  204|  42.2k|    return plen;
  205|  43.1k|}
a_int.c:asn1_string_get_int64:
  329|  1.33k|{
  330|  1.33k|    if (a == NULL) {
  ------------------
  |  Branch (330:9): [True: 0, False: 1.33k]
  ------------------
  331|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  332|      0|        return 0;
  333|      0|    }
  334|  1.33k|    if ((a->type & ~V_ASN1_NEG) != itype) {
  ------------------
  |  |   97|  1.33k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (334:9): [True: 0, False: 1.33k]
  ------------------
  335|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  336|      0|        return 0;
  337|      0|    }
  338|  1.33k|    return asn1_get_int64(pr, a->data, a->length, a->type & V_ASN1_NEG);
  ------------------
  |  |   97|  1.33k|# define V_ASN1_NEG                      0x100
  ------------------
  339|  1.33k|}
a_int.c:asn1_get_int64:
  257|  1.33k|{
  258|  1.33k|    uint64_t r;
  259|  1.33k|    if (asn1_get_uint64(&r, b, blen) == 0)
  ------------------
  |  Branch (259:9): [True: 0, False: 1.33k]
  ------------------
  260|      0|        return 0;
  261|  1.33k|    if (neg) {
  ------------------
  |  Branch (261:9): [True: 972, False: 364]
  ------------------
  262|    972|        if (r <= INT64_MAX) {
  ------------------
  |  Branch (262:13): [True: 217, False: 755]
  ------------------
  263|       |            /* Most significant bit is guaranteed to be clear, negation
  264|       |             * is guaranteed to be meaningful in platform-neutral sense. */
  265|    217|            *pr = -(int64_t)r;
  266|    755|        } else if (r == ABS_INT64_MIN) {
  ------------------
  |  |  252|    755|#define ABS_INT64_MIN ((uint64_t)INT64_MAX + (-(INT64_MIN + INT64_MAX)))
  ------------------
  |  Branch (266:20): [True: 319, False: 436]
  ------------------
  267|       |            /* This never happens if INT64_MAX == ABS_INT64_MIN, e.g.
  268|       |             * on ones'-complement system. */
  269|    319|            *pr = (int64_t)(0 - r);
  270|    436|        } else {
  271|    436|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|    436|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    436|    (ERR_new(),                                                 \
  |  |  |  |  404|    436|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    436|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    436|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    436|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    436|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|    436|            return 0;
  273|    436|        }
  274|    972|    } else {
  275|    364|        if (r <= INT64_MAX) {
  ------------------
  |  Branch (275:13): [True: 97, False: 267]
  ------------------
  276|     97|            *pr = (int64_t)r;
  277|    267|        } else {
  278|    267|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|    267|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    267|    (ERR_new(),                                                 \
  |  |  |  |  404|    267|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    267|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    267|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    267|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    267|     ERR_set_error)
  |  |  ------------------
  ------------------
  279|    267|            return 0;
  280|    267|        }
  281|    364|    }
  282|    633|    return 1;
  283|  1.33k|}
a_int.c:asn1_string_to_bn:
  505|  7.21k|{
  506|  7.21k|    BIGNUM *ret;
  507|       |
  508|  7.21k|    if ((ai->type & ~V_ASN1_NEG) != itype) {
  ------------------
  |  |   97|  7.21k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (508:9): [True: 0, False: 7.21k]
  ------------------
  509|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  510|      0|        return NULL;
  511|      0|    }
  512|       |
  513|  7.21k|    ret = BN_bin2bn(ai->data, ai->length, bn);
  514|  7.21k|    if (ret == NULL) {
  ------------------
  |  Branch (514:9): [True: 0, False: 7.21k]
  ------------------
  515|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  516|      0|        return NULL;
  517|      0|    }
  518|  7.21k|    if (ai->type & V_ASN1_NEG)
  ------------------
  |  |   97|  7.21k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (518:9): [True: 789, False: 6.42k]
  ------------------
  519|    789|        BN_set_negative(ret, 1);
  520|  7.21k|    return ret;
  521|  7.21k|}
a_int.c:asn1_get_uint64:
  214|  15.8k|{
  215|  15.8k|    size_t i;
  216|  15.8k|    uint64_t r;
  217|       |
  218|  15.8k|    if (blen > sizeof(*pr)) {
  ------------------
  |  Branch (218:9): [True: 0, False: 15.8k]
  ------------------
  219|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|      0|        return 0;
  221|      0|    }
  222|  15.8k|    if (b == NULL)
  ------------------
  |  Branch (222:9): [True: 0, False: 15.8k]
  ------------------
  223|      0|        return 0;
  224|  45.9k|    for (r = 0, i = 0; i < blen; i++) {
  ------------------
  |  Branch (224:24): [True: 30.0k, False: 15.8k]
  ------------------
  225|  30.0k|        r <<= 8;
  226|  30.0k|        r |= b[i];
  227|  30.0k|    }
  228|  15.8k|    *pr = r;
  229|  15.8k|    return 1;
  230|  15.8k|}
a_int.c:asn1_put_uint64:
  238|  31.7k|{
  239|  31.7k|    size_t off = sizeof(uint64_t);
  240|       |
  241|  35.4k|    do {
  242|  35.4k|        b[--off] = (unsigned char)r;
  243|  35.4k|    } while (r >>= 8);
  ------------------
  |  Branch (243:14): [True: 3.73k, False: 31.7k]
  ------------------
  244|       |
  245|  31.7k|    return off;
  246|  31.7k|}

ASN1_mbstring_copy:
   38|   644k|{
   39|   644k|    return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0);
   40|   644k|}
ASN1_mbstring_ncopy:
   45|   644k|{
   46|   644k|    int str_type;
   47|   644k|    int ret;
   48|   644k|    char free_out;
   49|   644k|    int outform, outlen = 0;
   50|   644k|    ASN1_STRING *dest;
   51|   644k|    unsigned char *p;
   52|   644k|    int nchar;
   53|   644k|    int (*cpyfunc) (unsigned long, void *) = NULL;
   54|   644k|    if (len == -1)
  ------------------
  |  Branch (54:9): [True: 0, False: 644k]
  ------------------
   55|      0|        len = strlen((const char *)in);
   56|   644k|    if (!mask)
  ------------------
  |  Branch (56:9): [True: 0, False: 644k]
  ------------------
   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|   644k|    if (len < 0)
  ------------------
  |  Branch (58:9): [True: 0, False: 644k]
  ------------------
   59|      0|        return -1;
   60|       |
   61|       |    /* First do a string check and work out the number of characters */
   62|   644k|    switch (inform) {
   63|       |
   64|   260k|    case MBSTRING_BMP:
  ------------------
  |  |  125|   260k|# define MBSTRING_BMP            (MBSTRING_FLAG|2)
  |  |  ------------------
  |  |  |  |  122|   260k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (64:5): [True: 260k, False: 384k]
  ------------------
   65|   260k|        if (len & 1) {
  ------------------
  |  Branch (65:13): [True: 0, False: 260k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   67|      0|            return -1;
   68|      0|        }
   69|   260k|        nchar = len >> 1;
   70|   260k|        break;
   71|       |
   72|  2.79k|    case MBSTRING_UNIV:
  ------------------
  |  |  126|  2.79k|# define MBSTRING_UNIV           (MBSTRING_FLAG|4)
  |  |  ------------------
  |  |  |  |  122|  2.79k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (72:5): [True: 2.79k, False: 641k]
  ------------------
   73|  2.79k|        if (len & 3) {
  ------------------
  |  Branch (73:13): [True: 0, False: 2.79k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   75|      0|            return -1;
   76|      0|        }
   77|  2.79k|        nchar = len >> 2;
   78|  2.79k|        break;
   79|       |
   80|  4.97k|    case MBSTRING_UTF8:
  ------------------
  |  |  123|  4.97k|# define MBSTRING_UTF8           (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  122|  4.97k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (80:5): [True: 4.97k, False: 639k]
  ------------------
   81|  4.97k|        nchar = 0;
   82|       |        /* This counts the characters and does utf8 syntax checking */
   83|  4.97k|        ret = traverse_string(in, len, MBSTRING_UTF8, in_utf8, &nchar);
  ------------------
  |  |  123|  4.97k|# define MBSTRING_UTF8           (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  122|  4.97k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
   84|  4.97k|        if (ret < 0) {
  ------------------
  |  Branch (84:13): [True: 1.60k, False: 3.36k]
  ------------------
   85|  1.60k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING);
  ------------------
  |  |  401|  1.60k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.60k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.60k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  1.60k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  1.60k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  1.60k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.60k|     ERR_set_error)
  |  |  ------------------
  ------------------
   86|  1.60k|            return -1;
   87|  1.60k|        }
   88|  3.36k|        break;
   89|       |
   90|   376k|    case MBSTRING_ASC:
  ------------------
  |  |  124|   376k|# define MBSTRING_ASC            (MBSTRING_FLAG|1)
  |  |  ------------------
  |  |  |  |  122|   376k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (90:5): [True: 376k, False: 267k]
  ------------------
   91|   376k|        nchar = len;
   92|   376k|        break;
   93|       |
   94|      0|    default:
  ------------------
  |  Branch (94:5): [True: 0, False: 644k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   96|      0|        return -1;
   97|   644k|    }
   98|       |
   99|   643k|    if ((minsize > 0) && (nchar < minsize)) {
  ------------------
  |  Branch (99:9): [True: 0, False: 643k]
  |  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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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,
  ------------------
  |  |  115|      0|# define ASN1_R_STRING_TOO_SHORT                          152
  ------------------
  101|      0|                       "minsize=%ld", minsize);
  102|      0|        return -1;
  103|      0|    }
  104|       |
  105|   643k|    if ((maxsize > 0) && (nchar > maxsize)) {
  ------------------
  |  Branch (105:9): [True: 0, False: 643k]
  |  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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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,
  ------------------
  |  |  114|      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|   643k|    if (traverse_string(in, len, inform, type_str, &mask) < 0) {
  ------------------
  |  Branch (112:9): [True: 48, False: 642k]
  ------------------
  113|     48|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS);
  ------------------
  |  |  401|     48|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     48|    (ERR_new(),                                                 \
  |  |  |  |  404|     48|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     48|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     48|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     48|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     48|     ERR_set_error)
  |  |  ------------------
  ------------------
  114|     48|        return -1;
  115|     48|    }
  116|       |
  117|       |    /* Now work out output format and string type */
  118|   642k|    outform = MBSTRING_ASC;
  ------------------
  |  |  124|   642k|# define MBSTRING_ASC            (MBSTRING_FLAG|1)
  |  |  ------------------
  |  |  |  |  122|   642k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  119|   642k|    if (mask & B_ASN1_NUMERICSTRING)
  ------------------
  |  |  102|   642k|# define B_ASN1_NUMERICSTRING    0x0001
  ------------------
  |  Branch (119:9): [True: 0, False: 642k]
  ------------------
  120|      0|        str_type = V_ASN1_NUMERICSTRING;
  ------------------
  |  |   76|      0|# define V_ASN1_NUMERICSTRING            18 /**/
  ------------------
  121|   642k|    else if (mask & B_ASN1_PRINTABLESTRING)
  ------------------
  |  |  103|   642k|# define B_ASN1_PRINTABLESTRING  0x0002
  ------------------
  |  Branch (121:14): [True: 0, False: 642k]
  ------------------
  122|      0|        str_type = V_ASN1_PRINTABLESTRING;
  ------------------
  |  |   77|      0|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  123|   642k|    else if (mask & B_ASN1_IA5STRING)
  ------------------
  |  |  107|   642k|# define B_ASN1_IA5STRING        0x0010
  ------------------
  |  Branch (123:14): [True: 0, False: 642k]
  ------------------
  124|      0|        str_type = V_ASN1_IA5STRING;
  ------------------
  |  |   81|      0|# define V_ASN1_IA5STRING                22
  ------------------
  125|   642k|    else if (mask & B_ASN1_T61STRING)
  ------------------
  |  |  104|   642k|# define B_ASN1_T61STRING        0x0004
  ------------------
  |  Branch (125:14): [True: 0, False: 642k]
  ------------------
  126|      0|        str_type = V_ASN1_T61STRING;
  ------------------
  |  |   78|      0|# define V_ASN1_T61STRING                20
  ------------------
  127|   642k|    else if (mask & B_ASN1_BMPSTRING) {
  ------------------
  |  |  115|   642k|# define B_ASN1_BMPSTRING        0x0800
  ------------------
  |  Branch (127:14): [True: 0, False: 642k]
  ------------------
  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|   642k|    } else if (mask & B_ASN1_UNIVERSALSTRING) {
  ------------------
  |  |  112|   642k|# define B_ASN1_UNIVERSALSTRING  0x0100
  ------------------
  |  Branch (130:16): [True: 0, False: 642k]
  ------------------
  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|   642k|    } else {
  134|   642k|        str_type = V_ASN1_UTF8STRING;
  ------------------
  |  |   73|   642k|# define V_ASN1_UTF8STRING               12
  ------------------
  135|   642k|        outform = MBSTRING_UTF8;
  ------------------
  |  |  123|   642k|# define MBSTRING_UTF8           (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  122|   642k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  136|   642k|    }
  137|   642k|    if (!out)
  ------------------
  |  Branch (137:9): [True: 0, False: 642k]
  ------------------
  138|      0|        return str_type;
  139|   642k|    if (*out) {
  ------------------
  |  Branch (139:9): [True: 642k, False: 0]
  ------------------
  140|   642k|        free_out = 0;
  141|   642k|        dest = *out;
  142|   642k|        ASN1_STRING_set0(dest,  NULL, 0);
  143|   642k|        dest->type = str_type;
  144|   642k|    } 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|   642k|    if (inform == outform) {
  ------------------
  |  Branch (154:9): [True: 3.36k, False: 639k]
  ------------------
  155|  3.36k|        if (!ASN1_STRING_set(dest, in, len)) {
  ------------------
  |  Branch (155:13): [True: 0, False: 3.36k]
  ------------------
  156|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  157|      0|            return -1;
  158|      0|        }
  159|  3.36k|        return str_type;
  160|  3.36k|    }
  161|       |
  162|       |    /* Work out how much space the destination will need */
  163|   639k|    switch (outform) {
  ------------------
  |  Branch (163:13): [True: 0, False: 639k]
  ------------------
  164|      0|    case MBSTRING_ASC:
  ------------------
  |  |  124|      0|# define MBSTRING_ASC            (MBSTRING_FLAG|1)
  |  |  ------------------
  |  |  |  |  122|      0|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (164:5): [True: 0, False: 639k]
  ------------------
  165|      0|        outlen = nchar;
  166|      0|        cpyfunc = cpy_asc;
  167|      0|        break;
  168|       |
  169|      0|    case MBSTRING_BMP:
  ------------------
  |  |  125|      0|# define MBSTRING_BMP            (MBSTRING_FLAG|2)
  |  |  ------------------
  |  |  |  |  122|      0|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (169:5): [True: 0, False: 639k]
  ------------------
  170|      0|        outlen = nchar << 1;
  171|      0|        cpyfunc = cpy_bmp;
  172|      0|        break;
  173|       |
  174|      0|    case MBSTRING_UNIV:
  ------------------
  |  |  126|      0|# define MBSTRING_UNIV           (MBSTRING_FLAG|4)
  |  |  ------------------
  |  |  |  |  122|      0|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (174:5): [True: 0, False: 639k]
  ------------------
  175|      0|        outlen = nchar << 2;
  176|      0|        cpyfunc = cpy_univ;
  177|      0|        break;
  178|       |
  179|   639k|    case MBSTRING_UTF8:
  ------------------
  |  |  123|   639k|# define MBSTRING_UTF8           (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  122|   639k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (179:5): [True: 639k, False: 0]
  ------------------
  180|   639k|        outlen = 0;
  181|   639k|        traverse_string(in, len, inform, out_utf8, &outlen);
  182|   639k|        cpyfunc = cpy_utf8;
  183|   639k|        break;
  184|   639k|    }
  185|   639k|    if ((p = OPENSSL_malloc(outlen + 1)) == NULL) {
  ------------------
  |  |   97|   639k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   639k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   639k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (185:9): [True: 0, False: 639k]
  ------------------
  186|      0|        if (free_out)
  ------------------
  |  Branch (186:13): [True: 0, False: 0]
  ------------------
  187|      0|            ASN1_STRING_free(dest);
  188|      0|        return -1;
  189|      0|    }
  190|   639k|    dest->length = outlen;
  191|   639k|    dest->data = p;
  192|   639k|    p[outlen] = 0;
  193|   639k|    traverse_string(in, len, inform, cpyfunc, &p);
  194|   639k|    return str_type;
  195|   639k|}
a_mbstr.c:traverse_string:
  205|  1.92M|{
  206|  1.92M|    unsigned long value;
  207|  1.92M|    int ret;
  208|  29.2M|    while (len) {
  ------------------
  |  Branch (208:12): [True: 27.3M, False: 1.92M]
  ------------------
  209|  27.3M|        if (inform == MBSTRING_ASC) {
  ------------------
  |  |  124|  27.3M|# define MBSTRING_ASC            (MBSTRING_FLAG|1)
  |  |  ------------------
  |  |  |  |  122|  27.3M|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (209:13): [True: 27.3M, False: 23.0k]
  ------------------
  210|  27.3M|            value = *p++;
  211|  27.3M|            len--;
  212|  27.3M|        } else if (inform == MBSTRING_BMP) {
  ------------------
  |  |  125|  23.0k|# define MBSTRING_BMP            (MBSTRING_FLAG|2)
  |  |  ------------------
  |  |  |  |  122|  23.0k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (212:20): [True: 11.0k, False: 12.0k]
  ------------------
  213|  11.0k|            value = *p++ << 8;
  214|  11.0k|            value |= *p++;
  215|  11.0k|            len -= 2;
  216|  12.0k|        } else if (inform == MBSTRING_UNIV) {
  ------------------
  |  |  126|  12.0k|# define MBSTRING_UNIV           (MBSTRING_FLAG|4)
  |  |  ------------------
  |  |  |  |  122|  12.0k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (216:20): [True: 1.69k, False: 10.3k]
  ------------------
  217|  1.69k|            value = ((unsigned long)*p++) << 24;
  218|  1.69k|            value |= ((unsigned long)*p++) << 16;
  219|  1.69k|            value |= *p++ << 8;
  220|  1.69k|            value |= *p++;
  221|  1.69k|            len -= 4;
  222|  10.3k|        } else {
  223|  10.3k|            ret = UTF8_getc(p, len, &value);
  224|  10.3k|            if (ret < 0)
  ------------------
  |  Branch (224:17): [True: 1.59k, False: 8.72k]
  ------------------
  225|  1.59k|                return -1;
  226|  8.72k|            len -= ret;
  227|  8.72k|            p += ret;
  228|  8.72k|        }
  229|  27.3M|        if (rfunc) {
  ------------------
  |  Branch (229:13): [True: 27.3M, False: 0]
  ------------------
  230|  27.3M|            ret = rfunc(value, arg);
  231|  27.3M|            if (ret <= 0)
  ------------------
  |  Branch (231:17): [True: 61, False: 27.3M]
  ------------------
  232|     61|                return ret;
  233|  27.3M|        }
  234|  27.3M|    }
  235|  1.92M|    return 1;
  236|  1.92M|}
a_mbstr.c:in_utf8:
  243|  6.89k|{
  244|  6.89k|    int *nchar;
  245|       |
  246|  6.89k|    if (!is_unicode_valid(value))
  ------------------
  |  Branch (246:9): [True: 13, False: 6.88k]
  ------------------
  247|     13|        return -2;
  248|  6.88k|    nchar = arg;
  249|  6.88k|    (*nchar)++;
  250|  6.88k|    return 1;
  251|  6.89k|}
a_mbstr.c:out_utf8:
  256|  9.10M|{
  257|  9.10M|    int *outlen, len;
  258|       |
  259|  9.10M|    len = UTF8_putc(NULL, -1, value);
  260|  9.10M|    if (len <= 0)
  ------------------
  |  Branch (260:9): [True: 0, False: 9.10M]
  ------------------
  261|      0|        return len;
  262|  9.10M|    outlen = arg;
  263|  9.10M|    *outlen += len;
  264|  9.10M|    return 1;
  265|  9.10M|}
a_mbstr.c:type_str:
  273|  9.10M|{
  274|  9.10M|    unsigned long types = *((unsigned long *)arg);
  275|  9.10M|    const int native = value > INT_MAX ? INT_MAX : ossl_fromascii(value);
  ------------------
  |  |   57|  18.2M|#  define ossl_fromascii(c)     (c)
  ------------------
  |  Branch (275:24): [True: 17, False: 9.10M]
  ------------------
  276|       |
  277|  9.10M|    if ((types & B_ASN1_NUMERICSTRING) && !(ossl_isdigit(native)
  ------------------
  |  |  102|  9.10M|# define B_ASN1_NUMERICSTRING    0x0001
  ------------------
  |  Branch (277:9): [True: 0, False: 9.10M]
  |  Branch (277:45): [True: 0, False: 0]
  ------------------
  278|      0|                                            || native == ' '))
  ------------------
  |  Branch (278:48): [True: 0, False: 0]
  ------------------
  279|      0|        types &= ~B_ASN1_NUMERICSTRING;
  ------------------
  |  |  102|      0|# define B_ASN1_NUMERICSTRING    0x0001
  ------------------
  280|  9.10M|    if ((types & B_ASN1_PRINTABLESTRING) && !ossl_isasn1print(native))
  ------------------
  |  |  103|  9.10M|# 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 (280:9): [True: 0, False: 9.10M]
  |  Branch (280:45): [True: 0, False: 0]
  ------------------
  281|      0|        types &= ~B_ASN1_PRINTABLESTRING;
  ------------------
  |  |  103|      0|# define B_ASN1_PRINTABLESTRING  0x0002
  ------------------
  282|  9.10M|    if ((types & B_ASN1_IA5STRING) && !ossl_isascii(native))
  ------------------
  |  |  107|  9.10M|# define B_ASN1_IA5STRING        0x0010
  ------------------
                  if ((types & B_ASN1_IA5STRING) && !ossl_isascii(native))
  ------------------
  |  |   75|      0|# define ossl_isascii(c)        (((c) & ~127) == 0)
  ------------------
  |  Branch (282:9): [True: 0, False: 9.10M]
  |  Branch (282:39): [True: 0, False: 0]
  ------------------
  283|      0|        types &= ~B_ASN1_IA5STRING;
  ------------------
  |  |  107|      0|# define B_ASN1_IA5STRING        0x0010
  ------------------
  284|  9.10M|    if ((types & B_ASN1_T61STRING) && (value > 0xff))
  ------------------
  |  |  104|  9.10M|# define B_ASN1_T61STRING        0x0004
  ------------------
  |  Branch (284:9): [True: 0, False: 9.10M]
  |  Branch (284:39): [True: 0, False: 0]
  ------------------
  285|      0|        types &= ~B_ASN1_T61STRING;
  ------------------
  |  |  104|      0|# define B_ASN1_T61STRING        0x0004
  ------------------
  286|  9.10M|    if ((types & B_ASN1_BMPSTRING) && (value > 0xffff))
  ------------------
  |  |  115|  9.10M|# define B_ASN1_BMPSTRING        0x0800
  ------------------
  |  Branch (286:9): [True: 0, False: 9.10M]
  |  Branch (286:39): [True: 0, False: 0]
  ------------------
  287|      0|        types &= ~B_ASN1_BMPSTRING;
  ------------------
  |  |  115|      0|# define B_ASN1_BMPSTRING        0x0800
  ------------------
  288|  9.10M|    if ((types & B_ASN1_UTF8STRING) && !is_unicode_valid(value))
  ------------------
  |  |  117|  9.10M|# define B_ASN1_UTF8STRING       0x2000
  ------------------
  |  Branch (288:9): [True: 9.10M, False: 0]
  |  Branch (288:40): [True: 48, False: 9.10M]
  ------------------
  289|     48|        types &= ~B_ASN1_UTF8STRING;
  ------------------
  |  |  117|     48|# define B_ASN1_UTF8STRING       0x2000
  ------------------
  290|  9.10M|    if (!types)
  ------------------
  |  Branch (290:9): [True: 48, False: 9.10M]
  ------------------
  291|     48|        return -1;
  292|  9.10M|    *((unsigned long *)arg) = types;
  293|  9.10M|    return 1;
  294|  9.10M|}
a_mbstr.c:cpy_utf8:
  339|  9.10M|{
  340|  9.10M|    unsigned char **p;
  341|  9.10M|    int ret;
  342|  9.10M|    p = arg;
  343|       |    /* We already know there is enough room so pass 0xff as the length */
  344|  9.10M|    ret = UTF8_putc(*p, 0xff, value);
  345|  9.10M|    *p += ret;
  346|  9.10M|    return 1;
  347|  9.10M|}

ossl_c2i_ASN1_OBJECT:
  240|  1.29M|{
  241|  1.29M|    ASN1_OBJECT *ret = NULL, tobj;
  242|  1.29M|    const unsigned char *p;
  243|  1.29M|    unsigned char *data;
  244|  1.29M|    int i, length;
  245|       |
  246|       |    /*
  247|       |     * Sanity check OID encoding. Need at least one content octet. MSB must
  248|       |     * be clear in the last octet. can't have leading 0x80 in subidentifiers,
  249|       |     * see: X.690 8.19.2
  250|       |     */
  251|  1.29M|    if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL ||
  ------------------
  |  Branch (251:9): [True: 554, False: 1.29M]
  |  Branch (251:21): [True: 0, False: 1.29M]
  |  Branch (251:38): [True: 0, False: 1.29M]
  |  Branch (251:52): [True: 0, False: 1.29M]
  ------------------
  252|  1.29M|        p[len - 1] & 0x80) {
  ------------------
  |  Branch (252:9): [True: 470, False: 1.29M]
  ------------------
  253|  1.02k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING);
  ------------------
  |  |  401|  1.02k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.02k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.02k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  1.02k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  1.02k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  1.02k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.02k|     ERR_set_error)
  |  |  ------------------
  ------------------
  254|  1.02k|        return NULL;
  255|  1.02k|    }
  256|       |    /* Now 0 < len <= INT_MAX, so the cast is safe. */
  257|  1.29M|    length = (int)len;
  258|       |    /*
  259|       |     * Try to lookup OID in table: these are all valid encodings so if we get
  260|       |     * a match we know the OID is valid.
  261|       |     */
  262|  1.29M|    tobj.nid = NID_undef;
  ------------------
  |  |   18|  1.29M|#define NID_undef                       0
  ------------------
  263|  1.29M|    tobj.data = p;
  264|  1.29M|    tobj.length = length;
  265|  1.29M|    tobj.flags = 0;
  266|  1.29M|    i = OBJ_obj2nid(&tobj);
  267|  1.29M|    if (i != NID_undef) {
  ------------------
  |  |   18|  1.29M|#define NID_undef                       0
  ------------------
  |  Branch (267:9): [True: 337k, False: 954k]
  ------------------
  268|       |        /*
  269|       |         * Return shared registered OID object: this improves efficiency
  270|       |         * because we don't have to return a dynamically allocated OID
  271|       |         * and NID lookups can use the cached value.
  272|       |         */
  273|   337k|        ret = OBJ_nid2obj(i);
  274|   337k|        if (a) {
  ------------------
  |  Branch (274:13): [True: 337k, False: 0]
  ------------------
  275|   337k|            ASN1_OBJECT_free(*a);
  276|   337k|            *a = ret;
  277|   337k|        }
  278|   337k|        *pp += len;
  279|   337k|        return ret;
  280|   337k|    }
  281|  2.19M|    for (i = 0; i < length; i++, p++) {
  ------------------
  |  Branch (281:17): [True: 1.23M, False: 954k]
  ------------------
  282|  1.23M|        if (*p == 0x80 && (!i || !(p[-1] & 0x80))) {
  ------------------
  |  Branch (282:13): [True: 13.2k, False: 1.22M]
  |  Branch (282:28): [True: 217, False: 13.0k]
  |  Branch (282:34): [True: 282, False: 12.7k]
  ------------------
  283|    499|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING);
  ------------------
  |  |  401|    499|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    499|    (ERR_new(),                                                 \
  |  |  |  |  404|    499|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    499|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    499|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    499|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    499|     ERR_set_error)
  |  |  ------------------
  ------------------
  284|    499|            return NULL;
  285|    499|        }
  286|  1.23M|    }
  287|       |
  288|   954k|    if ((a == NULL) || ((*a) == NULL) ||
  ------------------
  |  Branch (288:9): [True: 0, False: 954k]
  |  Branch (288:24): [True: 7.11k, False: 947k]
  ------------------
  289|   954k|        !((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC)) {
  ------------------
  |  |  110|   947k|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  |  Branch (289:9): [True: 947k, False: 0]
  ------------------
  290|   954k|        if ((ret = ASN1_OBJECT_new()) == NULL)
  ------------------
  |  Branch (290:13): [True: 0, False: 954k]
  ------------------
  291|      0|            return NULL;
  292|   954k|    } else {
  293|      0|        ret = (*a);
  294|      0|    }
  295|       |
  296|   954k|    p = *pp;
  297|       |    /* detach data from object */
  298|   954k|    data = (unsigned char *)ret->data;
  299|   954k|    ret->data = NULL;
  300|       |    /* once detached we can change it */
  301|   954k|    if ((data == NULL) || (ret->length < length)) {
  ------------------
  |  Branch (301:9): [True: 954k, False: 0]
  |  Branch (301:27): [True: 0, False: 0]
  ------------------
  302|   954k|        ret->length = 0;
  303|   954k|        OPENSSL_free(data);
  ------------------
  |  |  107|   954k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   954k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   954k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  304|   954k|        data = OPENSSL_malloc(length);
  ------------------
  |  |   97|   954k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   954k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   954k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  305|   954k|        if (data == NULL)
  ------------------
  |  Branch (305:13): [True: 0, False: 954k]
  ------------------
  306|      0|            goto err;
  307|   954k|        ret->flags |= ASN1_OBJECT_FLAG_DYNAMIC_DATA;
  ------------------
  |  |  113|   954k|# define ASN1_OBJECT_FLAG_DYNAMIC_DATA    0x08/* internal use */
  ------------------
  308|   954k|    }
  309|   954k|    memcpy(data, p, length);
  310|       |    /* If there are dynamic strings, free them here, and clear the flag */
  311|   954k|    if ((ret->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) != 0) {
  ------------------
  |  |  112|   954k|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
  |  Branch (311:9): [True: 0, False: 954k]
  ------------------
  312|      0|        OPENSSL_free((char *)ret->sn);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  313|      0|        OPENSSL_free((char *)ret->ln);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  314|      0|        ret->flags &= ~ASN1_OBJECT_FLAG_DYNAMIC_STRINGS;
  ------------------
  |  |  112|      0|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
  315|      0|    }
  316|       |    /* reattach data to object, after which it remains const */
  317|   954k|    ret->data = data;
  318|   954k|    ret->length = length;
  319|   954k|    ret->sn = NULL;
  320|   954k|    ret->ln = NULL;
  321|       |    /* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */
  322|   954k|    p += length;
  323|       |
  324|   954k|    if (a != NULL)
  ------------------
  |  Branch (324:9): [True: 954k, False: 0]
  ------------------
  325|   954k|        (*a) = ret;
  326|   954k|    *pp = p;
  327|   954k|    return ret;
  328|      0| err:
  329|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  330|      0|    if ((a == NULL) || (*a != ret))
  ------------------
  |  Branch (330:9): [True: 0, False: 0]
  |  Branch (330:24): [True: 0, False: 0]
  ------------------
  331|      0|        ASN1_OBJECT_free(ret);
  332|      0|    return NULL;
  333|   954k|}
ASN1_OBJECT_new:
  336|  2.15M|{
  337|  2.15M|    ASN1_OBJECT *ret;
  338|       |
  339|  2.15M|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   99|  2.15M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  2.15M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  2.15M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  340|  2.15M|    if (ret == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 2.15M]
  ------------------
  341|      0|        return NULL;
  342|  2.15M|    ret->flags = ASN1_OBJECT_FLAG_DYNAMIC;
  ------------------
  |  |  110|  2.15M|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  343|  2.15M|    return ret;
  344|  2.15M|}
ASN1_OBJECT_free:
  347|  2.88M|{
  348|  2.88M|    if (a == NULL)
  ------------------
  |  Branch (348:9): [True: 100k, False: 2.78M]
  ------------------
  349|   100k|        return;
  350|  2.78M|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) {
  ------------------
  |  |  112|  2.78M|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
  |  Branch (350:9): [True: 1.20M, False: 1.58M]
  ------------------
  351|  1.20M|#ifndef CONST_STRICT
  352|       |        /*
  353|       |         * Disable purely for compile-time strict const checking.  Doing this
  354|       |         * on a "real" compile will cause memory leaks
  355|       |         */
  356|  1.20M|        OPENSSL_free((void*)a->sn);
  ------------------
  |  |  107|  1.20M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.20M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.20M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  357|  1.20M|        OPENSSL_free((void*)a->ln);
  ------------------
  |  |  107|  1.20M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.20M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.20M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  358|  1.20M|#endif
  359|  1.20M|        a->sn = a->ln = NULL;
  360|  1.20M|    }
  361|  2.78M|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) {
  ------------------
  |  |  113|  2.78M|# define ASN1_OBJECT_FLAG_DYNAMIC_DATA    0x08/* internal use */
  ------------------
  |  Branch (361:9): [True: 2.15M, False: 629k]
  ------------------
  362|  2.15M|        OPENSSL_free((void*)a->data);
  ------------------
  |  |  107|  2.15M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  2.15M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  2.15M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  363|  2.15M|        a->data = NULL;
  364|  2.15M|        a->length = 0;
  365|  2.15M|    }
  366|  2.78M|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC)
  ------------------
  |  |  110|  2.78M|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  |  Branch (366:9): [True: 2.15M, False: 629k]
  ------------------
  367|  2.15M|        OPENSSL_free(a);
  ------------------
  |  |  107|  2.15M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  2.15M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  2.15M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  368|  2.78M|}

ASN1_STRING_to_UTF8:
  604|   644k|{
  605|   644k|    ASN1_STRING stmp, *str = &stmp;
  606|   644k|    int mbflag, type, ret;
  607|   644k|    if (!in)
  ------------------
  |  Branch (607:9): [True: 0, False: 644k]
  ------------------
  608|      0|        return -1;
  609|   644k|    type = in->type;
  610|   644k|    if ((type < 0) || (type > 30))
  ------------------
  |  Branch (610:9): [True: 0, False: 644k]
  |  Branch (610:23): [True: 0, False: 644k]
  ------------------
  611|      0|        return -1;
  612|   644k|    mbflag = tag2nbyte[type];
  613|   644k|    if (mbflag == -1)
  ------------------
  |  Branch (613:9): [True: 0, False: 644k]
  ------------------
  614|      0|        return -1;
  615|   644k|    mbflag |= MBSTRING_FLAG;
  ------------------
  |  |  122|   644k|# define MBSTRING_FLAG           0x1000
  ------------------
  616|   644k|    stmp.data = NULL;
  617|   644k|    stmp.length = 0;
  618|   644k|    stmp.flags = 0;
  619|   644k|    ret =
  620|   644k|        ASN1_mbstring_copy(&str, in->data, in->length, mbflag,
  621|   644k|                           B_ASN1_UTF8STRING);
  ------------------
  |  |  117|   644k|# define B_ASN1_UTF8STRING       0x2000
  ------------------
  622|   644k|    if (ret < 0)
  ------------------
  |  Branch (622:9): [True: 1.65k, False: 642k]
  ------------------
  623|  1.65k|        return ret;
  624|   642k|    *out = stmp.data;
  625|   642k|    return stmp.length;
  626|   644k|}

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

UTF8_getc:
   29|  10.3k|{
   30|  10.3k|    const unsigned char *p;
   31|  10.3k|    unsigned long value;
   32|  10.3k|    int ret;
   33|  10.3k|    if (len <= 0)
  ------------------
  |  Branch (33:9): [True: 0, False: 10.3k]
  ------------------
   34|      0|        return 0;
   35|  10.3k|    p = str;
   36|       |
   37|       |    /* Check syntax and work out the encoded value (if correct) */
   38|  10.3k|    if ((*p & 0x80) == 0) {
  ------------------
  |  Branch (38:9): [True: 7.60k, False: 2.71k]
  ------------------
   39|  7.60k|        value = *p++ & 0x7f;
   40|  7.60k|        ret = 1;
   41|  7.60k|    } else if ((*p & 0xe0) == 0xc0) {
  ------------------
  |  Branch (41:16): [True: 629, False: 2.08k]
  ------------------
   42|    629|        if (len < 2)
  ------------------
  |  Branch (42:13): [True: 70, False: 559]
  ------------------
   43|     70|            return -1;
   44|    559|        if ((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (44:13): [True: 216, False: 343]
  ------------------
   45|    216|            return -3;
   46|    343|        value = (*p++ & 0x1f) << 6;
   47|    343|        value |= *p++ & 0x3f;
   48|    343|        if (value < 0x80)
  ------------------
  |  Branch (48:13): [True: 83, False: 260]
  ------------------
   49|     83|            return -4;
   50|    260|        ret = 2;
   51|  2.08k|    } else if ((*p & 0xf0) == 0xe0) {
  ------------------
  |  Branch (51:16): [True: 873, False: 1.21k]
  ------------------
   52|    873|        if (len < 3)
  ------------------
  |  Branch (52:13): [True: 114, False: 759]
  ------------------
   53|    114|            return -1;
   54|    759|        if (((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (54:13): [True: 69, False: 690]
  ------------------
   55|    759|            || ((p[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (55:16): [True: 71, False: 619]
  ------------------
   56|    140|            return -3;
   57|    619|        value = (*p++ & 0xf) << 12;
   58|    619|        value |= (*p++ & 0x3f) << 6;
   59|    619|        value |= *p++ & 0x3f;
   60|    619|        if (value < 0x800)
  ------------------
  |  Branch (60:13): [True: 17, False: 602]
  ------------------
   61|     17|            return -4;
   62|    602|        if (is_unicode_surrogate(value))
  ------------------
  |  Branch (62:13): [True: 81, False: 521]
  ------------------
   63|     81|            return -2;
   64|    521|        ret = 3;
   65|  1.21k|    } else if ((*p & 0xf8) == 0xf0) {
  ------------------
  |  Branch (65:16): [True: 940, False: 274]
  ------------------
   66|    940|        if (len < 4)
  ------------------
  |  Branch (66:13): [True: 109, False: 831]
  ------------------
   67|    109|            return -1;
   68|    831|        if (((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (68:13): [True: 69, False: 762]
  ------------------
   69|    831|            || ((p[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (69:16): [True: 324, False: 438]
  ------------------
   70|    831|            || ((p[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (70:16): [True: 67, False: 371]
  ------------------
   71|    460|            return -3;
   72|    371|        value = ((unsigned long)(*p++ & 0x7)) << 18;
   73|    371|        value |= (*p++ & 0x3f) << 12;
   74|    371|        value |= (*p++ & 0x3f) << 6;
   75|    371|        value |= *p++ & 0x3f;
   76|    371|        if (value < 0x10000)
  ------------------
  |  Branch (76:13): [True: 31, False: 340]
  ------------------
   77|     31|            return -4;
   78|    340|        ret = 4;
   79|    340|    } else
   80|    274|        return -2;
   81|  8.72k|    *val = value;
   82|  8.72k|    return ret;
   83|  10.3k|}
UTF8_putc:
   94|  18.2M|{
   95|  18.2M|    if (!str)
  ------------------
  |  Branch (95:9): [True: 9.10M, False: 9.10M]
  ------------------
   96|  9.10M|        len = 4;                /* Maximum we will need */
   97|  9.10M|    else if (len <= 0)
  ------------------
  |  Branch (97:14): [True: 0, False: 9.10M]
  ------------------
   98|      0|        return -1;
   99|  18.2M|    if (value < 0x80) {
  ------------------
  |  Branch (99:9): [True: 2.86M, False: 15.3M]
  ------------------
  100|  2.86M|        if (str)
  ------------------
  |  Branch (100:13): [True: 1.43M, False: 1.43M]
  ------------------
  101|  1.43M|            *str = (unsigned char)value;
  102|  2.86M|        return 1;
  103|  2.86M|    }
  104|  15.3M|    if (value < 0x800) {
  ------------------
  |  Branch (104:9): [True: 15.3M, False: 4.90k]
  ------------------
  105|  15.3M|        if (len < 2)
  ------------------
  |  Branch (105:13): [True: 0, False: 15.3M]
  ------------------
  106|      0|            return -1;
  107|  15.3M|        if (str) {
  ------------------
  |  Branch (107:13): [True: 7.66M, False: 7.66M]
  ------------------
  108|  7.66M|            *str++ = (unsigned char)(((value >> 6) & 0x1f) | 0xc0);
  109|  7.66M|            *str = (unsigned char)((value & 0x3f) | 0x80);
  110|  7.66M|        }
  111|  15.3M|        return 2;
  112|  15.3M|    }
  113|  4.90k|    if (value < 0x10000) {
  ------------------
  |  Branch (113:9): [True: 4.06k, False: 844]
  ------------------
  114|  4.06k|        if (is_unicode_surrogate(value))
  ------------------
  |  Branch (114:13): [True: 0, False: 4.06k]
  ------------------
  115|      0|            return -2;
  116|  4.06k|        if (len < 3)
  ------------------
  |  Branch (116:13): [True: 0, False: 4.06k]
  ------------------
  117|      0|            return -1;
  118|  4.06k|        if (str) {
  ------------------
  |  Branch (118:13): [True: 2.03k, False: 2.03k]
  ------------------
  119|  2.03k|            *str++ = (unsigned char)(((value >> 12) & 0xf) | 0xe0);
  120|  2.03k|            *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
  121|  2.03k|            *str = (unsigned char)((value & 0x3f) | 0x80);
  122|  2.03k|        }
  123|  4.06k|        return 3;
  124|  4.06k|    }
  125|    844|    if (value < UNICODE_LIMIT) {
  ------------------
  |  Branch (125:9): [True: 844, False: 0]
  ------------------
  126|    844|        if (len < 4)
  ------------------
  |  Branch (126:13): [True: 0, False: 844]
  ------------------
  127|      0|            return -1;
  128|    844|        if (str) {
  ------------------
  |  Branch (128:13): [True: 422, False: 422]
  ------------------
  129|    422|            *str++ = (unsigned char)(((value >> 18) & 0x7) | 0xf0);
  130|    422|            *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80);
  131|    422|            *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
  132|    422|            *str = (unsigned char)((value & 0x3f) | 0x80);
  133|    422|        }
  134|    844|        return 4;
  135|    844|    }
  136|      0|    return -2;
  137|    844|}

EVP_PKEY_asn1_get_count:
   39|   150k|{
   40|   150k|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|   150k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   41|   150k|    if (app_methods)
  ------------------
  |  Branch (41:9): [True: 0, False: 150k]
  ------------------
   42|      0|        num += sk_EVP_PKEY_ASN1_METHOD_num(app_methods);
   43|   150k|    return num;
   44|   150k|}
EVP_PKEY_asn1_get0:
   47|  1.95M|{
   48|  1.95M|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|  1.95M|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   49|  1.95M|    if (idx < 0)
  ------------------
  |  Branch (49:9): [True: 0, False: 1.95M]
  ------------------
   50|      0|        return NULL;
   51|  1.95M|    if (idx < num)
  ------------------
  |  Branch (51:9): [True: 1.95M, False: 0]
  ------------------
   52|  1.95M|        return standard_methods[idx];
   53|      0|    idx -= num;
   54|      0|    return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
   55|  1.95M|}
EVP_PKEY_asn1_find:
   82|   105k|{
   83|   105k|    const EVP_PKEY_ASN1_METHOD *t;
   84|       |
   85|   110k|    for (;;) {
   86|   110k|        t = pkey_asn1_find(type);
   87|   110k|        if (!t || !(t->pkey_flags & ASN1_PKEY_ALIAS))
  ------------------
  |  | 1549|   110k|# define ASN1_PKEY_ALIAS         0x1
  ------------------
  |  Branch (87:13): [True: 0, False: 110k]
  |  Branch (87:19): [True: 105k, False: 4.92k]
  ------------------
   88|   105k|            break;
   89|  4.92k|        type = t->pkey_base_id;
   90|  4.92k|    }
   91|   105k|    if (pe) {
  ------------------
  |  Branch (91:9): [True: 105k, False: 0]
  ------------------
   92|   105k|#ifndef OPENSSL_NO_ENGINE
   93|   105k|        ENGINE *e;
   94|       |        /* type will contain the final unaliased type */
   95|   105k|        e = ENGINE_get_pkey_asn1_meth_engine(type);
   96|   105k|        if (e) {
  ------------------
  |  Branch (96:13): [True: 0, False: 105k]
  ------------------
   97|      0|            *pe = e;
   98|      0|            return ENGINE_get_pkey_asn1_meth(e, type);
   99|      0|        }
  100|   105k|#endif
  101|   105k|        *pe = NULL;
  102|   105k|    }
  103|   105k|    return t;
  104|   105k|}
EVP_PKEY_asn1_find_str:
  108|   150k|{
  109|   150k|    int i;
  110|   150k|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
  111|       |
  112|   150k|    if (len == -1)
  ------------------
  |  Branch (112:9): [True: 0, False: 150k]
  ------------------
  113|      0|        len = strlen(str);
  114|   150k|    if (pe) {
  ------------------
  |  Branch (114:9): [True: 150k, False: 0]
  ------------------
  115|   150k|#ifndef OPENSSL_NO_ENGINE
  116|   150k|        ENGINE *e;
  117|   150k|        ameth = ENGINE_pkey_asn1_find_str(&e, str, len);
  118|   150k|        if (ameth) {
  ------------------
  |  Branch (118:13): [True: 0, False: 150k]
  ------------------
  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|   150k|#endif
  129|   150k|        *pe = NULL;
  130|   150k|    }
  131|  2.04M|    for (i = EVP_PKEY_asn1_get_count(); i-- > 0; ) {
  ------------------
  |  Branch (131:41): [True: 1.95M, False: 91.6k]
  ------------------
  132|  1.95M|        ameth = EVP_PKEY_asn1_get0(i);
  133|  1.95M|        if (ameth->pkey_flags & ASN1_PKEY_ALIAS)
  ------------------
  |  | 1549|  1.95M|# define ASN1_PKEY_ALIAS         0x1
  ------------------
  |  Branch (133:13): [True: 631k, False: 1.32M]
  ------------------
  134|   631k|            continue;
  135|  1.32M|        if ((int)strlen(ameth->pem_str) == len
  ------------------
  |  Branch (135:13): [True: 87.4k, False: 1.23M]
  ------------------
  136|  1.32M|            && OPENSSL_strncasecmp(ameth->pem_str, str, len) == 0)
  ------------------
  |  Branch (136:16): [True: 59.3k, False: 28.1k]
  ------------------
  137|  59.3k|            return ameth;
  138|  1.32M|    }
  139|  91.6k|    return NULL;
  140|   150k|}
EVP_PKEY_asn1_get0_info:
  199|     16|{
  200|     16|    if (!ameth)
  ------------------
  |  Branch (200:9): [True: 0, False: 16]
  ------------------
  201|      0|        return 0;
  202|     16|    if (ppkey_id)
  ------------------
  |  Branch (202:9): [True: 16, False: 0]
  ------------------
  203|     16|        *ppkey_id = ameth->pkey_id;
  204|     16|    if (ppkey_base_id)
  ------------------
  |  Branch (204:9): [True: 16, False: 0]
  ------------------
  205|     16|        *ppkey_base_id = ameth->pkey_base_id;
  206|     16|    if (ppkey_flags)
  ------------------
  |  Branch (206:9): [True: 16, False: 0]
  ------------------
  207|     16|        *ppkey_flags = ameth->pkey_flags;
  208|     16|    if (pinfo)
  ------------------
  |  Branch (208:9): [True: 0, False: 16]
  ------------------
  209|      0|        *pinfo = ameth->info;
  210|     16|    if (ppem_str)
  ------------------
  |  Branch (210:9): [True: 16, False: 0]
  ------------------
  211|     16|        *ppem_str = ameth->pem_str;
  212|     16|    return 1;
  213|     16|}
ameth_lib.c:pkey_asn1_find:
   58|   110k|{
   59|   110k|    EVP_PKEY_ASN1_METHOD tmp;
   60|   110k|    const EVP_PKEY_ASN1_METHOD *t = &tmp, **ret;
   61|       |
   62|   110k|    tmp.pkey_id = type;
   63|   110k|    if (app_methods) {
  ------------------
  |  Branch (63:9): [True: 0, False: 110k]
  ------------------
   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|   110k|    ret = OBJ_bsearch_ameth(&t, standard_methods, OSSL_NELEM(standard_methods));
  ------------------
  |  |   14|   110k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   70|   110k|    if (ret == NULL || *ret == NULL)
  ------------------
  |  Branch (70:9): [True: 0, False: 110k]
  |  Branch (70:24): [True: 0, False: 110k]
  ------------------
   71|      0|        return NULL;
   72|   110k|    return *ret;
   73|   110k|}
ameth_lib.c:ameth_cmp:
   31|   211k|{
   32|   211k|    return ((*a)->pkey_id - (*b)->pkey_id);
   33|   211k|}

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

ASN1_get_object:
   48|  17.9M|{
   49|  17.9M|    int i, ret;
   50|  17.9M|    long len;
   51|  17.9M|    const unsigned char *p = *pp;
   52|  17.9M|    int tag, xclass, inf;
   53|  17.9M|    long max = omax;
   54|       |
   55|  17.9M|    if (omax <= 0) {
  ------------------
  |  Branch (55:9): [True: 0, False: 17.9M]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   57|      0|        return 0x80;
   58|      0|    }
   59|  17.9M|    ret = (*p & V_ASN1_CONSTRUCTED);
  ------------------
  |  |   52|  17.9M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
   60|  17.9M|    xclass = (*p & V_ASN1_PRIVATE);
  ------------------
  |  |   50|  17.9M|# define V_ASN1_PRIVATE                  0xc0
  ------------------
   61|  17.9M|    i = *p & V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   53|  17.9M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
   62|  17.9M|    if (i == V_ASN1_PRIMITIVE_TAG) { /* high-tag */
  ------------------
  |  |   53|  17.9M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  |  Branch (62:9): [True: 36.5k, False: 17.9M]
  ------------------
   63|  36.5k|        p++;
   64|  36.5k|        if (--max == 0)
  ------------------
  |  Branch (64:13): [True: 410, False: 36.1k]
  ------------------
   65|    410|            goto err;
   66|  36.1k|        len = 0;
   67|  47.4k|        while (*p & 0x80) {
  ------------------
  |  Branch (67:16): [True: 11.8k, False: 35.6k]
  ------------------
   68|  11.8k|            len <<= 7L;
   69|  11.8k|            len |= *(p++) & 0x7f;
   70|  11.8k|            if (--max == 0)
  ------------------
  |  Branch (70:17): [True: 280, False: 11.5k]
  ------------------
   71|    280|                goto err;
   72|  11.5k|            if (len > (INT_MAX >> 7L))
  ------------------
  |  Branch (72:17): [True: 222, False: 11.3k]
  ------------------
   73|    222|                goto err;
   74|  11.5k|        }
   75|  35.6k|        len <<= 7L;
   76|  35.6k|        len |= *(p++) & 0x7f;
   77|  35.6k|        tag = (int)len;
   78|  35.6k|        if (--max == 0)
  ------------------
  |  Branch (78:13): [True: 447, False: 35.1k]
  ------------------
   79|    447|            goto err;
   80|  17.9M|    } else {
   81|  17.9M|        tag = i;
   82|  17.9M|        p++;
   83|  17.9M|        if (--max == 0)
  ------------------
  |  Branch (83:13): [True: 4.14k, False: 17.9M]
  ------------------
   84|  4.14k|            goto err;
   85|  17.9M|    }
   86|  17.9M|    *ptag = tag;
   87|  17.9M|    *pclass = xclass;
   88|  17.9M|    if (!asn1_get_length(&p, &inf, plength, max))
  ------------------
  |  Branch (88:9): [True: 1.74k, False: 17.9M]
  ------------------
   89|  1.74k|        goto err;
   90|       |
   91|  17.9M|    if (inf && !(ret & V_ASN1_CONSTRUCTED))
  ------------------
  |  |   52|  2.54M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (91:9): [True: 2.54M, False: 15.3M]
  |  Branch (91:16): [True: 260, False: 2.54M]
  ------------------
   92|    260|        goto err;
   93|       |
   94|  17.9M|    if (*plength > (omax - (p - *pp))) {
  ------------------
  |  Branch (94:9): [True: 577k, False: 17.3M]
  ------------------
   95|   577k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|   577k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|   577k|    (ERR_new(),                                                 \
  |  |  |  |  404|   577k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|   577k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|   577k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|   577k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|   577k|     ERR_set_error)
  |  |  ------------------
  ------------------
   96|       |        /*
   97|       |         * Set this so that even if things are not long enough the values are
   98|       |         * set correctly
   99|       |         */
  100|   577k|        ret |= 0x80;
  101|   577k|    }
  102|  17.9M|    *pp = p;
  103|  17.9M|    return ret | inf;
  104|  7.50k| err:
  105|  7.50k|    ERR_raise(ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG);
  ------------------
  |  |  401|  7.50k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  7.50k|    (ERR_new(),                                                 \
  |  |  |  |  404|  7.50k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  7.50k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  7.50k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  7.50k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  7.50k|     ERR_set_error)
  |  |  ------------------
  ------------------
  106|  7.50k|    return 0x80;
  107|  17.9M|}
ASN1_put_object:
  162|  5.57M|{
  163|  5.57M|    unsigned char *p = *pp;
  164|  5.57M|    int i, ttag;
  165|       |
  166|  5.57M|    i = (constructed) ? V_ASN1_CONSTRUCTED : 0;
  ------------------
  |  |   52|  1.69M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (166:9): [True: 1.69M, False: 3.88M]
  ------------------
  167|  5.57M|    i |= (xclass & V_ASN1_PRIVATE);
  ------------------
  |  |   50|  5.57M|# define V_ASN1_PRIVATE                  0xc0
  ------------------
  168|  5.57M|    if (tag < 31) {
  ------------------
  |  Branch (168:9): [True: 5.57M, False: 787]
  ------------------
  169|  5.57M|        *(p++) = i | (tag & V_ASN1_PRIMITIVE_TAG);
  ------------------
  |  |   53|  5.57M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  170|  5.57M|    } else {
  171|    787|        *(p++) = i | V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   53|    787|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  172|  2.54k|        for (i = 0, ttag = tag; ttag > 0; i++)
  ------------------
  |  Branch (172:33): [True: 1.76k, False: 787]
  ------------------
  173|  1.76k|            ttag >>= 7;
  174|    787|        ttag = i;
  175|  2.54k|        while (i-- > 0) {
  ------------------
  |  Branch (175:16): [True: 1.76k, False: 787]
  ------------------
  176|  1.76k|            p[i] = tag & 0x7f;
  177|  1.76k|            if (i != (ttag - 1))
  ------------------
  |  Branch (177:17): [True: 975, False: 787]
  ------------------
  178|    975|                p[i] |= 0x80;
  179|  1.76k|            tag >>= 7;
  180|  1.76k|        }
  181|    787|        p += ttag;
  182|    787|    }
  183|  5.57M|    if (constructed == 2)
  ------------------
  |  Branch (183:9): [True: 0, False: 5.57M]
  ------------------
  184|      0|        *(p++) = 0x80;
  185|  5.57M|    else
  186|  5.57M|        asn1_put_length(&p, length);
  187|  5.57M|    *pp = p;
  188|  5.57M|}
ASN1_object_size:
  223|  24.2M|{
  224|  24.2M|    int ret = 1;
  225|       |
  226|  24.2M|    if (length < 0)
  ------------------
  |  Branch (226:9): [True: 0, False: 24.2M]
  ------------------
  227|      0|        return -1;
  228|  24.2M|    if (tag >= 31) {
  ------------------
  |  Branch (228:9): [True: 6.63k, False: 24.2M]
  ------------------
  229|  20.6k|        while (tag > 0) {
  ------------------
  |  Branch (229:16): [True: 14.0k, False: 6.63k]
  ------------------
  230|  14.0k|            tag >>= 7;
  231|  14.0k|            ret++;
  232|  14.0k|        }
  233|  6.63k|    }
  234|  24.2M|    if (constructed == 2) {
  ------------------
  |  Branch (234:9): [True: 0, False: 24.2M]
  ------------------
  235|      0|        ret += 3;
  236|  24.2M|    } else {
  237|  24.2M|        ret++;
  238|  24.2M|        if (length > 127) {
  ------------------
  |  Branch (238:13): [True: 25.3k, False: 24.2M]
  ------------------
  239|  25.3k|            int tmplen = length;
  240|  70.9k|            while (tmplen > 0) {
  ------------------
  |  Branch (240:20): [True: 45.6k, False: 25.3k]
  ------------------
  241|  45.6k|                tmplen >>= 8;
  242|  45.6k|                ret++;
  243|  45.6k|            }
  244|  25.3k|        }
  245|  24.2M|    }
  246|  24.2M|    if (ret >= INT_MAX - length)
  ------------------
  |  Branch (246:9): [True: 0, False: 24.2M]
  ------------------
  247|      0|        return -1;
  248|  24.2M|    return ret + length;
  249|  24.2M|}
ossl_asn1_string_set_bits_left:
  252|   245k|{
  253|   245k|    str->flags &= ~0x07;
  254|   245k|    str->flags |= ASN1_STRING_FLAG_BITS_LEFT | (num & 0x07);
  ------------------
  |  |  161|   245k|# define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  255|   245k|}
ASN1_STRING_copy:
  258|   563k|{
  259|   563k|    if (str == NULL)
  ------------------
  |  Branch (259:9): [True: 0, False: 563k]
  ------------------
  260|      0|        return 0;
  261|   563k|    dst->type = str->type;
  262|   563k|    if (!ASN1_STRING_set(dst, str->data, str->length))
  ------------------
  |  Branch (262:9): [True: 0, False: 563k]
  ------------------
  263|      0|        return 0;
  264|       |    /* Copy flags but preserve embed value */
  265|   563k|    dst->flags &= ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|   563k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  266|   563k|    dst->flags |= str->flags & ~ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|   563k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  267|   563k|    return 1;
  268|   563k|}
ASN1_STRING_set:
  287|  1.35M|{
  288|  1.35M|    unsigned char *c;
  289|  1.35M|    const char *data = _data;
  290|  1.35M|    size_t len;
  291|       |
  292|  1.35M|    if (len_in < 0) {
  ------------------
  |  Branch (292:9): [True: 0, False: 1.35M]
  ------------------
  293|      0|        if (data == NULL)
  ------------------
  |  Branch (293:13): [True: 0, False: 0]
  ------------------
  294|      0|            return 0;
  295|      0|        len = strlen(data);
  296|  1.35M|    } else {
  297|  1.35M|        len = (size_t)len_in;
  298|  1.35M|    }
  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|  1.35M|    if (len > INT_MAX - 1) {
  ------------------
  |  Branch (304:9): [True: 0, False: 1.35M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  306|      0|        return 0;
  307|      0|    }
  308|  1.35M|    if ((size_t)str->length <= len || str->data == NULL) {
  ------------------
  |  Branch (308:9): [True: 1.35M, False: 0]
  |  Branch (308:39): [True: 0, False: 0]
  ------------------
  309|  1.35M|        c = str->data;
  310|  1.35M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  311|       |        /* No NUL terminator in fuzzing builds */
  312|  1.35M|        str->data = OPENSSL_realloc(c, len != 0 ? len : 1);
  ------------------
  |  |  101|  2.71M|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.35M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.35M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (101:30): [True: 332k, False: 1.02M]
  |  |  ------------------
  ------------------
  313|       |#else
  314|       |        str->data = OPENSSL_realloc(c, len + 1);
  315|       |#endif
  316|  1.35M|        if (str->data == NULL) {
  ------------------
  |  Branch (316:13): [True: 0, False: 1.35M]
  ------------------
  317|      0|            str->data = c;
  318|      0|            return 0;
  319|      0|        }
  320|  1.35M|    }
  321|  1.35M|    str->length = len;
  322|  1.35M|    if (data != NULL) {
  ------------------
  |  Branch (322:9): [True: 1.27M, False: 82.3k]
  ------------------
  323|  1.27M|        memcpy(str->data, data, len);
  324|  1.27M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  325|       |        /* Set the unused byte to something non NUL and printable. */
  326|  1.27M|        if (len == 0)
  ------------------
  |  Branch (326:13): [True: 1.02M, False: 249k]
  ------------------
  327|  1.02M|            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|  1.27M|    }
  336|  1.35M|    return 1;
  337|  1.35M|}
ASN1_STRING_set0:
  340|  1.95M|{
  341|  1.95M|    OPENSSL_free(str->data);
  ------------------
  |  |  107|  1.95M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.95M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.95M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  342|  1.95M|    str->data = data;
  343|  1.95M|    str->length = len;
  344|  1.95M|}
ASN1_STRING_type_new:
  352|  3.17M|{
  353|  3.17M|    ASN1_STRING *ret;
  354|       |
  355|  3.17M|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   99|  3.17M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.17M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.17M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  356|  3.17M|    if (ret == NULL)
  ------------------
  |  Branch (356:9): [True: 0, False: 3.17M]
  ------------------
  357|      0|        return NULL;
  358|  3.17M|    ret->type = type;
  359|  3.17M|    return ret;
  360|  3.17M|}
ossl_asn1_string_embed_free:
  363|  3.34M|{
  364|  3.34M|    if (a == NULL)
  ------------------
  |  Branch (364:9): [True: 0, False: 3.34M]
  ------------------
  365|      0|        return;
  366|  3.34M|    if (!(a->flags & ASN1_STRING_FLAG_NDEF))
  ------------------
  |  |  167|  3.34M|# define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (366:9): [True: 3.34M, False: 0]
  ------------------
  367|  3.34M|        OPENSSL_free(a->data);
  ------------------
  |  |  107|  3.34M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.34M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.34M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  368|  3.34M|    if (embed == 0)
  ------------------
  |  Branch (368:9): [True: 3.17M, False: 169k]
  ------------------
  369|  3.17M|        OPENSSL_free(a);
  ------------------
  |  |  107|  3.17M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.17M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.17M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  370|  3.34M|}
ASN1_STRING_free:
  373|   447k|{
  374|   447k|    if (a == NULL)
  ------------------
  |  Branch (374:9): [True: 324k, False: 123k]
  ------------------
  375|   324k|        return;
  376|   123k|    ossl_asn1_string_embed_free(a, a->flags & ASN1_STRING_FLAG_EMBED);
  ------------------
  |  |  182|   123k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  377|   123k|}
ASN1_STRING_length:
  406|  21.7k|{
  407|  21.7k|    return x->length;
  408|  21.7k|}
ASN1_STRING_get0_data:
  423|  21.7k|{
  424|  21.7k|    return x->data;
  425|  21.7k|}
asn1_lib.c:asn1_get_length:
  118|  17.9M|{
  119|  17.9M|    const unsigned char *p = *pp;
  120|  17.9M|    unsigned long ret = 0;
  121|  17.9M|    int i;
  122|       |
  123|  17.9M|    if (max-- < 1)
  ------------------
  |  Branch (123:9): [True: 0, False: 17.9M]
  ------------------
  124|      0|        return 0;
  125|  17.9M|    if (*p == 0x80) {
  ------------------
  |  Branch (125:9): [True: 2.54M, False: 15.3M]
  ------------------
  126|  2.54M|        *inf = 1;
  127|  2.54M|        p++;
  128|  15.3M|    } else {
  129|  15.3M|        *inf = 0;
  130|  15.3M|        i = *p & 0x7f;
  131|  15.3M|        if (*p++ & 0x80) {
  ------------------
  |  Branch (131:13): [True: 66.7k, False: 15.3M]
  ------------------
  132|  66.7k|            if (max < i + 1)
  ------------------
  |  Branch (132:17): [True: 1.53k, False: 65.1k]
  ------------------
  133|  1.53k|                return 0;
  134|       |            /* Skip leading zeroes */
  135|   103k|            while (i > 0 && *p == 0) {
  ------------------
  |  Branch (135:20): [True: 82.6k, False: 20.9k]
  |  Branch (135:29): [True: 38.3k, False: 44.2k]
  ------------------
  136|  38.3k|                p++;
  137|  38.3k|                i--;
  138|  38.3k|            }
  139|  65.1k|            if (i > (int)sizeof(long))
  ------------------
  |  Branch (139:17): [True: 76, False: 65.0k]
  ------------------
  140|     76|                return 0;
  141|   136k|            while (i > 0) {
  ------------------
  |  Branch (141:20): [True: 71.5k, False: 65.0k]
  ------------------
  142|  71.5k|                ret <<= 8;
  143|  71.5k|                ret |= *p++;
  144|  71.5k|                i--;
  145|  71.5k|            }
  146|  65.0k|            if (ret > LONG_MAX)
  ------------------
  |  Branch (146:17): [True: 134, False: 64.9k]
  ------------------
  147|    134|                return 0;
  148|  15.3M|        } else {
  149|  15.3M|            ret = i;
  150|  15.3M|        }
  151|  15.3M|    }
  152|  17.9M|    *pp = p;
  153|  17.9M|    *rl = (long)ret;
  154|  17.9M|    return 1;
  155|  17.9M|}
asn1_lib.c:asn1_put_length:
  201|  5.57M|{
  202|  5.57M|    unsigned char *p = *pp;
  203|  5.57M|    int i, len;
  204|       |
  205|  5.57M|    if (length <= 127) {
  ------------------
  |  Branch (205:9): [True: 5.56M, False: 7.63k]
  ------------------
  206|  5.56M|        *(p++) = (unsigned char)length;
  207|  5.56M|    } else {
  208|  7.63k|        len = length;
  209|  21.7k|        for (i = 0; len > 0; i++)
  ------------------
  |  Branch (209:21): [True: 14.1k, False: 7.63k]
  ------------------
  210|  14.1k|            len >>= 8;
  211|  7.63k|        *(p++) = i | 0x80;
  212|  7.63k|        len = i;
  213|  21.7k|        while (i-- > 0) {
  ------------------
  |  Branch (213:16): [True: 14.1k, False: 7.63k]
  ------------------
  214|  14.1k|            p[i] = length & 0xff;
  215|  14.1k|            length >>= 8;
  216|  14.1k|        }
  217|  7.63k|        p += len;
  218|  7.63k|    }
  219|  5.57M|    *pp = p;
  220|  5.57M|}

ASN1_item_unpack:
   53|    810|{
   54|    810|    const unsigned char *p;
   55|    810|    void *ret;
   56|       |
   57|    810|    p = oct->data;
   58|    810|    if ((ret = ASN1_item_d2i(NULL, &p, oct->length, it)) == NULL)
  ------------------
  |  Branch (58:9): [True: 1, False: 809]
  ------------------
   59|    810|        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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
   60|    810|    return ret;
   61|    810|}

ASN1_tag2bit:
   88|  2.17M|{
   89|  2.17M|    if ((tag < 0) || (tag > 30))
  ------------------
  |  Branch (89:9): [True: 0, False: 2.17M]
  |  Branch (89:22): [True: 43, False: 2.17M]
  ------------------
   90|     43|        return 0;
   91|  2.17M|    return tag2bit[tag];
   92|  2.17M|}
ASN1_item_ex_d2i:
  128|   257k|{
  129|   257k|    return asn1_item_ex_d2i_intern(pval, in, len, it, tag, aclass, opt, ctx,
  130|   257k|                                   NULL, NULL);
  131|   257k|}
ASN1_item_d2i_ex:
  137|   176k|{
  138|   176k|    ASN1_TLC c;
  139|   176k|    ASN1_VALUE *ptmpval = NULL;
  140|       |
  141|   176k|    if (pval == NULL)
  ------------------
  |  Branch (141:9): [True: 67.2k, False: 109k]
  ------------------
  142|  67.2k|        pval = &ptmpval;
  143|   176k|    asn1_tlc_clear_nc(&c);
  ------------------
  |  |   98|   176k|#define asn1_tlc_clear_nc(c)    do {(c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (98:62): [Folded - Ignored]
  |  |  ------------------
  ------------------
  144|   176k|    if (asn1_item_ex_d2i_intern(pval, in, len, it, -1, 0, 0, &c, libctx,
  ------------------
  |  Branch (144:9): [True: 143k, False: 33.1k]
  ------------------
  145|   176k|                                propq) > 0)
  146|   143k|        return *pval;
  147|  33.1k|    return NULL;
  148|   176k|}
ASN1_item_d2i:
  153|   107k|{
  154|   107k|    return ASN1_item_d2i_ex(pval, in, len, it, NULL, NULL);
  155|   107k|}
tasn_dec.c:asn1_item_ex_d2i_intern:
  111|   434k|{
  112|   434k|    int rv;
  113|       |
  114|   434k|    if (pval == NULL || it == NULL) {
  ------------------
  |  Branch (114:9): [True: 0, False: 434k]
  |  Branch (114:25): [True: 0, False: 434k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  116|      0|        return 0;
  117|      0|    }
  118|   434k|    rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0,
  119|   434k|                             libctx, propq);
  120|   434k|    if (rv <= 0)
  ------------------
  |  Branch (120:9): [True: 34.3k, False: 399k]
  ------------------
  121|  34.3k|        ASN1_item_ex_free(pval, it);
  122|   434k|    return rv;
  123|   434k|}
tasn_dec.c:asn1_item_embed_d2i:
  167|  9.19M|{
  168|  9.19M|    const ASN1_TEMPLATE *tt, *errtt = NULL;
  169|  9.19M|    const ASN1_EXTERN_FUNCS *ef;
  170|  9.19M|    const ASN1_AUX *aux;
  171|  9.19M|    ASN1_aux_cb *asn1_cb;
  172|  9.19M|    const unsigned char *p = NULL, *q;
  173|  9.19M|    unsigned char oclass;
  174|  9.19M|    char seq_eoc, seq_nolen, cst, isopt;
  175|  9.19M|    long tmplen;
  176|  9.19M|    int i;
  177|  9.19M|    int otag;
  178|  9.19M|    int ret = 0;
  179|  9.19M|    ASN1_VALUE **pchptr;
  180|       |
  181|  9.19M|    if (pval == NULL || it == NULL) {
  ------------------
  |  Branch (181:9): [True: 0, False: 9.19M]
  |  Branch (181:25): [True: 0, False: 9.19M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  183|      0|        return 0;
  184|      0|    }
  185|  9.19M|    if (len <= 0) {
  ------------------
  |  Branch (185:9): [True: 1.20k, False: 9.19M]
  ------------------
  186|  1.20k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|  1.20k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.20k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.20k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  1.20k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  1.20k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  1.20k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.20k|     ERR_set_error)
  |  |  ------------------
  ------------------
  187|  1.20k|        return 0;
  188|  1.20k|    }
  189|  9.19M|    aux = it->funcs;
  190|  9.19M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (190:9): [True: 643k, False: 8.55M]
  |  Branch (190:16): [True: 326k, False: 316k]
  ------------------
  191|   326k|        asn1_cb = aux->asn1_cb;
  192|  8.86M|    else
  193|  8.86M|        asn1_cb = 0;
  194|       |
  195|  9.19M|    if (++depth > ASN1_MAX_CONSTRUCTED_NEST) {
  ------------------
  |  |   26|  9.19M|#define ASN1_MAX_CONSTRUCTED_NEST 30
  ------------------
  |  Branch (195:9): [True: 0, False: 9.19M]
  ------------------
  196|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  197|      0|        goto err;
  198|      0|    }
  199|       |
  200|  9.19M|    switch (it->itype) {
  201|  5.92M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  5.92M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (201:5): [True: 5.92M, False: 3.27M]
  ------------------
  202|  5.92M|        if (it->templates) {
  ------------------
  |  Branch (202:13): [True: 3.21M, False: 2.71M]
  ------------------
  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|  3.21M|            if ((tag != -1) || opt) {
  ------------------
  |  Branch (209:17): [True: 0, False: 3.21M]
  |  Branch (209:32): [True: 0, False: 3.21M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|  3.21M|            return asn1_template_ex_d2i(pval, in, len, it->templates, opt, ctx,
  215|  3.21M|                                        depth, libctx, propq);
  216|  3.21M|        }
  217|  2.71M|        return asn1_d2i_ex_primitive(pval, in, len, it,
  218|  2.71M|                                     tag, aclass, opt, ctx);
  219|       |
  220|   981k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   981k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (220:5): [True: 981k, False: 8.21M]
  ------------------
  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|   981k|        if (tag != -1) {
  ------------------
  |  Branch (225:13): [True: 0, False: 981k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  227|      0|            goto err;
  228|      0|        }
  229|       |
  230|   981k|        p = *in;
  231|       |        /* Just read in tag and class */
  232|   981k|        ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL,
  233|   981k|                              &p, len, -1, 0, 1, ctx);
  234|   981k|        if (!ret) {
  ------------------
  |  Branch (234:13): [True: 52, False: 981k]
  ------------------
  235|     52|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|     52|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     52|    (ERR_new(),                                                 \
  |  |  |  |  404|     52|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     52|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     52|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     52|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     52|     ERR_set_error)
  |  |  ------------------
  ------------------
  236|     52|            goto err;
  237|     52|        }
  238|       |
  239|       |        /* Must be UNIVERSAL class */
  240|   981k|        if (oclass != V_ASN1_UNIVERSAL) {
  ------------------
  |  |   47|   981k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (240:13): [True: 16.6k, False: 964k]
  ------------------
  241|       |            /* If OPTIONAL, assume this is OK */
  242|  16.6k|            if (opt)
  ------------------
  |  Branch (242:17): [True: 16.5k, False: 73]
  ------------------
  243|  16.5k|                return -1;
  244|  16.6k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL);
  ------------------
  |  |  401|     73|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     73|    (ERR_new(),                                                 \
  |  |  |  |  404|     73|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     73|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     73|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     73|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     73|     ERR_set_error)
  |  |  ------------------
  ------------------
  245|     73|            goto err;
  246|  16.6k|        }
  247|       |
  248|       |        /* Check tag matches bit map */
  249|   964k|        if (!(ASN1_tag2bit(otag) & it->utype)) {
  ------------------
  |  Branch (249:13): [True: 1.69k, False: 962k]
  ------------------
  250|       |            /* If OPTIONAL, assume this is OK */
  251|  1.69k|            if (opt)
  ------------------
  |  Branch (251:17): [True: 1.44k, False: 250]
  ------------------
  252|  1.44k|                return -1;
  253|  1.69k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    250|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    250|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    250|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    250|     ERR_set_error)
  |  |  ------------------
  ------------------
  254|    250|            goto err;
  255|  1.69k|        }
  256|   962k|        return asn1_d2i_ex_primitive(pval, in, len, it, otag, 0, 0, ctx);
  257|       |
  258|   257k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   257k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (258:5): [True: 257k, False: 8.93M]
  ------------------
  259|       |        /* Use new style d2i */
  260|   257k|        ef = it->funcs;
  261|   257k|        if (ef->asn1_ex_d2i_ex != NULL)
  ------------------
  |  Branch (261:13): [True: 113k, False: 144k]
  ------------------
  262|   113k|            return ef->asn1_ex_d2i_ex(pval, in, len, it, tag, aclass, opt, ctx,
  263|   113k|                                      libctx, propq);
  264|   144k|        return ef->asn1_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx);
  265|       |
  266|   230k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   230k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (266:5): [True: 230k, False: 8.96M]
  ------------------
  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|   230k|        if (tag != -1) {
  ------------------
  |  Branch (271:13): [True: 0, False: 230k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  273|      0|            goto err;
  274|      0|        }
  275|       |
  276|   230k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
  ------------------
  |  |  746|  15.2k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (276:13): [True: 15.2k, False: 215k]
  |  Branch (276:24): [True: 0, False: 15.2k]
  ------------------
  277|      0|            goto auxerr;
  278|   230k|        if (*pval) {
  ------------------
  |  Branch (278:13): [True: 6.75k, False: 223k]
  ------------------
  279|       |            /* Free up and zero CHOICE value if initialised */
  280|  6.75k|            i = ossl_asn1_get_choice_selector(pval, it);
  281|  6.75k|            if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (281:17): [True: 0, False: 6.75k]
  |  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|   223k|        } else if (!ossl_asn1_item_ex_new_intern(pval, it, libctx, propq)) {
  ------------------
  |  Branch (287:20): [True: 0, False: 223k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|   230k|        p = *in;
  293|   527k|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (293:41): [True: 526k, False: 523]
  ------------------
  294|   526k|            pchptr = ossl_asn1_get_field_ptr(pval, tt);
  295|       |            /*
  296|       |             * We mark field as OPTIONAL so its absence can be recognised.
  297|       |             */
  298|   526k|            ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx, depth,
  299|   526k|                                       libctx, propq);
  300|       |            /* If field not present, try the next one */
  301|   526k|            if (ret == -1)
  ------------------
  |  Branch (301:17): [True: 296k, False: 230k]
  ------------------
  302|   296k|                continue;
  303|       |            /* If positive return, read OK, break loop */
  304|   230k|            if (ret > 0)
  ------------------
  |  Branch (304:17): [True: 212k, False: 17.9k]
  ------------------
  305|   212k|                break;
  306|       |            /*
  307|       |             * Must be an ASN1 parsing error.
  308|       |             * Free up any partial choice value
  309|       |             */
  310|  17.9k|            ossl_asn1_template_free(pchptr, tt);
  311|  17.9k|            errtt = tt;
  312|  17.9k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  17.9k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  17.9k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  17.9k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  17.9k|     ERR_set_error)
  |  |  ------------------
  ------------------
  313|  17.9k|            goto err;
  314|   230k|        }
  315|       |
  316|       |        /* Did we fall off the end without reading anything? */
  317|   212k|        if (i == it->tcount) {
  ------------------
  |  Branch (317:13): [True: 523, False: 212k]
  ------------------
  318|       |            /* If OPTIONAL, this is OK */
  319|    523|            if (opt) {
  ------------------
  |  Branch (319:17): [True: 0, False: 523]
  ------------------
  320|       |                /* Free and zero it */
  321|      0|                ASN1_item_ex_free(pval, it);
  322|      0|                return -1;
  323|      0|            }
  324|    523|            ERR_raise(ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE);
  ------------------
  |  |  401|    523|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    523|    (ERR_new(),                                                 \
  |  |  |  |  404|    523|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    523|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    523|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    523|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    523|     ERR_set_error)
  |  |  ------------------
  ------------------
  325|    523|            goto err;
  326|    523|        }
  327|       |
  328|   212k|        ossl_asn1_set_choice_selector(pval, i, it);
  329|       |
  330|   212k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
  ------------------
  |  |  747|  11.9k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (330:13): [True: 11.9k, False: 200k]
  |  Branch (330:24): [True: 0, False: 11.9k]
  ------------------
  331|      0|            goto auxerr;
  332|   212k|        *in = p;
  333|   212k|        return 1;
  334|       |
  335|  17.0k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  17.0k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (335:5): [True: 17.0k, False: 9.17M]
  ------------------
  336|  1.80M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  1.80M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (336:5): [True: 1.78M, False: 7.41M]
  ------------------
  337|  1.80M|        p = *in;
  338|  1.80M|        tmplen = len;
  339|       |
  340|       |        /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */
  341|  1.80M|        if (tag == -1) {
  ------------------
  |  Branch (341:13): [True: 1.76M, False: 33.1k]
  ------------------
  342|  1.76M|            tag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  1.76M|# define V_ASN1_SEQUENCE                 16
  ------------------
  343|  1.76M|            aclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  1.76M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  344|  1.76M|        }
  345|       |        /* Get SEQUENCE length and update len, p */
  346|  1.80M|        ret = asn1_check_tlen(&len, NULL, NULL, &seq_eoc, &cst,
  347|  1.80M|                              &p, len, tag, aclass, opt, ctx);
  348|  1.80M|        if (!ret) {
  ------------------
  |  Branch (348:13): [True: 2.55k, False: 1.79M]
  ------------------
  349|  2.55k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  2.55k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.55k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.55k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  2.55k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  2.55k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  2.55k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.55k|     ERR_set_error)
  |  |  ------------------
  ------------------
  350|  2.55k|            goto err;
  351|  1.79M|        } else if (ret == -1)
  ------------------
  |  Branch (351:20): [True: 148k, False: 1.65M]
  ------------------
  352|   148k|            return -1;
  353|  1.65M|        if (aux && (aux->flags & ASN1_AFLG_BROKEN)) {
  ------------------
  |  |  736|   184k|# define ASN1_AFLG_BROKEN        4
  ------------------
  |  Branch (353:13): [True: 184k, False: 1.46M]
  |  Branch (353:20): [True: 0, False: 184k]
  ------------------
  354|      0|            len = tmplen - (p - *in);
  355|      0|            seq_nolen = 1;
  356|      0|        }
  357|       |        /* If indefinite we don't do a length check */
  358|  1.65M|        else
  359|  1.65M|            seq_nolen = seq_eoc;
  360|  1.65M|        if (!cst) {
  ------------------
  |  Branch (360:13): [True: 212, False: 1.65M]
  ------------------
  361|    212|            ERR_raise(ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    212|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    212|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    212|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    212|     ERR_set_error)
  |  |  ------------------
  ------------------
  362|    212|            goto err;
  363|    212|        }
  364|       |
  365|  1.65M|        if (*pval == NULL
  ------------------
  |  Branch (365:13): [True: 1.05M, False: 591k]
  ------------------
  366|  1.65M|                && !ossl_asn1_item_ex_new_intern(pval, it, libctx, propq)) {
  ------------------
  |  Branch (366:20): [True: 0, False: 1.05M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|      0|            goto err;
  369|      0|        }
  370|       |
  371|  1.65M|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
  ------------------
  |  |  746|   125k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (371:13): [True: 125k, False: 1.52M]
  |  Branch (371:24): [True: 0, False: 125k]
  ------------------
  372|      0|            goto auxerr;
  373|       |
  374|       |        /* Free up and zero any ADB found */
  375|  5.79M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (375:41): [True: 4.14M, False: 1.65M]
  ------------------
  376|  4.14M|            if (tt->flags & ASN1_TFLG_ADB_MASK) {
  ------------------
  |  |  583|  4.14M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
  |  Branch (376:17): [True: 13.3k, False: 4.13M]
  ------------------
  377|  13.3k|                const ASN1_TEMPLATE *seqtt;
  378|  13.3k|                ASN1_VALUE **pseqval;
  379|  13.3k|                seqtt = ossl_asn1_do_adb(*pval, tt, 0);
  380|  13.3k|                if (seqtt == NULL)
  ------------------
  |  Branch (380:21): [True: 11.9k, False: 1.37k]
  ------------------
  381|  11.9k|                    continue;
  382|  1.37k|                pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  383|  1.37k|                ossl_asn1_template_free(pseqval, seqtt);
  384|  1.37k|            }
  385|  4.14M|        }
  386|       |
  387|       |        /* Get each field entry */
  388|  5.24M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (388:41): [True: 3.89M, False: 1.35M]
  ------------------
  389|  3.89M|            const ASN1_TEMPLATE *seqtt;
  390|  3.89M|            ASN1_VALUE **pseqval;
  391|  3.89M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  392|  3.89M|            if (seqtt == NULL)
  ------------------
  |  Branch (392:17): [True: 0, False: 3.89M]
  ------------------
  393|      0|                goto err;
  394|  3.89M|            pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  395|       |            /* Have we ran out of data? */
  396|  3.89M|            if (!len)
  ------------------
  |  Branch (396:17): [True: 78.3k, False: 3.81M]
  ------------------
  397|  78.3k|                break;
  398|  3.81M|            q = p;
  399|  3.81M|            if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (399:17): [True: 172k, False: 3.64M]
  ------------------
  400|   172k|                if (!seq_eoc) {
  ------------------
  |  Branch (400:21): [True: 380, False: 172k]
  ------------------
  401|    380|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|    380|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    380|    (ERR_new(),                                                 \
  |  |  |  |  404|    380|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    380|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    380|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    380|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    380|     ERR_set_error)
  |  |  ------------------
  ------------------
  402|    380|                    goto err;
  403|    380|                }
  404|   172k|                len -= p - q;
  405|   172k|                seq_eoc = 0;
  406|   172k|                break;
  407|   172k|            }
  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|  3.64M|            if (i == (it->tcount - 1))
  ------------------
  |  Branch (414:17): [True: 1.36M, False: 2.27M]
  ------------------
  415|  1.36M|                isopt = 0;
  416|  2.27M|            else
  417|  2.27M|                isopt = (char)(seqtt->flags & ASN1_TFLG_OPTIONAL);
  ------------------
  |  |  523|  2.27M|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  418|       |            /*
  419|       |             * attempt to read in field, allowing each to be OPTIONAL
  420|       |             */
  421|       |
  422|  3.64M|            ret = asn1_template_ex_d2i(pseqval, &p, len, seqtt, isopt, ctx,
  423|  3.64M|                                       depth, libctx, propq);
  424|  3.64M|            if (!ret) {
  ------------------
  |  Branch (424:17): [True: 47.5k, False: 3.59M]
  ------------------
  425|  47.5k|                errtt = seqtt;
  426|  47.5k|                goto err;
  427|  3.59M|            } else if (ret == -1) {
  ------------------
  |  Branch (427:24): [True: 160k, False: 3.43M]
  ------------------
  428|       |                /*
  429|       |                 * OPTIONAL component absent. Free and zero the field.
  430|       |                 */
  431|   160k|                ossl_asn1_template_free(pseqval, seqtt);
  432|   160k|                continue;
  433|   160k|            }
  434|       |            /* Update length */
  435|  3.43M|            len -= p - q;
  436|  3.43M|        }
  437|       |
  438|       |        /* Check for EOC if expecting one */
  439|  1.60M|        if (seq_eoc && !asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (439:13): [True: 495k, False: 1.10M]
  |  Branch (439:24): [True: 2.29k, False: 493k]
  ------------------
  440|  2.29k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|  2.29k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.29k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.29k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  2.29k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  2.29k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  2.29k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.29k|     ERR_set_error)
  |  |  ------------------
  ------------------
  441|  2.29k|            goto err;
  442|  2.29k|        }
  443|       |        /* Check all data read */
  444|  1.60M|        if (!seq_nolen && len) {
  ------------------
  |  Branch (444:13): [True: 934k, False: 665k]
  |  Branch (444:27): [True: 221, False: 934k]
  ------------------
  445|    221|            ERR_raise(ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH);
  ------------------
  |  |  401|    221|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    221|    (ERR_new(),                                                 \
  |  |  |  |  404|    221|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    221|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    221|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    221|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    221|     ERR_set_error)
  |  |  ------------------
  ------------------
  446|    221|            goto err;
  447|    221|        }
  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.98M|        for (; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (454:16): [True: 387k, False: 1.59M]
  ------------------
  455|   387k|            const ASN1_TEMPLATE *seqtt;
  456|   387k|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  457|   387k|            if (seqtt == NULL)
  ------------------
  |  Branch (457:17): [True: 0, False: 387k]
  ------------------
  458|      0|                goto err;
  459|   387k|            if (seqtt->flags & ASN1_TFLG_OPTIONAL) {
  ------------------
  |  |  523|   387k|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (459:17): [True: 384k, False: 3.27k]
  ------------------
  460|   384k|                ASN1_VALUE **pseqval;
  461|   384k|                pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  462|   384k|                ossl_asn1_template_free(pseqval, seqtt);
  463|   384k|            } else {
  464|  3.27k|                errtt = seqtt;
  465|  3.27k|                ERR_raise(ERR_LIB_ASN1, ASN1_R_FIELD_MISSING);
  ------------------
  |  |  401|  3.27k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  3.27k|    (ERR_new(),                                                 \
  |  |  |  |  404|  3.27k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  3.27k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  3.27k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  3.27k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  3.27k|     ERR_set_error)
  |  |  ------------------
  ------------------
  466|  3.27k|                goto err;
  467|  3.27k|            }
  468|   387k|        }
  469|       |        /* Save encoding */
  470|  1.59M|        if (!ossl_asn1_enc_save(pval, *in, p - *in, it))
  ------------------
  |  Branch (470:13): [True: 0, False: 1.59M]
  ------------------
  471|      0|            goto auxerr;
  472|  1.59M|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
  ------------------
  |  |  747|   111k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (472:13): [True: 111k, False: 1.48M]
  |  Branch (472:24): [True: 0, False: 111k]
  ------------------
  473|      0|            goto auxerr;
  474|  1.59M|        *in = p;
  475|  1.59M|        return 1;
  476|       |
  477|      0|    default:
  ------------------
  |  Branch (477:5): [True: 0, False: 9.19M]
  ------------------
  478|      0|        return 0;
  479|  9.19M|    }
  480|      0| auxerr:
  481|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  482|  75.3k| err:
  483|  75.3k|    if (errtt)
  ------------------
  |  Branch (483:9): [True: 68.7k, False: 6.55k]
  ------------------
  484|  68.7k|        ERR_add_error_data(4, "Field=", errtt->field_name,
  485|  68.7k|                           ", Type=", it->sname);
  486|  6.55k|    else
  487|  6.55k|        ERR_add_error_data(2, "Type=", it->sname);
  488|  75.3k|    return 0;
  489|      0|}
tasn_dec.c:asn1_template_ex_d2i:
  501|  7.38M|{
  502|  7.38M|    int flags, aclass;
  503|  7.38M|    int ret;
  504|  7.38M|    long len;
  505|  7.38M|    const unsigned char *p, *q;
  506|  7.38M|    char exp_eoc;
  507|  7.38M|    if (!val)
  ------------------
  |  Branch (507:9): [True: 0, False: 7.38M]
  ------------------
  508|      0|        return 0;
  509|  7.38M|    flags = tt->flags;
  510|  7.38M|    aclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  7.38M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  511|       |
  512|  7.38M|    p = *in;
  513|       |
  514|       |    /* Check if EXPLICIT tag expected */
  515|  7.38M|    if (flags & ASN1_TFLG_EXPTAG) {
  ------------------
  |  |  550|  7.38M|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (515:9): [True: 102k, False: 7.27M]
  ------------------
  516|   102k|        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|   102k|        ret = asn1_check_tlen(&len, NULL, NULL, &exp_eoc, &cst,
  522|   102k|                              &p, inlen, tt->tag, aclass, opt, ctx);
  523|   102k|        q = p;
  524|   102k|        if (!ret) {
  ------------------
  |  Branch (524:13): [True: 1.29k, False: 101k]
  ------------------
  525|  1.29k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  1.29k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.29k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.29k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  1.29k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  1.29k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  1.29k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.29k|     ERR_set_error)
  |  |  ------------------
  ------------------
  526|  1.29k|            return 0;
  527|   101k|        } else if (ret == -1)
  ------------------
  |  Branch (527:20): [True: 66.9k, False: 34.5k]
  ------------------
  528|  66.9k|            return -1;
  529|  34.5k|        if (!cst) {
  ------------------
  |  Branch (529:13): [True: 198, False: 34.3k]
  ------------------
  530|    198|            ERR_raise(ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED);
  ------------------
  |  |  401|    198|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    198|    (ERR_new(),                                                 \
  |  |  |  |  404|    198|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    198|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    198|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    198|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    198|     ERR_set_error)
  |  |  ------------------
  ------------------
  531|    198|            return 0;
  532|    198|        }
  533|       |        /* We've found the field so it can't be OPTIONAL now */
  534|  34.3k|        ret = asn1_template_noexp_d2i(val, &p, len, tt, 0, ctx, depth, libctx,
  535|  34.3k|                                      propq);
  536|  34.3k|        if (!ret) {
  ------------------
  |  Branch (536:13): [True: 9.98k, False: 24.4k]
  ------------------
  537|  9.98k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  9.98k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  9.98k|    (ERR_new(),                                                 \
  |  |  |  |  404|  9.98k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  9.98k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  9.98k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  9.98k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  9.98k|     ERR_set_error)
  |  |  ------------------
  ------------------
  538|  9.98k|            return 0;
  539|  9.98k|        }
  540|       |        /* We read the field in OK so update length */
  541|  24.4k|        len -= p - q;
  542|  24.4k|        if (exp_eoc) {
  ------------------
  |  Branch (542:13): [True: 21.5k, False: 2.84k]
  ------------------
  543|       |            /* If NDEF we must have an EOC here */
  544|  21.5k|            if (!asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (544:17): [True: 730, False: 20.8k]
  ------------------
  545|    730|                ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|    730|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    730|    (ERR_new(),                                                 \
  |  |  |  |  404|    730|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    730|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    730|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    730|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    730|     ERR_set_error)
  |  |  ------------------
  ------------------
  546|    730|                goto err;
  547|    730|            }
  548|  21.5k|        } else {
  549|       |            /*
  550|       |             * Otherwise we must hit the EXPLICIT tag end or its an error
  551|       |             */
  552|  2.84k|            if (len) {
  ------------------
  |  Branch (552:17): [True: 208, False: 2.63k]
  ------------------
  553|    208|                ERR_raise(ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH);
  ------------------
  |  |  401|    208|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    208|    (ERR_new(),                                                 \
  |  |  |  |  404|    208|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    208|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    208|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    208|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    208|     ERR_set_error)
  |  |  ------------------
  ------------------
  554|    208|                goto err;
  555|    208|            }
  556|  2.84k|        }
  557|  24.4k|    } else
  558|  7.27M|        return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx, depth,
  559|  7.27M|                                       libctx, propq);
  560|       |
  561|  23.4k|    *in = p;
  562|  23.4k|    return 1;
  563|       |
  564|    938| err:
  565|    938|    return 0;
  566|  7.38M|}
tasn_dec.c:asn1_template_noexp_d2i:
  573|  7.31M|{
  574|  7.31M|    int flags, aclass;
  575|  7.31M|    int ret;
  576|  7.31M|    ASN1_VALUE *tval;
  577|  7.31M|    const unsigned char *p, *q;
  578|  7.31M|    if (!val)
  ------------------
  |  Branch (578:9): [True: 0, False: 7.31M]
  ------------------
  579|      0|        return 0;
  580|  7.31M|    flags = tt->flags;
  581|  7.31M|    aclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  7.31M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  582|       |
  583|  7.31M|    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.31M|    if (tt->flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  597|  7.31M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  |  Branch (589:9): [True: 482k, False: 6.82M]
  ------------------
  590|   482k|        tval = (ASN1_VALUE *)val;
  591|   482k|        val = &tval;
  592|   482k|    }
  593|       |
  594|  7.31M|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  7.31M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (594:9): [True: 3.27M, False: 4.03M]
  ------------------
  595|       |        /* SET OF, SEQUENCE OF */
  596|  3.27M|        int sktag, skaclass;
  597|  3.27M|        char sk_eoc;
  598|       |        /* First work out expected inner tag value */
  599|  3.27M|        if (flags & ASN1_TFLG_IMPTAG) {
  ------------------
  |  |  547|  3.27M|# define ASN1_TFLG_IMPTAG        (0x1 << 3)
  ------------------
  |  Branch (599:13): [True: 24.8k, False: 3.25M]
  ------------------
  600|  24.8k|            sktag = tt->tag;
  601|  24.8k|            skaclass = aclass;
  602|  3.25M|        } else {
  603|  3.25M|            skaclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  3.25M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  604|  3.25M|            if (flags & ASN1_TFLG_SET_OF)
  ------------------
  |  |  526|  3.25M|# define ASN1_TFLG_SET_OF        (0x1 << 1)
  ------------------
  |  Branch (604:17): [True: 3.06M, False: 185k]
  ------------------
  605|  3.06M|                sktag = V_ASN1_SET;
  ------------------
  |  |   75|  3.06M|# define V_ASN1_SET                      17
  ------------------
  606|   185k|            else
  607|   185k|                sktag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|   185k|# define V_ASN1_SEQUENCE                 16
  ------------------
  608|  3.25M|        }
  609|       |        /* Get the tag */
  610|  3.27M|        ret = asn1_check_tlen(&len, NULL, NULL, &sk_eoc, NULL,
  611|  3.27M|                              &p, len, sktag, skaclass, opt, ctx);
  612|  3.27M|        if (!ret) {
  ------------------
  |  Branch (612:13): [True: 1.42k, False: 3.27M]
  ------------------
  613|  1.42k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  1.42k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.42k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.42k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  1.42k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  1.42k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  1.42k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.42k|     ERR_set_error)
  |  |  ------------------
  ------------------
  614|  1.42k|            return 0;
  615|  3.27M|        } else if (ret == -1)
  ------------------
  |  Branch (615:20): [True: 25.3k, False: 3.25M]
  ------------------
  616|  25.3k|            return -1;
  617|  3.25M|        if (*val == NULL)
  ------------------
  |  Branch (617:13): [True: 3.24M, False: 5.39k]
  ------------------
  618|  3.24M|            *val = (ASN1_VALUE *)sk_ASN1_VALUE_new_null();
  ------------------
  |  |  901|  3.24M|#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  619|  5.39k|        else {
  620|       |            /*
  621|       |             * We've got a valid STACK: free up any items present
  622|       |             */
  623|  5.39k|            STACK_OF(ASN1_VALUE) *sktmp = (STACK_OF(ASN1_VALUE) *)*val;
  ------------------
  |  |   31|  5.39k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  624|  5.39k|            ASN1_VALUE *vtmp;
  625|  5.39k|            while (sk_ASN1_VALUE_num(sktmp) > 0) {
  ------------------
  |  |  898|  5.39k|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (625:20): [True: 0, False: 5.39k]
  ------------------
  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));
  ------------------
  |  |  421|      0|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  628|      0|            }
  629|  5.39k|        }
  630|       |
  631|  3.25M|        if (*val == NULL) {
  ------------------
  |  Branch (631:13): [True: 0, False: 3.25M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|  7.97M|        while (len > 0) {
  ------------------
  |  Branch (637:16): [True: 4.75M, False: 3.21M]
  ------------------
  638|  4.75M|            ASN1_VALUE *skfield;
  639|  4.75M|            q = p;
  640|       |            /* See if EOC found */
  641|  4.75M|            if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (641:17): [True: 30.1k, False: 4.72M]
  ------------------
  642|  30.1k|                if (!sk_eoc) {
  ------------------
  |  Branch (642:21): [True: 301, False: 29.8k]
  ------------------
  643|    301|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|    301|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    301|    (ERR_new(),                                                 \
  |  |  |  |  404|    301|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    301|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    301|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    301|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    301|     ERR_set_error)
  |  |  ------------------
  ------------------
  644|    301|                    goto err;
  645|    301|                }
  646|  29.8k|                len -= p - q;
  647|  29.8k|                sk_eoc = 0;
  648|  29.8k|                break;
  649|  30.1k|            }
  650|  4.72M|            skfield = NULL;
  651|  4.72M|            if (asn1_item_embed_d2i(&skfield, &p, len,
  ------------------
  |  Branch (651:17): [True: 10.4k, False: 4.71M]
  ------------------
  652|  4.72M|                                     ASN1_ITEM_ptr(tt->item), -1, 0, 0, ctx,
  ------------------
  |  |  421|  4.72M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  653|  4.72M|                                     depth, libctx, propq) <= 0) {
  654|  10.4k|                ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  10.4k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  10.4k|    (ERR_new(),                                                 \
  |  |  |  |  404|  10.4k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  10.4k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  10.4k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  10.4k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  10.4k|     ERR_set_error)
  |  |  ------------------
  ------------------
  655|       |                /* |skfield| may be partially allocated despite failure. */
  656|  10.4k|                ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  421|  10.4k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  657|  10.4k|                goto err;
  658|  10.4k|            }
  659|  4.71M|            len -= p - q;
  660|  4.71M|            if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val, skfield)) {
  ------------------
  |  |  908|  4.71M|#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.71M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  662|      0|                ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  421|      0|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  663|      0|                goto err;
  664|      0|            }
  665|  4.71M|        }
  666|  3.24M|        if (sk_eoc) {
  ------------------
  |  Branch (666:13): [True: 404, False: 3.24M]
  ------------------
  667|    404|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|    404|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    404|    (ERR_new(),                                                 \
  |  |  |  |  404|    404|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    404|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    404|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    404|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    404|     ERR_set_error)
  |  |  ------------------
  ------------------
  668|    404|            goto err;
  669|    404|        }
  670|  4.03M|    } else if (flags & ASN1_TFLG_IMPTAG) {
  ------------------
  |  |  547|  4.03M|# define ASN1_TFLG_IMPTAG        (0x1 << 3)
  ------------------
  |  Branch (670:16): [True: 311k, False: 3.72M]
  ------------------
  671|       |        /* IMPLICIT tagging */
  672|   311k|        ret = asn1_item_embed_d2i(val, &p, len,
  673|   311k|                                  ASN1_ITEM_ptr(tt->item), tt->tag, aclass, opt,
  ------------------
  |  |  421|   311k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  674|   311k|                                  ctx, depth, libctx, propq);
  675|   311k|        if (!ret) {
  ------------------
  |  Branch (675:13): [True: 11.1k, False: 300k]
  ------------------
  676|  11.1k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  11.1k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  11.1k|    (ERR_new(),                                                 \
  |  |  |  |  404|  11.1k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  11.1k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  11.1k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  11.1k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  11.1k|     ERR_set_error)
  |  |  ------------------
  ------------------
  677|  11.1k|            goto err;
  678|   300k|        } else if (ret == -1)
  ------------------
  |  Branch (678:20): [True: 168k, False: 131k]
  ------------------
  679|   168k|            return -1;
  680|  3.72M|    } else {
  681|       |        /* Nothing special */
  682|  3.72M|        ret = asn1_item_embed_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  421|  3.72M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  683|  3.72M|                                  -1, 0, opt, ctx, depth, libctx, propq);
  684|  3.72M|        if (!ret) {
  ------------------
  |  Branch (684:13): [True: 40.5k, False: 3.68M]
  ------------------
  685|  40.5k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  40.5k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  40.5k|    (ERR_new(),                                                 \
  |  |  |  |  404|  40.5k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  40.5k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  40.5k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  40.5k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  40.5k|     ERR_set_error)
  |  |  ------------------
  ------------------
  686|  40.5k|            goto err;
  687|  3.68M|        } else if (ret == -1)
  ------------------
  |  Branch (687:20): [True: 195k, False: 3.48M]
  ------------------
  688|   195k|            return -1;
  689|  3.72M|    }
  690|       |
  691|  6.85M|    *in = p;
  692|  6.85M|    return 1;
  693|       |
  694|  62.8k| err:
  695|  62.8k|    return 0;
  696|  7.31M|}
tasn_dec.c:asn1_d2i_ex_primitive:
  702|  3.67M|{
  703|  3.67M|    int ret = 0, utype;
  704|  3.67M|    long plen;
  705|  3.67M|    char cst, inf, free_cont = 0;
  706|  3.67M|    const unsigned char *p;
  707|  3.67M|    BUF_MEM buf = { 0, NULL, 0, 0 };
  708|  3.67M|    const unsigned char *cont = NULL;
  709|  3.67M|    long len;
  710|       |
  711|  3.67M|    if (pval == NULL) {
  ------------------
  |  Branch (711:9): [True: 0, False: 3.67M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  713|      0|        return 0;               /* Should never happen */
  714|      0|    }
  715|       |
  716|  3.67M|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  3.67M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (716:9): [True: 962k, False: 2.71M]
  ------------------
  717|   962k|        utype = tag;
  718|   962k|        tag = -1;
  719|   962k|    } else
  720|  2.71M|        utype = it->utype;
  721|       |
  722|  3.67M|    if (utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  3.67M|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (722:9): [True: 769k, False: 2.90M]
  ------------------
  723|       |        /* If type is ANY need to figure out type from tag */
  724|   769k|        unsigned char oclass;
  725|   769k|        if (tag >= 0) {
  ------------------
  |  Branch (725:13): [True: 0, False: 769k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  727|      0|            return 0;
  728|      0|        }
  729|   769k|        if (opt) {
  ------------------
  |  Branch (729:13): [True: 0, False: 769k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  731|      0|            return 0;
  732|      0|        }
  733|   769k|        p = *in;
  734|   769k|        ret = asn1_check_tlen(NULL, &utype, &oclass, NULL, NULL,
  735|   769k|                              &p, inlen, -1, 0, 0, ctx);
  736|   769k|        if (!ret) {
  ------------------
  |  Branch (736:13): [True: 111, False: 769k]
  ------------------
  737|    111|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|    111|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    111|    (ERR_new(),                                                 \
  |  |  |  |  404|    111|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    111|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    111|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    111|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    111|     ERR_set_error)
  |  |  ------------------
  ------------------
  738|    111|            return 0;
  739|    111|        }
  740|   769k|        if (oclass != V_ASN1_UNIVERSAL)
  ------------------
  |  |   47|   769k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (740:13): [True: 11.4k, False: 757k]
  ------------------
  741|  11.4k|            utype = V_ASN1_OTHER;
  ------------------
  |  |   57|  11.4k|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  742|   769k|    }
  743|  3.67M|    if (tag == -1) {
  ------------------
  |  Branch (743:9): [True: 3.39M, False: 278k]
  ------------------
  744|  3.39M|        tag = utype;
  745|  3.39M|        aclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  3.39M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  746|  3.39M|    }
  747|  3.67M|    p = *in;
  748|       |    /* Check header */
  749|  3.67M|    ret = asn1_check_tlen(&plen, NULL, NULL, &inf, &cst,
  750|  3.67M|                          &p, inlen, tag, aclass, opt, ctx);
  751|  3.67M|    if (!ret) {
  ------------------
  |  Branch (751:9): [True: 9.24k, False: 3.66M]
  ------------------
  752|  9.24k|        ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  9.24k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  9.24k|    (ERR_new(),                                                 \
  |  |  |  |  404|  9.24k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  9.24k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  9.24k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  9.24k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  9.24k|     ERR_set_error)
  |  |  ------------------
  ------------------
  753|  9.24k|        return 0;
  754|  3.66M|    } else if (ret == -1)
  ------------------
  |  Branch (754:16): [True: 198k, False: 3.46M]
  ------------------
  755|   198k|        return -1;
  756|  3.46M|    ret = 0;
  757|       |    /* SEQUENCE, SET and "OTHER" are left in encoded form */
  758|  3.46M|    if ((utype == V_ASN1_SEQUENCE)
  ------------------
  |  |   74|  3.46M|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (758:9): [True: 167k, False: 3.30M]
  ------------------
  759|  3.46M|        || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {
  ------------------
  |  |   75|  3.30M|# define V_ASN1_SET                      17
  ------------------
                      || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {
  ------------------
  |  |   57|  3.29M|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  |  Branch (759:12): [True: 3.24k, False: 3.29M]
  |  Branch (759:37): [True: 11.4k, False: 3.28M]
  ------------------
  760|       |        /*
  761|       |         * Clear context cache for type OTHER because the auto clear when we
  762|       |         * have a exact match won't work
  763|       |         */
  764|   182k|        if (utype == V_ASN1_OTHER) {
  ------------------
  |  |   57|   182k|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  |  Branch (764:13): [True: 11.4k, False: 171k]
  ------------------
  765|  11.4k|            asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  11.4k|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 11.4k, False: 0]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
  766|  11.4k|        }
  767|       |        /* SEQUENCE and SET must be constructed */
  768|   171k|        else if (!cst) {
  ------------------
  |  Branch (768:18): [True: 199, False: 170k]
  ------------------
  769|    199|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED);
  ------------------
  |  |  401|    199|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    199|    (ERR_new(),                                                 \
  |  |  |  |  404|    199|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    199|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    199|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    199|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    199|     ERR_set_error)
  |  |  ------------------
  ------------------
  770|    199|            return 0;
  771|    199|        }
  772|       |
  773|   182k|        cont = *in;
  774|       |        /* If indefinite length constructed find the real end */
  775|   182k|        if (inf) {
  ------------------
  |  Branch (775:13): [True: 43.1k, False: 139k]
  ------------------
  776|  43.1k|            if (!asn1_find_end(&p, plen, inf))
  ------------------
  |  Branch (776:17): [True: 1.25k, False: 41.8k]
  ------------------
  777|  1.25k|                goto err;
  778|  41.8k|            len = p - cont;
  779|   139k|        } else {
  780|   139k|            len = p - cont + plen;
  781|   139k|            p += plen;
  782|   139k|        }
  783|  3.28M|    } else if (cst) {
  ------------------
  |  Branch (783:16): [True: 1.08M, False: 2.20M]
  ------------------
  784|  1.08M|        if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN
  ------------------
  |  |   67|  2.16M|# define V_ASN1_NULL                     5
  ------------------
                      if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN
  ------------------
  |  |   63|  2.16M|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (784:13): [True: 194, False: 1.08M]
  |  Branch (784:37): [True: 227, False: 1.08M]
  ------------------
  785|  1.08M|            || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER
  ------------------
  |  |   68|  2.16M|# define V_ASN1_OBJECT                   6
  ------------------
                          || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER
  ------------------
  |  |   64|  2.16M|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (785:16): [True: 195, False: 1.08M]
  |  Branch (785:42): [True: 250, False: 1.08M]
  ------------------
  786|  1.08M|            || utype == V_ASN1_ENUMERATED) {
  ------------------
  |  |   72|  1.08M|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (786:16): [True: 66, False: 1.08M]
  ------------------
  787|    932|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE);
  ------------------
  |  |  401|    932|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    932|    (ERR_new(),                                                 \
  |  |  |  |  404|    932|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    932|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    932|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    932|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    932|     ERR_set_error)
  |  |  ------------------
  ------------------
  788|    932|            return 0;
  789|    932|        }
  790|       |
  791|       |        /* Free any returned 'buf' content */
  792|  1.08M|        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|  1.08M|        if (!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL, 0)) {
  ------------------
  |  |   47|  1.08M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (799:13): [True: 826, False: 1.08M]
  ------------------
  800|    826|            goto err;
  801|    826|        }
  802|  1.08M|        len = buf.length;
  803|       |        /* Append a final null to string */
  804|  1.08M|        if (!BUF_MEM_grow_clean(&buf, len + 1)) {
  ------------------
  |  Branch (804:13): [True: 0, False: 1.08M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  806|      0|            goto err;
  807|      0|        }
  808|  1.08M|        buf.data[len] = 0;
  809|  1.08M|        cont = (const unsigned char *)buf.data;
  810|  2.20M|    } else {
  811|  2.20M|        cont = p;
  812|  2.20M|        len = plen;
  813|  2.20M|        p += plen;
  814|  2.20M|    }
  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|  3.46M|    if (!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it))
  ------------------
  |  Branch (818:9): [True: 4.64k, False: 3.46M]
  ------------------
  819|  4.64k|        goto err;
  820|       |
  821|  3.46M|    *in = p;
  822|  3.46M|    ret = 1;
  823|  3.46M| err:
  824|  3.46M|    if (free_cont)
  ------------------
  |  Branch (824:9): [True: 18.3k, False: 3.44M]
  ------------------
  825|  18.3k|        OPENSSL_free(buf.data);
  ------------------
  |  |  107|  18.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  18.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  18.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  826|  3.46M|    return ret;
  827|  3.46M|}
tasn_dec.c:asn1_find_end:
  972|  43.1k|{
  973|  43.1k|    uint32_t expected_eoc;
  974|  43.1k|    long plen;
  975|  43.1k|    const unsigned char *p = *in, *q;
  976|       |    /* If not indefinite length constructed just add length */
  977|  43.1k|    if (inf == 0) {
  ------------------
  |  Branch (977:9): [True: 0, False: 43.1k]
  ------------------
  978|      0|        *in += len;
  979|      0|        return 1;
  980|      0|    }
  981|  43.1k|    expected_eoc = 1;
  982|       |    /*
  983|       |     * Indefinite length constructed form. Find the end when enough EOCs are
  984|       |     * found. If more indefinite length constructed headers are encountered
  985|       |     * increment the expected eoc count otherwise just skip to the end of the
  986|       |     * data.
  987|       |     */
  988|  1.10M|    while (len > 0) {
  ------------------
  |  Branch (988:12): [True: 1.10M, False: 553]
  ------------------
  989|  1.10M|        if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (989:13): [True: 181k, False: 926k]
  ------------------
  990|   181k|            expected_eoc--;
  991|   181k|            if (expected_eoc == 0)
  ------------------
  |  Branch (991:17): [True: 41.8k, False: 139k]
  ------------------
  992|  41.8k|                break;
  993|   139k|            len -= 2;
  994|   139k|            continue;
  995|   181k|        }
  996|   926k|        q = p;
  997|       |        /* Just read in a header: only care about the length */
  998|   926k|        if (!asn1_check_tlen(&plen, NULL, NULL, &inf, NULL, &p, len,
  ------------------
  |  Branch (998:13): [True: 705, False: 925k]
  ------------------
  999|   926k|                             -1, 0, 0, NULL)) {
 1000|    705|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|    705|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    705|    (ERR_new(),                                                 \
  |  |  |  |  404|    705|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    705|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    705|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    705|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    705|     ERR_set_error)
  |  |  ------------------
  ------------------
 1001|    705|            return 0;
 1002|    705|        }
 1003|   925k|        if (inf) {
  ------------------
  |  Branch (1003:13): [True: 140k, False: 785k]
  ------------------
 1004|   140k|            if (expected_eoc == UINT32_MAX) {
  ------------------
  |  Branch (1004:17): [True: 0, False: 140k]
  ------------------
 1005|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1006|      0|                return 0;
 1007|      0|            }
 1008|   140k|            expected_eoc++;
 1009|   785k|        } else {
 1010|   785k|            p += plen;
 1011|   785k|        }
 1012|   925k|        len -= p - q;
 1013|   925k|    }
 1014|  42.4k|    if (expected_eoc) {
  ------------------
  |  Branch (1014:9): [True: 553, False: 41.8k]
  ------------------
 1015|    553|        ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|    553|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    553|    (ERR_new(),                                                 \
  |  |  |  |  404|    553|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    553|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    553|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    553|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    553|     ERR_set_error)
  |  |  ------------------
  ------------------
 1016|    553|        return 0;
 1017|    553|    }
 1018|  41.8k|    *in = p;
 1019|  41.8k|    return 1;
 1020|  42.4k|}
tasn_dec.c:asn1_collect:
 1040|  1.38M|{
 1041|  1.38M|    const unsigned char *p, *q;
 1042|  1.38M|    long plen;
 1043|  1.38M|    char cst, ininf;
 1044|  1.38M|    p = *in;
 1045|  1.38M|    inf &= 1;
 1046|       |    /*
 1047|       |     * If no buffer and not indefinite length constructed just pass over the
 1048|       |     * encoded data
 1049|       |     */
 1050|  1.38M|    if (!buf && !inf) {
  ------------------
  |  Branch (1050:9): [True: 0, False: 1.38M]
  |  Branch (1050:17): [True: 0, False: 0]
  ------------------
 1051|      0|        *in += len;
 1052|      0|        return 1;
 1053|      0|    }
 1054|  1.91M|    while (len > 0) {
  ------------------
  |  Branch (1054:12): [True: 557k, False: 1.35M]
  ------------------
 1055|   557k|        q = p;
 1056|       |        /* Check for EOC */
 1057|   557k|        if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (1057:13): [True: 22.4k, False: 534k]
  ------------------
 1058|       |            /*
 1059|       |             * EOC is illegal outside indefinite length constructed form
 1060|       |             */
 1061|  22.4k|            if (!inf) {
  ------------------
  |  Branch (1061:17): [True: 200, False: 22.2k]
  ------------------
 1062|    200|                ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|    200|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    200|    (ERR_new(),                                                 \
  |  |  |  |  404|    200|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    200|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    200|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    200|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    200|     ERR_set_error)
  |  |  ------------------
  ------------------
 1063|    200|                return 0;
 1064|    200|            }
 1065|  22.2k|            inf = 0;
 1066|  22.2k|            break;
 1067|  22.4k|        }
 1068|       |
 1069|   534k|        if (!asn1_check_tlen(&plen, NULL, NULL, &ininf, &cst, &p,
  ------------------
  |  Branch (1069:13): [True: 172, False: 534k]
  ------------------
 1070|   534k|                             len, tag, aclass, 0, NULL)) {
 1071|    172|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|    172|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    172|    (ERR_new(),                                                 \
  |  |  |  |  404|    172|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    172|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    172|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    172|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    172|     ERR_set_error)
  |  |  ------------------
  ------------------
 1072|    172|            return 0;
 1073|    172|        }
 1074|       |
 1075|       |        /* If indefinite length constructed update max length */
 1076|   534k|        if (cst) {
  ------------------
  |  Branch (1076:13): [True: 298k, False: 235k]
  ------------------
 1077|   298k|            if (depth >= ASN1_MAX_STRING_NEST) {
  ------------------
  |  | 1035|   298k|# define ASN1_MAX_STRING_NEST 5
  ------------------
  |  Branch (1077:17): [True: 230, False: 298k]
  ------------------
 1078|    230|                ERR_raise(ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING);
  ------------------
  |  |  401|    230|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    230|    (ERR_new(),                                                 \
  |  |  |  |  404|    230|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    230|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    230|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    230|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    230|     ERR_set_error)
  |  |  ------------------
  ------------------
 1079|    230|                return 0;
 1080|    230|            }
 1081|   298k|            if (!asn1_collect(buf, &p, plen, ininf, tag, aclass, depth + 1))
  ------------------
  |  Branch (1081:17): [True: 1.48k, False: 297k]
  ------------------
 1082|  1.48k|                return 0;
 1083|   298k|        } else if (plen && !collect_data(buf, &p, plen))
  ------------------
  |  Branch (1083:20): [True: 219k, False: 16.5k]
  |  Branch (1083:28): [True: 0, False: 219k]
  ------------------
 1084|      0|            return 0;
 1085|   532k|        len -= p - q;
 1086|   532k|    }
 1087|  1.37M|    if (inf) {
  ------------------
  |  Branch (1087:9): [True: 224, False: 1.37M]
  ------------------
 1088|    224|        ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    224|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    224|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    224|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    224|     ERR_set_error)
  |  |  ------------------
  ------------------
 1089|    224|        return 0;
 1090|    224|    }
 1091|  1.37M|    *in = p;
 1092|  1.37M|    return 1;
 1093|  1.37M|}
tasn_dec.c:collect_data:
 1096|   219k|{
 1097|   219k|    int len;
 1098|   219k|    if (buf) {
  ------------------
  |  Branch (1098:9): [True: 219k, False: 0]
  ------------------
 1099|   219k|        len = buf->length;
 1100|   219k|        if (!BUF_MEM_grow_clean(buf, len + plen)) {
  ------------------
  |  Branch (1100:13): [True: 0, False: 219k]
  ------------------
 1101|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1102|      0|            return 0;
 1103|      0|        }
 1104|   219k|        memcpy(buf->data + len, *p, plen);
 1105|   219k|    }
 1106|   219k|    *p += plen;
 1107|   219k|    return 1;
 1108|   219k|}
tasn_dec.c:asn1_ex_c2i:
  833|  3.46M|{
  834|  3.46M|    ASN1_VALUE **opval = NULL;
  835|  3.46M|    ASN1_STRING *stmp;
  836|  3.46M|    ASN1_TYPE *typ = NULL;
  837|  3.46M|    int ret = 0;
  838|  3.46M|    const ASN1_PRIMITIVE_FUNCS *pf;
  839|  3.46M|    ASN1_INTEGER **tint;
  840|  3.46M|    pf = it->funcs;
  841|       |
  842|  3.46M|    if (pf && pf->prim_c2i)
  ------------------
  |  Branch (842:9): [True: 57.9k, False: 3.40M]
  |  Branch (842:15): [True: 57.9k, False: 0]
  ------------------
  843|  57.9k|        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.40M|    if (it->utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  3.40M|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (845:9): [True: 768k, False: 2.63M]
  ------------------
  846|   768k|        if (*pval == NULL) {
  ------------------
  |  Branch (846:13): [True: 768k, False: 326]
  ------------------
  847|   768k|            typ = ASN1_TYPE_new();
  848|   768k|            if (typ == NULL)
  ------------------
  |  Branch (848:17): [True: 0, False: 768k]
  ------------------
  849|      0|                goto err;
  850|   768k|            *pval = (ASN1_VALUE *)typ;
  851|   768k|        } else
  852|    326|            typ = (ASN1_TYPE *)*pval;
  853|       |
  854|   768k|        if (utype != typ->type)
  ------------------
  |  Branch (854:13): [True: 768k, False: 0]
  ------------------
  855|   768k|            ASN1_TYPE_set(typ, utype, NULL);
  856|   768k|        opval = pval;
  857|   768k|        pval = &typ->value.asn1_value;
  858|   768k|    }
  859|  3.40M|    switch (utype) {
  860|  1.29M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  1.29M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (860:5): [True: 1.29M, False: 2.11M]
  ------------------
  861|  1.29M|        if (!ossl_c2i_ASN1_OBJECT((ASN1_OBJECT **)pval, &cont, len))
  ------------------
  |  Branch (861:13): [True: 1.52k, False: 1.29M]
  ------------------
  862|  1.52k|            goto err;
  863|  1.29M|        break;
  864|       |
  865|  1.29M|    case V_ASN1_NULL:
  ------------------
  |  |   67|  7.00k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (865:5): [True: 7.00k, False: 3.40M]
  ------------------
  866|  7.00k|        if (len) {
  ------------------
  |  Branch (866:13): [True: 38, False: 6.96k]
  ------------------
  867|     38|            ERR_raise(ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     38|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     38|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     38|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     38|     ERR_set_error)
  |  |  ------------------
  ------------------
  868|     38|            goto err;
  869|     38|        }
  870|  6.96k|        *pval = (ASN1_VALUE *)1;
  871|  6.96k|        break;
  872|       |
  873|  8.02k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|  8.02k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (873:5): [True: 8.02k, False: 3.39M]
  ------------------
  874|  8.02k|        if (len != 1) {
  ------------------
  |  Branch (874:13): [True: 323, False: 7.69k]
  ------------------
  875|    323|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH);
  ------------------
  |  |  401|    323|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    323|    (ERR_new(),                                                 \
  |  |  |  |  404|    323|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    323|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    323|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    323|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    323|     ERR_set_error)
  |  |  ------------------
  ------------------
  876|    323|            goto err;
  877|  7.69k|        } else {
  878|  7.69k|            ASN1_BOOLEAN *tbool;
  879|  7.69k|            tbool = (ASN1_BOOLEAN *)pval;
  880|  7.69k|            *tbool = *cont;
  881|  7.69k|        }
  882|  7.69k|        break;
  883|       |
  884|   246k|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   65|   246k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (884:5): [True: 246k, False: 3.16M]
  ------------------
  885|   246k|        if (!ossl_c2i_ASN1_BIT_STRING((ASN1_BIT_STRING **)pval, &cont, len))
  ------------------
  |  Branch (885:13): [True: 467, False: 245k]
  ------------------
  886|    467|            goto err;
  887|   245k|        break;
  888|       |
  889|   245k|    case V_ASN1_INTEGER:
  ------------------
  |  |   64|  79.9k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (889:5): [True: 79.9k, False: 3.32M]
  ------------------
  890|  83.5k|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   72|  83.5k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (890:5): [True: 3.56k, False: 3.40M]
  ------------------
  891|  83.5k|        tint = (ASN1_INTEGER **)pval;
  892|  83.5k|        if (!ossl_c2i_ASN1_INTEGER(tint, &cont, len))
  ------------------
  |  Branch (892:13): [True: 1.32k, False: 82.1k]
  ------------------
  893|  1.32k|            goto err;
  894|       |        /* Fixup type to match the expected form */
  895|  82.1k|        (*tint)->type = utype | ((*tint)->type & V_ASN1_NEG);
  ------------------
  |  |   97|  82.1k|# define V_ASN1_NEG                      0x100
  ------------------
  896|  82.1k|        break;
  897|       |
  898|  36.7k|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   66|  36.7k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (898:5): [True: 36.7k, False: 3.37M]
  ------------------
  899|   511k|    case V_ASN1_NUMERICSTRING:
  ------------------
  |  |   76|   511k|# define V_ASN1_NUMERICSTRING            18 /**/
  ------------------
  |  Branch (899:5): [True: 474k, False: 2.93M]
  ------------------
  900|   541k|    case V_ASN1_PRINTABLESTRING:
  ------------------
  |  |   77|   541k|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  |  Branch (900:5): [True: 30.7k, False: 3.37M]
  ------------------
  901|   552k|    case V_ASN1_T61STRING:
  ------------------
  |  |   78|   552k|# define V_ASN1_T61STRING                20
  ------------------
  |  Branch (901:5): [True: 10.5k, False: 3.39M]
  ------------------
  902|   552k|    case V_ASN1_VIDEOTEXSTRING:
  ------------------
  |  |   80|   552k|# define V_ASN1_VIDEOTEXSTRING           21 /**/
  ------------------
  |  Branch (902:5): [True: 234, False: 3.40M]
  ------------------
  903|   777k|    case V_ASN1_IA5STRING:
  ------------------
  |  |   81|   777k|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (903:5): [True: 224k, False: 3.18M]
  ------------------
  904|   868k|    case V_ASN1_UTCTIME:
  ------------------
  |  |   82|   868k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (904:5): [True: 90.8k, False: 3.31M]
  ------------------
  905|   922k|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   83|   922k|# define V_ASN1_GENERALIZEDTIME          24 /**/
  ------------------
  |  Branch (905:5): [True: 53.6k, False: 3.35M]
  ------------------
  906|  1.05M|    case V_ASN1_GRAPHICSTRING:
  ------------------
  |  |   84|  1.05M|# define V_ASN1_GRAPHICSTRING            25 /**/
  ------------------
  |  Branch (906:5): [True: 131k, False: 3.27M]
  ------------------
  907|  1.05M|    case V_ASN1_VISIBLESTRING:
  ------------------
  |  |   86|  1.05M|# define V_ASN1_VISIBLESTRING            26/* alias */
  ------------------
  |  Branch (907:5): [True: 24, False: 3.40M]
  ------------------
  908|  1.05M|    case V_ASN1_GENERALSTRING:
  ------------------
  |  |   87|  1.05M|# define V_ASN1_GENERALSTRING            27 /**/
  ------------------
  |  Branch (908:5): [True: 87, False: 3.40M]
  ------------------
  909|  1.05M|    case V_ASN1_UNIVERSALSTRING:
  ------------------
  |  |   88|  1.05M|# define V_ASN1_UNIVERSALSTRING          28 /**/
  ------------------
  |  Branch (909:5): [True: 3.38k, False: 3.40M]
  ------------------
  910|  1.23M|    case V_ASN1_BMPSTRING:
  ------------------
  |  |   89|  1.23M|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (910:5): [True: 176k, False: 3.23M]
  ------------------
  911|  1.23M|    case V_ASN1_UTF8STRING:
  ------------------
  |  |   73|  1.23M|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (911:5): [True: 6.11k, False: 3.40M]
  ------------------
  912|  1.25M|    case V_ASN1_OTHER:
  ------------------
  |  |   57|  1.25M|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  |  Branch (912:5): [True: 11.4k, False: 3.39M]
  ------------------
  913|  1.25M|    case V_ASN1_SET:
  ------------------
  |  |   75|  1.25M|# define V_ASN1_SET                      17
  ------------------
  |  Branch (913:5): [True: 3.23k, False: 3.40M]
  ------------------
  914|  1.42M|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|  1.42M|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (914:5): [True: 166k, False: 3.24M]
  ------------------
  915|  1.76M|    default:
  ------------------
  |  Branch (915:5): [True: 349k, False: 3.05M]
  ------------------
  916|  1.76M|        if (utype == V_ASN1_BMPSTRING && (len & 1)) {
  ------------------
  |  |   89|  3.53M|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (916:13): [True: 176k, False: 1.59M]
  |  Branch (916:42): [True: 34, False: 176k]
  ------------------
  917|     34|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH);
  ------------------
  |  |  401|     34|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     34|    (ERR_new(),                                                 \
  |  |  |  |  404|     34|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     34|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     34|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     34|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     34|     ERR_set_error)
  |  |  ------------------
  ------------------
  918|     34|            goto err;
  919|     34|        }
  920|  1.76M|        if (utype == V_ASN1_UNIVERSALSTRING && (len & 3)) {
  ------------------
  |  |   88|  3.53M|# define V_ASN1_UNIVERSALSTRING          28 /**/
  ------------------
  |  Branch (920:13): [True: 3.38k, False: 1.76M]
  |  Branch (920:48): [True: 12, False: 3.36k]
  ------------------
  921|     12|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     12|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     12|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     12|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     12|     ERR_set_error)
  |  |  ------------------
  ------------------
  922|     12|            goto err;
  923|     12|        }
  924|       |        /* All based on ASN1_STRING and handled the same */
  925|  1.76M|        if (*pval == NULL) {
  ------------------
  |  Branch (925:13): [True: 774k, False: 994k]
  ------------------
  926|   774k|            stmp = ASN1_STRING_type_new(utype);
  927|   774k|            if (stmp == NULL) {
  ------------------
  |  Branch (927:17): [True: 0, False: 774k]
  ------------------
  928|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  929|      0|                goto err;
  930|      0|            }
  931|   774k|            *pval = (ASN1_VALUE *)stmp;
  932|   994k|        } else {
  933|   994k|            stmp = (ASN1_STRING *)*pval;
  934|   994k|            stmp->type = utype;
  935|   994k|        }
  936|       |        /* If we've already allocated a buffer use it */
  937|  1.76M|        if (*free_cont) {
  ------------------
  |  Branch (937:13): [True: 1.06M, False: 705k]
  ------------------
  938|  1.06M|            ASN1_STRING_set0(stmp, (unsigned char *)cont /* UGLY CAST! */, len);
  939|  1.06M|            *free_cont = 0;
  940|  1.06M|        } else {
  941|   705k|            if (!ASN1_STRING_set(stmp, cont, len)) {
  ------------------
  |  Branch (941:17): [True: 0, False: 705k]
  ------------------
  942|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  943|      0|                ASN1_STRING_free(stmp);
  944|      0|                *pval = NULL;
  945|      0|                goto err;
  946|      0|            }
  947|   705k|        }
  948|  1.76M|        break;
  949|  3.40M|    }
  950|       |    /* If ASN1_ANY and NULL type fix up value */
  951|  3.40M|    if (typ && (utype == V_ASN1_NULL))
  ------------------
  |  |   67|   768k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (951:9): [True: 768k, False: 2.63M]
  |  Branch (951:16): [True: 6.96k, False: 761k]
  ------------------
  952|  6.96k|        typ->value.ptr = NULL;
  953|       |
  954|  3.40M|    ret = 1;
  955|  3.40M| err:
  956|  3.40M|    if (!ret) {
  ------------------
  |  Branch (956:9): [True: 3.71k, False: 3.40M]
  ------------------
  957|  3.71k|        ASN1_TYPE_free(typ);
  958|  3.71k|        if (opval)
  ------------------
  |  Branch (958:13): [True: 419, False: 3.29k]
  ------------------
  959|    419|            *opval = NULL;
  960|  3.71k|    }
  961|  3.40M|    return ret;
  962|  3.40M|}
tasn_dec.c:asn1_check_tlen:
 1137|  12.0M|{
 1138|  12.0M|    int i;
 1139|  12.0M|    int ptag, pclass;
 1140|  12.0M|    long plen;
 1141|  12.0M|    const unsigned char *p, *q;
 1142|  12.0M|    p = *in;
 1143|  12.0M|    q = p;
 1144|       |
 1145|  12.0M|    if (len <= 0) {
  ------------------
  |  Branch (1145:9): [True: 7, False: 12.0M]
  ------------------
 1146|      7|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      7|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      7|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      7|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      7|     ERR_set_error)
  |  |  ------------------
  ------------------
 1147|      7|        goto err;
 1148|      7|    }
 1149|  12.0M|    if (ctx != NULL && ctx->valid) {
  ------------------
  |  Branch (1149:9): [True: 10.6M, False: 1.46M]
  |  Branch (1149:24): [True: 2.18M, False: 8.42M]
  ------------------
 1150|  2.18M|        i = ctx->ret;
 1151|  2.18M|        plen = ctx->plen;
 1152|  2.18M|        pclass = ctx->pclass;
 1153|  2.18M|        ptag = ctx->ptag;
 1154|  2.18M|        p += ctx->hdrlen;
 1155|  9.88M|    } else {
 1156|  9.88M|        i = ASN1_get_object(&p, &plen, &ptag, &pclass, len);
 1157|  9.88M|        if (ctx != NULL) {
  ------------------
  |  Branch (1157:13): [True: 8.42M, False: 1.46M]
  ------------------
 1158|  8.42M|            ctx->ret = i;
 1159|  8.42M|            ctx->plen = plen;
 1160|  8.42M|            ctx->pclass = pclass;
 1161|  8.42M|            ctx->ptag = ptag;
 1162|  8.42M|            ctx->hdrlen = p - q;
 1163|  8.42M|            ctx->valid = 1;
 1164|       |            /*
 1165|       |             * If definite length, and no error, length + header can't exceed
 1166|       |             * total amount of data available.
 1167|       |             */
 1168|  8.42M|            if ((i & 0x81) == 0 && (plen + ctx->hdrlen) > len) {
  ------------------
  |  Branch (1168:17): [True: 7.57M, False: 844k]
  |  Branch (1168:36): [True: 0, False: 7.57M]
  ------------------
 1169|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1170|      0|                goto err;
 1171|      0|            }
 1172|  8.42M|        }
 1173|  9.88M|    }
 1174|       |
 1175|  12.0M|    if ((i & 0x80) != 0) {
  ------------------
  |  Branch (1175:9): [True: 10.3k, False: 12.0M]
  ------------------
 1176|  10.3k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER);
  ------------------
  |  |  401|  10.3k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  10.3k|    (ERR_new(),                                                 \
  |  |  |  |  404|  10.3k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  10.3k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  10.3k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  10.3k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  10.3k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1177|  10.3k|        goto err;
 1178|  10.3k|    }
 1179|  12.0M|    if (exptag >= 0) {
  ------------------
  |  Branch (1179:9): [True: 8.83M, False: 3.22M]
  ------------------
 1180|  8.83M|        if (exptag != ptag || expclass != pclass) {
  ------------------
  |  Branch (1180:13): [True: 443k, False: 8.39M]
  |  Branch (1180:31): [True: 369, False: 8.39M]
  ------------------
 1181|       |            /*
 1182|       |             * If type is OPTIONAL, not an error: indicate missing type.
 1183|       |             */
 1184|   443k|            if (opt != 0)
  ------------------
  |  Branch (1184:17): [True: 438k, False: 5.20k]
  ------------------
 1185|   438k|                return -1;
 1186|   443k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_TAG);
  ------------------
  |  |  401|  5.20k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  5.20k|    (ERR_new(),                                                 \
  |  |  |  |  404|  5.20k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  5.20k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  5.20k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  5.20k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  5.20k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1187|  5.20k|            goto err;
 1188|   443k|        }
 1189|       |        /*
 1190|       |         * We have a tag and class match: assume we are going to do something
 1191|       |         * with it
 1192|       |         */
 1193|  8.39M|        asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  8.39M|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 8.39M, False: 0]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1194|  8.39M|    }
 1195|       |
 1196|  11.6M|    if ((i & 1) != 0)
  ------------------
  |  Branch (1196:9): [True: 1.04M, False: 10.5M]
  ------------------
 1197|  1.04M|        plen = len - (p - q);
 1198|       |
 1199|  11.6M|    if (inf != NULL)
  ------------------
  |  Branch (1199:9): [True: 9.86M, False: 1.75M]
  ------------------
 1200|  9.86M|        *inf = i & 1;
 1201|       |
 1202|  11.6M|    if (cst != NULL)
  ------------------
  |  Branch (1202:9): [True: 5.68M, False: 5.92M]
  ------------------
 1203|  5.68M|        *cst = i & V_ASN1_CONSTRUCTED;
  ------------------
  |  |   52|  5.68M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
 1204|       |
 1205|  11.6M|    if (olen != NULL)
  ------------------
  |  Branch (1205:9): [True: 9.86M, False: 1.75M]
  ------------------
 1206|  9.86M|        *olen = plen;
 1207|       |
 1208|  11.6M|    if (oclass != NULL)
  ------------------
  |  Branch (1208:9): [True: 1.75M, False: 9.86M]
  ------------------
 1209|  1.75M|        *oclass = pclass;
 1210|       |
 1211|  11.6M|    if (otag != NULL)
  ------------------
  |  Branch (1211:9): [True: 1.75M, False: 9.86M]
  ------------------
 1212|  1.75M|        *otag = ptag;
 1213|       |
 1214|  11.6M|    *in = p;
 1215|  11.6M|    return 1;
 1216|       |
 1217|  15.5k| err:
 1218|  15.5k|    asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  15.5k|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 14.6k, False: 877]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1219|  15.5k|    return 0;
 1220|  12.0M|}
tasn_dec.c:asn1_check_eoc:
 1113|  10.7M|{
 1114|  10.7M|    const unsigned char *p;
 1115|       |
 1116|  10.7M|    if (len < 2)
  ------------------
  |  Branch (1116:9): [True: 5.19k, False: 10.7M]
  ------------------
 1117|  5.19k|        return 0;
 1118|  10.7M|    p = *in;
 1119|  10.7M|    if (p[0] == '\0' && p[1] == '\0') {
  ------------------
  |  Branch (1119:9): [True: 987k, False: 9.76M]
  |  Branch (1119:25): [True: 921k, False: 66.1k]
  ------------------
 1120|   921k|        *in += 2;
 1121|   921k|        return 1;
 1122|   921k|    }
 1123|  9.83M|    return 0;
 1124|  10.7M|}

ASN1_item_i2d:
   44|  30.2k|{
   45|  30.2k|    return asn1_item_flags_i2d(val, out, it, 0);
   46|  30.2k|}
ASN1_item_ex_i2d:
   83|  25.9M|{
   84|  25.9M|    const ASN1_TEMPLATE *tt = NULL;
   85|  25.9M|    int i, seqcontlen, seqlen, ndef = 1;
   86|  25.9M|    const ASN1_EXTERN_FUNCS *ef;
   87|  25.9M|    const ASN1_AUX *aux = it->funcs;
   88|  25.9M|    ASN1_aux_const_cb *asn1_cb = NULL;
   89|       |
   90|  25.9M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
  ------------------
  |  |   80|  25.9M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (90:9): [True: 13.1M, False: 12.8M]
  |  Branch (90:48): [True: 7.23k, False: 13.1M]
  ------------------
   91|  7.23k|        return 0;
   92|       |
   93|  25.9M|    if (aux != NULL) {
  ------------------
  |  Branch (93:9): [True: 189k, False: 25.7M]
  ------------------
   94|   189k|        asn1_cb = ((aux->flags & ASN1_AFLG_CONST_CB) != 0) ? aux->asn1_const_cb
  ------------------
  |  |  738|   189k|# define ASN1_AFLG_CONST_CB      8
  ------------------
  |  Branch (94:19): [True: 0, False: 189k]
  ------------------
   95|   189k|            : (ASN1_aux_const_cb *)aux->asn1_cb; /* backward compatibility */
   96|   189k|    }
   97|       |
   98|  25.9M|    switch (it->itype) {
   99|       |
  100|  12.8M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  12.8M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (100:5): [True: 12.8M, False: 13.1M]
  ------------------
  101|  12.8M|        if (it->templates)
  ------------------
  |  Branch (101:13): [True: 34.9k, False: 12.8M]
  ------------------
  102|  34.9k|            return asn1_template_ex_i2d(pval, out, it->templates,
  103|  34.9k|                                        tag, aclass);
  104|  12.8M|        return asn1_i2d_ex_primitive(pval, out, it, tag, aclass);
  105|       |
  106|  6.85M|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|  6.85M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (106:5): [True: 6.85M, False: 19.0M]
  ------------------
  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|  6.85M|        if (tag != -1) {
  ------------------
  |  Branch (111:13): [True: 0, False: 6.85M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  113|      0|            return -1;
  114|      0|        }
  115|  6.85M|        return asn1_i2d_ex_primitive(pval, out, it, -1, aclass);
  116|       |
  117|   743k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   743k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (117:5): [True: 743k, False: 25.2M]
  ------------------
  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|   743k|        if (tag != -1) {
  ------------------
  |  Branch (122:13): [True: 0, False: 743k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  124|      0|            return -1;
  125|      0|        }
  126|   743k|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
  ------------------
  |  |  748|  26.0k|# define ASN1_OP_I2D_PRE         6
  ------------------
  |  Branch (126:13): [True: 26.0k, False: 717k]
  |  Branch (126:24): [True: 0, False: 26.0k]
  ------------------
  127|      0|            return 0;
  128|   743k|        i = ossl_asn1_get_choice_selector_const(pval, it);
  129|   743k|        if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (129:13): [True: 743k, False: 0]
  |  Branch (129:25): [True: 743k, False: 0]
  ------------------
  130|   743k|            const ASN1_VALUE **pchval;
  131|   743k|            const ASN1_TEMPLATE *chtt;
  132|   743k|            chtt = it->templates + i;
  133|   743k|            pchval = ossl_asn1_get_const_field_ptr(pval, chtt);
  134|   743k|            return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass);
  135|   743k|        }
  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|  13.0k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|  13.0k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (141:5): [True: 13.0k, False: 25.9M]
  ------------------
  142|       |        /* If new style i2d it does all the work */
  143|  13.0k|        ef = it->funcs;
  144|  13.0k|        return ef->asn1_ex_i2d(pval, out, it, tag, aclass);
  145|       |
  146|  8.00k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  8.00k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (146:5): [True: 8.00k, False: 25.9M]
  ------------------
  147|       |        /* Use indefinite length constructed if requested */
  148|  8.00k|        if (aclass & ASN1_TFLG_NDEF)
  ------------------
  |  |  594|  8.00k|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (148:13): [True: 0, False: 8.00k]
  ------------------
  149|      0|            ndef = 2;
  150|       |        /* fall through */
  151|       |
  152|  5.49M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  5.49M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (152:5): [True: 5.48M, False: 20.4M]
  ------------------
  153|  5.49M|        i = ossl_asn1_enc_restore(&seqcontlen, out, pval, it);
  154|       |        /* An error occurred */
  155|  5.49M|        if (i < 0)
  ------------------
  |  Branch (155:13): [True: 0, False: 5.49M]
  ------------------
  156|      0|            return 0;
  157|       |        /* We have a valid cached encoding... */
  158|  5.49M|        if (i > 0)
  ------------------
  |  Branch (158:13): [True: 62.0k, False: 5.43M]
  ------------------
  159|  62.0k|            return seqcontlen;
  160|       |        /* Otherwise carry on */
  161|  5.43M|        seqcontlen = 0;
  162|       |        /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */
  163|  5.43M|        if (tag == -1) {
  ------------------
  |  Branch (163:13): [True: 5.40M, False: 27.0k]
  ------------------
  164|  5.40M|            tag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  5.40M|# define V_ASN1_SEQUENCE                 16
  ------------------
  165|       |            /* Retain any other flags in aclass */
  166|  5.40M|            aclass = (aclass & ~ASN1_TFLG_TAG_CLASS)
  ------------------
  |  |  575|  5.40M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  167|  5.40M|                | V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  5.40M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  168|  5.40M|        }
  169|  5.43M|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
  ------------------
  |  |  748|  60.9k|# define ASN1_OP_I2D_PRE         6
  ------------------
  |  Branch (169:13): [True: 60.9k, False: 5.37M]
  |  Branch (169:24): [True: 0, False: 60.9k]
  ------------------
  170|      0|            return 0;
  171|       |        /* First work out sequence content length */
  172|  16.4M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (172:41): [True: 10.9M, False: 5.43M]
  ------------------
  173|  10.9M|            const ASN1_TEMPLATE *seqtt;
  174|  10.9M|            const ASN1_VALUE **pseqval;
  175|  10.9M|            int tmplen;
  176|  10.9M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  177|  10.9M|            if (!seqtt)
  ------------------
  |  Branch (177:17): [True: 0, False: 10.9M]
  ------------------
  178|      0|                return 0;
  179|  10.9M|            pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
  180|  10.9M|            tmplen = asn1_template_ex_i2d(pseqval, NULL, seqtt, -1, aclass);
  181|  10.9M|            if (tmplen == -1 || (tmplen > INT_MAX - seqcontlen))
  ------------------
  |  Branch (181:17): [True: 0, False: 10.9M]
  |  Branch (181:33): [True: 0, False: 10.9M]
  ------------------
  182|      0|                return -1;
  183|  10.9M|            seqcontlen += tmplen;
  184|  10.9M|        }
  185|       |
  186|  5.43M|        seqlen = ASN1_object_size(ndef, seqcontlen, tag);
  187|  5.43M|        if (!out || seqlen == -1)
  ------------------
  |  Branch (187:13): [True: 3.76M, False: 1.66M]
  |  Branch (187:21): [True: 0, False: 1.66M]
  ------------------
  188|  3.76M|            return seqlen;
  189|       |        /* Output SEQUENCE header */
  190|  1.66M|        ASN1_put_object(out, ndef, seqcontlen, tag, aclass);
  191|  5.04M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (191:41): [True: 3.37M, False: 1.66M]
  ------------------
  192|  3.37M|            const ASN1_TEMPLATE *seqtt;
  193|  3.37M|            const ASN1_VALUE **pseqval;
  194|  3.37M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  195|  3.37M|            if (!seqtt)
  ------------------
  |  Branch (195:17): [True: 0, False: 3.37M]
  ------------------
  196|      0|                return 0;
  197|  3.37M|            pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
  198|       |            /* FIXME: check for errors in enhanced version */
  199|  3.37M|            asn1_template_ex_i2d(pseqval, out, seqtt, -1, aclass);
  200|  3.37M|        }
  201|  1.66M|        if (ndef == 2)
  ------------------
  |  Branch (201:13): [True: 0, False: 1.66M]
  ------------------
  202|      0|            ASN1_put_eoc(out);
  203|  1.66M|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL))
  ------------------
  |  |  749|  24.2k|# define ASN1_OP_I2D_POST        7
  ------------------
  |  Branch (203:13): [True: 24.2k, False: 1.64M]
  |  Branch (203:24): [True: 0, False: 24.2k]
  ------------------
  204|      0|            return 0;
  205|  1.66M|        return seqlen;
  206|       |
  207|      0|    default:
  ------------------
  |  Branch (207:5): [True: 0, False: 25.9M]
  ------------------
  208|      0|        return 0;
  209|       |
  210|  25.9M|    }
  211|      0|    return 0;
  212|  25.9M|}
tasn_enc.c:asn1_item_flags_i2d:
   57|  30.2k|{
   58|  30.2k|    if (out != NULL && *out == NULL) {
  ------------------
  |  Branch (58:9): [True: 27.6k, False: 2.58k]
  |  Branch (58:24): [True: 27.6k, False: 0]
  ------------------
   59|  27.6k|        unsigned char *p, *buf;
   60|  27.6k|        int len;
   61|       |
   62|  27.6k|        len = ASN1_item_ex_i2d(&val, NULL, it, -1, flags);
   63|  27.6k|        if (len <= 0)
  ------------------
  |  Branch (63:13): [True: 0, False: 27.6k]
  ------------------
   64|      0|            return len;
   65|  27.6k|        if ((buf = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |   97|  27.6k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  27.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  27.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (65:13): [True: 0, False: 27.6k]
  ------------------
   66|      0|            return -1;
   67|  27.6k|        p = buf;
   68|  27.6k|        ASN1_item_ex_i2d(&val, &p, it, -1, flags);
   69|  27.6k|        *out = buf;
   70|  27.6k|        return len;
   71|  27.6k|    }
   72|       |
   73|  2.58k|    return ASN1_item_ex_i2d(&val, out, it, -1, flags);
   74|  30.2k|}
tasn_enc.c:asn1_template_ex_i2d:
  216|  15.1M|{
  217|  15.1M|    const int flags = tt->flags;
  218|  15.1M|    int i, ret, ttag, tclass, ndef, len;
  219|  15.1M|    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|  15.1M|    if (flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  597|  15.1M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  |  Branch (225:9): [True: 213k, False: 14.9M]
  ------------------
  226|   213k|        tval = (ASN1_VALUE *)pval;
  227|   213k|        pval = &tval;
  228|   213k|    }
  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|  15.1M|    if (flags & ASN1_TFLG_TAG_MASK) {
  ------------------
  |  |  552|  15.1M|# define ASN1_TFLG_TAG_MASK      (0x3 << 3)
  ------------------
  |  Branch (236:9): [True: 790k, False: 14.3M]
  ------------------
  237|       |        /* Error if argument and template tagging */
  238|   790k|        if (tag != -1)
  ------------------
  |  Branch (238:13): [True: 0, False: 790k]
  ------------------
  239|       |            /* FIXME: error code here */
  240|      0|            return -1;
  241|       |        /* Get tagging from template */
  242|   790k|        ttag = tt->tag;
  243|   790k|        tclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|   790k|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  244|  14.3M|    } else if (tag != -1) {
  ------------------
  |  Branch (244:16): [True: 0, False: 14.3M]
  ------------------
  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|  14.3M|    } else {
  249|  14.3M|        ttag = -1;
  250|  14.3M|        tclass = 0;
  251|  14.3M|    }
  252|       |    /*
  253|       |     * Remove any class mask from iflag.
  254|       |     */
  255|  15.1M|    iclass &= ~ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  15.1M|# 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|  15.1M|    if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF))
  ------------------
  |  |  594|  15.1M|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
                  if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF))
  ------------------
  |  |  594|  3.54k|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (263:9): [True: 3.54k, False: 15.1M]
  |  Branch (263:37): [True: 0, False: 3.54k]
  ------------------
  264|      0|        ndef = 2;
  265|  15.1M|    else
  266|  15.1M|        ndef = 1;
  267|       |
  268|  15.1M|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  15.1M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (268:9): [True: 77.1k, False: 15.0M]
  ------------------
  269|       |        /* SET OF, SEQUENCE OF */
  270|  77.1k|        STACK_OF(const_ASN1_VALUE) *sk = (STACK_OF(const_ASN1_VALUE) *)*pval;
  ------------------
  |  |   31|  77.1k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  271|  77.1k|        int isset, sktag, skaclass;
  272|  77.1k|        int skcontlen, sklen;
  273|  77.1k|        const ASN1_VALUE *skitem;
  274|       |
  275|  77.1k|        if (*pval == NULL)
  ------------------
  |  Branch (275:13): [True: 16.2k, False: 60.8k]
  ------------------
  276|  16.2k|            return 0;
  277|       |
  278|  60.8k|        if (flags & ASN1_TFLG_SET_OF) {
  ------------------
  |  |  526|  60.8k|# define ASN1_TFLG_SET_OF        (0x1 << 1)
  ------------------
  |  Branch (278:13): [True: 46.9k, False: 13.9k]
  ------------------
  279|  46.9k|            isset = 1;
  280|       |            /* 2 means we reorder */
  281|  46.9k|            if (flags & ASN1_TFLG_SEQUENCE_OF)
  ------------------
  |  |  529|  46.9k|# define ASN1_TFLG_SEQUENCE_OF   (0x2 << 1)
  ------------------
  |  Branch (281:17): [True: 0, False: 46.9k]
  ------------------
  282|      0|                isset = 2;
  283|  46.9k|        } else
  284|  13.9k|            isset = 0;
  285|       |
  286|       |        /*
  287|       |         * Work out inner tag value: if EXPLICIT or no tagging use underlying
  288|       |         * type.
  289|       |         */
  290|  60.8k|        if ((ttag != -1) && !(flags & ASN1_TFLG_EXPTAG)) {
  ------------------
  |  |  550|  4.92k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (290:13): [True: 4.92k, False: 55.9k]
  |  Branch (290:29): [True: 4.92k, False: 0]
  ------------------
  291|  4.92k|            sktag = ttag;
  292|  4.92k|            skaclass = tclass;
  293|  55.9k|        } else {
  294|  55.9k|            skaclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  55.9k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  295|  55.9k|            if (isset)
  ------------------
  |  Branch (295:17): [True: 42.0k, False: 13.9k]
  ------------------
  296|  42.0k|                sktag = V_ASN1_SET;
  ------------------
  |  |   75|  42.0k|# define V_ASN1_SET                      17
  ------------------
  297|  13.9k|            else
  298|  13.9k|                sktag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  13.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  299|  55.9k|        }
  300|       |
  301|       |        /* Determine total length of items */
  302|  60.8k|        skcontlen = 0;
  303|  8.52M|        for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  Branch (303:21): [True: 8.46M, False: 60.8k]
  ------------------
  304|  8.46M|            skitem = sk_const_ASN1_VALUE_value(sk, i);
  305|  8.46M|            len = ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  421|  8.46M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  306|  8.46M|                                   -1, iclass);
  307|  8.46M|            if (len == -1 || (skcontlen > INT_MAX - len))
  ------------------
  |  Branch (307:17): [True: 0, False: 8.46M]
  |  Branch (307:30): [True: 0, False: 8.46M]
  ------------------
  308|      0|                return -1;
  309|  8.46M|            if (len == 0 && (tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|      0|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (309:17): [True: 0, False: 8.46M]
  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  311|      0|                return -1;
  312|      0|            }
  313|  8.46M|            skcontlen += len;
  314|  8.46M|        }
  315|  60.8k|        sklen = ASN1_object_size(ndef, skcontlen, sktag);
  316|  60.8k|        if (sklen == -1)
  ------------------
  |  Branch (316:13): [True: 0, False: 60.8k]
  ------------------
  317|      0|            return -1;
  318|       |        /* If EXPLICIT need length of surrounding tag */
  319|  60.8k|        if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  550|  60.8k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (319:13): [True: 0, False: 60.8k]
  ------------------
  320|      0|            ret = ASN1_object_size(ndef, sklen, ttag);
  321|  60.8k|        else
  322|  60.8k|            ret = sklen;
  323|       |
  324|  60.8k|        if (!out || ret == -1)
  ------------------
  |  Branch (324:13): [True: 42.0k, False: 18.7k]
  |  Branch (324:21): [True: 0, False: 18.7k]
  ------------------
  325|  42.0k|            return ret;
  326|       |
  327|       |        /* Now encode this lot... */
  328|       |        /* EXPLICIT tag */
  329|  18.7k|        if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  550|  18.7k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (329:13): [True: 0, False: 18.7k]
  ------------------
  330|      0|            ASN1_put_object(out, ndef, sklen, ttag, tclass);
  331|       |        /* SET or SEQUENCE and IMPLICIT tag */
  332|  18.7k|        ASN1_put_object(out, ndef, skcontlen, sktag, skaclass);
  333|       |        /* And the stuff itself */
  334|  18.7k|        asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  421|  18.7k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  335|  18.7k|                         isset, iclass);
  336|  18.7k|        if (ndef == 2) {
  ------------------
  |  Branch (336:13): [True: 0, False: 18.7k]
  ------------------
  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|  18.7k|        return ret;
  343|  60.8k|    }
  344|       |
  345|  15.0M|    if (flags & ASN1_TFLG_EXPTAG) {
  ------------------
  |  |  550|  15.0M|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (345:9): [True: 24.9k, False: 15.0M]
  ------------------
  346|       |        /* EXPLICIT tagging */
  347|       |        /* Find length of tagged item */
  348|  24.9k|        i = ASN1_item_ex_i2d(pval, NULL, ASN1_ITEM_ptr(tt->item), -1, iclass);
  ------------------
  |  |  421|  24.9k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  349|  24.9k|        if (i == 0) {
  ------------------
  |  Branch (349:13): [True: 11.8k, False: 13.1k]
  ------------------
  350|  11.8k|            if ((tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|  11.8k|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (350:17): [True: 0, False: 11.8k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  352|      0|                return -1;
  353|      0|            }
  354|  11.8k|            return 0;
  355|  11.8k|        }
  356|       |        /* Find length of EXPLICIT tag */
  357|  13.1k|        ret = ASN1_object_size(ndef, i, ttag);
  358|  13.1k|        if (out && ret != -1) {
  ------------------
  |  Branch (358:13): [True: 2.42k, False: 10.7k]
  |  Branch (358:20): [True: 2.42k, False: 0]
  ------------------
  359|       |            /* Output tag and item */
  360|  2.42k|            ASN1_put_object(out, ndef, i, ttag, tclass);
  361|  2.42k|            ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, iclass);
  ------------------
  |  |  421|  2.42k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  362|  2.42k|            if (ndef == 2)
  ------------------
  |  Branch (362:17): [True: 0, False: 2.42k]
  ------------------
  363|      0|                ASN1_put_eoc(out);
  364|  2.42k|        }
  365|  13.1k|        return ret;
  366|  24.9k|    }
  367|       |
  368|       |    /* Either normal or IMPLICIT tagging: combine class and flags */
  369|  15.0M|    len = ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  421|  15.0M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  370|  15.0M|                              ttag, tclass | iclass);
  371|  15.0M|    if (len == 0 && (tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|  96.5k|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (371:9): [True: 96.5k, False: 14.9M]
  |  Branch (371:21): [True: 0, False: 96.5k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  373|      0|        return -1;
  374|      0|    }
  375|  15.0M|    return len;
  376|  15.0M|}
tasn_enc.c:asn1_set_seq_out:
  403|  18.7k|{
  404|  18.7k|    int i, ret = 0;
  405|  18.7k|    const ASN1_VALUE *skitem;
  406|  18.7k|    unsigned char *tmpdat = NULL, *p = NULL;
  407|  18.7k|    DER_ENC *derlst = NULL, *tder;
  408|       |
  409|  18.7k|    if (do_sort) {
  ------------------
  |  Branch (409:9): [True: 15.5k, False: 3.27k]
  ------------------
  410|       |        /* Don't need to sort less than 2 items */
  411|  15.5k|        if (sk_const_ASN1_VALUE_num(sk) < 2)
  ------------------
  |  Branch (411:13): [True: 13.2k, False: 2.29k]
  ------------------
  412|  13.2k|            do_sort = 0;
  413|  2.29k|        else {
  414|  2.29k|            derlst = OPENSSL_malloc(sk_const_ASN1_VALUE_num(sk)
  ------------------
  |  |   97|  2.29k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  2.29k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  2.29k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  415|  2.29k|                                    * sizeof(*derlst));
  416|  2.29k|            if (derlst == NULL)
  ------------------
  |  Branch (416:17): [True: 0, False: 2.29k]
  ------------------
  417|      0|                return 0;
  418|  2.29k|            tmpdat = OPENSSL_malloc(skcontlen);
  ------------------
  |  |   97|  2.29k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  2.29k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  2.29k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  419|  2.29k|            if (tmpdat == NULL)
  ------------------
  |  Branch (419:17): [True: 0, False: 2.29k]
  ------------------
  420|      0|                goto err;
  421|  2.29k|        }
  422|  15.5k|    }
  423|       |    /* If not sorting just output each item */
  424|  18.7k|    if (!do_sort) {
  ------------------
  |  Branch (424:9): [True: 16.5k, False: 2.29k]
  ------------------
  425|  34.4k|        for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  Branch (425:21): [True: 17.9k, False: 16.5k]
  ------------------
  426|  17.9k|            skitem = sk_const_ASN1_VALUE_value(sk, i);
  427|  17.9k|            ASN1_item_ex_i2d(&skitem, out, item, -1, iclass);
  428|  17.9k|        }
  429|  16.5k|        return 1;
  430|  16.5k|    }
  431|  2.29k|    p = tmpdat;
  432|       |
  433|       |    /* Doing sort: build up a list of each member's DER encoding */
  434|  2.32M|    for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++) {
  ------------------
  |  Branch (434:32): [True: 2.31M, False: 2.29k]
  ------------------
  435|  2.31M|        skitem = sk_const_ASN1_VALUE_value(sk, i);
  436|  2.31M|        tder->data = p;
  437|  2.31M|        tder->length = ASN1_item_ex_i2d(&skitem, &p, item, -1, iclass);
  438|  2.31M|        tder->field = skitem;
  439|  2.31M|    }
  440|       |
  441|       |    /* Now sort them */
  442|  2.29k|    qsort(derlst, sk_const_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp);
  443|       |    /* Output sorted DER encoding */
  444|  2.29k|    p = *out;
  445|  2.32M|    for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++) {
  ------------------
  |  Branch (445:32): [True: 2.31M, False: 2.29k]
  ------------------
  446|  2.31M|        memcpy(p, tder->data, tder->length);
  447|  2.31M|        p += tder->length;
  448|  2.31M|    }
  449|  2.29k|    *out = p;
  450|       |    /* If do_sort is 2 then reorder the STACK */
  451|  2.29k|    if (do_sort == 2) {
  ------------------
  |  Branch (451:9): [True: 0, False: 2.29k]
  ------------------
  452|      0|        for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++)
  ------------------
  |  Branch (452:36): [True: 0, False: 0]
  ------------------
  453|      0|            (void)sk_const_ASN1_VALUE_set(sk, i, tder->field);
  454|      0|    }
  455|  2.29k|    ret = 1;
  456|  2.29k|err:
  457|  2.29k|    OPENSSL_free(derlst);
  ------------------
  |  |  107|  2.29k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  2.29k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  2.29k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  458|  2.29k|    OPENSSL_free(tmpdat);
  ------------------
  |  |  107|  2.29k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  2.29k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  2.29k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  459|  2.29k|    return ret;
  460|  2.29k|}
tasn_enc.c:der_cmp:
  387|  29.3M|{
  388|  29.3M|    const DER_ENC *d1 = a, *d2 = b;
  389|  29.3M|    int cmplen, i;
  390|  29.3M|    cmplen = (d1->length < d2->length) ? d1->length : d2->length;
  ------------------
  |  Branch (390:14): [True: 48.6k, False: 29.3M]
  ------------------
  391|  29.3M|    i = memcmp(d1->data, d2->data, cmplen);
  392|  29.3M|    if (i)
  ------------------
  |  Branch (392:9): [True: 13.6M, False: 15.7M]
  ------------------
  393|  13.6M|        return i;
  394|  15.7M|    return d1->length - d2->length;
  395|  29.3M|}
tasn_enc.c:asn1_i2d_ex_primitive:
  464|  19.6M|{
  465|  19.6M|    int len;
  466|  19.6M|    int utype;
  467|  19.6M|    int usetag;
  468|  19.6M|    int ndef = 0;
  469|       |
  470|  19.6M|    utype = it->utype;
  471|       |
  472|       |    /*
  473|       |     * Get length of content octets and maybe find out the underlying type.
  474|       |     */
  475|       |
  476|  19.6M|    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|  19.6M|    if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) ||
  ------------------
  |  |   74|  19.6M|# define V_ASN1_SEQUENCE                 16
  ------------------
                  if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) ||
  ------------------
  |  |   75|  18.9M|# define V_ASN1_SET                      17
  ------------------
  |  Branch (483:9): [True: 715k, False: 18.9M]
  |  Branch (483:39): [True: 16.4k, False: 18.9M]
  ------------------
  484|  19.6M|        (utype == V_ASN1_OTHER))
  ------------------
  |  |   57|  18.9M|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  |  Branch (484:9): [True: 65.6k, False: 18.8M]
  ------------------
  485|   797k|        usetag = 0;
  486|  18.8M|    else
  487|  18.8M|        usetag = 1;
  488|       |
  489|       |    /* -1 means omit type */
  490|       |
  491|  19.6M|    if (len == -1)
  ------------------
  |  Branch (491:9): [True: 101k, False: 19.5M]
  ------------------
  492|   101k|        return 0;
  493|       |
  494|       |    /* -2 return is special meaning use ndef */
  495|  19.5M|    if (len == -2) {
  ------------------
  |  Branch (495:9): [True: 0, False: 19.5M]
  ------------------
  496|      0|        ndef = 2;
  497|      0|        len = 0;
  498|      0|    }
  499|       |
  500|       |    /* If not implicitly tagged get tag from underlying type */
  501|  19.5M|    if (tag == -1)
  ------------------
  |  Branch (501:9): [True: 18.8M, False: 710k]
  ------------------
  502|  18.8M|        tag = utype;
  503|       |
  504|       |    /* Output tag+length followed by content octets */
  505|  19.5M|    if (out) {
  ------------------
  |  Branch (505:9): [True: 4.01M, False: 15.5M]
  ------------------
  506|  4.01M|        if (usetag)
  ------------------
  |  Branch (506:13): [True: 3.88M, False: 130k]
  ------------------
  507|  3.88M|            ASN1_put_object(out, ndef, len, tag, aclass);
  508|  4.01M|        asn1_ex_i2c(pval, *out, &utype, it);
  509|  4.01M|        if (ndef)
  ------------------
  |  Branch (509:13): [True: 0, False: 4.01M]
  ------------------
  510|      0|            ASN1_put_eoc(out);
  511|  4.01M|        else
  512|  4.01M|            *out += len;
  513|  4.01M|    }
  514|       |
  515|  19.5M|    if (usetag)
  ------------------
  |  Branch (515:9): [True: 18.7M, False: 797k]
  ------------------
  516|  18.7M|        return ASN1_object_size(ndef, len, tag);
  517|   797k|    return len;
  518|  19.5M|}
tasn_enc.c:asn1_ex_i2c:
  524|  23.6M|{
  525|  23.6M|    ASN1_BOOLEAN *tbool = NULL;
  526|  23.6M|    ASN1_STRING *strtmp;
  527|  23.6M|    ASN1_OBJECT *otmp;
  528|  23.6M|    int utype;
  529|  23.6M|    const unsigned char *cont;
  530|  23.6M|    unsigned char c;
  531|  23.6M|    int len;
  532|  23.6M|    const ASN1_PRIMITIVE_FUNCS *pf;
  533|  23.6M|    pf = it->funcs;
  534|  23.6M|    if (pf && pf->prim_i2c)
  ------------------
  |  Branch (534:9): [True: 31.7k, False: 23.6M]
  |  Branch (534:15): [True: 31.7k, False: 0]
  ------------------
  535|  31.7k|        return pf->prim_i2c(pval, cout, putype, it);
  536|       |
  537|       |    /* Should type be omitted? */
  538|  23.6M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE)
  ------------------
  |  |   80|  23.6M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (538:9): [True: 8.46M, False: 15.1M]
  ------------------
  539|  23.6M|        || (it->utype != V_ASN1_BOOLEAN)) {
  ------------------
  |  |   63|  15.1M|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (539:12): [True: 15.1M, False: 0]
  ------------------
  540|  23.6M|        if (*pval == NULL)
  ------------------
  |  Branch (540:13): [True: 101k, False: 23.5M]
  ------------------
  541|   101k|            return -1;
  542|  23.6M|    }
  543|       |
  544|  23.5M|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  23.5M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (544:9): [True: 8.46M, False: 15.0M]
  ------------------
  545|       |        /* If MSTRING type set the underlying type */
  546|  8.46M|        strtmp = (ASN1_STRING *)*pval;
  547|  8.46M|        utype = strtmp->type;
  548|  8.46M|        *putype = utype;
  549|  15.0M|    } else if (it->utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  15.0M|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (549:16): [True: 5.48M, False: 9.58M]
  ------------------
  550|       |        /* If ANY set type and pointer to value */
  551|  5.48M|        ASN1_TYPE *typ;
  552|  5.48M|        typ = (ASN1_TYPE *)*pval;
  553|  5.48M|        utype = typ->type;
  554|  5.48M|        *putype = utype;
  555|  5.48M|        pval = (const ASN1_VALUE **)&typ->value.asn1_value; /* actually is const */
  556|  5.48M|    } else
  557|  9.58M|        utype = *putype;
  558|       |
  559|  23.5M|    switch (utype) {
  560|  8.66M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  8.66M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (560:5): [True: 8.66M, False: 14.8M]
  ------------------
  561|  8.66M|        otmp = (ASN1_OBJECT *)*pval;
  562|  8.66M|        cont = otmp->data;
  563|  8.66M|        len = otmp->length;
  564|  8.66M|        if (cont == NULL || len == 0)
  ------------------
  |  Branch (564:13): [True: 0, False: 8.66M]
  |  Branch (564:29): [True: 0, False: 8.66M]
  ------------------
  565|      0|            return -1;
  566|  8.66M|        break;
  567|       |
  568|  8.66M|    case V_ASN1_NULL:
  ------------------
  |  |   67|  74.0k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (568:5): [True: 74.0k, False: 23.4M]
  ------------------
  569|  74.0k|        cont = NULL;
  570|  74.0k|        len = 0;
  571|  74.0k|        break;
  572|       |
  573|  26.6k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|  26.6k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (573:5): [True: 26.6k, False: 23.5M]
  ------------------
  574|  26.6k|        tbool = (ASN1_BOOLEAN *)pval;
  575|  26.6k|        if (*tbool == -1)
  ------------------
  |  Branch (575:13): [True: 0, False: 26.6k]
  ------------------
  576|      0|            return -1;
  577|  26.6k|        if (it->utype != V_ASN1_ANY) {
  ------------------
  |  |   58|  26.6k|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (577:13): [True: 0, False: 26.6k]
  ------------------
  578|       |            /*
  579|       |             * Default handling if value == size field then omit
  580|       |             */
  581|      0|            if (*tbool && (it->size > 0))
  ------------------
  |  Branch (581:17): [True: 0, False: 0]
  |  Branch (581:27): [True: 0, False: 0]
  ------------------
  582|      0|                return -1;
  583|      0|            if (!*tbool && !it->size)
  ------------------
  |  Branch (583:17): [True: 0, False: 0]
  |  Branch (583:28): [True: 0, False: 0]
  ------------------
  584|      0|                return -1;
  585|      0|        }
  586|  26.6k|        c = (unsigned char)*tbool;
  587|  26.6k|        cont = &c;
  588|  26.6k|        len = 1;
  589|  26.6k|        break;
  590|       |
  591|  99.0k|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   65|  99.0k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (591:5): [True: 99.0k, False: 23.4M]
  ------------------
  592|  99.0k|        return ossl_i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval,
  593|  99.0k|                                        cout ? &cout : NULL);
  ------------------
  |  Branch (593:41): [True: 22.2k, False: 76.8k]
  ------------------
  594|       |
  595|  40.6k|    case V_ASN1_INTEGER:
  ------------------
  |  |   64|  40.6k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (595:5): [True: 40.6k, False: 23.4M]
  ------------------
  596|  51.5k|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   72|  51.5k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (596:5): [True: 10.8k, False: 23.5M]
  ------------------
  597|       |        /*
  598|       |         * These are all have the same content format as ASN1_INTEGER
  599|       |         */
  600|  51.5k|        return ossl_i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : NULL);
  ------------------
  |  Branch (600:61): [True: 5.97k, False: 45.5k]
  ------------------
  601|       |
  602|  43.7k|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   66|  43.7k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (602:5): [True: 43.7k, False: 23.4M]
  ------------------
  603|  4.36M|    case V_ASN1_NUMERICSTRING:
  ------------------
  |  |   76|  4.36M|# define V_ASN1_NUMERICSTRING            18 /**/
  ------------------
  |  Branch (603:5): [True: 4.32M, False: 19.2M]
  ------------------
  604|  4.45M|    case V_ASN1_PRINTABLESTRING:
  ------------------
  |  |   77|  4.45M|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  |  Branch (604:5): [True: 90.2k, False: 23.4M]
  ------------------
  605|  4.52M|    case V_ASN1_T61STRING:
  ------------------
  |  |   78|  4.52M|# define V_ASN1_T61STRING                20
  ------------------
  |  Branch (605:5): [True: 64.0k, False: 23.4M]
  ------------------
  606|  4.52M|    case V_ASN1_VIDEOTEXSTRING:
  ------------------
  |  |   80|  4.52M|# define V_ASN1_VIDEOTEXSTRING           21 /**/
  ------------------
  |  Branch (606:5): [True: 850, False: 23.5M]
  ------------------
  607|  5.19M|    case V_ASN1_IA5STRING:
  ------------------
  |  |   81|  5.19M|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (607:5): [True: 665k, False: 22.8M]
  ------------------
  608|  5.19M|    case V_ASN1_UTCTIME:
  ------------------
  |  |   82|  5.19M|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (608:5): [True: 405, False: 23.5M]
  ------------------
  609|  5.19M|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   83|  5.19M|# define V_ASN1_GENERALIZEDTIME          24 /**/
  ------------------
  |  Branch (609:5): [True: 7.89k, False: 23.5M]
  ------------------
  610|  6.37M|    case V_ASN1_GRAPHICSTRING:
  ------------------
  |  |   84|  6.37M|# define V_ASN1_GRAPHICSTRING            25 /**/
  ------------------
  |  Branch (610:5): [True: 1.17M, False: 22.3M]
  ------------------
  611|  6.37M|    case V_ASN1_VISIBLESTRING:
  ------------------
  |  |   86|  6.37M|# define V_ASN1_VISIBLESTRING            26/* alias */
  ------------------
  |  Branch (611:5): [True: 174, False: 23.5M]
  ------------------
  612|  6.37M|    case V_ASN1_GENERALSTRING:
  ------------------
  |  |   87|  6.37M|# define V_ASN1_GENERALSTRING            27 /**/
  ------------------
  |  Branch (612:5): [True: 700, False: 23.5M]
  ------------------
  613|  6.39M|    case V_ASN1_UNIVERSALSTRING:
  ------------------
  |  |   88|  6.39M|# define V_ASN1_UNIVERSALSTRING          28 /**/
  ------------------
  |  Branch (613:5): [True: 14.8k, False: 23.5M]
  ------------------
  614|  6.91M|    case V_ASN1_BMPSTRING:
  ------------------
  |  |   89|  6.91M|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (614:5): [True: 522k, False: 23.0M]
  ------------------
  615|  10.1M|    case V_ASN1_UTF8STRING:
  ------------------
  |  |   73|  10.1M|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (615:5): [True: 3.23M, False: 20.3M]
  ------------------
  616|  10.9M|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|  10.9M|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (616:5): [True: 835k, False: 22.7M]
  ------------------
  617|  11.0M|    case V_ASN1_SET:
  ------------------
  |  |   75|  11.0M|# define V_ASN1_SET                      17
  ------------------
  |  Branch (617:5): [True: 18.4k, False: 23.5M]
  ------------------
  618|  14.6M|    default:
  ------------------
  |  Branch (618:5): [True: 3.62M, False: 19.9M]
  ------------------
  619|       |        /* All based on ASN1_STRING and handled the same */
  620|  14.6M|        strtmp = (ASN1_STRING *)*pval;
  621|       |        /* Special handling for NDEF */
  622|  14.6M|        if ((it->size == ASN1_TFLG_NDEF)
  ------------------
  |  |  594|  14.6M|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (622:13): [True: 78, False: 14.6M]
  ------------------
  623|  14.6M|            && (strtmp->flags & ASN1_STRING_FLAG_NDEF)) {
  ------------------
  |  |  167|     78|# define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (623:16): [True: 0, False: 78]
  ------------------
  624|      0|            if (cout) {
  ------------------
  |  Branch (624:17): [True: 0, False: 0]
  ------------------
  625|      0|                strtmp->data = cout;
  626|      0|                strtmp->length = 0;
  627|      0|            }
  628|       |            /* Special return code */
  629|      0|            return -2;
  630|      0|        }
  631|  14.6M|        cont = strtmp->data;
  632|  14.6M|        len = strtmp->length;
  633|       |
  634|  14.6M|        break;
  635|       |
  636|  23.5M|    }
  637|  23.3M|    if (cout && len)
  ------------------
  |  Branch (637:9): [True: 3.98M, False: 19.4M]
  |  Branch (637:17): [True: 1.79M, False: 2.18M]
  ------------------
  638|  1.79M|        memcpy(cout, cont, len);
  639|  23.3M|    return len;
  640|  23.5M|}

ASN1_item_free:
   19|  3.18M|{
   20|  3.18M|    ossl_asn1_item_embed_free(&val, it, 0);
   21|  3.18M|}
ASN1_item_ex_free:
   24|  34.3k|{
   25|  34.3k|    ossl_asn1_item_embed_free(pval, it, 0);
   26|  34.3k|}
ossl_asn1_item_embed_free:
   29|  10.9M|{
   30|  10.9M|    const ASN1_TEMPLATE *tt = NULL, *seqtt;
   31|  10.9M|    const ASN1_EXTERN_FUNCS *ef;
   32|  10.9M|    const ASN1_AUX *aux = it->funcs;
   33|  10.9M|    ASN1_aux_cb *asn1_cb;
   34|  10.9M|    int i;
   35|       |
   36|  10.9M|    if (pval == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 10.9M]
  ------------------
   37|      0|        return;
   38|  10.9M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
  ------------------
  |  |   80|  10.9M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (38:9): [True: 6.17M, False: 4.78M]
  |  Branch (38:48): [True: 752k, False: 5.42M]
  ------------------
   39|   752k|        return;
   40|  10.2M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (40:9): [True: 477k, False: 9.72M]
  |  Branch (40:16): [True: 160k, False: 316k]
  ------------------
   41|   160k|        asn1_cb = aux->asn1_cb;
   42|  10.0M|    else
   43|  10.0M|        asn1_cb = 0;
   44|       |
   45|  10.2M|    switch (it->itype) {
  ------------------
  |  Branch (45:13): [True: 0, False: 10.2M]
  ------------------
   46|       |
   47|  4.78M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  4.78M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (47:5): [True: 4.78M, False: 5.42M]
  ------------------
   48|  4.78M|        if (it->templates)
  ------------------
  |  Branch (48:13): [True: 239k, False: 4.54M]
  ------------------
   49|   239k|            ossl_asn1_template_free(pval, it->templates);
   50|  4.54M|        else
   51|  4.54M|            ossl_asn1_primitive_free(pval, it, embed);
   52|  4.78M|        break;
   53|       |
   54|  2.17M|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|  2.17M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (54:5): [True: 2.17M, False: 8.03M]
  ------------------
   55|  2.17M|        ossl_asn1_primitive_free(pval, it, embed);
   56|  2.17M|        break;
   57|       |
   58|   230k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   230k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (58:5): [True: 230k, False: 9.97M]
  ------------------
   59|   230k|        if (asn1_cb) {
  ------------------
  |  Branch (59:13): [True: 15.2k, False: 215k]
  ------------------
   60|  15.2k|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  744|  15.2k|# define ASN1_OP_FREE_PRE        2
  ------------------
   61|  15.2k|            if (i == 2)
  ------------------
  |  Branch (61:17): [True: 0, False: 15.2k]
  ------------------
   62|      0|                return;
   63|  15.2k|        }
   64|   230k|        i = ossl_asn1_get_choice_selector(pval, it);
   65|   230k|        if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (65:13): [True: 212k, False: 18.4k]
  |  Branch (65:25): [True: 212k, False: 0]
  ------------------
   66|   212k|            ASN1_VALUE **pchval;
   67|       |
   68|   212k|            tt = it->templates + i;
   69|   212k|            pchval = ossl_asn1_get_field_ptr(pval, tt);
   70|   212k|            ossl_asn1_template_free(pchval, tt);
   71|   212k|        }
   72|   230k|        if (asn1_cb)
  ------------------
  |  Branch (72:13): [True: 15.2k, False: 215k]
  ------------------
   73|  15.2k|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  745|  15.2k|# define ASN1_OP_FREE_POST       3
  ------------------
   74|   230k|        if (embed == 0) {
  ------------------
  |  Branch (74:13): [True: 230k, False: 0]
  ------------------
   75|   230k|            OPENSSL_free(*pval);
  ------------------
  |  |  107|   230k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   230k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   230k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|   230k|            *pval = NULL;
   77|   230k|        }
   78|   230k|        break;
   79|       |
   80|   257k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   257k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (80:5): [True: 257k, False: 9.94M]
  ------------------
   81|   257k|        ef = it->funcs;
   82|   257k|        if (ef && ef->asn1_ex_free)
  ------------------
  |  Branch (82:13): [True: 257k, False: 0]
  |  Branch (82:19): [True: 257k, False: 0]
  ------------------
   83|   257k|            ef->asn1_ex_free(pval, it);
   84|   257k|        break;
   85|       |
   86|  22.6k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  22.6k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (86:5): [True: 22.6k, False: 10.1M]
  ------------------
   87|  2.76M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  2.76M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (87:5): [True: 2.74M, False: 7.46M]
  ------------------
   88|  2.76M|        if (ossl_asn1_do_lock(pval, -1, it) != 0) /* if error or ref-counter > 0 */
  ------------------
  |  Branch (88:13): [True: 0, False: 2.76M]
  ------------------
   89|      0|            return;
   90|  2.76M|        if (asn1_cb) {
  ------------------
  |  Branch (90:13): [True: 117k, False: 2.64M]
  ------------------
   91|   117k|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  744|   117k|# define ASN1_OP_FREE_PRE        2
  ------------------
   92|   117k|            if (i == 2)
  ------------------
  |  Branch (92:17): [True: 2.63k, False: 114k]
  ------------------
   93|  2.63k|                return;
   94|   117k|        }
   95|  2.76M|        ossl_asn1_enc_free(pval, it);
   96|       |        /*
   97|       |         * If we free up as normal we will invalidate any ANY DEFINED BY
   98|       |         * field and we won't be able to determine the type of the field it
   99|       |         * defines. So free up in reverse order.
  100|       |         */
  101|  2.76M|        tt = it->templates + it->tcount;
  102|  9.11M|        for (i = 0; i < it->tcount; i++) {
  ------------------
  |  Branch (102:21): [True: 6.35M, False: 2.76M]
  ------------------
  103|  6.35M|            ASN1_VALUE **pseqval;
  104|       |
  105|  6.35M|            tt--;
  106|  6.35M|            seqtt = ossl_asn1_do_adb(*pval, tt, 0);
  107|  6.35M|            if (!seqtt)
  ------------------
  |  Branch (107:17): [True: 3.18k, False: 6.35M]
  ------------------
  108|  3.18k|                continue;
  109|  6.35M|            pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  110|  6.35M|            ossl_asn1_template_free(pseqval, seqtt);
  111|  6.35M|        }
  112|  2.76M|        if (asn1_cb)
  ------------------
  |  Branch (112:13): [True: 114k, False: 2.64M]
  ------------------
  113|   114k|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  745|   114k|# define ASN1_OP_FREE_POST       3
  ------------------
  114|  2.76M|        if (embed == 0) {
  ------------------
  |  Branch (114:13): [True: 2.46M, False: 299k]
  ------------------
  115|  2.46M|            OPENSSL_free(*pval);
  ------------------
  |  |  107|  2.46M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  2.46M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  2.46M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  116|  2.46M|            *pval = NULL;
  117|  2.46M|        }
  118|  2.76M|        break;
  119|  10.2M|    }
  120|  10.2M|}
ossl_asn1_template_free:
  123|  7.36M|{
  124|  7.36M|    int embed = tt->flags & ASN1_TFLG_EMBED;
  ------------------
  |  |  597|  7.36M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  125|  7.36M|    ASN1_VALUE *tval;
  126|  7.36M|    if (embed) {
  ------------------
  |  Branch (126:9): [True: 490k, False: 6.87M]
  ------------------
  127|   490k|        tval = (ASN1_VALUE *)pval;
  128|   490k|        pval = &tval;
  129|   490k|    }
  130|  7.36M|    if (tt->flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  7.36M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (130:9): [True: 477k, False: 6.89M]
  ------------------
  131|   477k|        STACK_OF(ASN1_VALUE) *sk = (STACK_OF(ASN1_VALUE) *)*pval;
  ------------------
  |  |   31|   477k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  132|   477k|        int i;
  133|       |
  134|  1.32M|        for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  |  898|  1.32M|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (134:21): [True: 849k, False: 477k]
  ------------------
  135|   849k|            ASN1_VALUE *vtmp = sk_ASN1_VALUE_value(sk, i);
  ------------------
  |  |  899|   849k|#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
  ------------------
  136|       |
  137|   849k|            ossl_asn1_item_embed_free(&vtmp, ASN1_ITEM_ptr(tt->item), embed);
  ------------------
  |  |  421|   849k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  138|   849k|        }
  139|   477k|        sk_ASN1_VALUE_free(sk);
  ------------------
  |  |  904|   477k|#define sk_ASN1_VALUE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_VALUE_sk_type(sk))
  ------------------
  140|   477k|        *pval = NULL;
  141|  6.89M|    } else {
  142|  6.89M|        ossl_asn1_item_embed_free(pval, ASN1_ITEM_ptr(tt->item), embed);
  ------------------
  |  |  421|  6.89M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  143|  6.89M|    }
  144|  7.36M|}
ossl_asn1_primitive_free:
  147|  7.48M|{
  148|  7.48M|    int utype;
  149|       |
  150|       |    /* Special case: if 'it' is a primitive with a free_func, use that. */
  151|  7.48M|    if (it) {
  ------------------
  |  Branch (151:9): [True: 6.71M, False: 768k]
  ------------------
  152|  6.71M|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  153|       |
  154|  6.71M|        if (embed) {
  ------------------
  |  Branch (154:13): [True: 191k, False: 6.52M]
  ------------------
  155|   191k|            if (pf && pf->prim_clear) {
  ------------------
  |  Branch (155:17): [True: 22.3k, False: 169k]
  |  Branch (155:23): [True: 22.3k, False: 0]
  ------------------
  156|  22.3k|                pf->prim_clear(pval, it);
  157|  22.3k|                return;
  158|  22.3k|            }
  159|  6.52M|        } else if (pf && pf->prim_free) {
  ------------------
  |  Branch (159:20): [True: 6.26k, False: 6.51M]
  |  Branch (159:26): [True: 6.26k, False: 0]
  ------------------
  160|  6.26k|            pf->prim_free(pval, it);
  161|  6.26k|            return;
  162|  6.26k|        }
  163|  6.71M|    }
  164|       |
  165|       |    /* Special case: if 'it' is NULL, free contents of ASN1_TYPE */
  166|  7.45M|    if (!it) {
  ------------------
  |  Branch (166:9): [True: 768k, False: 6.68M]
  ------------------
  167|   768k|        ASN1_TYPE *typ = (ASN1_TYPE *)*pval;
  168|       |
  169|   768k|        utype = typ->type;
  170|   768k|        pval = &typ->value.asn1_value;
  171|   768k|        if (*pval == NULL)
  ------------------
  |  Branch (171:13): [True: 7.46k, False: 761k]
  ------------------
  172|  7.46k|            return;
  173|  6.68M|    } else if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  6.68M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (173:16): [True: 2.17M, False: 4.51M]
  ------------------
  174|  2.17M|        utype = -1;
  175|  2.17M|        if (*pval == NULL)
  ------------------
  |  Branch (175:13): [True: 0, False: 2.17M]
  ------------------
  176|      0|            return;
  177|  4.51M|    } else {
  178|  4.51M|        utype = it->utype;
  179|  4.51M|        if ((utype != V_ASN1_BOOLEAN) && *pval == NULL)
  ------------------
  |  |   63|  4.51M|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (179:13): [True: 4.40M, False: 114k]
  |  Branch (179:42): [True: 822k, False: 3.57M]
  ------------------
  180|   822k|            return;
  181|  4.51M|    }
  182|       |
  183|  6.62M|    switch (utype) {
  184|  2.52M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  2.52M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (184:5): [True: 2.52M, False: 4.10M]
  ------------------
  185|  2.52M|        ASN1_OBJECT_free((ASN1_OBJECT *)*pval);
  186|  2.52M|        break;
  187|       |
  188|   117k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|   117k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (188:5): [True: 117k, False: 6.50M]
  ------------------
  189|   117k|        if (it)
  ------------------
  |  Branch (189:13): [True: 114k, False: 3.09k]
  ------------------
  190|   114k|            *(ASN1_BOOLEAN *)pval = it->size;
  191|  3.09k|        else
  192|  3.09k|            *(ASN1_BOOLEAN *)pval = -1;
  193|   117k|        return;
  194|       |
  195|      2|    case V_ASN1_NULL:
  ------------------
  |  |   67|      2|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (195:5): [True: 2, False: 6.62M]
  ------------------
  196|      2|        break;
  197|       |
  198|   768k|    case V_ASN1_ANY:
  ------------------
  |  |   58|   768k|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (198:5): [True: 768k, False: 5.85M]
  ------------------
  199|   768k|        ossl_asn1_primitive_free(pval, NULL, 0);
  200|   768k|        OPENSSL_free(*pval);
  ------------------
  |  |  107|   768k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   768k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   768k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  201|   768k|        break;
  202|       |
  203|  3.21M|    default:
  ------------------
  |  Branch (203:5): [True: 3.21M, False: 3.40M]
  ------------------
  204|  3.21M|        ossl_asn1_string_embed_free((ASN1_STRING *)*pval, embed);
  205|  3.21M|        break;
  206|  6.62M|    }
  207|  6.50M|    *pval = NULL;
  208|  6.50M|}

ASN1_item_new:
   30|  2.09M|{
   31|  2.09M|    ASN1_VALUE *ret = NULL;
   32|  2.09M|    if (ASN1_item_ex_new(&ret, it) > 0)
  ------------------
  |  Branch (32:9): [True: 2.09M, False: 0]
  ------------------
   33|  2.09M|        return ret;
   34|      0|    return NULL;
   35|  2.09M|}
ossl_asn1_item_ex_new_intern:
   51|  1.28M|{
   52|  1.28M|    return asn1_item_embed_new(pval, it, 0, libctx, propq);
   53|  1.28M|}
ASN1_item_ex_new:
   56|  2.09M|{
   57|  2.09M|    return asn1_item_embed_new(pval, it, 0, NULL, NULL);
   58|  2.09M|}
tasn_new.c:asn1_item_embed_new:
   62|  8.76M|{
   63|  8.76M|    const ASN1_TEMPLATE *tt = NULL;
   64|  8.76M|    const ASN1_EXTERN_FUNCS *ef;
   65|  8.76M|    const ASN1_AUX *aux = it->funcs;
   66|  8.76M|    ASN1_aux_cb *asn1_cb;
   67|  8.76M|    ASN1_VALUE **pseqval;
   68|  8.76M|    int i;
   69|  8.76M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (69:9): [True: 435k, False: 8.32M]
  |  Branch (69:16): [True: 175k, False: 259k]
  ------------------
   70|   175k|        asn1_cb = aux->asn1_cb;
   71|  8.58M|    else
   72|  8.58M|        asn1_cb = 0;
   73|       |
   74|  8.76M|    switch (it->itype) {
  ------------------
  |  Branch (74:13): [True: 0, False: 8.76M]
  ------------------
   75|       |
   76|   200k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   200k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (76:5): [True: 200k, False: 8.56M]
  ------------------
   77|   200k|        ef = it->funcs;
   78|   200k|        if (ef != NULL) {
  ------------------
  |  Branch (78:13): [True: 200k, False: 0]
  ------------------
   79|   200k|            if (ef->asn1_ex_new_ex != NULL) {
  ------------------
  |  Branch (79:17): [True: 59.1k, False: 141k]
  ------------------
   80|  59.1k|                if (!ef->asn1_ex_new_ex(pval, it, libctx, propq))
  ------------------
  |  Branch (80:21): [True: 0, False: 59.1k]
  ------------------
   81|      0|                    goto asn1err;
   82|   141k|            } else if (ef->asn1_ex_new != NULL) {
  ------------------
  |  Branch (82:24): [True: 141k, False: 0]
  ------------------
   83|   141k|                if (!ef->asn1_ex_new(pval, it))
  ------------------
  |  Branch (83:21): [True: 0, False: 141k]
  ------------------
   84|      0|                    goto asn1err;
   85|   141k|            }
   86|   200k|        }
   87|   200k|        break;
   88|       |
   89|  3.43M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  3.43M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (89:5): [True: 3.43M, False: 5.32M]
  ------------------
   90|  3.43M|        if (it->templates) {
  ------------------
  |  Branch (90:13): [True: 0, False: 3.43M]
  ------------------
   91|      0|            if (!asn1_template_new(pval, it->templates, libctx, propq))
  ------------------
  |  Branch (91:17): [True: 0, False: 0]
  ------------------
   92|      0|                goto asn1err;
   93|  3.43M|        } else if (!asn1_primitive_new(pval, it, embed))
  ------------------
  |  Branch (93:20): [True: 0, False: 3.43M]
  ------------------
   94|      0|            goto asn1err;
   95|  3.43M|        break;
   96|       |
   97|  3.43M|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|  2.17M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (97:5): [True: 2.17M, False: 6.58M]
  ------------------
   98|  2.17M|        if (!asn1_primitive_new(pval, it, embed))
  ------------------
  |  Branch (98:13): [True: 0, False: 2.17M]
  ------------------
   99|      0|            goto asn1err;
  100|  2.17M|        break;
  101|       |
  102|  2.17M|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   230k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (102:5): [True: 230k, False: 8.53M]
  ------------------
  103|   230k|        if (asn1_cb) {
  ------------------
  |  Branch (103:13): [True: 15.2k, False: 215k]
  ------------------
  104|  15.2k|            i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
  ------------------
  |  |  742|  15.2k|# define ASN1_OP_NEW_PRE         0
  ------------------
  105|  15.2k|            if (!i)
  ------------------
  |  Branch (105:17): [True: 0, False: 15.2k]
  ------------------
  106|      0|                goto auxerr;
  107|  15.2k|            if (i == 2) {
  ------------------
  |  Branch (107:17): [True: 0, False: 15.2k]
  ------------------
  108|      0|                return 1;
  109|      0|            }
  110|  15.2k|        }
  111|   230k|        if (embed) {
  ------------------
  |  Branch (111:13): [True: 0, False: 230k]
  ------------------
  112|      0|            memset(*pval, 0, it->size);
  113|   230k|        } else {
  114|   230k|            *pval = OPENSSL_zalloc(it->size);
  ------------------
  |  |   99|   230k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   230k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   230k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|   230k|            if (*pval == NULL)
  ------------------
  |  Branch (115:17): [True: 0, False: 230k]
  ------------------
  116|      0|                return 0;
  117|   230k|        }
  118|   230k|        ossl_asn1_set_choice_selector(pval, -1, it);
  119|   230k|        if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
  ------------------
  |  |  743|  15.2k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (119:13): [True: 15.2k, False: 215k]
  |  Branch (119:24): [True: 0, False: 15.2k]
  ------------------
  120|      0|            goto auxerr2;
  121|   230k|        break;
  122|       |
  123|   230k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  22.6k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (123:5): [True: 22.6k, False: 8.73M]
  ------------------
  124|  2.71M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  2.71M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (124:5): [True: 2.69M, False: 6.06M]
  ------------------
  125|  2.71M|        if (asn1_cb) {
  ------------------
  |  Branch (125:13): [True: 125k, False: 2.59M]
  ------------------
  126|   125k|            i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
  ------------------
  |  |  742|   125k|# define ASN1_OP_NEW_PRE         0
  ------------------
  127|   125k|            if (!i)
  ------------------
  |  Branch (127:17): [True: 0, False: 125k]
  ------------------
  128|      0|                goto auxerr;
  129|   125k|            if (i == 2) {
  ------------------
  |  Branch (129:17): [True: 11.3k, False: 114k]
  ------------------
  130|  11.3k|                return 1;
  131|  11.3k|            }
  132|   125k|        }
  133|  2.70M|        if (embed) {
  ------------------
  |  Branch (133:13): [True: 299k, False: 2.40M]
  ------------------
  134|   299k|            memset(*pval, 0, it->size);
  135|  2.40M|        } else {
  136|  2.40M|            *pval = OPENSSL_zalloc(it->size);
  ------------------
  |  |   99|  2.40M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  2.40M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  2.40M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|  2.40M|            if (*pval == NULL)
  ------------------
  |  Branch (137:17): [True: 0, False: 2.40M]
  ------------------
  138|      0|                return 0;
  139|  2.40M|        }
  140|       |        /* 0 : init. lock */
  141|  2.70M|        if (ossl_asn1_do_lock(pval, 0, it) < 0) {
  ------------------
  |  Branch (141:13): [True: 0, False: 2.70M]
  ------------------
  142|      0|            if (!embed) {
  ------------------
  |  Branch (142:17): [True: 0, False: 0]
  ------------------
  143|      0|                OPENSSL_free(*pval);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  144|      0|                *pval = NULL;
  145|      0|            }
  146|      0|            goto asn1err;
  147|      0|        }
  148|  2.70M|        ossl_asn1_enc_init(pval, it);
  149|  8.96M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (149:41): [True: 6.26M, False: 2.70M]
  ------------------
  150|  6.26M|            pseqval = ossl_asn1_get_field_ptr(pval, tt);
  151|  6.26M|            if (!asn1_template_new(pseqval, tt, libctx, propq))
  ------------------
  |  Branch (151:17): [True: 0, False: 6.26M]
  ------------------
  152|      0|                goto asn1err2;
  153|  6.26M|        }
  154|  2.70M|        if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
  ------------------
  |  |  743|   114k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (154:13): [True: 114k, False: 2.59M]
  |  Branch (154:24): [True: 0, False: 114k]
  ------------------
  155|      0|            goto auxerr2;
  156|  2.70M|        break;
  157|  8.76M|    }
  158|  8.74M|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  170|      0|    return 0;
  171|       |
  172|      0|}
tasn_new.c:asn1_template_new:
  209|  6.26M|{
  210|  6.26M|    const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item);
  ------------------
  |  |  421|  6.26M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  211|  6.26M|    int embed = tt->flags & ASN1_TFLG_EMBED;
  ------------------
  |  |  597|  6.26M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  212|  6.26M|    ASN1_VALUE *tval;
  213|  6.26M|    int ret;
  214|  6.26M|    if (embed) {
  ------------------
  |  Branch (214:9): [True: 489k, False: 5.77M]
  ------------------
  215|   489k|        tval = (ASN1_VALUE *)pval;
  216|   489k|        pval = &tval;
  217|   489k|    }
  218|  6.26M|    if (tt->flags & ASN1_TFLG_OPTIONAL) {
  ------------------
  |  |  523|  6.26M|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (218:9): [True: 848k, False: 5.41M]
  ------------------
  219|   848k|        asn1_template_clear(pval, tt);
  220|   848k|        return 1;
  221|   848k|    }
  222|       |    /* If ANY DEFINED BY nothing to do */
  223|       |
  224|  5.41M|    if (tt->flags & ASN1_TFLG_ADB_MASK) {
  ------------------
  |  |  583|  5.41M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
  |  Branch (224:9): [True: 15.0k, False: 5.39M]
  ------------------
  225|  15.0k|        *pval = NULL;
  226|  15.0k|        return 1;
  227|  15.0k|    }
  228|       |    /* If SET OF or SEQUENCE OF, its a STACK */
  229|  5.39M|    if (tt->flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  5.39M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (229:9): [True: 10.9k, False: 5.38M]
  ------------------
  230|  10.9k|        STACK_OF(ASN1_VALUE) *skval;
  ------------------
  |  |   31|  10.9k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  231|  10.9k|        skval = sk_ASN1_VALUE_new_null();
  ------------------
  |  |  901|  10.9k|#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  232|  10.9k|        if (!skval) {
  ------------------
  |  Branch (232:13): [True: 0, False: 10.9k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  234|      0|            ret = 0;
  235|      0|            goto done;
  236|      0|        }
  237|  10.9k|        *pval = (ASN1_VALUE *)skval;
  238|  10.9k|        ret = 1;
  239|  10.9k|        goto done;
  240|  10.9k|    }
  241|       |    /* Otherwise pass it back to the item routine */
  242|  5.38M|    ret = asn1_item_embed_new(pval, it, embed, libctx, propq);
  243|  5.39M| done:
  244|  5.39M|    return ret;
  245|  5.38M|}
tasn_new.c:asn1_template_clear:
  248|   848k|{
  249|       |    /* If ADB or STACK just NULL the field */
  250|   848k|    if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK))
  ------------------
  |  |  583|   848k|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
                  if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK))
  ------------------
  |  |  539|   848k|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (250:9): [True: 134k, False: 713k]
  ------------------
  251|   134k|        *pval = NULL;
  252|   713k|    else
  253|   713k|        asn1_item_clear(pval, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  421|   713k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  254|   848k|}
tasn_new.c:asn1_item_clear:
  175|   713k|{
  176|   713k|    const ASN1_EXTERN_FUNCS *ef;
  177|       |
  178|   713k|    switch (it->itype) {
  ------------------
  |  Branch (178:13): [True: 0, False: 713k]
  ------------------
  179|       |
  180|      0|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|      0|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (180:5): [True: 0, False: 713k]
  ------------------
  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|   666k|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|   666k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (188:5): [True: 666k, False: 46.8k]
  ------------------
  189|   666k|        if (it->templates)
  ------------------
  |  Branch (189:13): [True: 0, False: 666k]
  ------------------
  190|      0|            asn1_template_clear(pval, it->templates);
  191|   666k|        else
  192|   666k|            asn1_primitive_clear(pval, it);
  193|   666k|        break;
  194|       |
  195|  21.5k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|  21.5k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (195:5): [True: 21.5k, False: 691k]
  ------------------
  196|  21.5k|        asn1_primitive_clear(pval, it);
  197|  21.5k|        break;
  198|       |
  199|  11.1k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|  11.1k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (199:5): [True: 11.1k, False: 702k]
  ------------------
  200|  25.3k|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  25.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (200:5): [True: 14.2k, False: 699k]
  ------------------
  201|  25.3k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  25.3k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (201:5): [True: 0, False: 713k]
  ------------------
  202|  25.3k|        *pval = NULL;
  203|  25.3k|        break;
  204|   713k|    }
  205|   713k|}
tasn_new.c:asn1_primitive_clear:
  328|   688k|{
  329|   688k|    int utype;
  330|   688k|    if (it && it->funcs) {
  ------------------
  |  Branch (330:9): [True: 688k, False: 0]
  |  Branch (330:15): [True: 4.27k, False: 683k]
  ------------------
  331|  4.27k|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  332|  4.27k|        if (pf->prim_clear)
  ------------------
  |  Branch (332:13): [True: 0, False: 4.27k]
  ------------------
  333|      0|            pf->prim_clear(pval, it);
  334|  4.27k|        else
  335|  4.27k|            *pval = NULL;
  336|  4.27k|        return;
  337|  4.27k|    }
  338|   683k|    if (!it || (it->itype == ASN1_ITYPE_MSTRING))
  ------------------
  |  |   85|   683k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (338:9): [True: 0, False: 683k]
  |  Branch (338:16): [True: 21.5k, False: 662k]
  ------------------
  339|  21.5k|        utype = -1;
  340|   662k|    else
  341|   662k|        utype = it->utype;
  342|   683k|    if (utype == V_ASN1_BOOLEAN)
  ------------------
  |  |   63|   683k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (342:9): [True: 70.1k, False: 613k]
  ------------------
  343|  70.1k|        *(ASN1_BOOLEAN *)pval = it->size;
  344|   613k|    else
  345|   613k|        *pval = NULL;
  346|   683k|}
tasn_new.c:asn1_primitive_new:
  263|  5.61M|{
  264|  5.61M|    ASN1_TYPE *typ;
  265|  5.61M|    ASN1_STRING *str;
  266|  5.61M|    int utype;
  267|       |
  268|  5.61M|    if (!it)
  ------------------
  |  Branch (268:9): [True: 0, False: 5.61M]
  ------------------
  269|      0|        return 0;
  270|       |
  271|  5.61M|    if (it->funcs) {
  ------------------
  |  Branch (271:9): [True: 34.2k, False: 5.57M]
  ------------------
  272|  34.2k|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  273|  34.2k|        if (embed) {
  ------------------
  |  Branch (273:13): [True: 21.4k, False: 12.8k]
  ------------------
  274|  21.4k|            if (pf->prim_clear) {
  ------------------
  |  Branch (274:17): [True: 21.4k, False: 0]
  ------------------
  275|  21.4k|                pf->prim_clear(pval, it);
  276|  21.4k|                return 1;
  277|  21.4k|            }
  278|  21.4k|        } else if (pf->prim_new) {
  ------------------
  |  Branch (278:20): [True: 12.8k, False: 0]
  ------------------
  279|  12.8k|            return pf->prim_new(pval, it);
  280|  12.8k|        }
  281|  34.2k|    }
  282|       |
  283|  5.57M|    if (it->itype == ASN1_ITYPE_MSTRING)
  ------------------
  |  |   85|  5.57M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (283:9): [True: 2.17M, False: 3.40M]
  ------------------
  284|  2.17M|        utype = -1;
  285|  3.40M|    else
  286|  3.40M|        utype = it->utype;
  287|  5.57M|    switch (utype) {
  288|  2.42M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  2.42M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (288:5): [True: 2.42M, False: 3.14M]
  ------------------
  289|  2.42M|        *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef);
  ------------------
  |  |   18|  2.42M|#define NID_undef                       0
  ------------------
  290|  2.42M|        return 1;
  291|       |
  292|      0|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|      0|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (292:5): [True: 0, False: 5.57M]
  ------------------
  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.57M]
  ------------------
  297|      0|        *pval = (ASN1_VALUE *)1;
  298|      0|        return 1;
  299|       |
  300|   768k|    case V_ASN1_ANY:
  ------------------
  |  |   58|   768k|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (300:5): [True: 768k, False: 4.80M]
  ------------------
  301|   768k|        if ((typ = OPENSSL_malloc(sizeof(*typ))) == NULL)
  ------------------
  |  |   97|   768k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   768k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   768k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (301:13): [True: 0, False: 768k]
  ------------------
  302|      0|            return 0;
  303|   768k|        typ->value.ptr = NULL;
  304|   768k|        typ->type = -1;
  305|   768k|        *pval = (ASN1_VALUE *)typ;
  306|   768k|        break;
  307|       |
  308|  2.37M|    default:
  ------------------
  |  Branch (308:5): [True: 2.37M, False: 3.19M]
  ------------------
  309|  2.37M|        if (embed) {
  ------------------
  |  Branch (309:13): [True: 169k, False: 2.20M]
  ------------------
  310|   169k|            str = *(ASN1_STRING **)pval;
  311|   169k|            memset(str, 0, sizeof(*str));
  312|   169k|            str->type = utype;
  313|   169k|            str->flags = ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|   169k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  314|  2.20M|        } else {
  315|  2.20M|            str = ASN1_STRING_type_new(utype);
  316|  2.20M|            *pval = (ASN1_VALUE *)str;
  317|  2.20M|        }
  318|  2.37M|        if (it->itype == ASN1_ITYPE_MSTRING && str)
  ------------------
  |  |   85|  4.75M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (318:13): [True: 2.17M, False: 206k]
  |  Branch (318:48): [True: 2.17M, False: 0]
  ------------------
  319|  2.17M|            str->flags |= ASN1_STRING_FLAG_MSTRING;
  ------------------
  |  |  180|  2.17M|# define ASN1_STRING_FLAG_MSTRING 0x040
  ------------------
  320|  2.37M|        break;
  321|  5.57M|    }
  322|  3.14M|    if (*pval)
  ------------------
  |  Branch (322:9): [True: 3.14M, False: 0]
  ------------------
  323|  3.14M|        return 1;
  324|      0|    return 0;
  325|  3.14M|}

ASN1_OCTET_STRING_free:
   23|   236k|void sname##_free(sname *x) \
   24|   236k|{ \
   25|   236k|    ASN1_STRING_free(x); \
   26|   236k|}
ASN1_INTEGER_new:
   19|  17.0k|sname *sname##_new(void) \
   20|  17.0k|{ \
   21|  17.0k|    return ASN1_STRING_type_new(V_##sname); \
   22|  17.0k|} \
ASN1_INTEGER_free:
   23|  95.8k|void sname##_free(sname *x) \
   24|  95.8k|{ \
   25|  95.8k|    ASN1_STRING_free(x); \
   26|  95.8k|}
ASN1_ENUMERATED_free:
   23|  1.56k|void sname##_free(sname *x) \
   24|  1.56k|{ \
   25|  1.56k|    ASN1_STRING_free(x); \
   26|  1.56k|}
ASN1_BIT_STRING_new:
   19|   170k|sname *sname##_new(void) \
   20|   170k|{ \
   21|   170k|    return ASN1_STRING_type_new(V_##sname); \
   22|   170k|} \
ASN1_BIT_STRING_free:
   23|   113k|void sname##_free(sname *x) \
   24|   113k|{ \
   25|   113k|    ASN1_STRING_free(x); \
   26|   113k|}

ossl_asn1_get_choice_selector:
   30|   237k|{
   31|   237k|    int *sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|   237k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   32|       |
   33|   237k|    return *sel;
   34|   237k|}
ossl_asn1_get_choice_selector_const:
   38|   743k|{
   39|   743k|    int *sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|   743k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   40|       |
   41|   743k|    return *sel;
   42|   743k|}
ossl_asn1_set_choice_selector:
   50|   442k|{
   51|   442k|    int *sel, ret;
   52|       |
   53|   442k|    sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|   442k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   54|   442k|    ret = *sel;
   55|   442k|    *sel = value;
   56|   442k|    return ret;
   57|   442k|}
ossl_asn1_do_lock:
   69|  5.47M|{
   70|  5.47M|    const ASN1_AUX *aux;
   71|  5.47M|    CRYPTO_RWLOCK **lock;
   72|  5.47M|    CRYPTO_REF_COUNT *refcnt;
   73|  5.47M|    int ret = -1;
   74|       |
   75|  5.47M|    if ((it->itype != ASN1_ITYPE_SEQUENCE)
  ------------------
  |  |   81|  5.47M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (75:9): [True: 45.2k, False: 5.42M]
  ------------------
   76|  5.47M|        && (it->itype != ASN1_ITYPE_NDEF_SEQUENCE))
  ------------------
  |  |   86|  45.2k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (76:12): [True: 0, False: 45.2k]
  ------------------
   77|      0|        return 0;
   78|  5.47M|    aux = it->funcs;
   79|  5.47M|    if (aux == NULL || (aux->flags & ASN1_AFLG_REFCOUNT) == 0)
  ------------------
  |  |  732|   349k|# define ASN1_AFLG_REFCOUNT      1
  ------------------
  |  Branch (79:9): [True: 5.12M, False: 349k]
  |  Branch (79:24): [True: 190k, False: 159k]
  ------------------
   80|  5.31M|        return 0;
   81|   159k|    lock = offset2ptr(*pval, aux->ref_lock);
  ------------------
  |  |   23|   159k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   82|   159k|    refcnt = offset2ptr(*pval, aux->ref_offset);
  ------------------
  |  |   23|   159k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   83|       |
   84|   159k|    switch (op) {
  ------------------
  |  Branch (84:13): [True: 0, False: 159k]
  ------------------
   85|  79.9k|    case 0:
  ------------------
  |  Branch (85:5): [True: 79.9k, False: 79.9k]
  ------------------
   86|  79.9k|        if (!CRYPTO_NEW_REF(refcnt, 1))
  ------------------
  |  Branch (86:13): [True: 0, False: 79.9k]
  ------------------
   87|      0|            return -1;
   88|  79.9k|        *lock = CRYPTO_THREAD_lock_new();
   89|  79.9k|        if (*lock == NULL) {
  ------------------
  |  Branch (89:13): [True: 0, False: 79.9k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   92|      0|            return -1;
   93|      0|        }
   94|  79.9k|        ret = 1;
   95|  79.9k|        break;
   96|      0|    case 1:
  ------------------
  |  Branch (96:5): [True: 0, False: 159k]
  ------------------
   97|      0|        if (!CRYPTO_UP_REF(refcnt, &ret))
  ------------------
  |  Branch (97:13): [True: 0, False: 0]
  ------------------
   98|      0|            return -1;
   99|      0|        break;
  100|  79.9k|    case -1:
  ------------------
  |  Branch (100:5): [True: 79.9k, False: 79.9k]
  ------------------
  101|  79.9k|        if (!CRYPTO_DOWN_REF(refcnt, &ret))
  ------------------
  |  Branch (101:13): [True: 0, False: 79.9k]
  ------------------
  102|      0|            return -1;  /* failed */
  103|  79.9k|        REF_PRINT_EX(it->sname, ret, (void *)it);
  ------------------
  |  |  287|  79.9k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  ------------------
  |  |  |  |  294|  79.9k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  ------------------
  |  |  |  |  |  |  282|  79.9k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  104|  79.9k|        REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  281|  79.9k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 79.9k]
  |  |  ------------------
  ------------------
  105|  79.9k|        if (ret == 0) {
  ------------------
  |  Branch (105:13): [True: 79.9k, False: 0]
  ------------------
  106|  79.9k|            CRYPTO_THREAD_lock_free(*lock);
  107|  79.9k|            *lock = NULL;
  108|  79.9k|            CRYPTO_FREE_REF(refcnt);
  109|  79.9k|        }
  110|  79.9k|        break;
  111|   159k|    }
  112|       |
  113|   159k|    return ret;
  114|   159k|}
ossl_asn1_enc_init:
  142|  2.70M|{
  143|  2.70M|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  144|       |
  145|  2.70M|    if (enc != NULL) {
  ------------------
  |  Branch (145:9): [True: 79.9k, False: 2.62M]
  ------------------
  146|  79.9k|        enc->enc = NULL;
  147|  79.9k|        enc->len = 0;
  148|  79.9k|        enc->modified = 1;
  149|  79.9k|    }
  150|  2.70M|}
ossl_asn1_enc_free:
  153|  2.76M|{
  154|  2.76M|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  155|       |
  156|  2.76M|    if (enc != NULL) {
  ------------------
  |  Branch (156:9): [True: 79.9k, False: 2.68M]
  ------------------
  157|  79.9k|        OPENSSL_free(enc->enc);
  ------------------
  |  |  107|  79.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  79.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  79.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  158|  79.9k|        enc->enc = NULL;
  159|  79.9k|        enc->len = 0;
  160|  79.9k|        enc->modified = 1;
  161|  79.9k|    }
  162|  2.76M|}
ossl_asn1_enc_save:
  166|  1.59M|{
  167|  1.59M|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  168|       |
  169|  1.59M|    if (enc == NULL)
  ------------------
  |  Branch (169:9): [True: 1.51M, False: 77.4k]
  ------------------
  170|  1.51M|        return 1;
  171|       |
  172|  77.4k|    OPENSSL_free(enc->enc);
  ------------------
  |  |  107|  77.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  77.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  77.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  173|  77.4k|    if (inlen <= 0)
  ------------------
  |  Branch (173:9): [True: 0, False: 77.4k]
  ------------------
  174|      0|        return 0;
  175|  77.4k|    if ((enc->enc = OPENSSL_malloc(inlen)) == NULL)
  ------------------
  |  |   97|  77.4k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  77.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  77.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (175:9): [True: 0, False: 77.4k]
  ------------------
  176|      0|        return 0;
  177|  77.4k|    memcpy(enc->enc, in, inlen);
  178|  77.4k|    enc->len = inlen;
  179|  77.4k|    enc->modified = 0;
  180|       |
  181|  77.4k|    return 1;
  182|  77.4k|}
ossl_asn1_enc_restore:
  186|  5.49M|{
  187|  5.49M|    const ASN1_ENCODING *enc = asn1_get_const_enc_ptr(pval, it);
  188|       |
  189|  5.49M|    if (enc == NULL || enc->modified)
  ------------------
  |  Branch (189:9): [True: 5.43M, False: 62.0k]
  |  Branch (189:24): [True: 0, False: 62.0k]
  ------------------
  190|  5.43M|        return 0;
  191|  62.0k|    if (out) {
  ------------------
  |  Branch (191:9): [True: 20.4k, False: 41.5k]
  ------------------
  192|  20.4k|        memcpy(*out, enc->enc, enc->len);
  193|  20.4k|        *out += enc->len;
  194|  20.4k|    }
  195|  62.0k|    if (len != NULL)
  ------------------
  |  Branch (195:9): [True: 62.0k, False: 0]
  ------------------
  196|  62.0k|        *len = enc->len;
  197|  62.0k|    return 1;
  198|  5.49M|}
ossl_asn1_get_field_ptr:
  202|  17.6M|{
  203|  17.6M|    ASN1_VALUE **pvaltmp = offset2ptr(*pval, tt->offset);
  ------------------
  |  |   23|  17.6M|#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|  17.6M|    return pvaltmp;
  210|  17.6M|}
ossl_asn1_get_const_field_ptr:
  215|  15.1M|{
  216|  15.1M|    return offset2ptr(*pval, tt->offset);
  ------------------
  |  |   23|  15.1M|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  217|  15.1M|}
ossl_asn1_do_adb:
  227|  25.0M|{
  228|  25.0M|    const ASN1_ADB *adb;
  229|  25.0M|    const ASN1_ADB_TABLE *atbl;
  230|  25.0M|    long selector;
  231|  25.0M|    const ASN1_VALUE **sfld;
  232|  25.0M|    int i;
  233|       |
  234|  25.0M|    if ((tt->flags & ASN1_TFLG_ADB_MASK) == 0)
  ------------------
  |  |  583|  25.0M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
  |  Branch (234:9): [True: 24.9M, False: 41.8k]
  ------------------
  235|  24.9M|        return tt;
  236|       |
  237|       |    /* Else ANY DEFINED BY ... get the table */
  238|  41.8k|    adb = ASN1_ADB_ptr(tt->item);
  ------------------
  |  |   89|  41.8k|# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
  ------------------
  239|       |
  240|       |    /* Get the selector field */
  241|  41.8k|    sfld = offset2ptr(val, adb->offset);
  ------------------
  |  |   23|  41.8k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  242|       |
  243|       |    /* Check if NULL */
  244|  41.8k|    if (*sfld == NULL) {
  ------------------
  |  Branch (244:9): [True: 15.1k, False: 26.7k]
  ------------------
  245|  15.1k|        if (adb->null_tt == NULL)
  ------------------
  |  Branch (245:13): [True: 15.1k, False: 0]
  ------------------
  246|  15.1k|            goto err;
  247|      0|        return adb->null_tt;
  248|  15.1k|    }
  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|  26.7k|    if ((tt->flags & ASN1_TFLG_ADB_OID) != 0)
  ------------------
  |  |  585|  26.7k|# define ASN1_TFLG_ADB_OID       (0x1<<8)
  ------------------
  |  Branch (254:9): [True: 26.7k, False: 0]
  ------------------
  255|  26.7k|        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|  26.7k|    if (adb->adb_cb != NULL && adb->adb_cb(&selector) == 0) {
  ------------------
  |  Branch (260:9): [True: 0, False: 26.7k]
  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|   129k|    for (atbl = adb->tbl, i = 0; i < adb->tblcount; i++, atbl++)
  ------------------
  |  Branch (272:34): [True: 122k, False: 7.17k]
  ------------------
  273|   122k|        if (atbl->value == selector)
  ------------------
  |  Branch (273:13): [True: 19.5k, False: 102k]
  ------------------
  274|  19.5k|            return &atbl->tt;
  275|       |
  276|       |    /* FIXME: need to search application table too */
  277|       |
  278|       |    /* No match, return default type */
  279|  7.17k|    if (!adb->default_tt)
  ------------------
  |  Branch (279:9): [True: 0, False: 7.17k]
  ------------------
  280|      0|        goto err;
  281|  7.17k|    return adb->default_tt;
  282|       |
  283|  15.1k| err:
  284|       |    /* FIXME: should log the value or OID of unsupported type */
  285|  15.1k|    if (nullerr)
  ------------------
  |  Branch (285:9): [True: 0, False: 15.1k]
  ------------------
  286|  15.1k|        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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  287|  15.1k|    return NULL;
  288|  7.17k|}
tasn_utl.c:asn1_get_enc_ptr:
  117|  7.06M|{
  118|  7.06M|    const ASN1_AUX *aux;
  119|       |
  120|  7.06M|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 7.06M]
  |  Branch (120:25): [True: 0, False: 7.06M]
  ------------------
  121|      0|        return NULL;
  122|  7.06M|    aux = it->funcs;
  123|  7.06M|    if (aux == NULL || (aux->flags & ASN1_AFLG_ENCODING) == 0)
  ------------------
  |  |  734|   515k|# define ASN1_AFLG_ENCODING      2
  ------------------
  |  Branch (123:9): [True: 6.54M, False: 515k]
  |  Branch (123:24): [True: 278k, False: 237k]
  ------------------
  124|  6.82M|        return NULL;
  125|   237k|    return offset2ptr(*pval, aux->enc_offset);
  ------------------
  |  |   23|   237k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  126|  7.06M|}
tasn_utl.c:asn1_get_const_enc_ptr:
  130|  5.49M|{
  131|  5.49M|    const ASN1_AUX *aux;
  132|       |
  133|  5.49M|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 5.49M]
  |  Branch (133:25): [True: 0, False: 5.49M]
  ------------------
  134|      0|        return NULL;
  135|  5.49M|    aux = it->funcs;
  136|  5.49M|    if (aux == NULL || (aux->flags & ASN1_AFLG_ENCODING) == 0)
  ------------------
  |  |  734|   122k|# define ASN1_AFLG_ENCODING      2
  ------------------
  |  Branch (136:9): [True: 5.37M, False: 122k]
  |  Branch (136:24): [True: 60.9k, False: 62.0k]
  ------------------
  137|  5.43M|        return NULL;
  138|  62.0k|    return offset2ptr(*pval, aux->enc_offset);
  ------------------
  |  |   23|  62.0k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  139|  5.49M|}

X509_ALGOR_get0:
   74|   143k|{
   75|   143k|    if (paobj)
  ------------------
  |  Branch (75:9): [True: 58.7k, False: 84.2k]
  ------------------
   76|  58.7k|        *paobj = algor->algorithm;
   77|   143k|    if (pptype) {
  ------------------
  |  Branch (77:9): [True: 88.5k, False: 54.4k]
  ------------------
   78|  88.5k|        if (algor->parameter == NULL) {
  ------------------
  |  Branch (78:13): [True: 7.35k, False: 81.2k]
  ------------------
   79|  7.35k|            *pptype = V_ASN1_UNDEF;
  ------------------
  |  |   60|  7.35k|# define V_ASN1_UNDEF                    -1
  ------------------
   80|  7.35k|            return;
   81|  7.35k|        } else
   82|  81.2k|            *pptype = algor->parameter->type;
   83|  81.2k|        if (ppval)
  ------------------
  |  Branch (83:13): [True: 81.1k, False: 43]
  ------------------
   84|  81.1k|            *ppval = algor->parameter->value.ptr;
   85|  81.2k|    }
   86|   143k|}
ossl_x509_algor_get_md:
  158|  1.61k|{
  159|  1.61k|    const EVP_MD *md;
  160|       |
  161|  1.61k|    if (alg == NULL)
  ------------------
  |  Branch (161:9): [True: 1.61k, False: 0]
  ------------------
  162|  1.61k|        return EVP_sha1();
  163|      0|    md = EVP_get_digestbyobj(alg->algorithm);
  ------------------
  |  |  529|      0|# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a))
  |  |  ------------------
  |  |  |  |  528|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|    return md;
  167|  1.61k|}

BIGNUM_it:
   57|  66.9k|ASN1_ITEM_start(BIGNUM)
  ------------------
  |  |   95|  66.9k|        { \
  |  |   96|  66.9k|                static const ASN1_ITEM local_it = {
  ------------------
   58|  66.9k|        ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM"
  ------------------
  |  |   80|  66.9k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                      ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM"
  ------------------
  |  |   64|  66.9k|# define V_ASN1_INTEGER                  2
  ------------------
   59|  66.9k|ASN1_ITEM_end(BIGNUM)
  ------------------
  |  |  102|  66.9k|                }; \
  |  |  103|  66.9k|        return &local_it; \
  |  |  104|  66.9k|        }
  ------------------
x_bignum.c:bn_new:
   66|  38.2k|{
   67|  38.2k|    *pval = (ASN1_VALUE *)BN_new();
   68|  38.2k|    if (*pval != NULL)
  ------------------
  |  Branch (68:9): [True: 38.2k, False: 0]
  ------------------
   69|  38.2k|        return 1;
   70|      0|    else
   71|      0|        return 0;
   72|  38.2k|}
x_bignum.c:bn_free:
   84|  6.26k|{
   85|  6.26k|    if (*pval == NULL)
  ------------------
  |  Branch (85:9): [True: 2.51k, False: 3.74k]
  ------------------
   86|  2.51k|        return;
   87|  3.74k|    if (it->size & BN_SENSITIVE)
  ------------------
  |  |   22|  3.74k|#define BN_SENSITIVE    1
  ------------------
  |  Branch (87:9): [True: 0, False: 3.74k]
  ------------------
   88|      0|        BN_clear_free((BIGNUM *)*pval);
   89|  3.74k|    else
   90|  3.74k|        BN_free((BIGNUM *)*pval);
   91|  3.74k|    *pval = NULL;
   92|  3.74k|}
x_bignum.c:bn_c2i:
  117|  36.6k|{
  118|  36.6k|    BIGNUM *bn;
  119|       |
  120|  36.6k|    if (*pval == NULL && !bn_new(pval, it))
  ------------------
  |  Branch (120:9): [True: 25.4k, False: 11.1k]
  |  Branch (120:26): [True: 0, False: 25.4k]
  ------------------
  121|      0|        return 0;
  122|  36.6k|    bn = (BIGNUM *)*pval;
  123|  36.6k|    if (!BN_bin2bn(cont, len, bn)) {
  ------------------
  |  Branch (123:9): [True: 0, False: 36.6k]
  ------------------
  124|      0|        bn_free(pval, it);
  125|      0|        return 0;
  126|      0|    }
  127|  36.6k|    return 1;
  128|  36.6k|}

INT32_it:
  250|  91.8k|ASN1_ITEM_start(INT32)
  ------------------
  |  |   95|  91.8k|        { \
  |  |   96|  91.8k|                static const ASN1_ITEM local_it = {
  ------------------
  251|  91.8k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   80|  91.8k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   64|  91.8k|# define V_ASN1_INTEGER                  2
  ------------------
  252|  91.8k|    INTxx_FLAG_SIGNED, "INT32"
  ------------------
  |  |   27|  91.8k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  253|  91.8k|ASN1_ITEM_end(INT32)
  ------------------
  |  |  102|  91.8k|                }; \
  |  |  103|  91.8k|        return &local_it; \
  |  |  104|  91.8k|        }
  ------------------
ZINT32_it:
  268|  2.73k|ASN1_ITEM_start(ZINT32)
  ------------------
  |  |   95|  2.73k|        { \
  |  |   96|  2.73k|                static const ASN1_ITEM local_it = {
  ------------------
  269|  2.73k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   80|  2.73k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   64|  2.73k|# define V_ASN1_INTEGER                  2
  ------------------
  270|  2.73k|    INTxx_FLAG_ZERO_DEFAULT|INTxx_FLAG_SIGNED, "ZINT32"
  ------------------
  |  |   26|  2.73k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
                  INTxx_FLAG_ZERO_DEFAULT|INTxx_FLAG_SIGNED, "ZINT32"
  ------------------
  |  |   27|  2.73k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  271|  2.73k|ASN1_ITEM_end(ZINT32)
  ------------------
  |  |  102|  2.73k|                }; \
  |  |  103|  2.73k|        return &local_it; \
  |  |  104|  2.73k|        }
  ------------------
x_int64.c:uint32_clear:
  136|  43.7k|{
  137|  43.7k|    **(uint32_t **)pval = 0;
  138|  43.7k|}
x_int64.c:uint32_c2i:
  173|  21.3k|{
  174|  21.3k|    uint64_t utmp = 0;
  175|  21.3k|    uint32_t utmp2 = 0;
  176|  21.3k|    char *cp;
  177|  21.3k|    int neg = 0;
  178|       |
  179|  21.3k|    if (*pval == NULL && !uint64_new(pval, it))
  ------------------
  |  Branch (179:9): [True: 0, False: 21.3k]
  |  Branch (179:26): [True: 0, False: 0]
  ------------------
  180|      0|        return 0;
  181|       |
  182|  21.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|  21.3k|    if (len == 0)
  ------------------
  |  Branch (190:9): [True: 6.41k, False: 14.8k]
  ------------------
  191|  6.41k|        goto long_compat;
  192|       |
  193|  14.8k|    if (!ossl_c2i_uint64_int(&utmp, &neg, &cont, len))
  ------------------
  |  Branch (193:9): [True: 341, False: 14.5k]
  ------------------
  194|    341|        return 0;
  195|  14.5k|    if ((it->size & INTxx_FLAG_SIGNED) == 0 && neg) {
  ------------------
  |  |   27|  14.5k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (195:9): [True: 0, False: 14.5k]
  |  Branch (195:48): [True: 0, False: 0]
  ------------------
  196|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  197|      0|        return 0;
  198|      0|    }
  199|  14.5k|    if (neg) {
  ------------------
  |  Branch (199:9): [True: 2.99k, False: 11.5k]
  ------------------
  200|  2.99k|        if (utmp > ABS_INT32_MIN) {
  ------------------
  |  |  169|  2.99k|#define ABS_INT32_MIN ((uint32_t)INT32_MAX + 1)
  ------------------
  |  Branch (200:13): [True: 142, False: 2.85k]
  ------------------
  201|    142|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|    142|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    142|    (ERR_new(),                                                 \
  |  |  |  |  404|    142|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    142|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    142|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    142|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    142|     ERR_set_error)
  |  |  ------------------
  ------------------
  202|    142|            return 0;
  203|    142|        }
  204|  2.85k|        utmp = 0 - utmp;
  205|  11.5k|    } else {
  206|  11.5k|        if (((it->size & INTxx_FLAG_SIGNED) != 0 && utmp > INT32_MAX)
  ------------------
  |  |   27|  11.5k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (206:14): [True: 11.5k, False: 0]
  |  Branch (206:53): [True: 447, False: 11.1k]
  ------------------
  207|  11.5k|            || ((it->size & INTxx_FLAG_SIGNED) == 0 && utmp > UINT32_MAX)) {
  ------------------
  |  |   27|  11.1k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (207:17): [True: 0, False: 11.1k]
  |  Branch (207:56): [True: 0, False: 0]
  ------------------
  208|    447|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|    447|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    447|    (ERR_new(),                                                 \
  |  |  |  |  404|    447|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    447|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    447|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    447|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    447|     ERR_set_error)
  |  |  ------------------
  ------------------
  209|    447|            return 0;
  210|    447|        }
  211|  11.5k|    }
  212|       |
  213|  20.3k| long_compat:
  214|  20.3k|    utmp2 = (uint32_t)utmp;
  215|  20.3k|    memcpy(cp, &utmp2, sizeof(utmp2));
  216|  20.3k|    return 1;
  217|  14.5k|}
x_int64.c:uint32_i2c:
  142|  31.7k|{
  143|  31.7k|    uint32_t utmp;
  144|  31.7k|    int neg = 0;
  145|       |    /* this exists to bypass broken gcc optimization */
  146|  31.7k|    char *cp = (char *)*pval;
  147|       |
  148|       |    /* use memcpy, because we may not be uint32_t aligned */
  149|  31.7k|    memcpy(&utmp, cp, sizeof(utmp));
  150|       |
  151|  31.7k|    if ((it->size & INTxx_FLAG_ZERO_DEFAULT) == INTxx_FLAG_ZERO_DEFAULT
  ------------------
  |  |   26|  31.7k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
                  if ((it->size & INTxx_FLAG_ZERO_DEFAULT) == INTxx_FLAG_ZERO_DEFAULT
  ------------------
  |  |   26|  63.4k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
  |  Branch (151:9): [True: 0, False: 31.7k]
  ------------------
  152|  31.7k|        && utmp == 0)
  ------------------
  |  Branch (152:12): [True: 0, False: 0]
  ------------------
  153|      0|        return -1;
  154|  31.7k|    if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  31.7k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
                  if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  63.4k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (154:9): [True: 31.7k, False: 0]
  ------------------
  155|  31.7k|        && (int32_t)utmp < 0) {
  ------------------
  |  Branch (155:12): [True: 6.06k, False: 25.6k]
  ------------------
  156|       |        /* ossl_i2c_uint64_int() assumes positive values */
  157|  6.06k|        utmp = 0 - utmp;
  158|  6.06k|        neg = 1;
  159|  6.06k|    }
  160|       |
  161|  31.7k|    return ossl_i2c_uint64_int(cont, (uint64_t)utmp, neg);
  162|  31.7k|}

ossl_encode_der_length:
   40|  61.9k|{
   41|  61.9k|    if (cont_len > 0xffff)
  ------------------
  |  Branch (41:9): [True: 3, False: 61.9k]
  ------------------
   42|      3|        return 0; /* Too large for supported length encodings */
   43|       |
   44|  61.9k|    if (cont_len > 0xff) {
  ------------------
  |  Branch (44:9): [True: 2.36k, False: 59.5k]
  ------------------
   45|  2.36k|        if (!WPACKET_put_bytes_u8(pkt, 0x82)
  ------------------
  |  |  878|  4.73k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (45:13): [True: 0, False: 2.36k]
  ------------------
   46|  2.36k|                || !WPACKET_put_bytes_u16(pkt, cont_len))
  ------------------
  |  |  880|  2.36k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (46:20): [True: 0, False: 2.36k]
  ------------------
   47|      0|            return 0;
   48|  59.5k|    } else {
   49|  59.5k|        if (cont_len > 0x7f
  ------------------
  |  Branch (49:13): [True: 4.99k, False: 54.5k]
  ------------------
   50|  59.5k|                && !WPACKET_put_bytes_u8(pkt, 0x81))
  ------------------
  |  |  878|  4.99k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (50:20): [True: 0, False: 4.99k]
  ------------------
   51|      0|            return 0;
   52|  59.5k|        if (!WPACKET_put_bytes_u8(pkt, cont_len))
  ------------------
  |  |  878|  59.5k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (52:13): [True: 0, False: 59.5k]
  ------------------
   53|      0|            return 0;
   54|  59.5k|    }
   55|       |
   56|  61.9k|    return 1;
   57|  61.9k|}
ossl_encode_der_integer:
   67|  41.3k|{
   68|  41.3k|    unsigned char *bnbytes;
   69|  41.3k|    size_t cont_len;
   70|       |
   71|  41.3k|    if (BN_is_negative(n))
  ------------------
  |  Branch (71:9): [True: 0, False: 41.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|  41.3k|    cont_len = BN_num_bits(n) / 8 + 1;
   84|       |
   85|  41.3k|    if (!WPACKET_start_sub_packet(pkt)
  ------------------
  |  Branch (85:9): [True: 0, False: 41.3k]
  ------------------
   86|  41.3k|            || !WPACKET_put_bytes_u8(pkt, ID_INTEGER)
  ------------------
  |  |  878|  82.6k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (86:16): [True: 0, False: 41.3k]
  ------------------
   87|  41.3k|            || !ossl_encode_der_length(pkt, cont_len)
  ------------------
  |  Branch (87:16): [True: 2, False: 41.2k]
  ------------------
   88|  41.3k|            || !WPACKET_allocate_bytes(pkt, cont_len, &bnbytes)
  ------------------
  |  Branch (88:16): [True: 0, False: 41.2k]
  ------------------
   89|  41.3k|            || !WPACKET_close(pkt))
  ------------------
  |  Branch (89:16): [True: 0, False: 41.2k]
  ------------------
   90|      2|        return 0;
   91|       |
   92|  41.2k|    if (bnbytes != NULL
  ------------------
  |  Branch (92:9): [True: 0, False: 41.2k]
  ------------------
   93|  41.2k|            && BN_bn2binpad(n, bnbytes, (int)cont_len) != (int)cont_len)
  ------------------
  |  Branch (93:16): [True: 0, False: 0]
  ------------------
   94|      0|        return 0;
   95|       |
   96|  41.2k|    return 1;
   97|  41.2k|}
ossl_encode_der_dsa_sig:
  107|  20.6k|{
  108|  20.6k|    WPACKET tmppkt, *dummypkt;
  109|  20.6k|    size_t cont_len;
  110|  20.6k|    int isnull = WPACKET_is_null_buf(pkt);
  111|       |
  112|  20.6k|    if (!WPACKET_start_sub_packet(pkt))
  ------------------
  |  Branch (112:9): [True: 0, False: 20.6k]
  ------------------
  113|      0|        return 0;
  114|       |
  115|  20.6k|    if (!isnull) {
  ------------------
  |  Branch (115:9): [True: 0, False: 20.6k]
  ------------------
  116|      0|        if (!WPACKET_init_null(&tmppkt, 0))
  ------------------
  |  Branch (116:13): [True: 0, False: 0]
  ------------------
  117|      0|            return 0;
  118|      0|        dummypkt = &tmppkt;
  119|  20.6k|    } else {
  120|       |        /* If the input packet has a NULL buffer, we don't need a dummy packet */
  121|  20.6k|        dummypkt = pkt;
  122|  20.6k|    }
  123|       |
  124|       |    /* Calculate the content length */
  125|  20.6k|    if (!ossl_encode_der_integer(dummypkt, r)
  ------------------
  |  Branch (125:9): [True: 2, False: 20.6k]
  ------------------
  126|  20.6k|            || !ossl_encode_der_integer(dummypkt, s)
  ------------------
  |  Branch (126:16): [True: 0, False: 20.6k]
  ------------------
  127|  20.6k|            || !WPACKET_get_length(dummypkt, &cont_len)
  ------------------
  |  Branch (127:16): [True: 0, False: 20.6k]
  ------------------
  128|  20.6k|            || (!isnull && !WPACKET_finish(dummypkt))) {
  ------------------
  |  Branch (128:17): [True: 0, False: 20.6k]
  |  Branch (128:28): [True: 0, False: 0]
  ------------------
  129|      2|        if (!isnull)
  ------------------
  |  Branch (129:13): [True: 0, False: 2]
  ------------------
  130|      0|            WPACKET_cleanup(dummypkt);
  131|      2|        return 0;
  132|      2|    }
  133|       |
  134|       |    /* Add the tag and length bytes */
  135|  20.6k|    if (!WPACKET_put_bytes_u8(pkt, ID_SEQUENCE)
  ------------------
  |  |  878|  41.2k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (135:9): [True: 0, False: 20.6k]
  ------------------
  136|  20.6k|            || !ossl_encode_der_length(pkt, cont_len)
  ------------------
  |  Branch (136:16): [True: 1, False: 20.6k]
  ------------------
  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|  20.6k|            || (!isnull && !ossl_encode_der_integer(pkt, r))
  ------------------
  |  Branch (141:17): [True: 0, False: 20.6k]
  |  Branch (141:28): [True: 0, False: 0]
  ------------------
  142|  20.6k|            || (!isnull && !ossl_encode_der_integer(pkt, s))
  ------------------
  |  Branch (142:17): [True: 0, False: 20.6k]
  |  Branch (142:28): [True: 0, False: 0]
  ------------------
  143|  20.6k|            || !WPACKET_close(pkt))
  ------------------
  |  Branch (143:16): [True: 0, False: 20.6k]
  ------------------
  144|      1|        return 0;
  145|       |
  146|  20.6k|    return 1;
  147|  20.6k|}

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|}

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|   232k|{
   83|   232k|    BIO *bio = OPENSSL_zalloc(sizeof(*bio));
  ------------------
  |  |   99|   232k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   232k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   232k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|       |
   85|   232k|    if (bio == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 232k]
  ------------------
   86|      0|        return NULL;
   87|       |
   88|   232k|    bio->libctx = libctx;
   89|   232k|    bio->method = method;
   90|   232k|    bio->shutdown = 1;
   91|       |
   92|   232k|    if (!CRYPTO_NEW_REF(&bio->references, 1))
  ------------------
  |  Branch (92:9): [True: 0, False: 232k]
  ------------------
   93|      0|        goto err;
   94|       |
   95|   232k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data))
  ------------------
  |  |  230|   232k|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  |  Branch (95:9): [True: 0, False: 232k]
  ------------------
   96|      0|        goto err;
   97|       |
   98|   232k|    if (method->create != NULL && !method->create(bio)) {
  ------------------
  |  Branch (98:9): [True: 231k, False: 955]
  |  Branch (98:35): [True: 0, False: 231k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  100|      0|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);
  ------------------
  |  |  230|      0|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  101|      0|        goto err;
  102|      0|    }
  103|   232k|    if (method->create == NULL)
  ------------------
  |  Branch (103:9): [True: 955, False: 231k]
  ------------------
  104|    955|        bio->init = 1;
  105|       |
  106|   232k|    return bio;
  107|       |
  108|      0|err:
  109|      0|    CRYPTO_FREE_REF(&bio->references);
  110|      0|    OPENSSL_free(bio);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|      0|    return NULL;
  112|   232k|}
BIO_new:
  115|   232k|{
  116|   232k|    return BIO_new_ex(NULL, method);
  117|   232k|}
BIO_free:
  120|   425k|{
  121|   425k|    int ret;
  122|       |
  123|   425k|    if (a == NULL)
  ------------------
  |  Branch (123:9): [True: 84.2k, False: 341k]
  ------------------
  124|  84.2k|        return 0;
  125|       |
  126|   341k|    if (CRYPTO_DOWN_REF(&a->references, &ret) <= 0)
  ------------------
  |  Branch (126:9): [True: 0, False: 341k]
  ------------------
  127|      0|        return 0;
  128|       |
  129|   341k|    REF_PRINT_COUNT("BIO", a);
  ------------------
  |  |  289|   341k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|   341k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|   341k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|   341k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  130|   341k|    if (ret > 0)
  ------------------
  |  Branch (130:9): [True: 109k, False: 232k]
  ------------------
  131|   109k|        return 1;
  132|   232k|    REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  281|   232k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 232k]
  |  |  ------------------
  ------------------
  133|       |
  134|   232k|    if (HAS_CALLBACK(a)) {
  ------------------
  |  |   26|   232k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 232k]
  |  |  |  Branch (26:52): [True: 0, False: 232k]
  |  |  ------------------
  ------------------
  135|      0|        ret = (int)bio_call_callback(a, BIO_CB_FREE, NULL, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  285|      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|   232k|    if ((a->method != NULL) && (a->method->destroy != NULL))
  ------------------
  |  Branch (140:9): [True: 232k, False: 0]
  |  Branch (140:32): [True: 231k, False: 955]
  ------------------
  141|   231k|        a->method->destroy(a);
  142|       |
  143|   232k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
  ------------------
  |  |  230|   232k|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  144|       |
  145|   232k|    CRYPTO_FREE_REF(&a->references);
  146|       |
  147|   232k|    OPENSSL_free(a);
  ------------------
  |  |  107|   232k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   232k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   232k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  148|       |
  149|   232k|    return 1;
  150|   232k|}
BIO_set_data:
  153|   109k|{
  154|   109k|    a->ptr = ptr;
  155|   109k|}
BIO_get_data:
  158|  1.49M|{
  159|  1.49M|    return a->ptr;
  160|  1.49M|}
BIO_set_init:
  163|   218k|{
  164|   218k|    a->init = init;
  165|   218k|}
BIO_up_ref:
  188|   109k|{
  189|   109k|    int i;
  190|       |
  191|   109k|    if (CRYPTO_UP_REF(&a->references, &i) <= 0)
  ------------------
  |  Branch (191:9): [True: 0, False: 109k]
  ------------------
  192|      0|        return 0;
  193|       |
  194|   109k|    REF_PRINT_COUNT("BIO", a);
  ------------------
  |  |  289|   109k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|   109k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|   109k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|   109k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|   109k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|   109k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 109k]
  |  |  ------------------
  ------------------
  196|   109k|    return i > 1;
  197|   109k|}
BIO_clear_flags:
  200|  8.65M|{
  201|  8.65M|    b->flags &= ~flags;
  202|  8.65M|}
BIO_set_flags:
  210|  10.8k|{
  211|  10.8k|    b->flags |= flags;
  212|  10.8k|}
BIO_read:
  304|  8.64M|{
  305|  8.64M|    size_t readbytes;
  306|  8.64M|    int ret;
  307|       |
  308|  8.64M|    if (dlen < 0)
  ------------------
  |  Branch (308:9): [True: 0, False: 8.64M]
  ------------------
  309|      0|        return 0;
  310|       |
  311|  8.64M|    ret = bio_read_intern(b, data, (size_t)dlen, &readbytes);
  312|       |
  313|  8.64M|    if (ret > 0) {
  ------------------
  |  Branch (313:9): [True: 8.60M, False: 40.1k]
  ------------------
  314|       |        /* *readbytes should always be <= dlen */
  315|  8.60M|        ret = (int)readbytes;
  316|  8.60M|    }
  317|       |
  318|  8.64M|    return ret;
  319|  8.64M|}
BIO_read_ex:
  322|  1.38M|{
  323|  1.38M|    return bio_read_intern(b, data, dlen, readbytes) > 0;
  324|  1.38M|}
BIO_write:
  371|  9.51k|{
  372|  9.51k|    size_t written;
  373|  9.51k|    int ret;
  374|       |
  375|  9.51k|    if (dlen <= 0)
  ------------------
  |  Branch (375:9): [True: 0, False: 9.51k]
  ------------------
  376|      0|        return 0;
  377|       |
  378|  9.51k|    ret = bio_write_intern(b, data, (size_t)dlen, &written);
  379|       |
  380|  9.51k|    if (ret > 0) {
  ------------------
  |  Branch (380:9): [True: 9.51k, False: 0]
  ------------------
  381|       |        /* written should always be <= dlen */
  382|  9.51k|        ret = (int)written;
  383|  9.51k|    }
  384|       |
  385|  9.51k|    return ret;
  386|  9.51k|}
BIO_ctrl:
  661|   412k|{
  662|   412k|    long ret;
  663|       |
  664|   412k|    if (b == NULL)
  ------------------
  |  Branch (664:9): [True: 0, False: 412k]
  ------------------
  665|      0|        return -1;
  666|   412k|    if (b->method == NULL || b->method->ctrl == NULL) {
  ------------------
  |  Branch (666:9): [True: 0, False: 412k]
  |  Branch (666:30): [True: 0, False: 412k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  668|      0|        return -2;
  669|      0|    }
  670|       |
  671|   412k|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|   412k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 412k]
  |  |  |  Branch (26:52): [True: 0, False: 412k]
  |  |  ------------------
  ------------------
  672|      0|        ret = bio_call_callback(b, BIO_CB_CTRL, parg, 0, cmd, larg, 1L, NULL);
  ------------------
  |  |  290|      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|   412k|    ret = b->method->ctrl(b, cmd, larg, parg);
  678|       |
  679|   412k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|   412k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 412k]
  |  |  |  Branch (26:52): [True: 0, False: 412k]
  |  |  ------------------
  ------------------
  680|      0|        ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  290|      0|# define BIO_CB_CTRL        0x06
  ------------------
                      ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  298|      0|# define BIO_CB_RETURN   0x80
  ------------------
  681|      0|                                larg, ret, NULL);
  682|       |
  683|   412k|    return ret;
  684|   412k|}
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|  10.0M|{
  264|  10.0M|    int ret;
  265|       |
  266|  10.0M|    if (b == NULL) {
  ------------------
  |  Branch (266:9): [True: 0, False: 10.0M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  268|      0|        return -1;
  269|      0|    }
  270|  10.0M|    if (b->method == NULL || b->method->bread == NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 10.0M]
  |  Branch (270:30): [True: 0, False: 10.0M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        return -2;
  273|      0|    }
  274|       |
  275|  10.0M|    if (HAS_CALLBACK(b) &&
  ------------------
  |  |   26|  20.0M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 10.0M]
  |  |  |  Branch (26:52): [True: 0, False: 10.0M]
  |  |  ------------------
  ------------------
  276|  10.0M|        ((ret = (int)bio_call_callback(b, BIO_CB_READ, data, dlen, 0, 0L, 1L,
  ------------------
  |  |  286|      0|# define BIO_CB_READ        0x02
  ------------------
  |  Branch (276:9): [True: 0, False: 0]
  ------------------
  277|      0|                                       NULL)) <= 0))
  278|      0|        return ret;
  279|       |
  280|  10.0M|    if (!b->init) {
  ------------------
  |  Branch (280:9): [True: 0, False: 10.0M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  282|      0|        return -1;
  283|      0|    }
  284|       |
  285|  10.0M|    ret = b->method->bread(b, data, dlen, readbytes);
  286|       |
  287|  10.0M|    if (ret > 0)
  ------------------
  |  Branch (287:9): [True: 9.96M, False: 69.5k]
  ------------------
  288|  9.96M|        b->num_read += (uint64_t)*readbytes;
  289|       |
  290|  10.0M|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  10.0M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 10.0M]
  |  |  |  Branch (26:52): [True: 0, False: 10.0M]
  |  |  ------------------
  ------------------
  291|      0|        ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data,
  ------------------
  |  |  286|      0|# define BIO_CB_READ        0x02
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data,
  ------------------
  |  |  298|      0|# define BIO_CB_RETURN   0x80
  ------------------
  292|      0|                                     dlen, 0, 0L, ret, readbytes);
  293|       |
  294|       |    /* Shouldn't happen */
  295|  10.0M|    if (ret > 0 && *readbytes > dlen) {
  ------------------
  |  Branch (295:9): [True: 9.96M, False: 69.5k]
  |  Branch (295:20): [True: 0, False: 9.96M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  297|      0|        return -1;
  298|      0|    }
  299|       |
  300|  10.0M|    return ret;
  301|  10.0M|}
bio_lib.c:bio_write_intern:
  328|  9.51k|{
  329|  9.51k|    size_t local_written;
  330|  9.51k|    int ret;
  331|       |
  332|  9.51k|    if (written != NULL)
  ------------------
  |  Branch (332:9): [True: 9.51k, False: 0]
  ------------------
  333|  9.51k|        *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|  9.51k|    if (b == NULL)
  ------------------
  |  Branch (338:9): [True: 0, False: 9.51k]
  ------------------
  339|      0|        return 0;
  340|       |
  341|  9.51k|    if (b->method == NULL || b->method->bwrite == NULL) {
  ------------------
  |  Branch (341:9): [True: 0, False: 9.51k]
  |  Branch (341:30): [True: 0, False: 9.51k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  343|      0|        return -2;
  344|      0|    }
  345|       |
  346|  9.51k|    if (HAS_CALLBACK(b) &&
  ------------------
  |  |   26|  19.0k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 9.51k]
  |  |  |  Branch (26:52): [True: 0, False: 9.51k]
  |  |  ------------------
  ------------------
  347|  9.51k|        ((ret = (int)bio_call_callback(b, BIO_CB_WRITE, data, dlen, 0, 0L, 1L,
  ------------------
  |  |  287|      0|# define BIO_CB_WRITE       0x03
  ------------------
  |  Branch (347:9): [True: 0, False: 0]
  ------------------
  348|      0|                                       NULL)) <= 0))
  349|      0|        return ret;
  350|       |
  351|  9.51k|    if (!b->init) {
  ------------------
  |  Branch (351:9): [True: 0, False: 9.51k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  353|      0|        return -1;
  354|      0|    }
  355|       |
  356|  9.51k|    ret = b->method->bwrite(b, data, dlen, &local_written);
  357|       |
  358|  9.51k|    if (ret > 0)
  ------------------
  |  Branch (358:9): [True: 9.51k, False: 0]
  ------------------
  359|  9.51k|        b->num_write += (uint64_t)local_written;
  360|       |
  361|  9.51k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  9.51k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 9.51k]
  |  |  |  Branch (26:52): [True: 0, False: 9.51k]
  |  |  ------------------
  ------------------
  362|      0|        ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  287|      0|# define BIO_CB_WRITE       0x03
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  298|      0|# define BIO_CB_RETURN   0x80
  ------------------
  363|      0|                                     dlen, 0, 0L, ret, &local_written);
  364|       |
  365|  9.51k|    if (written != NULL)
  ------------------
  |  Branch (365:9): [True: 9.51k, False: 0]
  ------------------
  366|  9.51k|        *written = local_written;
  367|  9.51k|    return ret;
  368|  9.51k|}

BIO_meth_new:
   36|      1|{
   37|      1|    BIO_METHOD *biom = OPENSSL_zalloc(sizeof(BIO_METHOD));
  ------------------
  |  |   99|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   38|       |
   39|      1|    if (biom == NULL
  ------------------
  |  Branch (39:9): [True: 0, False: 1]
  ------------------
   40|      1|            || (biom->name = OPENSSL_strdup(name)) == NULL) {
  ------------------
  |  |  111|      1|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (40:16): [True: 0, False: 1]
  ------------------
   41|      0|        OPENSSL_free(biom);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   42|      0|        return NULL;
   43|      0|    }
   44|      1|    biom->type = type;
   45|      1|    return biom;
   46|      1|}
BIO_meth_free:
   49|      1|{
   50|      1|    if (biom != NULL) {
  ------------------
  |  Branch (50:9): [True: 1, False: 0]
  ------------------
   51|      1|        OPENSSL_free(biom->name);
  ------------------
  |  |  107|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|      1|        OPENSSL_free(biom);
  ------------------
  |  |  107|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   53|      1|    }
   54|      1|}
bwrite_conv:
   69|  9.51k|{
   70|  9.51k|    int ret;
   71|       |
   72|  9.51k|    if (datal > INT_MAX)
  ------------------
  |  Branch (72:9): [True: 0, False: 9.51k]
  ------------------
   73|      0|        datal = INT_MAX;
   74|       |
   75|  9.51k|    ret = bio->method->bwrite_old(bio, data, (int)datal);
   76|       |
   77|  9.51k|    if (ret <= 0) {
  ------------------
  |  Branch (77:9): [True: 0, False: 9.51k]
  ------------------
   78|      0|        *written = 0;
   79|      0|        return ret;
   80|      0|    }
   81|       |
   82|  9.51k|    *written = (size_t)ret;
   83|       |
   84|  9.51k|    return 1;
   85|  9.51k|}
BIO_meth_set_write_ex:
   97|      1|{
   98|      1|    biom->bwrite_old = NULL;
   99|      1|    biom->bwrite = bwrite;
  100|      1|    return 1;
  101|      1|}
bread_conv:
  115|  8.64M|{
  116|  8.64M|    int ret;
  117|       |
  118|  8.64M|    if (datal > INT_MAX)
  ------------------
  |  Branch (118:9): [True: 0, False: 8.64M]
  ------------------
  119|      0|        datal = INT_MAX;
  120|       |
  121|  8.64M|    ret = bio->method->bread_old(bio, data, (int)datal);
  122|       |
  123|  8.64M|    if (ret <= 0) {
  ------------------
  |  Branch (123:9): [True: 40.1k, False: 8.60M]
  ------------------
  124|  40.1k|        *readbytes = 0;
  125|  40.1k|        return ret;
  126|  40.1k|    }
  127|       |
  128|  8.60M|    *readbytes = (size_t)ret;
  129|       |
  130|  8.60M|    return 1;
  131|  8.64M|}
BIO_meth_set_read_ex:
  143|      1|{
  144|      1|    biom->bread_old = NULL;
  145|      1|    biom->bread = bread;
  146|      1|    return 1;
  147|      1|}
BIO_meth_set_puts:
  156|      1|{
  157|      1|    biom->bputs = bputs;
  158|      1|    return 1;
  159|      1|}
BIO_meth_set_gets:
  168|      1|{
  169|      1|    biom->bgets = bgets;
  170|      1|    return 1;
  171|      1|}
BIO_meth_set_ctrl:
  180|      1|{
  181|      1|    biom->ctrl = ctrl;
  182|      1|    return 1;
  183|      1|}
BIO_meth_set_create:
  191|      1|{
  192|      1|    biom->create = create;
  193|      1|    return 1;
  194|      1|}
BIO_meth_set_destroy:
  202|      1|{
  203|      1|    biom->destroy = destroy;
  204|      1|    return 1;
  205|      1|}

BIO_snprintf:
  925|  39.9k|{
  926|  39.9k|    va_list args;
  927|  39.9k|    int ret;
  928|       |
  929|  39.9k|    va_start(args, format);
  930|       |
  931|  39.9k|    ret = BIO_vsnprintf(buf, n, format, args);
  932|       |
  933|  39.9k|    va_end(args);
  934|  39.9k|    return ret;
  935|  39.9k|}
BIO_vsnprintf:
  938|  70.5k|{
  939|  70.5k|    size_t retlen;
  940|  70.5k|    int truncated;
  941|       |
  942|  70.5k|    if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
  ------------------
  |  Branch (942:9): [True: 0, False: 70.5k]
  ------------------
  943|      0|        return -1;
  944|       |
  945|  70.5k|    if (truncated)
  ------------------
  |  Branch (945:9): [True: 0, False: 70.5k]
  ------------------
  946|       |        /*
  947|       |         * In case of truncation, return -1 like traditional snprintf.
  948|       |         * (Current drafts for ISO/IEC 9899 say snprintf should return the
  949|       |         * number of characters that would have been written, had the buffer
  950|       |         * been large enough.)
  951|       |         */
  952|      0|        return -1;
  953|  70.5k|    return (retlen <= INT_MAX) ? (int)retlen : -1;
  ------------------
  |  Branch (953:12): [True: 70.5k, False: 0]
  ------------------
  954|  70.5k|}
bio_print.c:_dopr:
   91|  70.5k|{
   92|  70.5k|    char ch;
   93|  70.5k|    int64_t value;
   94|  70.5k|#ifndef OPENSSL_SYS_UEFI
   95|  70.5k|    LDOUBLE fvalue;
  ------------------
  |  |   28|  70.5k|# define LDOUBLE double
  ------------------
   96|  70.5k|#endif
   97|  70.5k|    char *strvalue;
   98|  70.5k|    int min;
   99|  70.5k|    int max;
  100|  70.5k|    int state;
  101|  70.5k|    int flags;
  102|  70.5k|    int cflags;
  103|  70.5k|    size_t currlen;
  104|       |
  105|  70.5k|    state = DP_S_DEFAULT;
  ------------------
  |  |   45|  70.5k|#define DP_S_DEFAULT    0
  ------------------
  106|  70.5k|    flags = currlen = cflags = min = 0;
  107|  70.5k|    max = -1;
  108|  70.5k|    ch = *format++;
  109|       |
  110|  2.65M|    while (state != DP_S_DONE) {
  ------------------
  |  |   52|  2.65M|#define DP_S_DONE       7
  ------------------
  |  Branch (110:12): [True: 2.58M, False: 70.5k]
  ------------------
  111|  2.58M|        if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
  ------------------
  |  Branch (111:13): [True: 70.5k, False: 2.51M]
  |  Branch (111:28): [True: 2.51M, False: 0]
  |  Branch (111:46): [True: 0, False: 2.51M]
  ------------------
  112|  70.5k|            state = DP_S_DONE;
  ------------------
  |  |   52|  70.5k|#define DP_S_DONE       7
  ------------------
  113|       |
  114|  2.58M|        switch (state) {
  115|  1.54M|        case DP_S_DEFAULT:
  ------------------
  |  |   45|  1.54M|#define DP_S_DEFAULT    0
  ------------------
  |  Branch (115:9): [True: 1.54M, False: 1.03M]
  ------------------
  116|  1.54M|            if (ch == '%')
  ------------------
  |  Branch (116:17): [True: 191k, False: 1.35M]
  ------------------
  117|   191k|                state = DP_S_FLAGS;
  ------------------
  |  |   46|   191k|#define DP_S_FLAGS      1
  ------------------
  118|  1.35M|            else
  119|  1.35M|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (119:21): [True: 0, False: 1.35M]
  ------------------
  120|      0|                    return 0;
  121|  1.54M|            ch = *format++;
  122|  1.54M|            break;
  123|   195k|        case DP_S_FLAGS:
  ------------------
  |  |   46|   195k|#define DP_S_FLAGS      1
  ------------------
  |  Branch (123:9): [True: 195k, False: 2.39M]
  ------------------
  124|   195k|            switch (ch) {
  125|      0|            case '-':
  ------------------
  |  Branch (125:13): [True: 0, False: 195k]
  ------------------
  126|      0|                flags |= DP_F_MINUS;
  ------------------
  |  |   56|      0|#define DP_F_MINUS      (1 << 0)
  ------------------
  127|      0|                ch = *format++;
  128|      0|                break;
  129|      0|            case '+':
  ------------------
  |  Branch (129:13): [True: 0, False: 195k]
  ------------------
  130|      0|                flags |= DP_F_PLUS;
  ------------------
  |  |   58|      0|#define DP_F_PLUS       (1 << 1)
  ------------------
  131|      0|                ch = *format++;
  132|      0|                break;
  133|      0|            case ' ':
  ------------------
  |  Branch (133:13): [True: 0, False: 195k]
  ------------------
  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: 195k]
  ------------------
  138|      0|                flags |= DP_F_NUM;
  ------------------
  |  |   62|      0|#define DP_F_NUM        (1 << 3)
  ------------------
  139|      0|                ch = *format++;
  140|      0|                break;
  141|  4.50k|            case '0':
  ------------------
  |  Branch (141:13): [True: 4.50k, False: 191k]
  ------------------
  142|  4.50k|                flags |= DP_F_ZERO;
  ------------------
  |  |   64|  4.50k|#define DP_F_ZERO       (1 << 4)
  ------------------
  143|  4.50k|                ch = *format++;
  144|  4.50k|                break;
  145|   191k|            default:
  ------------------
  |  Branch (145:13): [True: 191k, False: 4.50k]
  ------------------
  146|   191k|                state = DP_S_MIN;
  ------------------
  |  |   47|   191k|#define DP_S_MIN        2
  ------------------
  147|   191k|                break;
  148|   195k|            }
  149|   195k|            break;
  150|   200k|        case DP_S_MIN:
  ------------------
  |  |   47|   200k|#define DP_S_MIN        2
  ------------------
  |  Branch (150:9): [True: 200k, False: 2.38M]
  ------------------
  151|   200k|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (151:17): [True: 9.00k, False: 191k]
  ------------------
  152|  9.00k|                min = 10 * min + char_to_int(ch);
  ------------------
  |  |   83|  9.00k|#define char_to_int(p) (p - '0')
  ------------------
  153|  9.00k|                ch = *format++;
  154|   191k|            } else if (ch == '*') {
  ------------------
  |  Branch (154:24): [True: 0, False: 191k]
  ------------------
  155|      0|                min = va_arg(args, int);
  156|      0|                ch = *format++;
  157|      0|                state = DP_S_DOT;
  ------------------
  |  |   48|      0|#define DP_S_DOT        3
  ------------------
  158|      0|            } else
  159|   191k|                state = DP_S_DOT;
  ------------------
  |  |   48|   191k|#define DP_S_DOT        3
  ------------------
  160|   200k|            break;
  161|   191k|        case DP_S_DOT:
  ------------------
  |  |   48|   191k|#define DP_S_DOT        3
  ------------------
  |  Branch (161:9): [True: 191k, False: 2.39M]
  ------------------
  162|   191k|            if (ch == '.') {
  ------------------
  |  Branch (162:17): [True: 0, False: 191k]
  ------------------
  163|      0|                state = DP_S_MAX;
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  164|      0|                ch = *format++;
  165|      0|            } else
  166|   191k|                state = DP_S_MOD;
  ------------------
  |  |   50|   191k|#define DP_S_MOD        5
  ------------------
  167|   191k|            break;
  168|      0|        case DP_S_MAX:
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  |  Branch (168:9): [True: 0, False: 2.58M]
  ------------------
  169|      0|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (169:17): [True: 0, False: 0]
  ------------------
  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|      0|            } else if (ch == '*') {
  ------------------
  |  Branch (174:24): [True: 0, False: 0]
  ------------------
  175|      0|                max = va_arg(args, int);
  176|      0|                ch = *format++;
  177|      0|                state = DP_S_MOD;
  ------------------
  |  |   50|      0|#define DP_S_MOD        5
  ------------------
  178|      0|            } else
  179|      0|                state = DP_S_MOD;
  ------------------
  |  |   50|      0|#define DP_S_MOD        5
  ------------------
  180|      0|            break;
  181|   191k|        case DP_S_MOD:
  ------------------
  |  |   50|   191k|#define DP_S_MOD        5
  ------------------
  |  Branch (181:9): [True: 191k, False: 2.39M]
  ------------------
  182|   191k|            switch (ch) {
  183|      0|            case 'h':
  ------------------
  |  Branch (183:13): [True: 0, False: 191k]
  ------------------
  184|      0|                cflags = DP_C_SHORT;
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  185|      0|                ch = *format++;
  186|      0|                break;
  187|  39.9k|            case 'l':
  ------------------
  |  Branch (187:13): [True: 39.9k, False: 151k]
  ------------------
  188|  39.9k|                if (*format == 'l') {
  ------------------
  |  Branch (188:21): [True: 0, False: 39.9k]
  ------------------
  189|      0|                    cflags = DP_C_LLONG;
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  190|      0|                    format++;
  191|      0|                } else
  192|  39.9k|                    cflags = DP_C_LONG;
  ------------------
  |  |   72|  39.9k|#define DP_C_LONG       2
  ------------------
  193|  39.9k|                ch = *format++;
  194|  39.9k|                break;
  195|      0|            case 'q':
  ------------------
  |  Branch (195:13): [True: 0, False: 191k]
  ------------------
  196|      0|            case 'j':
  ------------------
  |  Branch (196:13): [True: 0, False: 191k]
  ------------------
  197|      0|                cflags = DP_C_LLONG;
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  198|      0|                ch = *format++;
  199|      0|                break;
  200|      0|            case 'L':
  ------------------
  |  Branch (200:13): [True: 0, False: 191k]
  ------------------
  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: 191k]
  ------------------
  205|      0|                cflags = DP_C_SIZE;
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  206|      0|                ch = *format++;
  207|      0|                break;
  208|   151k|            default:
  ------------------
  |  Branch (208:13): [True: 151k, False: 39.9k]
  ------------------
  209|   151k|                break;
  210|   191k|            }
  211|   191k|            state = DP_S_CONV;
  ------------------
  |  |   51|   191k|#define DP_S_CONV       6
  ------------------
  212|   191k|            break;
  213|   191k|        case DP_S_CONV:
  ------------------
  |  |   51|   191k|#define DP_S_CONV       6
  ------------------
  |  Branch (213:9): [True: 191k, False: 2.39M]
  ------------------
  214|   191k|            switch (ch) {
  215|      0|            case 'd':
  ------------------
  |  Branch (215:13): [True: 0, False: 191k]
  ------------------
  216|      0|            case 'i':
  ------------------
  |  Branch (216:13): [True: 0, False: 191k]
  ------------------
  217|      0|                switch (cflags) {
  218|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (218:17): [True: 0, False: 0]
  ------------------
  219|      0|                    value = (short int)va_arg(args, int);
  220|      0|                    break;
  221|      0|                case DP_C_LONG:
  ------------------
  |  |   72|      0|#define DP_C_LONG       2
  ------------------
  |  Branch (221:17): [True: 0, False: 0]
  ------------------
  222|      0|                    value = va_arg(args, long int);
  223|      0|                    break;
  224|      0|                case DP_C_LLONG:
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  |  Branch (224:17): [True: 0, False: 0]
  ------------------
  225|      0|                    value = va_arg(args, int64_t);
  226|      0|                    break;
  227|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (227:17): [True: 0, False: 0]
  ------------------
  228|      0|                    value = va_arg(args, ossl_ssize_t);
  229|      0|                    break;
  230|      0|                default:
  ------------------
  |  Branch (230:17): [True: 0, False: 0]
  ------------------
  231|      0|                    value = va_arg(args, int);
  232|      0|                    break;
  233|      0|                }
  234|      0|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min,
  ------------------
  |  Branch (234:21): [True: 0, False: 0]
  ------------------
  235|      0|                            max, flags))
  236|      0|                    return 0;
  237|      0|                break;
  238|      0|            case 'X':
  ------------------
  |  Branch (238:13): [True: 0, False: 191k]
  ------------------
  239|      0|                flags |= DP_F_UP;
  ------------------
  |  |   66|      0|#define DP_F_UP         (1 << 5)
  ------------------
  240|       |                /* FALLTHROUGH */
  241|      0|            case 'x':
  ------------------
  |  Branch (241:13): [True: 0, False: 191k]
  ------------------
  242|      0|            case 'o':
  ------------------
  |  Branch (242:13): [True: 0, False: 191k]
  ------------------
  243|  39.9k|            case 'u':
  ------------------
  |  Branch (243:13): [True: 39.9k, False: 151k]
  ------------------
  244|  39.9k|                flags |= DP_F_UNSIGNED;
  ------------------
  |  |   68|  39.9k|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  245|  39.9k|                switch (cflags) {
  246|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (246:17): [True: 0, False: 39.9k]
  ------------------
  247|      0|                    value = (unsigned short int)va_arg(args, unsigned int);
  248|      0|                    break;
  249|  39.9k|                case DP_C_LONG:
  ------------------
  |  |   72|  39.9k|#define DP_C_LONG       2
  ------------------
  |  Branch (249:17): [True: 39.9k, False: 0]
  ------------------
  250|  39.9k|                    value = va_arg(args, unsigned long int);
  251|  39.9k|                    break;
  252|      0|                case DP_C_LLONG:
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  |  Branch (252:17): [True: 0, False: 39.9k]
  ------------------
  253|      0|                    value = va_arg(args, uint64_t);
  254|      0|                    break;
  255|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (255:17): [True: 0, False: 39.9k]
  ------------------
  256|      0|                    value = va_arg(args, size_t);
  257|      0|                    break;
  258|      0|                default:
  ------------------
  |  Branch (258:17): [True: 0, False: 39.9k]
  ------------------
  259|      0|                    value = va_arg(args, unsigned int);
  260|      0|                    break;
  261|  39.9k|                }
  262|  39.9k|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value,
  ------------------
  |  Branch (262:21): [True: 0, False: 39.9k]
  ------------------
  263|  39.9k|                            ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
  ------------------
  |  Branch (263:29): [True: 0, False: 39.9k]
  |  Branch (263:46): [True: 39.9k, False: 0]
  ------------------
  264|  39.9k|                            min, max, flags))
  265|      0|                    return 0;
  266|  39.9k|                break;
  267|  39.9k|#ifndef OPENSSL_SYS_UEFI
  268|  39.9k|            case 'f':
  ------------------
  |  Branch (268:13): [True: 0, False: 191k]
  ------------------
  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: 191k]
  ------------------
  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: 191k]
  ------------------
  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: 191k]
  ------------------
  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: 191k]
  ------------------
  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|      0|            case 'c':
  ------------------
  |  Branch (311:13): [True: 0, False: 191k]
  ------------------
  312|      0|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen,
  ------------------
  |  Branch (312:21): [True: 0, False: 0]
  ------------------
  313|      0|                                 va_arg(args, int)))
  314|      0|                    return 0;
  315|      0|                break;
  316|   151k|            case 's':
  ------------------
  |  Branch (316:13): [True: 151k, False: 39.9k]
  ------------------
  317|   151k|                strvalue = va_arg(args, char *);
  318|   151k|                if (max < 0) {
  ------------------
  |  Branch (318:21): [True: 151k, False: 0]
  ------------------
  319|   151k|                    if (buffer)
  ------------------
  |  Branch (319:25): [True: 0, False: 151k]
  ------------------
  320|      0|                        max = INT_MAX;
  321|   151k|                    else
  322|   151k|                        max = *maxlen;
  323|   151k|                }
  324|   151k|                if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
  ------------------
  |  Branch (324:21): [True: 0, False: 151k]
  ------------------
  325|   151k|                            flags, min, max))
  326|      0|                    return 0;
  327|   151k|                break;
  328|   151k|            case 'p':
  ------------------
  |  Branch (328:13): [True: 0, False: 191k]
  ------------------
  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: 191k]
  ------------------
  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: 191k]
  ------------------
  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: 191k]
  ------------------
  346|       |                /* not supported yet, treat as next char */
  347|      0|                format++;
  348|      0|                break;
  349|      0|            default:
  ------------------
  |  Branch (349:13): [True: 0, False: 191k]
  ------------------
  350|       |                /* unknown, skip */
  351|      0|                break;
  352|   191k|            }
  353|   191k|            ch = *format++;
  354|   191k|            state = DP_S_DEFAULT;
  ------------------
  |  |   45|   191k|#define DP_S_DEFAULT    0
  ------------------
  355|   191k|            flags = cflags = min = 0;
  356|   191k|            max = -1;
  357|   191k|            break;
  358|  70.5k|        case DP_S_DONE:
  ------------------
  |  |   52|  70.5k|#define DP_S_DONE       7
  ------------------
  |  Branch (358:9): [True: 70.5k, False: 2.51M]
  ------------------
  359|  70.5k|            break;
  360|      0|        default:
  ------------------
  |  Branch (360:9): [True: 0, False: 2.58M]
  ------------------
  361|      0|            break;
  362|  2.58M|        }
  363|  2.58M|    }
  364|       |    /*
  365|       |     * We have to truncate if there is no dynamic buffer and we have filled the
  366|       |     * static buffer.
  367|       |     */
  368|  70.5k|    if (buffer == NULL) {
  ------------------
  |  Branch (368:9): [True: 70.5k, False: 0]
  ------------------
  369|  70.5k|        *truncated = (currlen > *maxlen - 1);
  370|  70.5k|        if (*truncated)
  ------------------
  |  Branch (370:13): [True: 0, False: 70.5k]
  ------------------
  371|      0|            currlen = *maxlen - 1;
  372|  70.5k|    }
  373|  70.5k|    if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
  ------------------
  |  Branch (373:9): [True: 0, False: 70.5k]
  ------------------
  374|      0|        return 0;
  375|  70.5k|    *retlen = currlen - 1;
  376|  70.5k|    return 1;
  377|  70.5k|}
bio_print.c:doapr_outch:
  833|  2.98M|{
  834|       |    /* If we haven't at least one buffer, someone has done a big booboo */
  835|  2.98M|    if (!ossl_assert(*sbuffer != NULL || buffer != NULL))
  ------------------
  |  |   52|  2.98M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2.98M, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  2.98M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (835:9): [True: 0, False: 2.98M]
  ------------------
  836|      0|        return 0;
  837|       |
  838|       |    /* |currlen| must always be <= |*maxlen| */
  839|  2.98M|    if (!ossl_assert(*currlen <= *maxlen))
  ------------------
  |  |   52|  2.98M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.98M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (839:9): [True: 0, False: 2.98M]
  ------------------
  840|      0|        return 0;
  841|       |
  842|  2.98M|    if (buffer && *currlen == *maxlen) {
  ------------------
  |  Branch (842:9): [True: 0, False: 2.98M]
  |  Branch (842:19): [True: 0, False: 0]
  ------------------
  843|      0|        if (*maxlen > INT_MAX - BUFFER_INC)
  ------------------
  |  |  828|      0|#define BUFFER_INC  1024
  ------------------
  |  Branch (843:13): [True: 0, False: 0]
  ------------------
  844|      0|            return 0;
  845|       |
  846|      0|        *maxlen += BUFFER_INC;
  ------------------
  |  |  828|      0|#define BUFFER_INC  1024
  ------------------
  847|      0|        if (*buffer == NULL) {
  ------------------
  |  Branch (847:13): [True: 0, False: 0]
  ------------------
  848|      0|            if ((*buffer = OPENSSL_malloc(*maxlen)) == NULL)
  ------------------
  |  |   97|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (848:17): [True: 0, False: 0]
  ------------------
  849|      0|                return 0;
  850|      0|            if (*currlen > 0) {
  ------------------
  |  Branch (850:17): [True: 0, False: 0]
  ------------------
  851|      0|                if (!ossl_assert(*sbuffer != NULL))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (851:21): [True: 0, False: 0]
  ------------------
  852|      0|                    return 0;
  853|      0|                memcpy(*buffer, *sbuffer, *currlen);
  854|      0|            }
  855|      0|            *sbuffer = NULL;
  856|      0|        } else {
  857|      0|            char *tmpbuf;
  858|       |
  859|      0|            tmpbuf = OPENSSL_realloc(*buffer, *maxlen);
  ------------------
  |  |  101|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  860|      0|            if (tmpbuf == NULL)
  ------------------
  |  Branch (860:17): [True: 0, False: 0]
  ------------------
  861|      0|                return 0;
  862|      0|            *buffer = tmpbuf;
  863|      0|        }
  864|      0|    }
  865|       |
  866|  2.98M|    if (*currlen < *maxlen) {
  ------------------
  |  Branch (866:9): [True: 2.98M, False: 0]
  ------------------
  867|  2.98M|        if (*sbuffer)
  ------------------
  |  Branch (867:13): [True: 2.98M, False: 0]
  ------------------
  868|  2.98M|            (*sbuffer)[(*currlen)++] = (char)c;
  869|      0|        else
  870|      0|            (*buffer)[(*currlen)++] = (char)c;
  871|  2.98M|    }
  872|       |
  873|  2.98M|    return 1;
  874|  2.98M|}
bio_print.c:fmtint:
  436|  39.9k|{
  437|  39.9k|    int signvalue = 0;
  438|  39.9k|    const char *prefix = "";
  439|  39.9k|    uint64_t uvalue;
  440|  39.9k|    char convert[DECIMAL_SIZE(value) + 3];
  441|  39.9k|    int place = 0;
  442|  39.9k|    int spadlen = 0;
  443|  39.9k|    int zpadlen = 0;
  444|  39.9k|    int caps = 0;
  445|       |
  446|  39.9k|    if (max < 0)
  ------------------
  |  Branch (446:9): [True: 39.9k, False: 0]
  ------------------
  447|  39.9k|        max = 0;
  448|  39.9k|    uvalue = value;
  449|  39.9k|    if (!(flags & DP_F_UNSIGNED)) {
  ------------------
  |  |   68|  39.9k|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  |  Branch (449:9): [True: 0, False: 39.9k]
  ------------------
  450|      0|        if (value < 0) {
  ------------------
  |  Branch (450:13): [True: 0, False: 0]
  ------------------
  451|      0|            signvalue = '-';
  452|      0|            uvalue = 0 - (uint64_t)value;
  453|      0|        } else if (flags & DP_F_PLUS)
  ------------------
  |  |   58|      0|#define DP_F_PLUS       (1 << 1)
  ------------------
  |  Branch (453:20): [True: 0, False: 0]
  ------------------
  454|      0|            signvalue = '+';
  455|      0|        else if (flags & DP_F_SPACE)
  ------------------
  |  |   60|      0|#define DP_F_SPACE      (1 << 2)
  ------------------
  |  Branch (455:18): [True: 0, False: 0]
  ------------------
  456|      0|            signvalue = ' ';
  457|      0|    }
  458|  39.9k|    if (flags & DP_F_NUM) {
  ------------------
  |  |   62|  39.9k|#define DP_F_NUM        (1 << 3)
  ------------------
  |  Branch (458:9): [True: 0, False: 39.9k]
  ------------------
  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|  39.9k|    if (flags & DP_F_UP)
  ------------------
  |  |   66|  39.9k|#define DP_F_UP         (1 << 5)
  ------------------
  |  Branch (464:9): [True: 0, False: 39.9k]
  ------------------
  465|      0|        caps = 1;
  466|   175k|    do {
  467|   175k|        convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
  ------------------
  |  Branch (467:29): [True: 0, False: 175k]
  ------------------
  468|   175k|            [uvalue % (unsigned)base];
  469|   175k|        uvalue = (uvalue / (unsigned)base);
  470|   175k|    } while (uvalue && (place < (int)sizeof(convert)));
  ------------------
  |  Branch (470:14): [True: 135k, False: 39.9k]
  |  Branch (470:24): [True: 135k, False: 0]
  ------------------
  471|  39.9k|    if (place == sizeof(convert))
  ------------------
  |  Branch (471:9): [True: 0, False: 39.9k]
  ------------------
  472|      0|        place--;
  473|  39.9k|    convert[place] = 0;
  474|       |
  475|  39.9k|    zpadlen = max - place;
  476|  39.9k|    spadlen =
  477|  39.9k|        min - OSSL_MAX(max, place) - (signvalue ? 1 : 0) - strlen(prefix);
  ------------------
  |  |   84|  39.9k|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 39.9k]
  |  |  ------------------
  ------------------
  |  Branch (477:39): [True: 0, False: 39.9k]
  ------------------
  478|  39.9k|    if (zpadlen < 0)
  ------------------
  |  Branch (478:9): [True: 39.9k, False: 0]
  ------------------
  479|  39.9k|        zpadlen = 0;
  480|  39.9k|    if (spadlen < 0)
  ------------------
  |  Branch (480:9): [True: 35.4k, False: 4.50k]
  ------------------
  481|  35.4k|        spadlen = 0;
  482|  39.9k|    if (flags & DP_F_ZERO) {
  ------------------
  |  |   64|  39.9k|#define DP_F_ZERO       (1 << 4)
  ------------------
  |  Branch (482:9): [True: 4.50k, False: 35.4k]
  ------------------
  483|  4.50k|        zpadlen = OSSL_MAX(zpadlen, spadlen);
  ------------------
  |  |   84|  4.50k|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 3.46k, False: 1.03k]
  |  |  ------------------
  ------------------
  484|  4.50k|        spadlen = 0;
  485|  4.50k|    }
  486|  39.9k|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  39.9k|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (486:9): [True: 0, False: 39.9k]
  ------------------
  487|      0|        spadlen = -spadlen;
  488|       |
  489|       |    /* spaces */
  490|  39.9k|    while (spadlen > 0) {
  ------------------
  |  Branch (490:12): [True: 0, False: 39.9k]
  ------------------
  491|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (491:13): [True: 0, False: 0]
  ------------------
  492|      0|            return 0;
  493|      0|        --spadlen;
  494|      0|    }
  495|       |
  496|       |    /* sign */
  497|  39.9k|    if (signvalue)
  ------------------
  |  Branch (497:9): [True: 0, False: 39.9k]
  ------------------
  498|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
  ------------------
  |  Branch (498:13): [True: 0, False: 0]
  ------------------
  499|      0|            return 0;
  500|       |
  501|       |    /* prefix */
  502|  39.9k|    while (*prefix) {
  ------------------
  |  Branch (502:12): [True: 0, False: 39.9k]
  ------------------
  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|  39.9k|    if (zpadlen > 0) {
  ------------------
  |  Branch (509:9): [True: 1.03k, False: 38.9k]
  ------------------
  510|  2.09k|        while (zpadlen > 0) {
  ------------------
  |  Branch (510:16): [True: 1.06k, False: 1.03k]
  ------------------
  511|  1.06k|            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
  ------------------
  |  Branch (511:17): [True: 0, False: 1.06k]
  ------------------
  512|      0|                return 0;
  513|  1.06k|            --zpadlen;
  514|  1.06k|        }
  515|  1.03k|    }
  516|       |    /* digits */
  517|   215k|    while (place > 0) {
  ------------------
  |  Branch (517:12): [True: 175k, False: 39.9k]
  ------------------
  518|   175k|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]))
  ------------------
  |  Branch (518:13): [True: 0, False: 175k]
  ------------------
  519|      0|            return 0;
  520|   175k|    }
  521|       |
  522|       |    /* left justified spaces */
  523|  39.9k|    while (spadlen < 0) {
  ------------------
  |  Branch (523:12): [True: 0, False: 39.9k]
  ------------------
  524|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (524:13): [True: 0, False: 0]
  ------------------
  525|      0|            return 0;
  526|      0|        ++spadlen;
  527|      0|    }
  528|  39.9k|    return 1;
  529|  39.9k|}
bio_print.c:fmtstr:
  384|   151k|{
  385|   151k|    int padlen;
  386|   151k|    size_t strln;
  387|   151k|    int cnt = 0;
  388|       |
  389|   151k|    if (value == 0)
  ------------------
  |  Branch (389:9): [True: 0, False: 151k]
  ------------------
  390|      0|        value = "<NULL>";
  391|       |
  392|   151k|    strln = OPENSSL_strnlen(value, max < 0 ? SIZE_MAX : (size_t)max);
  ------------------
  |  Branch (392:36): [True: 0, False: 151k]
  ------------------
  393|       |
  394|   151k|    padlen = min - strln;
  395|   151k|    if (min < 0 || padlen < 0)
  ------------------
  |  Branch (395:9): [True: 0, False: 151k]
  |  Branch (395:20): [True: 151k, False: 0]
  ------------------
  396|   151k|        padlen = 0;
  397|   151k|    if (max >= 0) {
  ------------------
  |  Branch (397:9): [True: 151k, False: 0]
  ------------------
  398|       |        /*
  399|       |         * Calculate the maximum output including padding.
  400|       |         * Make sure max doesn't overflow into negativity
  401|       |         */
  402|   151k|        if (max < INT_MAX - padlen)
  ------------------
  |  Branch (402:13): [True: 151k, False: 0]
  ------------------
  403|   151k|            max += padlen;
  404|      0|        else
  405|      0|            max = INT_MAX;
  406|   151k|    }
  407|   151k|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|   151k|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (407:9): [True: 0, False: 151k]
  ------------------
  408|      0|        padlen = -padlen;
  409|       |
  410|   151k|    while ((padlen > 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (410:12): [True: 0, False: 151k]
  |  Branch (410:29): [True: 0, False: 0]
  |  Branch (410:40): [True: 0, False: 0]
  ------------------
  411|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (411:13): [True: 0, False: 0]
  ------------------
  412|      0|            return 0;
  413|      0|        --padlen;
  414|      0|        ++cnt;
  415|      0|    }
  416|  1.53M|    while (strln > 0 && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (416:12): [True: 1.38M, False: 151k]
  |  Branch (416:26): [True: 0, False: 1.38M]
  |  Branch (416:37): [True: 1.38M, False: 0]
  ------------------
  417|  1.38M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
  ------------------
  |  Branch (417:13): [True: 0, False: 1.38M]
  ------------------
  418|      0|            return 0;
  419|  1.38M|        --strln;
  420|  1.38M|        ++cnt;
  421|  1.38M|    }
  422|   151k|    while ((padlen < 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (422:12): [True: 0, False: 151k]
  |  Branch (422:29): [True: 0, False: 0]
  |  Branch (422:40): [True: 0, False: 0]
  ------------------
  423|      0|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (423:13): [True: 0, False: 0]
  ------------------
  424|      0|            return 0;
  425|      0|        ++padlen;
  426|      0|        ++cnt;
  427|      0|    }
  428|   151k|    return 1;
  429|   151k|}

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

ossl_bio_core_globals_free:
   26|      2|{
   27|      2|    OPENSSL_free(vbcg);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   28|      2|}
ossl_bio_core_globals_new:
   31|      2|{
   32|      2|    return OPENSSL_zalloc(sizeof(BIO_CORE_GLOBALS));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      2|}

BIO_new_file:
   58|      1|{
   59|      1|    BIO  *ret;
   60|      1|    FILE *file = openssl_fopen(filename, mode);
   61|      1|    int fp_flags = BIO_CLOSE;
  ------------------
  |  |   80|      1|# define BIO_CLOSE               0x01
  ------------------
   62|       |
   63|      1|    if (strchr(mode, 'b') == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 1]
  ------------------
   64|      0|        fp_flags |= BIO_FP_TEXT;
  ------------------
  |  |  214|      0|# define BIO_FP_TEXT             0x10
  ------------------
   65|       |
   66|      1|    if (file == NULL) {
  ------------------
  |  Branch (66:9): [True: 1, False: 0]
  ------------------
   67|      1|        ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      1|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      1|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   72|      1|# define ERR_LIB_SYS             2
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      1|# define get_last_sys_error()    errno
  ------------------
   68|      1|                       "calling fopen(%s, %s)",
   69|      1|                       filename, mode);
   70|      1|        if (errno == ENOENT
  ------------------
  |  Branch (70:13): [True: 1, False: 0]
  ------------------
   71|      1|#ifdef ENXIO
   72|      1|            || errno == ENXIO
  ------------------
  |  Branch (72:16): [True: 0, False: 0]
  ------------------
   73|      1|#endif
   74|      1|            )
   75|      1|            ERR_raise(ERR_LIB_BIO, BIO_R_NO_SUCH_FILE);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
   76|      0|        else
   77|      1|            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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   78|      1|        return NULL;
   79|      1|    }
   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);
  ------------------
  |  |  559|      0|# define BIO_set_fp(b,fp,c)      BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)(fp))
  |  |  ------------------
  |  |  |  |  431|      0|# define BIO_C_SET_FILE_PTR                      106
  |  |  ------------------
  ------------------
   88|      0|    return ret;
   89|      0|}

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

BIO_s_null:
   36|    955|{
   37|    955|    return &null_method;
   38|    955|}
bss_null.c:null_write:
   46|    955|{
   47|    955|    return inl;
   48|    955|}

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

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

BN_add:
   15|  48.4k|{
   16|  48.4k|    int ret, r_neg, cmp_res;
   17|       |
   18|  48.4k|    bn_check_top(a);
   19|  48.4k|    bn_check_top(b);
   20|       |
   21|  48.4k|    if (a->neg == b->neg) {
  ------------------
  |  Branch (21:9): [True: 0, False: 48.4k]
  ------------------
   22|      0|        r_neg = a->neg;
   23|      0|        ret = BN_uadd(r, a, b);
   24|  48.4k|    } else {
   25|  48.4k|        cmp_res = BN_ucmp(a, b);
   26|  48.4k|        if (cmp_res > 0) {
  ------------------
  |  Branch (26:13): [True: 0, False: 48.4k]
  ------------------
   27|      0|            r_neg = a->neg;
   28|      0|            ret = BN_usub(r, a, b);
   29|  48.4k|        } else if (cmp_res < 0) {
  ------------------
  |  Branch (29:20): [True: 48.4k, False: 0]
  ------------------
   30|  48.4k|            r_neg = b->neg;
   31|  48.4k|            ret = BN_usub(r, b, a);
   32|  48.4k|        } 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|  48.4k|    }
   38|       |
   39|  48.4k|    r->neg = r_neg;
   40|  48.4k|    bn_check_top(r);
   41|  48.4k|    return ret;
   42|  48.4k|}
BN_sub:
   46|  62.1k|{
   47|  62.1k|    int ret, r_neg, cmp_res;
   48|       |
   49|  62.1k|    bn_check_top(a);
   50|  62.1k|    bn_check_top(b);
   51|       |
   52|  62.1k|    if (a->neg != b->neg) {
  ------------------
  |  Branch (52:9): [True: 0, False: 62.1k]
  ------------------
   53|      0|        r_neg = a->neg;
   54|      0|        ret = BN_uadd(r, a, b);
   55|  62.1k|    } else {
   56|  62.1k|        cmp_res = BN_ucmp(a, b);
   57|  62.1k|        if (cmp_res > 0) {
  ------------------
  |  Branch (57:13): [True: 13.5k, False: 48.5k]
  ------------------
   58|  13.5k|            r_neg = a->neg;
   59|  13.5k|            ret = BN_usub(r, a, b);
   60|  48.5k|        } else if (cmp_res < 0) {
  ------------------
  |  Branch (60:20): [True: 48.4k, False: 133]
  ------------------
   61|  48.4k|            r_neg = !b->neg;
   62|  48.4k|            ret = BN_usub(r, b, a);
   63|  48.4k|        } else {
   64|    133|            r_neg = 0;
   65|    133|            BN_zero(r);
  ------------------
  |  |  202|    133|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
   66|    133|            ret = 1;
   67|    133|        }
   68|  62.1k|    }
   69|       |
   70|  62.1k|    r->neg = r_neg;
   71|  62.1k|    bn_check_top(r);
   72|  62.1k|    return ret;
   73|  62.1k|}
BN_uadd:
   77|  4.52M|{
   78|  4.52M|    int max, min, dif;
   79|  4.52M|    const BN_ULONG *ap, *bp;
   80|  4.52M|    BN_ULONG *rp, carry, t1, t2;
  ------------------
  |  |   37|  4.52M|#  define BN_ULONG        unsigned long
  ------------------
   81|       |
   82|  4.52M|    bn_check_top(a);
   83|  4.52M|    bn_check_top(b);
   84|       |
   85|  4.52M|    if (a->top < b->top) {
  ------------------
  |  Branch (85:9): [True: 91.1k, False: 4.43M]
  ------------------
   86|  91.1k|        const BIGNUM *tmp;
   87|       |
   88|  91.1k|        tmp = a;
   89|  91.1k|        a = b;
   90|  91.1k|        b = tmp;
   91|  91.1k|    }
   92|  4.52M|    max = a->top;
   93|  4.52M|    min = b->top;
   94|  4.52M|    dif = max - min;
   95|       |
   96|  4.52M|    if (bn_wexpand(r, max + 1) == NULL)
  ------------------
  |  Branch (96:9): [True: 0, False: 4.52M]
  ------------------
   97|      0|        return 0;
   98|       |
   99|  4.52M|    r->top = max;
  100|       |
  101|  4.52M|    ap = a->d;
  102|  4.52M|    bp = b->d;
  103|  4.52M|    rp = r->d;
  104|       |
  105|  4.52M|    carry = bn_add_words(rp, ap, bp, min);
  106|  4.52M|    rp += min;
  107|  4.52M|    ap += min;
  108|       |
  109|  5.40M|    while (dif) {
  ------------------
  |  Branch (109:12): [True: 880k, False: 4.52M]
  ------------------
  110|   880k|        dif--;
  111|   880k|        t1 = *(ap++);
  112|   880k|        t2 = (t1 + carry) & BN_MASK2;
  ------------------
  |  |   94|   880k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  113|   880k|        *(rp++) = t2;
  114|   880k|        carry &= (t2 == 0);
  115|   880k|    }
  116|  4.52M|    *rp = carry;
  117|  4.52M|    r->top += carry;
  118|       |
  119|  4.52M|    r->neg = 0;
  120|  4.52M|    bn_check_top(r);
  121|  4.52M|    return 1;
  122|  4.52M|}
BN_usub:
  126|  3.07M|{
  127|  3.07M|    int max, min, dif;
  128|  3.07M|    BN_ULONG t1, t2, borrow, *rp;
  ------------------
  |  |   37|  3.07M|#  define BN_ULONG        unsigned long
  ------------------
  129|  3.07M|    const BN_ULONG *ap, *bp;
  130|       |
  131|  3.07M|    bn_check_top(a);
  132|  3.07M|    bn_check_top(b);
  133|       |
  134|  3.07M|    max = a->top;
  135|  3.07M|    min = b->top;
  136|  3.07M|    dif = max - min;
  137|       |
  138|  3.07M|    if (dif < 0) {              /* hmm... should not be happening */
  ------------------
  |  Branch (138:9): [True: 0, False: 3.07M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  140|      0|        return 0;
  141|      0|    }
  142|       |
  143|  3.07M|    if (bn_wexpand(r, max) == NULL)
  ------------------
  |  Branch (143:9): [True: 0, False: 3.07M]
  ------------------
  144|      0|        return 0;
  145|       |
  146|  3.07M|    ap = a->d;
  147|  3.07M|    bp = b->d;
  148|  3.07M|    rp = r->d;
  149|       |
  150|  3.07M|    borrow = bn_sub_words(rp, ap, bp, min);
  151|  3.07M|    ap += min;
  152|  3.07M|    rp += min;
  153|       |
  154|  3.10M|    while (dif) {
  ------------------
  |  Branch (154:12): [True: 35.1k, False: 3.07M]
  ------------------
  155|  35.1k|        dif--;
  156|  35.1k|        t1 = *(ap++);
  157|  35.1k|        t2 = (t1 - borrow) & BN_MASK2;
  ------------------
  |  |   94|  35.1k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  158|  35.1k|        *(rp++) = t2;
  159|  35.1k|        borrow &= (t1 == 0);
  160|  35.1k|    }
  161|       |
  162|  3.12M|    while (max && *--rp == 0)
  ------------------
  |  Branch (162:12): [True: 3.07M, False: 48.7k]
  |  Branch (162:19): [True: 52.9k, False: 3.02M]
  ------------------
  163|  52.9k|        max--;
  164|       |
  165|  3.07M|    r->top = max;
  166|  3.07M|    r->neg = 0;
  167|  3.07M|    bn_pollute(r);
  168|       |
  169|  3.07M|    return 1;
  170|  3.07M|}

BN_BLINDING_free:
   80|  8.99k|{
   81|  8.99k|    if (r == NULL)
  ------------------
  |  Branch (81:9): [True: 8.99k, False: 0]
  ------------------
   82|  8.99k|        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);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   89|      0|}

BN_bn2dec:
   51|  3.52k|{
   52|  3.52k|    int i = 0, num, ok = 0, n, tbytes;
   53|  3.52k|    char *buf = NULL;
   54|  3.52k|    char *p;
   55|  3.52k|    BIGNUM *t = NULL;
   56|  3.52k|    BN_ULONG *bn_data = NULL, *lp;
  ------------------
  |  |   37|  3.52k|#  define BN_ULONG        unsigned long
  ------------------
   57|  3.52k|    int bn_data_num;
   58|       |
   59|       |    /*-
   60|       |     * get an upper bound for the length of the decimal integer
   61|       |     * num <= (BN_num_bits(a) + 1) * log(2)
   62|       |     *     <= 3 * BN_num_bits(a) * 0.101 + log(2) + 1     (rounding error)
   63|       |     *     <= 3 * BN_num_bits(a) / 10 + 3 * BN_num_bits / 1000 + 1 + 1
   64|       |     */
   65|  3.52k|    i = BN_num_bits(a) * 3;
   66|  3.52k|    num = (i / 10 + i / 1000 + 1) + 1;
   67|  3.52k|    tbytes = num + 3;   /* negative and terminator and one spare? */
   68|  3.52k|    bn_data_num = num / BN_DEC_NUM + 1;
  ------------------
  |  |   99|  3.52k|#  define BN_DEC_NUM      19
  ------------------
   69|  3.52k|    bn_data = OPENSSL_malloc(bn_data_num * sizeof(BN_ULONG));
  ------------------
  |  |   97|  3.52k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.52k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.52k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   70|  3.52k|    buf = OPENSSL_malloc(tbytes);
  ------------------
  |  |   97|  3.52k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.52k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.52k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   71|  3.52k|    if (buf == NULL || bn_data == NULL)
  ------------------
  |  Branch (71:9): [True: 0, False: 3.52k]
  |  Branch (71:24): [True: 0, False: 3.52k]
  ------------------
   72|      0|        goto err;
   73|  3.52k|    if ((t = BN_dup(a)) == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 3.52k]
  ------------------
   74|      0|        goto err;
   75|       |
   76|  3.52k|    p = buf;
   77|  3.52k|    lp = bn_data;
   78|  3.52k|    if (BN_is_zero(t)) {
  ------------------
  |  Branch (78:9): [True: 0, False: 3.52k]
  ------------------
   79|      0|        *p++ = '0';
   80|      0|        *p++ = '\0';
   81|  3.52k|    } else {
   82|  3.52k|        if (BN_is_negative(t))
  ------------------
  |  Branch (82:13): [True: 0, False: 3.52k]
  ------------------
   83|      0|            *p++ = '-';
   84|       |
   85|  11.5k|        while (!BN_is_zero(t)) {
  ------------------
  |  Branch (85:16): [True: 8.02k, False: 3.52k]
  ------------------
   86|  8.02k|            if (lp - bn_data >= bn_data_num)
  ------------------
  |  Branch (86:17): [True: 0, False: 8.02k]
  ------------------
   87|      0|                goto err;
   88|  8.02k|            *lp = BN_div_word(t, BN_DEC_CONV);
  ------------------
  |  |   98|  8.02k|#  define BN_DEC_CONV     (10000000000000000000UL)
  ------------------
   89|  8.02k|            if (*lp == (BN_ULONG)-1)
  ------------------
  |  Branch (89:17): [True: 0, False: 8.02k]
  ------------------
   90|      0|                goto err;
   91|  8.02k|            lp++;
   92|  8.02k|        }
   93|  3.52k|        lp--;
   94|       |        /*
   95|       |         * We now have a series of blocks, BN_DEC_NUM chars in length, where
   96|       |         * the last one needs truncation. The blocks need to be reversed in
   97|       |         * order.
   98|       |         */
   99|  3.52k|        n = BIO_snprintf(p, tbytes - (size_t)(p - buf), BN_DEC_FMT1, *lp);
  ------------------
  |  |  100|  3.52k|#  define BN_DEC_FMT1     "%lu"
  ------------------
  100|  3.52k|        if (n < 0)
  ------------------
  |  Branch (100:13): [True: 0, False: 3.52k]
  ------------------
  101|      0|            goto err;
  102|  3.52k|        p += n;
  103|  8.02k|        while (lp != bn_data) {
  ------------------
  |  Branch (103:16): [True: 4.50k, False: 3.52k]
  ------------------
  104|  4.50k|            lp--;
  105|  4.50k|            n = BIO_snprintf(p, tbytes - (size_t)(p - buf), BN_DEC_FMT2, *lp);
  ------------------
  |  |  101|  4.50k|#  define BN_DEC_FMT2     "%019lu"
  ------------------
  106|  4.50k|            if (n < 0)
  ------------------
  |  Branch (106:17): [True: 0, False: 4.50k]
  ------------------
  107|      0|                goto err;
  108|  4.50k|            p += n;
  109|  4.50k|        }
  110|  3.52k|    }
  111|  3.52k|    ok = 1;
  112|  3.52k| err:
  113|  3.52k|    OPENSSL_free(bn_data);
  ------------------
  |  |  107|  3.52k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.52k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.52k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  114|  3.52k|    BN_free(t);
  115|  3.52k|    if (ok)
  ------------------
  |  Branch (115:9): [True: 3.52k, False: 0]
  ------------------
  116|  3.52k|        return buf;
  117|      0|    OPENSSL_free(buf);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  118|      0|    return NULL;
  119|  3.52k|}

BN_CTX_new_ex:
  119|   120k|{
  120|   120k|    BN_CTX *ret;
  121|       |
  122|   120k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |   99|   120k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   120k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   120k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (122:9): [True: 0, False: 120k]
  ------------------
  123|      0|        return NULL;
  124|       |    /* Initialise the structure */
  125|   120k|    BN_POOL_init(&ret->pool);
  126|   120k|    BN_STACK_init(&ret->stack);
  127|   120k|    ret->libctx = ctx;
  128|   120k|    return ret;
  129|   120k|}
BN_CTX_new:
  133|  8.93k|{
  134|  8.93k|    return BN_CTX_new_ex(NULL);
  135|  8.93k|}
BN_CTX_free:
  155|   353k|{
  156|   353k|    if (ctx == NULL)
  ------------------
  |  Branch (156:9): [True: 232k, False: 120k]
  ------------------
  157|   232k|        return;
  158|   120k|#ifndef FIPS_MODULE
  159|   120k|    OSSL_TRACE_BEGIN(BN_CTX) {
  ------------------
  |  |  219|   120k|    do {                                        \
  |  |  220|   120k|        BIO *trc_out = NULL;                    \
  |  |  221|   120k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221: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|   120k|    } OSSL_TRACE_END(BN_CTX);
  ------------------
  |  |  224|   120k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  173|   120k|#endif
  174|   120k|    BN_STACK_finish(&ctx->stack);
  175|   120k|    BN_POOL_finish(&ctx->pool);
  176|   120k|    OPENSSL_free(ctx);
  ------------------
  |  |  107|   120k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   120k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   120k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|   120k|}
BN_CTX_start:
  180|  34.7M|{
  181|  34.7M|    CTXDBG("ENTER BN_CTX_start()", ctx);
  ------------------
  |  |  110|  34.7M|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  219|  34.7M|    do {                                        \
  |  |  |  |  220|  34.7M|        BIO *trc_out = NULL;                    \
  |  |  |  |  221|  34.7M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  34.7M|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  224|  34.7M|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|       |    /* If we're already overflowing ... */
  183|  34.7M|    if (ctx->err_stack || ctx->too_many)
  ------------------
  |  Branch (183:9): [True: 0, False: 34.7M]
  |  Branch (183:27): [True: 0, False: 34.7M]
  ------------------
  184|      0|        ctx->err_stack++;
  185|       |    /* (Try to) get a new frame pointer */
  186|  34.7M|    else if (!BN_STACK_push(&ctx->stack, ctx->used)) {
  ------------------
  |  Branch (186:14): [True: 0, False: 34.7M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  188|      0|        ctx->err_stack++;
  189|      0|    }
  190|  34.7M|    CTXDBG("LEAVE BN_CTX_start()", ctx);
  ------------------
  |  |  110|  34.7M|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  219|  34.7M|    do {                                        \
  |  |  |  |  220|  34.7M|        BIO *trc_out = NULL;                    \
  |  |  |  |  221|  34.7M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  34.7M|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  224|  34.7M|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  34.7M|}
BN_CTX_end:
  194|  34.7M|{
  195|  34.7M|    if (ctx == NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 34.7M]
  ------------------
  196|      0|        return;
  197|  34.7M|    CTXDBG("ENTER BN_CTX_end()", ctx);
  ------------------
  |  |  110|  34.7M|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  219|  34.7M|    do {                                        \
  |  |  |  |  220|  34.7M|        BIO *trc_out = NULL;                    \
  |  |  |  |  221|  34.7M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  34.7M|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  224|  34.7M|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|  34.7M|    if (ctx->err_stack)
  ------------------
  |  Branch (198:9): [True: 0, False: 34.7M]
  ------------------
  199|      0|        ctx->err_stack--;
  200|  34.7M|    else {
  201|  34.7M|        unsigned int fp = BN_STACK_pop(&ctx->stack);
  202|       |        /* Does this stack frame have anything to release? */
  203|  34.7M|        if (fp < ctx->used)
  ------------------
  |  Branch (203:13): [True: 34.2M, False: 505k]
  ------------------
  204|  34.2M|            BN_POOL_release(&ctx->pool, ctx->used - fp);
  205|  34.7M|        ctx->used = fp;
  206|       |        /* Unjam "too_many" in case "get" had failed */
  207|  34.7M|        ctx->too_many = 0;
  208|  34.7M|    }
  209|  34.7M|    CTXDBG("LEAVE BN_CTX_end()", ctx);
  ------------------
  |  |  110|  34.7M|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  219|  34.7M|    do {                                        \
  |  |  |  |  220|  34.7M|        BIO *trc_out = NULL;                    \
  |  |  |  |  221|  34.7M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  34.7M|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  224|  34.7M|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  34.7M|}
BN_CTX_get:
  213|  70.1M|{
  214|  70.1M|    BIGNUM *ret;
  215|       |
  216|  70.1M|    CTXDBG("ENTER BN_CTX_get()", ctx);
  ------------------
  |  |  110|  70.1M|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  219|  70.1M|    do {                                        \
  |  |  |  |  220|  70.1M|        BIO *trc_out = NULL;                    \
  |  |  |  |  221|  70.1M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  70.1M|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  224|  70.1M|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  217|  70.1M|    if (ctx->err_stack || ctx->too_many)
  ------------------
  |  Branch (217:9): [True: 0, False: 70.1M]
  |  Branch (217:27): [True: 0, False: 70.1M]
  ------------------
  218|      0|        return NULL;
  219|  70.1M|    if ((ret = BN_POOL_get(&ctx->pool, ctx->flags)) == NULL) {
  ------------------
  |  Branch (219:9): [True: 0, False: 70.1M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|  70.1M|    BN_zero(ret);
  ------------------
  |  |  202|  70.1M|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  230|       |    /* clear BN_FLG_CONSTTIME if leaked from previous frames */
  231|  70.1M|    ret->flags &= (~BN_FLG_CONSTTIME);
  ------------------
  |  |   67|  70.1M|# define BN_FLG_CONSTTIME        0x04
  ------------------
  232|  70.1M|    ctx->used++;
  233|  70.1M|    CTXDBG("LEAVE BN_CTX_get()", ctx);
  ------------------
  |  |  110|  70.1M|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  219|  70.1M|    do {                                        \
  |  |  |  |  220|  70.1M|        BIO *trc_out = NULL;                    \
  |  |  |  |  221|  70.1M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  70.1M|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  224|  70.1M|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|  70.1M|    return ret;
  235|  70.1M|}
ossl_bn_get_libctx:
  238|  30.0k|{
  239|  30.0k|    if (ctx == NULL)
  ------------------
  |  Branch (239:9): [True: 0, False: 30.0k]
  ------------------
  240|      0|        return NULL;
  241|  30.0k|    return ctx->libctx;
  242|  30.0k|}
bn_ctx.c:BN_STACK_init:
  249|   120k|{
  250|   120k|    st->indexes = NULL;
  251|   120k|    st->depth = st->size = 0;
  252|   120k|}
bn_ctx.c:BN_STACK_finish:
  255|   120k|{
  256|   120k|    OPENSSL_free(st->indexes);
  ------------------
  |  |  107|   120k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   120k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   120k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  257|   120k|    st->indexes = NULL;
  258|   120k|}
bn_ctx.c:BN_STACK_push:
  262|  34.7M|{
  263|  34.7M|    if (st->depth == st->size) {
  ------------------
  |  Branch (263:9): [True: 101k, False: 34.6M]
  ------------------
  264|       |        /* Need to expand */
  265|   101k|        unsigned int newsize =
  266|   101k|            st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
  ------------------
  |  |   17|   101k|#define BN_CTX_START_FRAMES     32
  ------------------
  |  Branch (266:13): [True: 0, False: 101k]
  ------------------
  267|   101k|        unsigned int *newitems;
  268|       |
  269|   101k|        if ((newitems = OPENSSL_malloc(sizeof(*newitems) * newsize)) == NULL)
  ------------------
  |  |   97|   101k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   101k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   101k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (269:13): [True: 0, False: 101k]
  ------------------
  270|      0|            return 0;
  271|   101k|        if (st->depth)
  ------------------
  |  Branch (271:13): [True: 0, False: 101k]
  ------------------
  272|      0|            memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
  273|   101k|        OPENSSL_free(st->indexes);
  ------------------
  |  |  107|   101k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   101k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   101k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  274|   101k|        st->indexes = newitems;
  275|   101k|        st->size = newsize;
  276|   101k|    }
  277|  34.7M|    st->indexes[(st->depth)++] = idx;
  278|  34.7M|    return 1;
  279|  34.7M|}
bn_ctx.c:BN_STACK_pop:
  282|  34.7M|{
  283|  34.7M|    return st->indexes[--(st->depth)];
  284|  34.7M|}
bn_ctx.c:BN_POOL_init:
  291|   120k|{
  292|   120k|    p->head = p->current = p->tail = NULL;
  293|   120k|    p->used = p->size = 0;
  294|   120k|}
bn_ctx.c:BN_POOL_finish:
  297|   120k|{
  298|   120k|    unsigned int loop;
  299|   120k|    BIGNUM *bn;
  300|       |
  301|   218k|    while (p->head) {
  ------------------
  |  Branch (301:12): [True: 97.9k, False: 120k]
  ------------------
  302|  1.66M|        for (loop = 0, bn = p->head->vals; loop++ < BN_CTX_POOL_SIZE; bn++)
  ------------------
  |  |   15|  1.66M|#define BN_CTX_POOL_SIZE        16
  ------------------
  |  Branch (302:44): [True: 1.56M, False: 97.9k]
  ------------------
  303|  1.56M|            if (bn->d)
  ------------------
  |  Branch (303:17): [True: 937k, False: 628k]
  ------------------
  304|   937k|                BN_clear_free(bn);
  305|  97.9k|        p->current = p->head->next;
  306|  97.9k|        OPENSSL_free(p->head);
  ------------------
  |  |  107|  97.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  97.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  97.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  307|  97.9k|        p->head = p->current;
  308|  97.9k|    }
  309|   120k|}
bn_ctx.c:BN_POOL_get:
  313|  70.1M|{
  314|  70.1M|    BIGNUM *bn;
  315|  70.1M|    unsigned int loop;
  316|       |
  317|       |    /* Full; allocate a new pool item and link it in. */
  318|  70.1M|    if (p->used == p->size) {
  ------------------
  |  Branch (318:9): [True: 97.9k, False: 70.0M]
  ------------------
  319|  97.9k|        BN_POOL_ITEM *item;
  320|       |
  321|  97.9k|        if ((item = OPENSSL_malloc(sizeof(*item))) == NULL)
  ------------------
  |  |   97|  97.9k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  97.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  97.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (321:13): [True: 0, False: 97.9k]
  ------------------
  322|      0|            return NULL;
  323|  1.66M|        for (loop = 0, bn = item->vals; loop++ < BN_CTX_POOL_SIZE; bn++) {
  ------------------
  |  |   15|  1.66M|#define BN_CTX_POOL_SIZE        16
  ------------------
  |  Branch (323:41): [True: 1.56M, False: 97.9k]
  ------------------
  324|  1.56M|            bn_init(bn);
  325|  1.56M|            if ((flag & BN_FLG_SECURE) != 0)
  ------------------
  |  |   68|  1.56M|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (325:17): [True: 0, False: 1.56M]
  ------------------
  326|      0|                BN_set_flags(bn, BN_FLG_SECURE);
  ------------------
  |  |   68|      0|# define BN_FLG_SECURE           0x08
  ------------------
  327|  1.56M|        }
  328|  97.9k|        item->prev = p->tail;
  329|  97.9k|        item->next = NULL;
  330|       |
  331|  97.9k|        if (p->head == NULL)
  ------------------
  |  Branch (331:13): [True: 83.2k, False: 14.6k]
  ------------------
  332|  83.2k|            p->head = p->current = p->tail = item;
  333|  14.6k|        else {
  334|  14.6k|            p->tail->next = item;
  335|  14.6k|            p->tail = item;
  336|  14.6k|            p->current = item;
  337|  14.6k|        }
  338|  97.9k|        p->size += BN_CTX_POOL_SIZE;
  ------------------
  |  |   15|  97.9k|#define BN_CTX_POOL_SIZE        16
  ------------------
  339|  97.9k|        p->used++;
  340|       |        /* Return the first bignum from the new pool */
  341|  97.9k|        return item->vals;
  342|  97.9k|    }
  343|       |
  344|  70.0M|    if (!p->used)
  ------------------
  |  Branch (344:9): [True: 94.2k, False: 69.9M]
  ------------------
  345|  94.2k|        p->current = p->head;
  346|  69.9M|    else if ((p->used % BN_CTX_POOL_SIZE) == 0)
  ------------------
  |  |   15|  69.9M|#define BN_CTX_POOL_SIZE        16
  ------------------
  |  Branch (346:14): [True: 10.8M, False: 59.0M]
  ------------------
  347|  10.8M|        p->current = p->current->next;
  348|  70.0M|    return p->current->vals + ((p->used++) % BN_CTX_POOL_SIZE);
  ------------------
  |  |   15|  70.0M|#define BN_CTX_POOL_SIZE        16
  ------------------
  349|  70.1M|}
bn_ctx.c:BN_POOL_release:
  352|  34.2M|{
  353|  34.2M|    unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;
  ------------------
  |  |   15|  34.2M|#define BN_CTX_POOL_SIZE        16
  ------------------
  354|       |
  355|  34.2M|    p->used -= num;
  356|   104M|    while (num--) {
  ------------------
  |  Branch (356:12): [True: 70.1M, False: 34.2M]
  ------------------
  357|  70.1M|        bn_check_top(p->current->vals + offset);
  358|  70.1M|        if (offset == 0) {
  ------------------
  |  Branch (358:13): [True: 11.0M, False: 59.0M]
  ------------------
  359|  11.0M|            offset = BN_CTX_POOL_SIZE - 1;
  ------------------
  |  |   15|  11.0M|#define BN_CTX_POOL_SIZE        16
  ------------------
  360|  11.0M|            p->current = p->current->prev;
  361|  11.0M|        } else
  362|  59.0M|            offset--;
  363|  70.1M|    }
  364|  34.2M|}

BN_div:
  211|  11.6M|{
  212|  11.6M|    int ret;
  213|       |
  214|  11.6M|    if (BN_is_zero(divisor)) {
  ------------------
  |  Branch (214:9): [True: 0, False: 11.6M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|  11.6M|    if (divisor->d[divisor->top - 1] == 0) {
  ------------------
  |  Branch (224:9): [True: 0, False: 11.6M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  226|      0|        return 0;
  227|      0|    }
  228|       |
  229|  11.6M|    ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
  230|       |
  231|  11.6M|    if (ret) {
  ------------------
  |  Branch (231:9): [True: 11.6M, False: 0]
  ------------------
  232|  11.6M|        if (dv != NULL)
  ------------------
  |  Branch (232:13): [True: 59.9k, False: 11.5M]
  ------------------
  233|  59.9k|            bn_correct_top(dv);
  234|  11.6M|        if (rm != NULL)
  ------------------
  |  Branch (234:13): [True: 11.5M, False: 59.9k]
  ------------------
  235|  11.5M|            bn_correct_top(rm);
  236|  11.6M|    }
  237|       |
  238|  11.6M|    return ret;
  239|  11.6M|}
bn_div_fixed_top:
  266|  11.6M|{
  267|  11.6M|    int norm_shift, i, j, loop;
  268|  11.6M|    BIGNUM *tmp, *snum, *sdiv, *res;
  269|  11.6M|    BN_ULONG *resp, *wnum, *wnumtop;
  ------------------
  |  |   37|  11.6M|#  define BN_ULONG        unsigned long
  ------------------
  270|  11.6M|    BN_ULONG d0, d1;
  ------------------
  |  |   37|  11.6M|#  define BN_ULONG        unsigned long
  ------------------
  271|  11.6M|    int num_n, div_n, num_neg;
  272|       |
  273|  11.6M|    assert(divisor->top > 0 && divisor->d[divisor->top - 1] != 0);
  274|       |
  275|  11.6M|    bn_check_top(num);
  276|  11.6M|    bn_check_top(divisor);
  277|  11.6M|    bn_check_top(dv);
  278|  11.6M|    bn_check_top(rm);
  279|       |
  280|  11.6M|    BN_CTX_start(ctx);
  281|  11.6M|    res = (dv == NULL) ? BN_CTX_get(ctx) : dv;
  ------------------
  |  Branch (281:11): [True: 11.5M, False: 59.9k]
  ------------------
  282|  11.6M|    tmp = BN_CTX_get(ctx);
  283|  11.6M|    snum = BN_CTX_get(ctx);
  284|  11.6M|    sdiv = BN_CTX_get(ctx);
  285|  11.6M|    if (sdiv == NULL)
  ------------------
  |  Branch (285:9): [True: 0, False: 11.6M]
  ------------------
  286|      0|        goto err;
  287|       |
  288|       |    /* First we normalise the numbers */
  289|  11.6M|    if (!BN_copy(sdiv, divisor))
  ------------------
  |  Branch (289:9): [True: 0, False: 11.6M]
  ------------------
  290|      0|        goto err;
  291|  11.6M|    norm_shift = bn_left_align(sdiv);
  292|  11.6M|    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|  11.6M|    if (!(bn_lshift_fixed_top(snum, num, norm_shift)))
  ------------------
  |  Branch (300:9): [True: 0, False: 11.6M]
  ------------------
  301|      0|        goto err;
  302|       |
  303|  11.6M|    div_n = sdiv->top;
  304|  11.6M|    num_n = snum->top;
  305|       |
  306|  11.6M|    if (num_n <= div_n) {
  ------------------
  |  Branch (306:9): [True: 50.1k, False: 11.5M]
  ------------------
  307|       |        /* caller didn't pad dividend -> no constant-time guarantee... */
  308|  50.1k|        if (bn_wexpand(snum, div_n + 1) == NULL)
  ------------------
  |  Branch (308:13): [True: 0, False: 50.1k]
  ------------------
  309|      0|            goto err;
  310|  50.1k|        memset(&(snum->d[num_n]), 0, (div_n - num_n + 1) * sizeof(BN_ULONG));
  311|  50.1k|        snum->top = num_n = div_n + 1;
  312|  50.1k|    }
  313|       |
  314|  11.6M|    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|  11.6M|    wnum = &(snum->d[loop]);
  320|  11.6M|    wnumtop = &(snum->d[num_n - 1]);
  321|       |
  322|       |    /* Get the top 2 words of sdiv */
  323|  11.6M|    d0 = sdiv->d[div_n - 1];
  324|  11.6M|    d1 = (div_n == 1) ? 0 : sdiv->d[div_n - 2];
  ------------------
  |  Branch (324:10): [True: 244k, False: 11.3M]
  ------------------
  325|       |
  326|       |    /* Setup quotient */
  327|  11.6M|    if (!bn_wexpand(res, loop))
  ------------------
  |  Branch (327:9): [True: 0, False: 11.6M]
  ------------------
  328|      0|        goto err;
  329|  11.6M|    num_neg = num->neg;
  330|  11.6M|    res->neg = (num_neg ^ divisor->neg);
  331|  11.6M|    res->top = loop;
  332|  11.6M|    res->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  11.6M|#  define BN_FLG_FIXED_TOP 0
  ------------------
  333|  11.6M|    resp = &(res->d[loop]);
  334|       |
  335|       |    /* space for temp */
  336|  11.6M|    if (!bn_wexpand(tmp, (div_n + 1)))
  ------------------
  |  Branch (336:9): [True: 0, False: 11.6M]
  ------------------
  337|      0|        goto err;
  338|       |
  339|  56.7M|    for (i = 0; i < loop; i++, wnumtop--) {
  ------------------
  |  Branch (339:17): [True: 45.1M, False: 11.6M]
  ------------------
  340|  45.1M|        BN_ULONG q, l0;
  ------------------
  |  |   37|  45.1M|#  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|  45.1M|        BN_ULONG n0, n1, rem = 0;
  ------------------
  |  |   37|  45.1M|#  define BN_ULONG        unsigned long
  ------------------
  349|       |
  350|  45.1M|        n0 = wnumtop[0];
  351|  45.1M|        n1 = wnumtop[-1];
  352|  45.1M|        if (n0 == d0)
  ------------------
  |  Branch (352:13): [True: 224k, False: 44.9M]
  ------------------
  353|   224k|            q = BN_MASK2;
  ------------------
  |  |   94|   224k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  354|  44.9M|        else {                  /* n0 < d0 */
  355|  44.9M|            BN_ULONG n2 = (wnumtop == wnum) ? 0 : wnumtop[-2];
  ------------------
  |  |   37|  44.9M|#  define BN_ULONG        unsigned long
  ------------------
  |  Branch (355:27): [True: 526k, False: 44.4M]
  ------------------
  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|  44.9M|            BN_ULONG t2l, t2h;
  ------------------
  |  |   37|  44.9M|#  define BN_ULONG        unsigned long
  ------------------
  385|       |
  386|  44.9M|            q = bn_div_words(n0, n1, d0);
  387|  44.9M|#   ifndef REMAINDER_IS_ALREADY_CALCULATED
  388|  44.9M|            rem = (n1 - q * d0) & BN_MASK2;
  ------------------
  |  |   94|  44.9M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  389|  44.9M|#   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|  44.9M|            {
  398|  44.9M|                BN_ULONG ql, qh;
  ------------------
  |  |   37|  44.9M|#  define BN_ULONG        unsigned long
  ------------------
  399|  44.9M|                t2l = LBITS(d1);
  ------------------
  |  |  566|  44.9M|#  define LBITS(a)        ((a)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   95|  44.9M|#  define BN_MASK2l       (0xffffffffL)
  |  |  ------------------
  ------------------
  400|  44.9M|                t2h = HBITS(d1);
  ------------------
  |  |  567|  44.9M|#  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   93|  44.9M|#  define BN_BITS4        32
  |  |  ------------------
  |  |               #  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   95|  44.9M|#  define BN_MASK2l       (0xffffffffL)
  |  |  ------------------
  ------------------
  401|  44.9M|                ql = LBITS(q);
  ------------------
  |  |  566|  44.9M|#  define LBITS(a)        ((a)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   95|  44.9M|#  define BN_MASK2l       (0xffffffffL)
  |  |  ------------------
  ------------------
  402|  44.9M|                qh = HBITS(q);
  ------------------
  |  |  567|  44.9M|#  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   93|  44.9M|#  define BN_BITS4        32
  |  |  ------------------
  |  |               #  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   95|  44.9M|#  define BN_MASK2l       (0xffffffffL)
  |  |  ------------------
  ------------------
  403|  44.9M|                mul64(t2l, t2h, ql, qh); /* t2=(BN_ULLONG)d1*q; */
  ------------------
  |  |  575|  44.9M|        { \
  |  |  576|  44.9M|        BN_ULONG m,m1,lt,ht; \
  |  |  ------------------
  |  |  |  |   37|  44.9M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  577|  44.9M| \
  |  |  578|  44.9M|        lt=l; \
  |  |  579|  44.9M|        ht=h; \
  |  |  580|  44.9M|        m =(bh)*(lt); \
  |  |  581|  44.9M|        lt=(bl)*(lt); \
  |  |  582|  44.9M|        m1=(bl)*(ht); \
  |  |  583|  44.9M|        ht =(bh)*(ht); \
  |  |  584|  44.9M|        m=(m+m1)&BN_MASK2; ht += L2HBITS((BN_ULONG)(m < m1)); \
  |  |  ------------------
  |  |  |  |   94|  44.9M|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  ------------------
  |  |                       m=(m+m1)&BN_MASK2; ht += L2HBITS((BN_ULONG)(m < m1)); \
  |  |  ------------------
  |  |  |  |  568|  44.9M|#  define L2HBITS(a)      (((a)<<BN_BITS4)&BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  44.9M|#  define BN_BITS4        32
  |  |  |  |  ------------------
  |  |  |  |               #  define L2HBITS(a)      (((a)<<BN_BITS4)&BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|  44.9M|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  585|  44.9M|        ht+=HBITS(m); \
  |  |  ------------------
  |  |  |  |  567|  44.9M|#  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  44.9M|#  define BN_BITS4        32
  |  |  |  |  ------------------
  |  |  |  |               #  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  44.9M|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  586|  44.9M|        m1=L2HBITS(m); \
  |  |  ------------------
  |  |  |  |  568|  44.9M|#  define L2HBITS(a)      (((a)<<BN_BITS4)&BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  44.9M|#  define BN_BITS4        32
  |  |  |  |  ------------------
  |  |  |  |               #  define L2HBITS(a)      (((a)<<BN_BITS4)&BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|  44.9M|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  587|  44.9M|        lt=(lt+m1)&BN_MASK2; ht += (lt < m1); \
  |  |  ------------------
  |  |  |  |   94|  44.9M|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  ------------------
  |  |  588|  44.9M|        (l)=lt; \
  |  |  589|  44.9M|        (h)=ht; \
  |  |  590|  44.9M|        }
  ------------------
  404|  44.9M|            }
  405|  44.9M|#   endif
  406|       |
  407|  44.9M|            for (;;) {
  408|  44.9M|                if ((t2h < rem) || ((t2h == rem) && (t2l <= n2)))
  ------------------
  |  Branch (408:21): [True: 27.7M, False: 17.2M]
  |  Branch (408:37): [True: 888k, False: 16.3M]
  |  Branch (408:53): [True: 654k, False: 234k]
  ------------------
  409|  28.4M|                    break;
  410|  16.5M|                q--;
  411|  16.5M|                rem += d0;
  412|  16.5M|                if (rem < d0)
  ------------------
  |  Branch (412:21): [True: 16.4M, False: 54.4k]
  ------------------
  413|  16.4M|                    break;      /* don't let rem overflow */
  414|  54.4k|                if (t2l < d1)
  ------------------
  |  Branch (414:21): [True: 19.0k, False: 35.4k]
  ------------------
  415|  19.0k|                    t2h--;
  416|  54.4k|                t2l -= d1;
  417|  54.4k|            }
  418|  44.9M|#  endif                        /* !BN_LLONG */
  419|  44.9M|        }
  420|  45.1M|# endif                         /* !BN_DIV3W */
  421|       |
  422|  45.1M|        l0 = bn_mul_words(tmp->d, sdiv->d, div_n, q);
  423|  45.1M|        tmp->d[div_n] = l0;
  424|  45.1M|        wnum--;
  425|       |        /*
  426|       |         * ignore top values of the bignums just sub the two BN_ULONG arrays
  427|       |         * with bn_sub_words
  428|       |         */
  429|  45.1M|        l0 = bn_sub_words(wnum, wnum, tmp->d, div_n + 1);
  430|  45.1M|        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|   224M|        for (l0 = 0 - l0, j = 0; j < div_n; j++)
  ------------------
  |  Branch (436:34): [True: 179M, False: 45.1M]
  ------------------
  437|   179M|            tmp->d[j] = sdiv->d[j] & l0;
  438|  45.1M|        l0 = bn_add_words(wnum, wnum, tmp->d, div_n);
  439|  45.1M|        (*wnumtop) += l0;
  440|  45.1M|        assert((*wnumtop) == 0);
  441|       |
  442|       |        /* store part of the result */
  443|  45.1M|        *--resp = q;
  444|  45.1M|    }
  445|       |    /* snum holds remainder, it's as wide as divisor */
  446|  11.6M|    snum->neg = num_neg;
  447|  11.6M|    snum->top = div_n;
  448|  11.6M|    snum->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  11.6M|#  define BN_FLG_FIXED_TOP 0
  ------------------
  449|       |
  450|  11.6M|    if (rm != NULL && bn_rshift_fixed_top(rm, snum, norm_shift) == 0)
  ------------------
  |  Branch (450:9): [True: 11.5M, False: 59.9k]
  |  Branch (450:23): [True: 0, False: 11.5M]
  ------------------
  451|      0|        goto err;
  452|       |
  453|  11.6M|    BN_CTX_end(ctx);
  454|  11.6M|    return 1;
  455|      0| err:
  456|      0|    bn_check_top(rm);
  457|      0|    BN_CTX_end(ctx);
  458|      0|    return 0;
  459|  11.6M|}
bn_div.c:bn_left_align:
  142|  11.6M|{
  143|  11.6M|    BN_ULONG *d = num->d, n, m, rmask;
  ------------------
  |  |   37|  11.6M|#  define BN_ULONG        unsigned long
  ------------------
  144|  11.6M|    int top = num->top;
  145|  11.6M|    int rshift = BN_num_bits_word(d[top - 1]), lshift, i;
  146|       |
  147|  11.6M|    lshift = BN_BITS2 - rshift;
  ------------------
  |  |   54|  11.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  148|  11.6M|    rshift %= BN_BITS2;            /* say no to undefined behaviour */
  ------------------
  |  |   54|  11.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  149|  11.6M|    rmask = (BN_ULONG)0 - rshift;  /* rmask = 0 - (rshift != 0) */
  150|  11.6M|    rmask |= rmask >> 8;
  151|       |
  152|  57.3M|    for (i = 0, m = 0; i < top; i++) {
  ------------------
  |  Branch (152:24): [True: 45.7M, False: 11.6M]
  ------------------
  153|  45.7M|        n = d[i];
  154|  45.7M|        d[i] = ((n << lshift) | m) & BN_MASK2;
  ------------------
  |  |   94|  45.7M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  155|  45.7M|        m = (n >> rshift) & rmask;
  156|  45.7M|    }
  157|       |
  158|  11.6M|    return lshift;
  159|  11.6M|}

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|  19.9k|{
  100|  19.9k|    int ret;
  101|       |
  102|  19.9k|    bn_check_top(a);
  103|  19.9k|    bn_check_top(p);
  104|  19.9k|    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|  19.9k|#define MONT_MUL_MOD
  138|  19.9k|#define MONT_EXP_WORD
  139|  19.9k|#define RECP_MUL_MOD
  140|       |
  141|  19.9k|#ifdef MONT_MUL_MOD
  142|  19.9k|    if (BN_is_odd(m)) {
  ------------------
  |  Branch (142:9): [True: 19.9k, False: 0]
  ------------------
  143|  19.9k|# ifdef MONT_EXP_WORD
  144|  19.9k|        if (a->top == 1 && !a->neg
  ------------------
  |  Branch (144:13): [True: 7.03k, False: 12.9k]
  |  Branch (144:28): [True: 7.03k, False: 0]
  ------------------
  145|  19.9k|            && (BN_get_flags(p, BN_FLG_CONSTTIME) == 0)
  ------------------
  |  |   67|  7.03k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (145:16): [True: 7.03k, False: 0]
  ------------------
  146|  19.9k|            && (BN_get_flags(a, BN_FLG_CONSTTIME) == 0)
  ------------------
  |  |   67|  7.03k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (146:16): [True: 7.03k, False: 0]
  ------------------
  147|  19.9k|            && (BN_get_flags(m, BN_FLG_CONSTTIME) == 0)) {
  ------------------
  |  |   67|  7.03k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (147:16): [True: 7.03k, False: 0]
  ------------------
  148|  7.03k|            BN_ULONG A = a->d[0];
  ------------------
  |  |   37|  7.03k|#  define BN_ULONG        unsigned long
  ------------------
  149|  7.03k|            ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL);
  150|  7.03k|        } else
  151|  12.9k|# endif
  152|  12.9k|            ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL);
  153|  19.9k|    } else
  154|      0|#endif
  155|      0|#ifdef RECP_MUL_MOD
  156|      0|    {
  157|      0|        ret = BN_mod_exp_recp(r, a, p, m, ctx);
  158|      0|    }
  159|       |#else
  160|       |    {
  161|       |        ret = BN_mod_exp_simple(r, a, p, m, ctx);
  162|       |    }
  163|       |#endif
  164|       |
  165|  19.9k|    bn_check_top(r);
  166|  19.9k|    return ret;
  167|  19.9k|}
BN_mod_exp_mont:
  306|  12.9k|{
  307|  12.9k|    int i, j, bits, ret = 0, wstart, wend, window;
  308|  12.9k|    int start = 1;
  309|  12.9k|    BIGNUM *d, *r;
  310|  12.9k|    const BIGNUM *aa;
  311|       |    /* Table of variables obtained from 'ctx' */
  312|  12.9k|    BIGNUM *val[TABLE_SIZE];
  313|  12.9k|    BN_MONT_CTX *mont = NULL;
  314|       |
  315|  12.9k|    bn_check_top(a);
  316|  12.9k|    bn_check_top(p);
  317|  12.9k|    bn_check_top(m);
  318|       |
  319|  12.9k|    if (!BN_is_odd(m)) {
  ------------------
  |  Branch (319:9): [True: 0, False: 12.9k]
  ------------------
  320|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  321|      0|        return 0;
  322|      0|    }
  323|       |
  324|  12.9k|    if (m->top <= BN_CONSTTIME_SIZE_LIMIT
  ------------------
  |  |   46|  25.9k|#define BN_CONSTTIME_SIZE_LIMIT (INT_MAX / BN_BYTES / 256)
  |  |  ------------------
  |  |  |  |   38|  12.9k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (324:9): [True: 12.9k, False: 0]
  ------------------
  325|  12.9k|        && (BN_get_flags(p, BN_FLG_CONSTTIME) != 0
  ------------------
  |  |   67|  12.9k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (325:13): [True: 0, False: 12.9k]
  ------------------
  326|  12.9k|            || BN_get_flags(a, BN_FLG_CONSTTIME) != 0
  ------------------
  |  |   67|  12.9k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (326:16): [True: 0, False: 12.9k]
  ------------------
  327|  12.9k|            || BN_get_flags(m, BN_FLG_CONSTTIME) != 0)) {
  ------------------
  |  |   67|  12.9k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (327:16): [True: 0, False: 12.9k]
  ------------------
  328|      0|        return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
  329|      0|    }
  330|       |
  331|  12.9k|    bits = BN_num_bits(p);
  332|  12.9k|    if (bits == 0) {
  ------------------
  |  Branch (332:9): [True: 0, False: 12.9k]
  ------------------
  333|       |        /* x**0 mod 1, or x**0 mod -1 is still zero. */
  334|      0|        if (BN_abs_is_word(m, 1)) {
  ------------------
  |  Branch (334:13): [True: 0, False: 0]
  ------------------
  335|      0|            ret = 1;
  336|      0|            BN_zero(rr);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  337|      0|        } else {
  338|      0|            ret = BN_one(rr);
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  339|      0|        }
  340|      0|        return ret;
  341|      0|    }
  342|       |
  343|  12.9k|    BN_CTX_start(ctx);
  344|  12.9k|    d = BN_CTX_get(ctx);
  345|  12.9k|    r = BN_CTX_get(ctx);
  346|  12.9k|    val[0] = BN_CTX_get(ctx);
  347|  12.9k|    if (val[0] == NULL)
  ------------------
  |  Branch (347:9): [True: 0, False: 12.9k]
  ------------------
  348|      0|        goto err;
  349|       |
  350|       |    /*
  351|       |     * If this is not done, things will break in the montgomery part
  352|       |     */
  353|       |
  354|  12.9k|    if (in_mont != NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 12.9k]
  ------------------
  355|      0|        mont = in_mont;
  356|  12.9k|    else {
  357|  12.9k|        if ((mont = BN_MONT_CTX_new()) == NULL)
  ------------------
  |  Branch (357:13): [True: 0, False: 12.9k]
  ------------------
  358|      0|            goto err;
  359|  12.9k|        if (!BN_MONT_CTX_set(mont, m, ctx))
  ------------------
  |  Branch (359:13): [True: 0, False: 12.9k]
  ------------------
  360|      0|            goto err;
  361|  12.9k|    }
  362|       |
  363|  12.9k|    if (a->neg || BN_ucmp(a, m) >= 0) {
  ------------------
  |  Branch (363:9): [True: 0, False: 12.9k]
  |  Branch (363:19): [True: 0, False: 12.9k]
  ------------------
  364|      0|        if (!BN_nnmod(val[0], a, m, ctx))
  ------------------
  |  Branch (364:13): [True: 0, False: 0]
  ------------------
  365|      0|            goto err;
  366|      0|        aa = val[0];
  367|      0|    } else
  368|  12.9k|        aa = a;
  369|  12.9k|    if (!bn_to_mont_fixed_top(val[0], aa, mont, ctx))
  ------------------
  |  Branch (369:9): [True: 0, False: 12.9k]
  ------------------
  370|      0|        goto err;               /* 1 */
  371|       |
  372|  12.9k|    window = BN_window_bits_for_exponent_size(bits);
  ------------------
  |  |  322|  12.9k|                ((b) > 671 ? 6 : \
  |  |  ------------------
  |  |  |  Branch (322:18): [True: 0, False: 12.9k]
  |  |  ------------------
  |  |  323|  12.9k|                 (b) > 239 ? 5 : \
  |  |  ------------------
  |  |  |  Branch (323:18): [True: 4.84k, False: 8.11k]
  |  |  ------------------
  |  |  324|  12.9k|                 (b) >  79 ? 4 : \
  |  |  ------------------
  |  |  |  Branch (324:18): [True: 8.11k, False: 0]
  |  |  ------------------
  |  |  325|  8.11k|                 (b) >  23 ? 3 : 1)
  |  |  ------------------
  |  |  |  Branch (325:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  373|  12.9k|    if (window > 1) {
  ------------------
  |  Branch (373:9): [True: 12.9k, False: 0]
  ------------------
  374|  12.9k|        if (!bn_mul_mont_fixed_top(d, val[0], val[0], mont, ctx))
  ------------------
  |  Branch (374:13): [True: 0, False: 12.9k]
  ------------------
  375|      0|            goto err;           /* 2 */
  376|  12.9k|        j = 1 << (window - 1);
  377|   142k|        for (i = 1; i < j; i++) {
  ------------------
  |  Branch (377:21): [True: 129k, False: 12.9k]
  ------------------
  378|   129k|            if (((val[i] = BN_CTX_get(ctx)) == NULL) ||
  ------------------
  |  Branch (378:17): [True: 0, False: 129k]
  ------------------
  379|   129k|                !bn_mul_mont_fixed_top(val[i], val[i - 1], d, mont, ctx))
  ------------------
  |  Branch (379:17): [True: 0, False: 129k]
  ------------------
  380|      0|                goto err;
  381|   129k|        }
  382|  12.9k|    }
  383|       |
  384|  12.9k|    start = 1;                  /* This is used to avoid multiplication etc
  385|       |                                 * when there is only the value '1' in the
  386|       |                                 * buffer. */
  387|  12.9k|    wstart = bits - 1;          /* The top bit of the window */
  388|  12.9k|    wend = 0;                   /* The bottom bit of the window */
  389|       |
  390|  12.9k|#if 1                           /* by Shay Gueron's suggestion */
  391|  12.9k|    j = m->top;                 /* borrow j */
  392|  12.9k|    if (m->d[j - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) {
  ------------------
  |  |   54|  12.9k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.9k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (392:9): [True: 3.64k, False: 9.30k]
  ------------------
  393|  3.64k|        if (bn_wexpand(r, j) == NULL)
  ------------------
  |  Branch (393:13): [True: 0, False: 3.64k]
  ------------------
  394|      0|            goto err;
  395|       |        /* 2^(top*BN_BITS2) - m */
  396|  3.64k|        r->d[0] = (0 - m->d[0]) & BN_MASK2;
  ------------------
  |  |   94|  3.64k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  397|  26.4k|        for (i = 1; i < j; i++)
  ------------------
  |  Branch (397:21): [True: 22.8k, False: 3.64k]
  ------------------
  398|  22.8k|            r->d[i] = (~m->d[i]) & BN_MASK2;
  ------------------
  |  |   94|  26.4k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  399|  3.64k|        r->top = j;
  400|  3.64k|        r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  3.64k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  401|  3.64k|    } else
  402|  9.30k|#endif
  403|  9.30k|    if (!bn_to_mont_fixed_top(r, BN_value_one(), mont, ctx))
  ------------------
  |  Branch (403:9): [True: 0, False: 9.30k]
  ------------------
  404|      0|        goto err;
  405|  1.83M|    for (;;) {
  406|  1.83M|        int wvalue;             /* The 'value' of the window */
  407|       |
  408|  1.83M|        if (BN_is_bit_set(p, wstart) == 0) {
  ------------------
  |  Branch (408:13): [True: 1.30M, False: 524k]
  ------------------
  409|  1.30M|            if (!start) {
  ------------------
  |  Branch (409:17): [True: 1.30M, False: 0]
  ------------------
  410|  1.30M|                if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx))
  ------------------
  |  Branch (410:21): [True: 0, False: 1.30M]
  ------------------
  411|      0|                    goto err;
  412|  1.30M|            }
  413|  1.30M|            if (wstart == 0)
  ------------------
  |  Branch (413:17): [True: 3.21k, False: 1.30M]
  ------------------
  414|  3.21k|                break;
  415|  1.30M|            wstart--;
  416|  1.30M|            continue;
  417|  1.30M|        }
  418|       |        /*
  419|       |         * We now have wstart on a 'set' bit, we now need to work out how bit
  420|       |         * a window to do.  To do this we need to scan forward until the last
  421|       |         * set bit before the end of the window
  422|       |         */
  423|   524k|        wvalue = 1;
  424|   524k|        wend = 0;
  425|  2.35M|        for (i = 1; i < window; i++) {
  ------------------
  |  Branch (425:21): [True: 1.84M, False: 514k]
  ------------------
  426|  1.84M|            if (wstart - i < 0)
  ------------------
  |  Branch (426:17): [True: 10.0k, False: 1.83M]
  ------------------
  427|  10.0k|                break;
  428|  1.83M|            if (BN_is_bit_set(p, wstart - i)) {
  ------------------
  |  Branch (428:17): [True: 1.29M, False: 534k]
  ------------------
  429|  1.29M|                wvalue <<= (i - wend);
  430|  1.29M|                wvalue |= 1;
  431|  1.29M|                wend = i;
  432|  1.29M|            }
  433|  1.83M|        }
  434|       |
  435|       |        /* wend is the size of the current window */
  436|   524k|        j = wend + 1;
  437|       |        /* add the 'bytes above' */
  438|   524k|        if (!start)
  ------------------
  |  Branch (438:13): [True: 511k, False: 12.9k]
  ------------------
  439|  2.56M|            for (i = 0; i < j; i++) {
  ------------------
  |  Branch (439:25): [True: 2.05M, False: 511k]
  ------------------
  440|  2.05M|                if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx))
  ------------------
  |  Branch (440:21): [True: 0, False: 2.05M]
  ------------------
  441|      0|                    goto err;
  442|  2.05M|            }
  443|       |
  444|       |        /* wvalue will be an odd number < 2^window */
  445|   524k|        if (!bn_mul_mont_fixed_top(r, r, val[wvalue >> 1], mont, ctx))
  ------------------
  |  Branch (445:13): [True: 0, False: 524k]
  ------------------
  446|      0|            goto err;
  447|       |
  448|       |        /* move the 'window' down further */
  449|   524k|        wstart -= wend + 1;
  450|   524k|        start = 0;
  451|   524k|        if (wstart < 0)
  ------------------
  |  Branch (451:13): [True: 9.73k, False: 514k]
  ------------------
  452|  9.73k|            break;
  453|   524k|    }
  454|       |    /*
  455|       |     * Done with zero-padded intermediate BIGNUMs. Final BN_from_montgomery
  456|       |     * removes padding [if any] and makes return value suitable for public
  457|       |     * API consumer.
  458|       |     */
  459|       |#if defined(SPARC_T4_MONT)
  460|       |    if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) {
  461|       |        j = mont->N.top;        /* borrow j */
  462|       |        val[0]->d[0] = 1;       /* borrow val[0] */
  463|       |        for (i = 1; i < j; i++)
  464|       |            val[0]->d[i] = 0;
  465|       |        val[0]->top = j;
  466|       |        if (!BN_mod_mul_montgomery(rr, r, val[0], mont, ctx))
  467|       |            goto err;
  468|       |    } else
  469|       |#endif
  470|  12.9k|    if (!BN_from_montgomery(rr, r, mont, ctx))
  ------------------
  |  Branch (470:9): [True: 0, False: 12.9k]
  ------------------
  471|      0|        goto err;
  472|  12.9k|    ret = 1;
  473|  12.9k| err:
  474|  12.9k|    if (in_mont == NULL)
  ------------------
  |  Branch (474:9): [True: 12.9k, False: 0]
  ------------------
  475|  12.9k|        BN_MONT_CTX_free(mont);
  476|  12.9k|    BN_CTX_end(ctx);
  477|  12.9k|    bn_check_top(rr);
  478|  12.9k|    return ret;
  479|  12.9k|}
BN_mod_exp_mont_word:
 1157|  7.03k|{
 1158|  7.03k|    BN_MONT_CTX *mont = NULL;
 1159|  7.03k|    int b, bits, ret = 0;
 1160|  7.03k|    int r_is_one;
 1161|  7.03k|    BN_ULONG w, next_w;
  ------------------
  |  |   37|  7.03k|#  define BN_ULONG        unsigned long
  ------------------
 1162|  7.03k|    BIGNUM *r, *t;
 1163|  7.03k|    BIGNUM *swap_tmp;
 1164|  7.03k|#define BN_MOD_MUL_WORD(r, w, m) \
 1165|  7.03k|                (BN_mul_word(r, (w)) && \
 1166|  7.03k|                (/* BN_ucmp(r, (m)) < 0 ? 1 :*/  \
 1167|  7.03k|                        (BN_mod(t, r, m, ctx) && (swap_tmp = r, r = t, t = swap_tmp, 1))))
 1168|       |    /*
 1169|       |     * BN_MOD_MUL_WORD is only used with 'w' large, so the BN_ucmp test is
 1170|       |     * probably more overhead than always using BN_mod (which uses BN_copy if
 1171|       |     * a similar test returns true).
 1172|       |     */
 1173|       |    /*
 1174|       |     * We can use BN_mod and do not need BN_nnmod because our accumulator is
 1175|       |     * never negative (the result of BN_mod does not depend on the sign of
 1176|       |     * the modulus).
 1177|       |     */
 1178|  7.03k|#define BN_TO_MONTGOMERY_WORD(r, w, mont) \
 1179|  7.03k|                (BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
 1180|       |
 1181|  7.03k|    if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0
  ------------------
  |  |   67|  7.03k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (1181:9): [True: 0, False: 7.03k]
  ------------------
 1182|  7.03k|            || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) {
  ------------------
  |  |   67|  7.03k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (1182:16): [True: 0, False: 7.03k]
  ------------------
 1183|       |        /* BN_FLG_CONSTTIME only supported by BN_mod_exp_mont() */
 1184|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1185|      0|        return 0;
 1186|      0|    }
 1187|       |
 1188|  7.03k|    bn_check_top(p);
 1189|  7.03k|    bn_check_top(m);
 1190|       |
 1191|  7.03k|    if (!BN_is_odd(m)) {
  ------------------
  |  Branch (1191:9): [True: 0, False: 7.03k]
  ------------------
 1192|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1193|      0|        return 0;
 1194|      0|    }
 1195|  7.03k|    if (m->top == 1)
  ------------------
  |  Branch (1195:9): [True: 0, False: 7.03k]
  ------------------
 1196|      0|        a %= m->d[0];           /* make sure that 'a' is reduced */
 1197|       |
 1198|  7.03k|    bits = BN_num_bits(p);
 1199|  7.03k|    if (bits == 0) {
  ------------------
  |  Branch (1199:9): [True: 0, False: 7.03k]
  ------------------
 1200|       |        /* x**0 mod 1, or x**0 mod -1 is still zero. */
 1201|      0|        if (BN_abs_is_word(m, 1)) {
  ------------------
  |  Branch (1201:13): [True: 0, False: 0]
  ------------------
 1202|      0|            ret = 1;
 1203|      0|            BN_zero(rr);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1204|      0|        } else {
 1205|      0|            ret = BN_one(rr);
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
 1206|      0|        }
 1207|      0|        return ret;
 1208|      0|    }
 1209|  7.03k|    if (a == 0) {
  ------------------
  |  Branch (1209:9): [True: 0, False: 7.03k]
  ------------------
 1210|      0|        BN_zero(rr);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1211|      0|        ret = 1;
 1212|      0|        return ret;
 1213|      0|    }
 1214|       |
 1215|  7.03k|    BN_CTX_start(ctx);
 1216|  7.03k|    r = BN_CTX_get(ctx);
 1217|  7.03k|    t = BN_CTX_get(ctx);
 1218|  7.03k|    if (t == NULL)
  ------------------
  |  Branch (1218:9): [True: 0, False: 7.03k]
  ------------------
 1219|      0|        goto err;
 1220|       |
 1221|  7.03k|    if (in_mont != NULL)
  ------------------
  |  Branch (1221:9): [True: 0, False: 7.03k]
  ------------------
 1222|      0|        mont = in_mont;
 1223|  7.03k|    else {
 1224|  7.03k|        if ((mont = BN_MONT_CTX_new()) == NULL)
  ------------------
  |  Branch (1224:13): [True: 0, False: 7.03k]
  ------------------
 1225|      0|            goto err;
 1226|  7.03k|        if (!BN_MONT_CTX_set(mont, m, ctx))
  ------------------
  |  Branch (1226:13): [True: 0, False: 7.03k]
  ------------------
 1227|      0|            goto err;
 1228|  7.03k|    }
 1229|       |
 1230|  7.03k|    r_is_one = 1;               /* except for Montgomery factor */
 1231|       |
 1232|       |    /* bits-1 >= 0 */
 1233|       |
 1234|       |    /* The result is accumulated in the product r*w. */
 1235|  7.03k|    w = a;                      /* bit 'bits-1' of 'p' is always set */
 1236|   900k|    for (b = bits - 2; b >= 0; b--) {
  ------------------
  |  Branch (1236:24): [True: 893k, False: 7.03k]
  ------------------
 1237|       |        /* First, square r*w. */
 1238|   893k|        next_w = w * w;
 1239|   893k|        if ((next_w / w) != w) { /* overflow */
  ------------------
  |  Branch (1239:13): [True: 309k, False: 583k]
  ------------------
 1240|   309k|            if (r_is_one) {
  ------------------
  |  Branch (1240:17): [True: 6.81k, False: 303k]
  ------------------
 1241|  6.81k|                if (!BN_TO_MONTGOMERY_WORD(r, w, mont))
  ------------------
  |  | 1179|  6.81k|                (BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
  |  |  ------------------
  |  |  |  Branch (1179:18): [True: 6.81k, False: 0]
  |  |  |  Branch (1179:41): [True: 6.81k, False: 0]
  |  |  ------------------
  ------------------
 1242|      0|                    goto err;
 1243|  6.81k|                r_is_one = 0;
 1244|   303k|            } else {
 1245|   303k|                if (!BN_MOD_MUL_WORD(r, w, m))
  ------------------
  |  | 1165|   303k|                (BN_mul_word(r, (w)) && \
  |  |  ------------------
  |  |  |  Branch (1165:18): [True: 303k, False: 0]
  |  |  ------------------
  |  | 1166|   303k|                (/* BN_ucmp(r, (m)) < 0 ? 1 :*/  \
  |  | 1167|   303k|                        (BN_mod(t, r, m, ctx) && (swap_tmp = r, r = t, t = swap_tmp, 1))))
  |  |  ------------------
  |  |  |  |  277|   606k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:30): [True: 303k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1167:50): [True: 303k, False: 0]
  |  |  ------------------
  ------------------
 1246|      0|                    goto err;
 1247|   303k|            }
 1248|   309k|            next_w = 1;
 1249|   309k|        }
 1250|   893k|        w = next_w;
 1251|   893k|        if (!r_is_one) {
  ------------------
  |  Branch (1251:13): [True: 876k, False: 17.1k]
  ------------------
 1252|   876k|            if (!BN_mod_mul_montgomery(r, r, r, mont, ctx))
  ------------------
  |  Branch (1252:17): [True: 0, False: 876k]
  ------------------
 1253|      0|                goto err;
 1254|   876k|        }
 1255|       |
 1256|       |        /* Second, multiply r*w by 'a' if exponent bit is set. */
 1257|   893k|        if (BN_is_bit_set(p, b)) {
  ------------------
  |  Branch (1257:13): [True: 887k, False: 6.37k]
  ------------------
 1258|   887k|            next_w = w * a;
 1259|   887k|            if ((next_w / a) != w) { /* overflow */
  ------------------
  |  Branch (1259:17): [True: 23.2k, False: 863k]
  ------------------
 1260|  23.2k|                if (r_is_one) {
  ------------------
  |  Branch (1260:21): [True: 215, False: 23.0k]
  ------------------
 1261|    215|                    if (!BN_TO_MONTGOMERY_WORD(r, w, mont))
  ------------------
  |  | 1179|    215|                (BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
  |  |  ------------------
  |  |  |  Branch (1179:18): [True: 215, False: 0]
  |  |  |  Branch (1179:41): [True: 215, False: 0]
  |  |  ------------------
  ------------------
 1262|      0|                        goto err;
 1263|    215|                    r_is_one = 0;
 1264|  23.0k|                } else {
 1265|  23.0k|                    if (!BN_MOD_MUL_WORD(r, w, m))
  ------------------
  |  | 1165|  23.0k|                (BN_mul_word(r, (w)) && \
  |  |  ------------------
  |  |  |  Branch (1165:18): [True: 23.0k, False: 0]
  |  |  ------------------
  |  | 1166|  23.0k|                (/* BN_ucmp(r, (m)) < 0 ? 1 :*/  \
  |  | 1167|  23.0k|                        (BN_mod(t, r, m, ctx) && (swap_tmp = r, r = t, t = swap_tmp, 1))))
  |  |  ------------------
  |  |  |  |  277|  46.0k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:30): [True: 23.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1167:50): [True: 23.0k, False: 0]
  |  |  ------------------
  ------------------
 1266|      0|                        goto err;
 1267|  23.0k|                }
 1268|  23.2k|                next_w = a;
 1269|  23.2k|            }
 1270|   887k|            w = next_w;
 1271|   887k|        }
 1272|   893k|    }
 1273|       |
 1274|       |    /* Finally, set r:=r*w. */
 1275|  7.03k|    if (w != 1) {
  ------------------
  |  Branch (1275:9): [True: 5.90k, False: 1.12k]
  ------------------
 1276|  5.90k|        if (r_is_one) {
  ------------------
  |  Branch (1276:13): [True: 0, False: 5.90k]
  ------------------
 1277|      0|            if (!BN_TO_MONTGOMERY_WORD(r, w, mont))
  ------------------
  |  | 1179|      0|                (BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
  |  |  ------------------
  |  |  |  Branch (1179:18): [True: 0, False: 0]
  |  |  |  Branch (1179:41): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1278|      0|                goto err;
 1279|      0|            r_is_one = 0;
 1280|  5.90k|        } else {
 1281|  5.90k|            if (!BN_MOD_MUL_WORD(r, w, m))
  ------------------
  |  | 1165|  5.90k|                (BN_mul_word(r, (w)) && \
  |  |  ------------------
  |  |  |  Branch (1165:18): [True: 5.90k, False: 0]
  |  |  ------------------
  |  | 1166|  5.90k|                (/* BN_ucmp(r, (m)) < 0 ? 1 :*/  \
  |  | 1167|  5.90k|                        (BN_mod(t, r, m, ctx) && (swap_tmp = r, r = t, t = swap_tmp, 1))))
  |  |  ------------------
  |  |  |  |  277|  11.8k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:30): [True: 5.90k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1167:50): [True: 5.90k, False: 0]
  |  |  ------------------
  ------------------
 1282|      0|                goto err;
 1283|  5.90k|        }
 1284|  5.90k|    }
 1285|       |
 1286|  7.03k|    if (r_is_one) {             /* can happen only if a == 1 */
  ------------------
  |  Branch (1286:9): [True: 0, False: 7.03k]
  ------------------
 1287|      0|        if (!BN_one(rr))
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (1287:13): [True: 0, False: 0]
  ------------------
 1288|      0|            goto err;
 1289|  7.03k|    } else {
 1290|  7.03k|        if (!BN_from_montgomery(rr, r, mont, ctx))
  ------------------
  |  Branch (1290:13): [True: 0, False: 7.03k]
  ------------------
 1291|      0|            goto err;
 1292|  7.03k|    }
 1293|  7.03k|    ret = 1;
 1294|  7.03k| err:
 1295|  7.03k|    if (in_mont == NULL)
  ------------------
  |  Branch (1295:9): [True: 7.03k, False: 0]
  ------------------
 1296|  7.03k|        BN_MONT_CTX_free(mont);
 1297|  7.03k|    BN_CTX_end(ctx);
 1298|  7.03k|    bn_check_top(rr);
 1299|  7.03k|    return ret;
 1300|  7.03k|}

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

BN_GF2m_add:
  253|   666k|{
  254|   666k|    int i;
  255|   666k|    const BIGNUM *at, *bt;
  256|       |
  257|   666k|    bn_check_top(a);
  258|   666k|    bn_check_top(b);
  259|       |
  260|   666k|    if (a->top < b->top) {
  ------------------
  |  Branch (260:9): [True: 24.9k, False: 641k]
  ------------------
  261|  24.9k|        at = b;
  262|  24.9k|        bt = a;
  263|   641k|    } else {
  264|   641k|        at = a;
  265|   641k|        bt = b;
  266|   641k|    }
  267|       |
  268|   666k|    if (bn_wexpand(r, at->top) == NULL)
  ------------------
  |  Branch (268:9): [True: 0, False: 666k]
  ------------------
  269|      0|        return 0;
  270|       |
  271|  3.05M|    for (i = 0; i < bt->top; i++) {
  ------------------
  |  Branch (271:17): [True: 2.38M, False: 666k]
  ------------------
  272|  2.38M|        r->d[i] = at->d[i] ^ bt->d[i];
  273|  2.38M|    }
  274|   770k|    for (; i < at->top; i++) {
  ------------------
  |  Branch (274:12): [True: 104k, False: 666k]
  ------------------
  275|   104k|        r->d[i] = at->d[i];
  276|   104k|    }
  277|       |
  278|   666k|    r->top = at->top;
  279|   666k|    bn_correct_top(r);
  280|       |
  281|   666k|    return 1;
  282|   666k|}
BN_GF2m_mod_arr:
  293|  1.39M|{
  294|  1.39M|    int j, k;
  295|  1.39M|    int n, dN, d0, d1;
  296|  1.39M|    BN_ULONG zz, *z;
  ------------------
  |  |   37|  1.39M|#  define BN_ULONG        unsigned long
  ------------------
  297|       |
  298|  1.39M|    bn_check_top(a);
  299|       |
  300|  1.39M|    if (p[0] == 0) {
  ------------------
  |  Branch (300:9): [True: 0, False: 1.39M]
  ------------------
  301|       |        /* reduction mod 1 => return 0 */
  302|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  303|      0|        return 1;
  304|      0|    }
  305|       |
  306|       |    /*
  307|       |     * Since the algorithm does reduction in the r value, if a != r, copy the
  308|       |     * contents of a into r so we can do reduction in r.
  309|       |     */
  310|  1.39M|    if (a != r) {
  ------------------
  |  Branch (310:9): [True: 1.39M, False: 30]
  ------------------
  311|  1.39M|        if (!bn_wexpand(r, a->top))
  ------------------
  |  Branch (311:13): [True: 0, False: 1.39M]
  ------------------
  312|      0|            return 0;
  313|  10.6M|        for (j = 0; j < a->top; j++) {
  ------------------
  |  Branch (313:21): [True: 9.26M, False: 1.39M]
  ------------------
  314|  9.26M|            r->d[j] = a->d[j];
  315|  9.26M|        }
  316|  1.39M|        r->top = a->top;
  317|  1.39M|    }
  318|  1.39M|    z = r->d;
  319|       |
  320|       |    /* start reduction */
  321|  1.39M|    dN = p[0] / BN_BITS2;
  ------------------
  |  |   54|  1.39M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.39M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  322|  10.0M|    for (j = r->top - 1; j > dN;) {
  ------------------
  |  Branch (322:26): [True: 8.63M, False: 1.39M]
  ------------------
  323|  8.63M|        zz = z[j];
  324|  8.63M|        if (z[j] == 0) {
  ------------------
  |  Branch (324:13): [True: 4.31M, False: 4.31M]
  ------------------
  325|  4.31M|            j--;
  326|  4.31M|            continue;
  327|  4.31M|        }
  328|  4.31M|        z[j] = 0;
  329|       |
  330|  12.0M|        for (k = 1; p[k] != 0; k++) {
  ------------------
  |  Branch (330:21): [True: 7.75M, False: 4.31M]
  ------------------
  331|       |            /* reducing component t^p[k] */
  332|  7.75M|            n = p[0] - p[k];
  333|  7.75M|            d0 = n % BN_BITS2;
  ------------------
  |  |   54|  7.75M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.75M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  334|  7.75M|            d1 = BN_BITS2 - d0;
  ------------------
  |  |   54|  7.75M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.75M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  335|  7.75M|            n /= BN_BITS2;
  ------------------
  |  |   54|  7.75M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.75M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  336|  7.75M|            z[j - n] ^= (zz >> d0);
  337|  7.75M|            if (d0)
  ------------------
  |  Branch (337:17): [True: 7.07M, False: 686k]
  ------------------
  338|  7.07M|                z[j - n - 1] ^= (zz << d1);
  339|  7.75M|        }
  340|       |
  341|       |        /* reducing component t^0 */
  342|  4.31M|        n = dN;
  343|  4.31M|        d0 = p[0] % BN_BITS2;
  ------------------
  |  |   54|  4.31M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  4.31M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  344|  4.31M|        d1 = BN_BITS2 - d0;
  ------------------
  |  |   54|  4.31M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  4.31M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  345|  4.31M|        z[j - n] ^= (zz >> d0);
  346|  4.31M|        if (d0)
  ------------------
  |  Branch (346:13): [True: 4.31M, False: 0]
  ------------------
  347|  4.31M|            z[j - n - 1] ^= (zz << d1);
  348|  4.31M|    }
  349|       |
  350|       |    /* final round of reduction */
  351|  2.73M|    while (j == dN) {
  ------------------
  |  Branch (351:12): [True: 2.71M, False: 21.7k]
  ------------------
  352|       |
  353|  2.71M|        d0 = p[0] % BN_BITS2;
  ------------------
  |  |   54|  2.71M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.71M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  354|  2.71M|        zz = z[dN] >> d0;
  355|  2.71M|        if (zz == 0)
  ------------------
  |  Branch (355:13): [True: 1.37M, False: 1.33M]
  ------------------
  356|  1.37M|            break;
  357|  1.33M|        d1 = BN_BITS2 - d0;
  ------------------
  |  |   54|  1.33M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.33M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  358|       |
  359|       |        /* clear up the top d1 bits */
  360|  1.33M|        if (d0)
  ------------------
  |  Branch (360:13): [True: 1.33M, False: 0]
  ------------------
  361|  1.33M|            z[dN] = (z[dN] << d1) >> d1;
  362|      0|        else
  363|      0|            z[dN] = 0;
  364|  1.33M|        z[0] ^= zz;             /* reduction t^0 component */
  365|       |
  366|  3.73M|        for (k = 1; p[k] != 0; k++) {
  ------------------
  |  Branch (366:21): [True: 2.40M, False: 1.33M]
  ------------------
  367|  2.40M|            BN_ULONG tmp_ulong;
  ------------------
  |  |   37|  2.40M|#  define BN_ULONG        unsigned long
  ------------------
  368|       |
  369|       |            /* reducing component t^p[k] */
  370|  2.40M|            n = p[k] / BN_BITS2;
  ------------------
  |  |   54|  2.40M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.40M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  371|  2.40M|            d0 = p[k] % BN_BITS2;
  ------------------
  |  |   54|  2.40M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.40M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  372|  2.40M|            d1 = BN_BITS2 - d0;
  ------------------
  |  |   54|  2.40M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.40M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  373|  2.40M|            z[n] ^= (zz << d0);
  374|  2.40M|            if (d0 && (tmp_ulong = zz >> d1))
  ------------------
  |  Branch (374:17): [True: 2.40M, False: 0]
  |  Branch (374:23): [True: 316k, False: 2.08M]
  ------------------
  375|   316k|                z[n + 1] ^= tmp_ulong;
  376|  2.40M|        }
  377|       |
  378|  1.33M|    }
  379|       |
  380|  1.39M|    bn_correct_top(r);
  381|  1.39M|    return 1;
  382|  1.39M|}
BN_GF2m_mod:
  391|  7.58k|{
  392|  7.58k|    int ret = 0;
  393|  7.58k|    int arr[6];
  394|  7.58k|    bn_check_top(a);
  395|  7.58k|    bn_check_top(p);
  396|  7.58k|    ret = BN_GF2m_poly2arr(p, arr, OSSL_NELEM(arr));
  ------------------
  |  |   14|  7.58k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  397|  7.58k|    if (!ret || ret > (int)OSSL_NELEM(arr)) {
  ------------------
  |  |   14|  7.58k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (397:9): [True: 0, False: 7.58k]
  |  Branch (397:17): [True: 0, False: 7.58k]
  ------------------
  398|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  399|      0|        return 0;
  400|      0|    }
  401|  7.58k|    ret = BN_GF2m_mod_arr(r, a, arr);
  402|  7.58k|    bn_check_top(r);
  403|  7.58k|    return ret;
  404|  7.58k|}
BN_GF2m_mod_mul_arr:
  412|  73.4k|{
  413|  73.4k|    int zlen, i, j, k, ret = 0;
  414|  73.4k|    BIGNUM *s;
  415|  73.4k|    BN_ULONG x1, x0, y1, y0, zz[4];
  ------------------
  |  |   37|  73.4k|#  define BN_ULONG        unsigned long
  ------------------
  416|       |
  417|  73.4k|    bn_check_top(a);
  418|  73.4k|    bn_check_top(b);
  419|       |
  420|  73.4k|    if (a == b) {
  ------------------
  |  Branch (420:9): [True: 0, False: 73.4k]
  ------------------
  421|      0|        return BN_GF2m_mod_sqr_arr(r, a, p, ctx);
  422|      0|    }
  423|       |
  424|  73.4k|    BN_CTX_start(ctx);
  425|  73.4k|    if ((s = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (425:9): [True: 0, False: 73.4k]
  ------------------
  426|      0|        goto err;
  427|       |
  428|  73.4k|    zlen = a->top + b->top + 4;
  429|  73.4k|    if (!bn_wexpand(s, zlen))
  ------------------
  |  Branch (429:9): [True: 0, False: 73.4k]
  ------------------
  430|      0|        goto err;
  431|  73.4k|    s->top = zlen;
  432|       |
  433|   863k|    for (i = 0; i < zlen; i++)
  ------------------
  |  Branch (433:17): [True: 790k, False: 73.4k]
  ------------------
  434|   790k|        s->d[i] = 0;
  435|       |
  436|   215k|    for (j = 0; j < b->top; j += 2) {
  ------------------
  |  Branch (436:17): [True: 141k, False: 73.4k]
  ------------------
  437|   141k|        y0 = b->d[j];
  438|   141k|        y1 = ((j + 1) == b->top) ? 0 : b->d[j + 1];
  ------------------
  |  Branch (438:14): [True: 31.8k, False: 109k]
  ------------------
  439|   492k|        for (i = 0; i < a->top; i += 2) {
  ------------------
  |  Branch (439:21): [True: 350k, False: 141k]
  ------------------
  440|   350k|            x0 = a->d[i];
  441|   350k|            x1 = ((i + 1) == a->top) ? 0 : a->d[i + 1];
  ------------------
  |  Branch (441:18): [True: 81.9k, False: 268k]
  ------------------
  442|   350k|            bn_GF2m_mul_2x2(zz, x1, x0, y1, y0);
  443|  1.75M|            for (k = 0; k < 4; k++)
  ------------------
  |  Branch (443:25): [True: 1.40M, False: 350k]
  ------------------
  444|  1.40M|                s->d[i + j + k] ^= zz[k];
  445|   350k|        }
  446|   141k|    }
  447|       |
  448|  73.4k|    bn_correct_top(s);
  449|  73.4k|    if (BN_GF2m_mod_arr(r, s, p))
  ------------------
  |  Branch (449:9): [True: 73.4k, False: 0]
  ------------------
  450|  73.4k|        ret = 1;
  451|  73.4k|    bn_check_top(r);
  452|       |
  453|  73.4k| err:
  454|  73.4k|    BN_CTX_end(ctx);
  455|  73.4k|    return ret;
  456|  73.4k|}
BN_GF2m_mod_mul:
  467|  22.7k|{
  468|  22.7k|    int ret = 0;
  469|  22.7k|    const int max = BN_num_bits(p) + 1;
  470|  22.7k|    int *arr;
  471|       |
  472|  22.7k|    bn_check_top(a);
  473|  22.7k|    bn_check_top(b);
  474|  22.7k|    bn_check_top(p);
  475|       |
  476|  22.7k|    arr = OPENSSL_malloc(sizeof(*arr) * max);
  ------------------
  |  |   97|  22.7k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  22.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  22.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  477|  22.7k|    if (arr == NULL)
  ------------------
  |  Branch (477:9): [True: 0, False: 22.7k]
  ------------------
  478|      0|        return 0;
  479|  22.7k|    ret = BN_GF2m_poly2arr(p, arr, max);
  480|  22.7k|    if (!ret || ret > max) {
  ------------------
  |  Branch (480:9): [True: 0, False: 22.7k]
  |  Branch (480:17): [True: 0, False: 22.7k]
  ------------------
  481|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  482|      0|        goto err;
  483|      0|    }
  484|  22.7k|    ret = BN_GF2m_mod_mul_arr(r, a, b, arr, ctx);
  485|  22.7k|    bn_check_top(r);
  486|  22.7k| err:
  487|  22.7k|    OPENSSL_free(arr);
  ------------------
  |  |  107|  22.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  22.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  22.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  488|  22.7k|    return ret;
  489|  22.7k|}
BN_GF2m_mod_sqr_arr:
  494|  1.27M|{
  495|  1.27M|    int i, ret = 0;
  496|  1.27M|    BIGNUM *s;
  497|       |
  498|  1.27M|    bn_check_top(a);
  499|  1.27M|    BN_CTX_start(ctx);
  500|  1.27M|    if ((s = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (500:9): [True: 0, False: 1.27M]
  ------------------
  501|      0|        goto err;
  502|  1.27M|    if (!bn_wexpand(s, 2 * a->top))
  ------------------
  |  Branch (502:9): [True: 0, False: 1.27M]
  ------------------
  503|      0|        goto err;
  504|       |
  505|  5.78M|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (505:26): [True: 4.51M, False: 1.27M]
  ------------------
  506|  4.51M|        s->d[2 * i + 1] = SQR1(a->d[i]);
  ------------------
  |  |   34|  4.51M|    SQR_nibble((w) >> 60) << 56 | SQR_nibble((w) >> 56) << 48 | \
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 60) << 56 | SQR_nibble((w) >> 56) << 48 | \
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   35|  4.51M|    SQR_nibble((w) >> 52) << 40 | SQR_nibble((w) >> 48) << 32 | \
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 52) << 40 | SQR_nibble((w) >> 48) << 32 | \
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   36|  4.51M|    SQR_nibble((w) >> 44) << 24 | SQR_nibble((w) >> 40) << 16 | \
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 44) << 24 | SQR_nibble((w) >> 40) << 16 | \
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   37|  4.51M|    SQR_nibble((w) >> 36) <<  8 | SQR_nibble((w) >> 32)
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 36) <<  8 | SQR_nibble((w) >> 32)
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  ------------------
  507|  4.51M|        s->d[2 * i] = SQR0(a->d[i]);
  ------------------
  |  |   39|  4.51M|    SQR_nibble((w) >> 28) << 56 | SQR_nibble((w) >> 24) << 48 | \
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 28) << 56 | SQR_nibble((w) >> 24) << 48 | \
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   40|  4.51M|    SQR_nibble((w) >> 20) << 40 | SQR_nibble((w) >> 16) << 32 | \
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 20) << 40 | SQR_nibble((w) >> 16) << 32 | \
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   41|  4.51M|    SQR_nibble((w) >> 12) << 24 | SQR_nibble((w) >>  8) << 16 | \
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 12) << 24 | SQR_nibble((w) >>  8) << 16 | \
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   42|  4.51M|    SQR_nibble((w) >>  4) <<  8 | SQR_nibble((w)      )
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >>  4) <<  8 | SQR_nibble((w)      )
  |  |  ------------------
  |  |  |  |   25|  4.51M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  4.51M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  4.51M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  4.51M|                       |   ((w) & 1))
  |  |  ------------------
  ------------------
  508|  4.51M|    }
  509|       |
  510|  1.27M|    s->top = 2 * a->top;
  511|  1.27M|    bn_correct_top(s);
  512|  1.27M|    if (!BN_GF2m_mod_arr(r, s, p))
  ------------------
  |  Branch (512:9): [True: 0, False: 1.27M]
  ------------------
  513|      0|        goto err;
  514|  1.27M|    bn_check_top(r);
  515|  1.27M|    ret = 1;
  516|  1.27M| err:
  517|  1.27M|    BN_CTX_end(ctx);
  518|  1.27M|    return ret;
  519|  1.27M|}
BN_GF2m_mod_inv:
  730|  7.58k|{
  731|  7.58k|    BIGNUM *b = NULL;
  732|  7.58k|    int ret = 0;
  733|       |
  734|  7.58k|    BN_CTX_start(ctx);
  735|  7.58k|    if ((b = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (735:9): [True: 0, False: 7.58k]
  ------------------
  736|      0|        goto err;
  737|       |
  738|       |    /* generate blinding value */
  739|  7.58k|    do {
  740|  7.58k|        if (!BN_priv_rand_ex(b, BN_num_bits(p) - 1,
  ------------------
  |  Branch (740:13): [True: 0, False: 7.58k]
  ------------------
  741|  7.58k|                             BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx))
  ------------------
  |  |   80|  7.58k|#define BN_RAND_TOP_ANY    -1
  ------------------
                                           BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx))
  ------------------
  |  |   85|  7.58k|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  742|      0|            goto err;
  743|  7.58k|    } while (BN_is_zero(b));
  ------------------
  |  Branch (743:14): [True: 0, False: 7.58k]
  ------------------
  744|       |
  745|       |    /* r := a * b */
  746|  7.58k|    if (!BN_GF2m_mod_mul(r, a, b, p, ctx))
  ------------------
  |  Branch (746:9): [True: 0, False: 7.58k]
  ------------------
  747|      0|        goto err;
  748|       |
  749|       |    /* r := 1/(a * b) */
  750|  7.58k|    if (!BN_GF2m_mod_inv_vartime(r, r, p, ctx))
  ------------------
  |  Branch (750:9): [True: 0, False: 7.58k]
  ------------------
  751|      0|        goto err;
  752|       |
  753|       |    /* r := b/(a * b) = 1/a */
  754|  7.58k|    if (!BN_GF2m_mod_mul(r, r, b, p, ctx))
  ------------------
  |  Branch (754:9): [True: 0, False: 7.58k]
  ------------------
  755|      0|        goto err;
  756|       |
  757|  7.58k|    ret = 1;
  758|       |
  759|  7.58k| err:
  760|  7.58k|    BN_CTX_end(ctx);
  761|  7.58k|    return ret;
  762|  7.58k|}
BN_GF2m_mod_div:
  797|  7.58k|{
  798|  7.58k|    BIGNUM *xinv = NULL;
  799|  7.58k|    int ret = 0;
  800|       |
  801|  7.58k|    bn_check_top(y);
  802|  7.58k|    bn_check_top(x);
  803|  7.58k|    bn_check_top(p);
  804|       |
  805|  7.58k|    BN_CTX_start(ctx);
  806|  7.58k|    xinv = BN_CTX_get(ctx);
  807|  7.58k|    if (xinv == NULL)
  ------------------
  |  Branch (807:9): [True: 0, False: 7.58k]
  ------------------
  808|      0|        goto err;
  809|       |
  810|  7.58k|    if (!BN_GF2m_mod_inv(xinv, x, p, ctx))
  ------------------
  |  Branch (810:9): [True: 0, False: 7.58k]
  ------------------
  811|      0|        goto err;
  812|  7.58k|    if (!BN_GF2m_mod_mul(r, y, xinv, p, ctx))
  ------------------
  |  Branch (812:9): [True: 0, False: 7.58k]
  ------------------
  813|      0|        goto err;
  814|  7.58k|    bn_check_top(r);
  815|  7.58k|    ret = 1;
  816|       |
  817|  7.58k| err:
  818|  7.58k|    BN_CTX_end(ctx);
  819|  7.58k|    return ret;
  820|  7.58k|}
BN_GF2m_mod_exp_arr:
  858|  1.12k|{
  859|  1.12k|    int ret = 0, i, n;
  860|  1.12k|    BIGNUM *u;
  861|       |
  862|  1.12k|    bn_check_top(a);
  863|  1.12k|    bn_check_top(b);
  864|       |
  865|  1.12k|    if (BN_is_zero(b))
  ------------------
  |  Branch (865:9): [True: 0, False: 1.12k]
  ------------------
  866|      0|        return BN_one(r);
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  867|       |
  868|  1.12k|    if (BN_abs_is_word(b, 1))
  ------------------
  |  Branch (868:9): [True: 0, False: 1.12k]
  ------------------
  869|      0|        return (BN_copy(r, a) != NULL);
  870|       |
  871|  1.12k|    BN_CTX_start(ctx);
  872|  1.12k|    if ((u = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (872:9): [True: 0, False: 1.12k]
  ------------------
  873|      0|        goto err;
  874|       |
  875|  1.12k|    if (!BN_GF2m_mod_arr(u, a, p))
  ------------------
  |  Branch (875:9): [True: 0, False: 1.12k]
  ------------------
  876|      0|        goto err;
  877|       |
  878|  1.12k|    n = BN_num_bits(b) - 1;
  879|   128k|    for (i = n - 1; i >= 0; i--) {
  ------------------
  |  Branch (879:21): [True: 127k, False: 1.12k]
  ------------------
  880|   127k|        if (!BN_GF2m_mod_sqr_arr(u, u, p, ctx))
  ------------------
  |  Branch (880:13): [True: 0, False: 127k]
  ------------------
  881|      0|            goto err;
  882|   127k|        if (BN_is_bit_set(b, i)) {
  ------------------
  |  Branch (882:13): [True: 0, False: 127k]
  ------------------
  883|      0|            if (!BN_GF2m_mod_mul_arr(u, u, a, p, ctx))
  ------------------
  |  Branch (883:17): [True: 0, False: 0]
  ------------------
  884|      0|                goto err;
  885|      0|        }
  886|   127k|    }
  887|  1.12k|    if (!BN_copy(r, u))
  ------------------
  |  Branch (887:9): [True: 0, False: 1.12k]
  ------------------
  888|      0|        goto err;
  889|  1.12k|    bn_check_top(r);
  890|  1.12k|    ret = 1;
  891|  1.12k| err:
  892|  1.12k|    BN_CTX_end(ctx);
  893|  1.12k|    return ret;
  894|  1.12k|}
BN_GF2m_mod_sqrt_arr:
  934|  1.12k|{
  935|  1.12k|    int ret = 0;
  936|  1.12k|    BIGNUM *u;
  937|       |
  938|  1.12k|    bn_check_top(a);
  939|       |
  940|  1.12k|    if (p[0] == 0) {
  ------------------
  |  Branch (940:9): [True: 0, False: 1.12k]
  ------------------
  941|       |        /* reduction mod 1 => return 0 */
  942|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  943|      0|        return 1;
  944|      0|    }
  945|       |
  946|  1.12k|    BN_CTX_start(ctx);
  947|  1.12k|    if ((u = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (947:9): [True: 0, False: 1.12k]
  ------------------
  948|      0|        goto err;
  949|       |
  950|  1.12k|    if (!BN_set_bit(u, p[0] - 1))
  ------------------
  |  Branch (950:9): [True: 0, False: 1.12k]
  ------------------
  951|      0|        goto err;
  952|  1.12k|    ret = BN_GF2m_mod_exp_arr(r, a, u, p, ctx);
  953|  1.12k|    bn_check_top(r);
  954|       |
  955|  1.12k| err:
  956|  1.12k|    BN_CTX_end(ctx);
  957|  1.12k|    return ret;
  958|  1.12k|}
BN_GF2m_mod_solve_quad_arr:
  996|  6.62k|{
  997|  6.62k|    int ret = 0, count = 0, j;
  998|  6.62k|    BIGNUM *a, *z, *rho, *w, *w2, *tmp;
  999|       |
 1000|  6.62k|    bn_check_top(a_);
 1001|       |
 1002|  6.62k|    if (p[0] == 0) {
  ------------------
  |  Branch (1002:9): [True: 0, False: 6.62k]
  ------------------
 1003|       |        /* reduction mod 1 => return 0 */
 1004|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1005|      0|        return 1;
 1006|      0|    }
 1007|       |
 1008|  6.62k|    BN_CTX_start(ctx);
 1009|  6.62k|    a = BN_CTX_get(ctx);
 1010|  6.62k|    z = BN_CTX_get(ctx);
 1011|  6.62k|    w = BN_CTX_get(ctx);
 1012|  6.62k|    if (w == NULL)
  ------------------
  |  Branch (1012:9): [True: 0, False: 6.62k]
  ------------------
 1013|      0|        goto err;
 1014|       |
 1015|  6.62k|    if (!BN_GF2m_mod_arr(a, a_, p))
  ------------------
  |  Branch (1015:9): [True: 0, False: 6.62k]
  ------------------
 1016|      0|        goto err;
 1017|       |
 1018|  6.62k|    if (BN_is_zero(a)) {
  ------------------
  |  Branch (1018:9): [True: 186, False: 6.44k]
  ------------------
 1019|    186|        BN_zero(r);
  ------------------
  |  |  202|    186|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1020|    186|        ret = 1;
 1021|    186|        goto err;
 1022|    186|    }
 1023|       |
 1024|  6.44k|    if (p[0] & 0x1) {           /* m is odd */
  ------------------
  |  Branch (1024:9): [True: 6.42k, False: 14]
  ------------------
 1025|       |        /* compute half-trace of a */
 1026|  6.42k|        if (!BN_copy(z, a))
  ------------------
  |  Branch (1026:13): [True: 0, False: 6.42k]
  ------------------
 1027|      0|            goto err;
 1028|   558k|        for (j = 1; j <= (p[0] - 1) / 2; j++) {
  ------------------
  |  Branch (1028:21): [True: 552k, False: 6.42k]
  ------------------
 1029|   552k|            if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
  ------------------
  |  Branch (1029:17): [True: 0, False: 552k]
  ------------------
 1030|      0|                goto err;
 1031|   552k|            if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
  ------------------
  |  Branch (1031:17): [True: 0, False: 552k]
  ------------------
 1032|      0|                goto err;
 1033|   552k|            if (!BN_GF2m_add(z, z, a))
  ------------------
  |  Branch (1033:17): [True: 0, False: 552k]
  ------------------
 1034|      0|                goto err;
 1035|   552k|        }
 1036|       |
 1037|  6.42k|    } else {                    /* m is even */
 1038|       |
 1039|     14|        rho = BN_CTX_get(ctx);
 1040|     14|        w2 = BN_CTX_get(ctx);
 1041|     14|        tmp = BN_CTX_get(ctx);
 1042|     14|        if (tmp == NULL)
  ------------------
  |  Branch (1042:13): [True: 0, False: 14]
  ------------------
 1043|      0|            goto err;
 1044|     30|        do {
 1045|     30|            if (!BN_priv_rand_ex(rho, p[0], BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   81|     30|#define BN_RAND_TOP_ONE     0
  ------------------
                          if (!BN_priv_rand_ex(rho, p[0], BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   85|     30|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  |  Branch (1045:17): [True: 0, False: 30]
  ------------------
 1046|     30|                                 0, ctx))
 1047|      0|                goto err;
 1048|     30|            if (!BN_GF2m_mod_arr(rho, rho, p))
  ------------------
  |  Branch (1048:17): [True: 0, False: 30]
  ------------------
 1049|      0|                goto err;
 1050|     30|            BN_zero(z);
  ------------------
  |  |  202|     30|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1051|     30|            if (!BN_copy(w, rho))
  ------------------
  |  Branch (1051:17): [True: 0, False: 30]
  ------------------
 1052|      0|                goto err;
 1053|  7.68k|            for (j = 1; j <= p[0] - 1; j++) {
  ------------------
  |  Branch (1053:25): [True: 7.65k, False: 30]
  ------------------
 1054|  7.65k|                if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
  ------------------
  |  Branch (1054:21): [True: 0, False: 7.65k]
  ------------------
 1055|      0|                    goto err;
 1056|  7.65k|                if (!BN_GF2m_mod_sqr_arr(w2, w, p, ctx))
  ------------------
  |  Branch (1056:21): [True: 0, False: 7.65k]
  ------------------
 1057|      0|                    goto err;
 1058|  7.65k|                if (!BN_GF2m_mod_mul_arr(tmp, w2, a, p, ctx))
  ------------------
  |  Branch (1058:21): [True: 0, False: 7.65k]
  ------------------
 1059|      0|                    goto err;
 1060|  7.65k|                if (!BN_GF2m_add(z, z, tmp))
  ------------------
  |  Branch (1060:21): [True: 0, False: 7.65k]
  ------------------
 1061|      0|                    goto err;
 1062|  7.65k|                if (!BN_GF2m_add(w, w2, rho))
  ------------------
  |  Branch (1062:21): [True: 0, False: 7.65k]
  ------------------
 1063|      0|                    goto err;
 1064|  7.65k|            }
 1065|     30|            count++;
 1066|     30|        } while (BN_is_zero(w) && (count < MAX_ITERATIONS));
  ------------------
  |  |   23|     16|# define MAX_ITERATIONS 50
  ------------------
  |  Branch (1066:18): [True: 16, False: 14]
  |  Branch (1066:35): [True: 16, False: 0]
  ------------------
 1067|     14|        if (BN_is_zero(w)) {
  ------------------
  |  Branch (1067:13): [True: 0, False: 14]
  ------------------
 1068|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1069|      0|            goto err;
 1070|      0|        }
 1071|     14|    }
 1072|       |
 1073|  6.44k|    if (!BN_GF2m_mod_sqr_arr(w, z, p, ctx))
  ------------------
  |  Branch (1073:9): [True: 0, False: 6.44k]
  ------------------
 1074|      0|        goto err;
 1075|  6.44k|    if (!BN_GF2m_add(w, z, w))
  ------------------
  |  Branch (1075:9): [True: 0, False: 6.44k]
  ------------------
 1076|      0|        goto err;
 1077|  6.44k|    if (BN_GF2m_cmp(w, a)) {
  ------------------
  |  |  504|  6.44k|#  define BN_GF2m_cmp(a, b) BN_ucmp((a), (b))
  |  |  ------------------
  |  |  |  Branch (504:29): [True: 1.80k, False: 4.63k]
  |  |  ------------------
  ------------------
 1078|  1.80k|        ERR_raise(ERR_LIB_BN, BN_R_NO_SOLUTION);
  ------------------
  |  |  401|  1.80k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.80k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.80k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  1.80k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  1.80k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  1.80k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.80k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1079|  1.80k|        goto err;
 1080|  1.80k|    }
 1081|       |
 1082|  4.63k|    if (!BN_copy(r, z))
  ------------------
  |  Branch (1082:9): [True: 0, False: 4.63k]
  ------------------
 1083|      0|        goto err;
 1084|  4.63k|    bn_check_top(r);
 1085|       |
 1086|  4.63k|    ret = 1;
 1087|       |
 1088|  6.62k| err:
 1089|  6.62k|    BN_CTX_end(ctx);
 1090|  6.62k|    return ret;
 1091|  4.63k|}
BN_GF2m_poly2arr:
 1132|  42.6k|{
 1133|  42.6k|    int i, j, k = 0;
 1134|  42.6k|    BN_ULONG mask;
  ------------------
  |  |   37|  42.6k|#  define BN_ULONG        unsigned long
  ------------------
 1135|       |
 1136|  42.6k|    if (BN_is_zero(a))
  ------------------
  |  Branch (1136:9): [True: 0, False: 42.6k]
  ------------------
 1137|      0|        return 0;
 1138|       |
 1139|   189k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (1139:26): [True: 146k, False: 42.6k]
  ------------------
 1140|   146k|        if (!a->d[i])
  ------------------
  |  Branch (1140:13): [True: 49.6k, False: 96.8k]
  ------------------
 1141|       |            /* skip word if a->d[i] == 0 */
 1142|  49.6k|            continue;
 1143|  96.8k|        mask = BN_TBIT;
  ------------------
  |  |   56|  96.8k|# define BN_TBIT        ((BN_ULONG)1 << (BN_BITS2 - 1))
  |  |  ------------------
  |  |  |  |   54|  96.8k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  96.8k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1144|  6.29M|        for (j = BN_BITS2 - 1; j >= 0; j--) {
  ------------------
  |  |   54|  96.8k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  96.8k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (1144:32): [True: 6.19M, False: 96.8k]
  ------------------
 1145|  6.19M|            if (a->d[i] & mask) {
  ------------------
  |  Branch (1145:17): [True: 164k, False: 6.03M]
  ------------------
 1146|   164k|                if (k < max)
  ------------------
  |  Branch (1146:21): [True: 164k, False: 0]
  ------------------
 1147|   164k|                    p[k] = BN_BITS2 * i + j;
  ------------------
  |  |   54|   164k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   164k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
 1148|   164k|                k++;
 1149|   164k|            }
 1150|  6.19M|            mask >>= 1;
 1151|  6.19M|        }
 1152|  96.8k|    }
 1153|       |
 1154|  42.6k|    if (k < max) {
  ------------------
  |  Branch (1154:9): [True: 42.6k, False: 0]
  ------------------
 1155|  42.6k|        p[k] = -1;
 1156|  42.6k|        k++;
 1157|  42.6k|    }
 1158|       |
 1159|  42.6k|    return k;
 1160|  42.6k|}
bn_gf2m.c:BN_GF2m_mod_inv_vartime:
  559|  7.58k|{
  560|  7.58k|    BIGNUM *b, *c = NULL, *u = NULL, *v = NULL, *tmp;
  561|  7.58k|    int ret = 0;
  562|       |
  563|  7.58k|    bn_check_top(a);
  564|  7.58k|    bn_check_top(p);
  565|       |
  566|  7.58k|    BN_CTX_start(ctx);
  567|       |
  568|  7.58k|    b = BN_CTX_get(ctx);
  569|  7.58k|    c = BN_CTX_get(ctx);
  570|  7.58k|    u = BN_CTX_get(ctx);
  571|  7.58k|    v = BN_CTX_get(ctx);
  572|  7.58k|    if (v == NULL)
  ------------------
  |  Branch (572:9): [True: 0, False: 7.58k]
  ------------------
  573|      0|        goto err;
  574|       |
  575|  7.58k|    if (!BN_GF2m_mod(u, a, p))
  ------------------
  |  Branch (575:9): [True: 0, False: 7.58k]
  ------------------
  576|      0|        goto err;
  577|  7.58k|    if (BN_is_zero(u))
  ------------------
  |  Branch (577:9): [True: 0, False: 7.58k]
  ------------------
  578|      0|        goto err;
  579|       |
  580|  7.58k|    if (!BN_copy(v, p))
  ------------------
  |  Branch (580:9): [True: 0, False: 7.58k]
  ------------------
  581|      0|        goto err;
  582|       |# if 0
  583|       |    if (!BN_one(b))
  584|       |        goto err;
  585|       |
  586|       |    while (1) {
  587|       |        while (!BN_is_odd(u)) {
  588|       |            if (BN_is_zero(u))
  589|       |                goto err;
  590|       |            if (!BN_rshift1(u, u))
  591|       |                goto err;
  592|       |            if (BN_is_odd(b)) {
  593|       |                if (!BN_GF2m_add(b, b, p))
  594|       |                    goto err;
  595|       |            }
  596|       |            if (!BN_rshift1(b, b))
  597|       |                goto err;
  598|       |        }
  599|       |
  600|       |        if (BN_abs_is_word(u, 1))
  601|       |            break;
  602|       |
  603|       |        if (BN_num_bits(u) < BN_num_bits(v)) {
  604|       |            tmp = u;
  605|       |            u = v;
  606|       |            v = tmp;
  607|       |            tmp = b;
  608|       |            b = c;
  609|       |            c = tmp;
  610|       |        }
  611|       |
  612|       |        if (!BN_GF2m_add(u, u, v))
  613|       |            goto err;
  614|       |        if (!BN_GF2m_add(b, b, c))
  615|       |            goto err;
  616|       |    }
  617|       |# else
  618|  7.58k|    {
  619|  7.58k|        int i;
  620|  7.58k|        int ubits = BN_num_bits(u);
  621|  7.58k|        int vbits = BN_num_bits(v); /* v is copy of p */
  622|  7.58k|        int top = p->top;
  623|  7.58k|        BN_ULONG *udp, *bdp, *vdp, *cdp;
  ------------------
  |  |   37|  7.58k|#  define BN_ULONG        unsigned long
  ------------------
  624|       |
  625|  7.58k|        if (!bn_wexpand(u, top))
  ------------------
  |  Branch (625:13): [True: 0, False: 7.58k]
  ------------------
  626|      0|            goto err;
  627|  7.58k|        udp = u->d;
  628|  7.92k|        for (i = u->top; i < top; i++)
  ------------------
  |  Branch (628:26): [True: 339, False: 7.58k]
  ------------------
  629|    339|            udp[i] = 0;
  630|  7.58k|        u->top = top;
  631|  7.58k|        if (!bn_wexpand(b, top))
  ------------------
  |  Branch (631:13): [True: 0, False: 7.58k]
  ------------------
  632|      0|          goto err;
  633|  7.58k|        bdp = b->d;
  634|  7.58k|        bdp[0] = 1;
  635|  23.6k|        for (i = 1; i < top; i++)
  ------------------
  |  Branch (635:21): [True: 16.0k, False: 7.58k]
  ------------------
  636|  16.0k|            bdp[i] = 0;
  637|  7.58k|        b->top = top;
  638|  7.58k|        if (!bn_wexpand(c, top))
  ------------------
  |  Branch (638:13): [True: 0, False: 7.58k]
  ------------------
  639|      0|          goto err;
  640|  7.58k|        cdp = c->d;
  641|  31.2k|        for (i = 0; i < top; i++)
  ------------------
  |  Branch (641:21): [True: 23.6k, False: 7.58k]
  ------------------
  642|  23.6k|            cdp[i] = 0;
  643|  7.58k|        c->top = top;
  644|  7.58k|        vdp = v->d;             /* It pays off to "cache" *->d pointers,
  645|       |                                 * because it allows optimizer to be more
  646|       |                                 * aggressive. But we don't have to "cache"
  647|       |                                 * p->d, because *p is declared 'const'... */
  648|  1.04M|        while (1) {
  ------------------
  |  Branch (648:16): [Folded - Ignored]
  ------------------
  649|  3.13M|            while (ubits && !(udp[0] & 1)) {
  ------------------
  |  Branch (649:20): [True: 3.13M, False: 0]
  |  Branch (649:29): [True: 2.08M, False: 1.04M]
  ------------------
  650|  2.08M|                BN_ULONG u0, u1, b0, b1, mask;
  ------------------
  |  |   37|  2.08M|#  define BN_ULONG        unsigned long
  ------------------
  651|       |
  652|  2.08M|                u0 = udp[0];
  653|  2.08M|                b0 = bdp[0];
  654|  2.08M|                mask = (BN_ULONG)0 - (b0 & 1);
  655|  2.08M|                b0 ^= p->d[0] & mask;
  656|  7.52M|                for (i = 0; i < top - 1; i++) {
  ------------------
  |  Branch (656:29): [True: 5.44M, False: 2.08M]
  ------------------
  657|  5.44M|                    u1 = udp[i + 1];
  658|  5.44M|                    udp[i] = ((u0 >> 1) | (u1 << (BN_BITS2 - 1))) & BN_MASK2;
  ------------------
  |  |   54|  5.44M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  5.44M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                                  udp[i] = ((u0 >> 1) | (u1 << (BN_BITS2 - 1))) & BN_MASK2;
  ------------------
  |  |   94|  5.44M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  659|  5.44M|                    u0 = u1;
  660|  5.44M|                    b1 = bdp[i + 1] ^ (p->d[i + 1] & mask);
  661|  5.44M|                    bdp[i] = ((b0 >> 1) | (b1 << (BN_BITS2 - 1))) & BN_MASK2;
  ------------------
  |  |   54|  5.44M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  5.44M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                                  bdp[i] = ((b0 >> 1) | (b1 << (BN_BITS2 - 1))) & BN_MASK2;
  ------------------
  |  |   94|  5.44M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  662|  5.44M|                    b0 = b1;
  663|  5.44M|                }
  664|  2.08M|                udp[i] = u0 >> 1;
  665|  2.08M|                bdp[i] = b0 >> 1;
  666|  2.08M|                ubits--;
  667|  2.08M|            }
  668|       |
  669|  1.04M|            if (ubits <= BN_BITS2) {
  ------------------
  |  |   54|  1.04M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.04M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (669:17): [True: 396k, False: 650k]
  ------------------
  670|   396k|                if (udp[0] == 0) /* poly was reducible */
  ------------------
  |  Branch (670:21): [True: 0, False: 396k]
  ------------------
  671|      0|                    goto err;
  672|   396k|                if (udp[0] == 1)
  ------------------
  |  Branch (672:21): [True: 7.58k, False: 388k]
  ------------------
  673|  7.58k|                    break;
  674|   396k|            }
  675|       |
  676|  1.03M|            if (ubits < vbits) {
  ------------------
  |  Branch (676:17): [True: 418k, False: 621k]
  ------------------
  677|   418k|                i = ubits;
  678|   418k|                ubits = vbits;
  679|   418k|                vbits = i;
  680|   418k|                tmp = u;
  681|   418k|                u = v;
  682|   418k|                v = tmp;
  683|   418k|                tmp = b;
  684|   418k|                b = c;
  685|   418k|                c = tmp;
  686|   418k|                udp = vdp;
  687|   418k|                vdp = v->d;
  688|   418k|                bdp = cdp;
  689|   418k|                cdp = c->d;
  690|   418k|            }
  691|  4.79M|            for (i = 0; i < top; i++) {
  ------------------
  |  Branch (691:25): [True: 3.75M, False: 1.03M]
  ------------------
  692|  3.75M|                udp[i] ^= vdp[i];
  693|  3.75M|                bdp[i] ^= cdp[i];
  694|  3.75M|            }
  695|  1.03M|            if (ubits == vbits) {
  ------------------
  |  Branch (695:17): [True: 208k, False: 831k]
  ------------------
  696|   208k|                BN_ULONG ul;
  ------------------
  |  |   37|   208k|#  define BN_ULONG        unsigned long
  ------------------
  697|   208k|                int utop = (ubits - 1) / BN_BITS2;
  ------------------
  |  |   54|   208k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   208k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  698|       |
  699|   213k|                while ((ul = udp[utop]) == 0 && utop)
  ------------------
  |  Branch (699:24): [True: 5.21k, False: 208k]
  |  Branch (699:49): [True: 5.21k, False: 0]
  ------------------
  700|  5.21k|                    utop--;
  701|   208k|                ubits = utop * BN_BITS2 + BN_num_bits_word(ul);
  ------------------
  |  |   54|   208k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   208k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  702|   208k|            }
  703|  1.03M|        }
  704|  7.58k|        bn_correct_top(b);
  705|  7.58k|    }
  706|      0|# endif
  707|       |
  708|  7.58k|    if (!BN_copy(r, b))
  ------------------
  |  Branch (708:9): [True: 0, False: 7.58k]
  ------------------
  709|      0|        goto err;
  710|  7.58k|    bn_check_top(r);
  711|  7.58k|    ret = 1;
  712|       |
  713|  7.58k| err:
  714|       |# ifdef BN_DEBUG
  715|       |    /* BN_CTX_end would complain about the expanded form */
  716|       |    bn_correct_top(c);
  717|       |    bn_correct_top(u);
  718|       |    bn_correct_top(v);
  719|       |# endif
  720|  7.58k|    BN_CTX_end(ctx);
  721|  7.58k|    return ret;
  722|  7.58k|}

bn_set_all_zero:
  148|  49.0k|{
  149|  49.0k|    int i;
  150|       |
  151|   137k|    for (i = a->top; i < a->dmax; i++)
  ------------------
  |  Branch (151:22): [True: 88.9k, False: 49.0k]
  ------------------
  152|  88.9k|        a->d[i] = 0;
  153|  49.0k|}

BN_kronecker:
   18|  53.1k|{
   19|  53.1k|    int i;
   20|  53.1k|    int ret = -2;               /* avoid 'uninitialized' warning */
   21|  53.1k|    int err = 0;
   22|  53.1k|    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|  53.1k|    static const int tab[8] = { 0, 1, 0, -1, 0, -1, 0, 1 };
   31|       |
   32|  53.1k|    bn_check_top(a);
   33|  53.1k|    bn_check_top(b);
   34|       |
   35|  53.1k|    BN_CTX_start(ctx);
   36|  53.1k|    A = BN_CTX_get(ctx);
   37|  53.1k|    B = BN_CTX_get(ctx);
   38|  53.1k|    if (B == NULL)
  ------------------
  |  Branch (38:9): [True: 0, False: 53.1k]
  ------------------
   39|      0|        goto end;
   40|       |
   41|  53.1k|    err = !BN_copy(A, a);
   42|  53.1k|    if (err)
  ------------------
  |  Branch (42:9): [True: 0, False: 53.1k]
  ------------------
   43|      0|        goto end;
   44|  53.1k|    err = !BN_copy(B, b);
   45|  53.1k|    if (err)
  ------------------
  |  Branch (45:9): [True: 0, False: 53.1k]
  ------------------
   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|  53.1k|    if (BN_is_zero(B)) {
  ------------------
  |  Branch (56:9): [True: 0, False: 53.1k]
  ------------------
   57|      0|        ret = BN_abs_is_word(A, 1);
   58|      0|        goto end;
   59|      0|    }
   60|       |
   61|       |    /* Cohen's step 2: */
   62|       |
   63|  53.1k|    if (!BN_is_odd(A) && !BN_is_odd(B)) {
  ------------------
  |  Branch (63:9): [True: 26.5k, False: 26.5k]
  |  Branch (63:26): [True: 0, False: 26.5k]
  ------------------
   64|      0|        ret = 0;
   65|      0|        goto end;
   66|      0|    }
   67|       |
   68|       |    /* now  B  is non-zero */
   69|  53.1k|    i = 0;
   70|  53.1k|    while (!BN_is_bit_set(B, i))
  ------------------
  |  Branch (70:12): [True: 0, False: 53.1k]
  ------------------
   71|      0|        i++;
   72|  53.1k|    err = !BN_rshift(B, B, i);
   73|  53.1k|    if (err)
  ------------------
  |  Branch (73:9): [True: 0, False: 53.1k]
  ------------------
   74|      0|        goto end;
   75|  53.1k|    if (i & 1) {
  ------------------
  |  Branch (75:9): [True: 0, False: 53.1k]
  ------------------
   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|  53.1k|    } else {
   82|       |        /* i is even */
   83|  53.1k|        ret = 1;
   84|  53.1k|    }
   85|       |
   86|  53.1k|    if (B->neg) {
  ------------------
  |  Branch (86:9): [True: 0, False: 53.1k]
  ------------------
   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|   143k|    while (1) {
  ------------------
  |  Branch (97:12): [Folded - Ignored]
  ------------------
   98|       |        /* Cohen's step 3: */
   99|       |
  100|       |        /*  B  is positive and odd */
  101|       |
  102|   143k|        if (BN_is_zero(A)) {
  ------------------
  |  Branch (102:13): [True: 53.1k, False: 90.3k]
  ------------------
  103|  53.1k|            ret = BN_is_one(B) ? ret : 0;
  ------------------
  |  Branch (103:19): [True: 53.1k, False: 0]
  ------------------
  104|  53.1k|            goto end;
  105|  53.1k|        }
  106|       |
  107|       |        /* now  A  is non-zero */
  108|  90.3k|        i = 0;
  109|   169k|        while (!BN_is_bit_set(A, i))
  ------------------
  |  Branch (109:16): [True: 79.6k, False: 90.3k]
  ------------------
  110|  79.6k|            i++;
  111|  90.3k|        err = !BN_rshift(A, A, i);
  112|  90.3k|        if (err)
  ------------------
  |  Branch (112:13): [True: 0, False: 90.3k]
  ------------------
  113|      0|            goto end;
  114|  90.3k|        if (i & 1) {
  ------------------
  |  Branch (114:13): [True: 26.5k, False: 63.7k]
  ------------------
  115|       |            /* i is odd */
  116|       |            /* multiply 'ret' by  $(-1)^{(B^2-1)/8}$ */
  117|  26.5k|            ret = ret * tab[BN_lsw(B) & 7];
  ------------------
  |  |   14|  26.5k|#define BN_lsw(n) (((n)->top == 0) ? (BN_ULONG) 0 : (n)->d[0])
  |  |  ------------------
  |  |  |  Branch (14:20): [True: 0, False: 26.5k]
  |  |  ------------------
  ------------------
  118|  26.5k|        }
  119|       |
  120|       |        /* Cohen's step 4: */
  121|       |        /* multiply 'ret' by  $(-1)^{(A-1)(B-1)/4}$ */
  122|  90.3k|        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|  90.3k|#define BN_lsw(n) (((n)->top == 0) ? (BN_ULONG) 0 : (n)->d[0])
  |  |  ------------------
  |  |  |  Branch (14:20): [True: 0, False: 90.3k]
  |  |  ------------------
  ------------------
                      if ((A->neg ? ~BN_lsw(A) : BN_lsw(A)) & BN_lsw(B) & 2)
  ------------------
  |  |   14|  90.3k|#define BN_lsw(n) (((n)->top == 0) ? (BN_ULONG) 0 : (n)->d[0])
  |  |  ------------------
  |  |  |  Branch (14:20): [True: 0, False: 90.3k]
  |  |  ------------------
  ------------------
  |  Branch (122:13): [True: 0, False: 90.3k]
  |  Branch (122:14): [True: 0, False: 90.3k]
  ------------------
  123|      0|            ret = -ret;
  124|       |
  125|       |        /* (A, B) := (B mod |A|, |A|) */
  126|  90.3k|        err = !BN_nnmod(B, B, A, ctx);
  127|  90.3k|        if (err)
  ------------------
  |  Branch (127:13): [True: 0, False: 90.3k]
  ------------------
  128|      0|            goto end;
  129|  90.3k|        tmp = A;
  130|  90.3k|        A = B;
  131|  90.3k|        B = tmp;
  132|  90.3k|        tmp->neg = 0;
  133|  90.3k|    }
  134|  53.1k| end:
  135|  53.1k|    BN_CTX_end(ctx);
  136|  53.1k|    if (err)
  ------------------
  |  Branch (136:9): [True: 0, False: 53.1k]
  ------------------
  137|      0|        return -2;
  138|  53.1k|    else
  139|  53.1k|        return ret;
  140|  53.1k|}

BN_value_one:
   83|  65.8k|{
   84|  65.8k|    static const BN_ULONG data_one = 1L;
   85|  65.8k|    static const BIGNUM const_one =
   86|  65.8k|        { (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA };
  ------------------
  |  |   59|  65.8k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
   87|       |
   88|  65.8k|    return &const_one;
   89|  65.8k|}
BN_num_bits_word:
  101|  12.2M|{
  102|  12.2M|    BN_ULONG x, mask;
  ------------------
  |  |   37|  12.2M|#  define BN_ULONG        unsigned long
  ------------------
  103|  12.2M|    int bits = (l != 0);
  104|       |
  105|  12.2M|#if BN_BITS2 > 32
  106|  12.2M|    x = l >> 32;
  107|  12.2M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  12.2M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  108|  12.2M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  12.2M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  109|  12.2M|    bits += 32 & mask;
  110|  12.2M|    l ^= (x ^ l) & mask;
  111|  12.2M|#endif
  112|       |
  113|  12.2M|    x = l >> 16;
  114|  12.2M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  12.2M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  115|  12.2M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  12.2M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  116|  12.2M|    bits += 16 & mask;
  117|  12.2M|    l ^= (x ^ l) & mask;
  118|       |
  119|  12.2M|    x = l >> 8;
  120|  12.2M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  12.2M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  121|  12.2M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  12.2M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  122|  12.2M|    bits += 8 & mask;
  123|  12.2M|    l ^= (x ^ l) & mask;
  124|       |
  125|  12.2M|    x = l >> 4;
  126|  12.2M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  12.2M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  127|  12.2M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  12.2M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  128|  12.2M|    bits += 4 & mask;
  129|  12.2M|    l ^= (x ^ l) & mask;
  130|       |
  131|  12.2M|    x = l >> 2;
  132|  12.2M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  12.2M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  133|  12.2M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  12.2M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  134|  12.2M|    bits += 2 & mask;
  135|  12.2M|    l ^= (x ^ l) & mask;
  136|       |
  137|  12.2M|    x = l >> 1;
  138|  12.2M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  12.2M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  139|  12.2M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  12.2M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  140|  12.2M|    bits += 1 & mask;
  141|       |
  142|  12.2M|    return bits;
  143|  12.2M|}
BN_num_bits:
  179|   412k|{
  180|   412k|    int i = a->top - 1;
  181|   412k|    bn_check_top(a);
  182|       |
  183|   412k|    if (a->flags & BN_FLG_CONSTTIME) {
  ------------------
  |  |   67|   412k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (183:9): [True: 0, False: 412k]
  ------------------
  184|       |        /*
  185|       |         * We assume that BIGNUMs flagged as CONSTTIME have also been expanded
  186|       |         * so that a->dmax is not leaking secret information.
  187|       |         *
  188|       |         * In other words, it's the caller's responsibility to ensure `a` has
  189|       |         * been preallocated in advance to a public length if we hit this
  190|       |         * branch.
  191|       |         *
  192|       |         */
  193|      0|        return bn_num_bits_consttime(a);
  194|      0|    }
  195|       |
  196|   412k|    if (BN_is_zero(a))
  ------------------
  |  Branch (196:9): [True: 9.82k, False: 403k]
  ------------------
  197|  9.82k|        return 0;
  198|       |
  199|   403k|    return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
  ------------------
  |  |   54|   403k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   403k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  200|   412k|}
BN_clear_free:
  214|  1.33M|{
  215|  1.33M|    if (a == NULL)
  ------------------
  |  Branch (215:9): [True: 89.4k, False: 1.24M]
  ------------------
  216|  89.4k|        return;
  217|  1.24M|    if (a->d != NULL && !BN_get_flags(a, BN_FLG_STATIC_DATA))
  ------------------
  |  |   59|  1.14M|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (217:9): [True: 1.14M, False: 99.9k]
  |  Branch (217:25): [True: 1.14M, False: 0]
  ------------------
  218|  1.14M|        bn_free_d(a, 1);
  219|  1.24M|    if (BN_get_flags(a, BN_FLG_MALLOCED)) {
  ------------------
  |  |   58|  1.24M|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (219:9): [True: 7.21k, False: 1.23M]
  ------------------
  220|  7.21k|        OPENSSL_cleanse(a, sizeof(*a));
  221|  7.21k|        OPENSSL_free(a);
  ------------------
  |  |  107|  7.21k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  7.21k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  7.21k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  222|  7.21k|    }
  223|  1.24M|}
BN_free:
  226|   956k|{
  227|   956k|    if (a == NULL)
  ------------------
  |  Branch (227:9): [True: 59.8k, False: 896k]
  ------------------
  228|  59.8k|        return;
  229|   896k|    if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  ------------------
  |  |   59|   896k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (229:9): [True: 896k, False: 0]
  ------------------
  230|   896k|        bn_free_d(a, 0);
  231|   896k|    if (a->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|   896k|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (231:9): [True: 896k, False: 0]
  ------------------
  232|   896k|        OPENSSL_free(a);
  ------------------
  |  |  107|   896k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   896k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   896k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  233|   896k|}
bn_init:
  236|  1.92M|{
  237|  1.92M|    static BIGNUM nilbn;
  238|       |
  239|  1.92M|    *a = nilbn;
  240|  1.92M|    bn_check_top(a);
  241|  1.92M|}
BN_new:
  244|   903k|{
  245|   903k|    BIGNUM *ret;
  246|       |
  247|   903k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |   99|   903k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   903k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   903k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (247:9): [True: 0, False: 903k]
  ------------------
  248|      0|        return NULL;
  249|   903k|    ret->flags = BN_FLG_MALLOCED;
  ------------------
  |  |   58|   903k|# define BN_FLG_MALLOCED         0x01
  ------------------
  250|   903k|    bn_check_top(ret);
  251|   903k|    return ret;
  252|   903k|}
bn_expand2:
  299|  2.73M|{
  300|  2.73M|    if (words > b->dmax) {
  ------------------
  |  Branch (300:9): [True: 2.73M, False: 0]
  ------------------
  301|  2.73M|        BN_ULONG *a = bn_expand_internal(b, words);
  ------------------
  |  |   37|  2.73M|#  define BN_ULONG        unsigned long
  ------------------
  302|  2.73M|        if (!a)
  ------------------
  |  Branch (302:13): [True: 0, False: 2.73M]
  ------------------
  303|      0|            return NULL;
  304|  2.73M|        if (b->d != NULL)
  ------------------
  |  Branch (304:13): [True: 765k, False: 1.97M]
  ------------------
  305|   765k|            bn_free_d(b, 1);
  306|  2.73M|        b->d = a;
  307|  2.73M|        b->dmax = words;
  308|  2.73M|    }
  309|       |
  310|  2.73M|    return b;
  311|  2.73M|}
BN_dup:
  314|  13.7k|{
  315|  13.7k|    BIGNUM *t;
  316|       |
  317|  13.7k|    if (a == NULL)
  ------------------
  |  Branch (317:9): [True: 0, False: 13.7k]
  ------------------
  318|      0|        return NULL;
  319|  13.7k|    bn_check_top(a);
  320|       |
  321|  13.7k|    t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();
  ------------------
  |  |   68|  13.7k|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (321:9): [True: 0, False: 13.7k]
  ------------------
  322|  13.7k|    if (t == NULL)
  ------------------
  |  Branch (322:9): [True: 0, False: 13.7k]
  ------------------
  323|      0|        return NULL;
  324|  13.7k|    if (!BN_copy(t, a)) {
  ------------------
  |  Branch (324:9): [True: 0, False: 13.7k]
  ------------------
  325|      0|        BN_free(t);
  326|      0|        return NULL;
  327|      0|    }
  328|  13.7k|    bn_check_top(t);
  329|  13.7k|    return t;
  330|  13.7k|}
BN_copy:
  333|  13.0M|{
  334|  13.0M|    int bn_words;
  335|       |
  336|  13.0M|    bn_check_top(b);
  337|       |
  338|  13.0M|    bn_words = BN_get_flags(b, BN_FLG_CONSTTIME) ? b->dmax : b->top;
  ------------------
  |  |   67|  13.0M|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (338:16): [True: 0, False: 13.0M]
  ------------------
  339|       |
  340|  13.0M|    if (a == b)
  ------------------
  |  Branch (340:9): [True: 0, False: 13.0M]
  ------------------
  341|      0|        return a;
  342|  13.0M|    if (bn_wexpand(a, bn_words) == NULL)
  ------------------
  |  Branch (342:9): [True: 0, False: 13.0M]
  ------------------
  343|      0|        return NULL;
  344|       |
  345|  13.0M|    if (b->top > 0)
  ------------------
  |  Branch (345:9): [True: 12.9M, False: 50.5k]
  ------------------
  346|  12.9M|        memcpy(a->d, b->d, sizeof(b->d[0]) * bn_words);
  347|       |
  348|  13.0M|    a->neg = b->neg;
  349|  13.0M|    a->top = b->top;
  350|  13.0M|    a->flags |= b->flags & BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  13.0M|#  define BN_FLG_FIXED_TOP 0
  ------------------
  351|  13.0M|    bn_check_top(a);
  352|  13.0M|    return a;
  353|  13.0M|}
BN_clear:
  395|  10.1k|{
  396|  10.1k|    if (a == NULL)
  ------------------
  |  Branch (396:9): [True: 0, False: 10.1k]
  ------------------
  397|      0|        return;
  398|  10.1k|    bn_check_top(a);
  399|  10.1k|    if (a->d != NULL)
  ------------------
  |  Branch (399:9): [True: 0, False: 10.1k]
  ------------------
  400|      0|        OPENSSL_cleanse(a->d, sizeof(*a->d) * a->dmax);
  401|  10.1k|    a->neg = 0;
  402|  10.1k|    a->top = 0;
  403|  10.1k|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  10.1k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  404|  10.1k|}
BN_set_word:
  417|   156k|{
  418|   156k|    bn_check_top(a);
  419|   156k|    if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
  ------------------
  |  Branch (419:9): [True: 0, False: 156k]
  ------------------
  420|      0|        return 0;
  421|   156k|    a->neg = 0;
  422|   156k|    a->d[0] = w;
  423|   156k|    a->top = (w ? 1 : 0);
  ------------------
  |  Branch (423:15): [True: 156k, False: 0]
  ------------------
  424|   156k|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   156k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  425|   156k|    bn_check_top(a);
  426|   156k|    return 1;
  427|   156k|}
BN_bin2bn:
  535|   276k|{
  536|   276k|    return bin2bn(s, len, ret, BIG, UNSIGNED);
  537|   276k|}
BN_ucmp:
  707|  3.28M|{
  708|  3.28M|    int i;
  709|  3.28M|    BN_ULONG t1, t2, *ap, *bp;
  ------------------
  |  |   37|  3.28M|#  define BN_ULONG        unsigned long
  ------------------
  710|       |
  711|  3.28M|    bn_check_top(a);
  712|  3.28M|    bn_check_top(b);
  713|       |
  714|  3.28M|    i = a->top - b->top;
  715|  3.28M|    if (i != 0)
  ------------------
  |  Branch (715:9): [True: 143k, False: 3.14M]
  ------------------
  716|   143k|        return i;
  717|  3.14M|    ap = a->d;
  718|  3.14M|    bp = b->d;
  719|  3.34M|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (719:26): [True: 3.26M, False: 80.7k]
  ------------------
  720|  3.26M|        t1 = ap[i];
  721|  3.26M|        t2 = bp[i];
  722|  3.26M|        if (t1 != t2)
  ------------------
  |  Branch (722:13): [True: 3.06M, False: 202k]
  ------------------
  723|  3.06M|            return ((t1 > t2) ? 1 : -1);
  ------------------
  |  Branch (723:21): [True: 1.26M, False: 1.79M]
  ------------------
  724|  3.26M|    }
  725|  80.7k|    return 0;
  726|  3.14M|}
BN_cmp:
  729|   135k|{
  730|   135k|    int i;
  731|   135k|    int gt, lt;
  732|   135k|    BN_ULONG t1, t2;
  ------------------
  |  |   37|   135k|#  define BN_ULONG        unsigned long
  ------------------
  733|       |
  734|   135k|    if ((a == NULL) || (b == NULL)) {
  ------------------
  |  Branch (734:9): [True: 0, False: 135k]
  |  Branch (734:24): [True: 0, False: 135k]
  ------------------
  735|      0|        if (a != NULL)
  ------------------
  |  Branch (735:13): [True: 0, False: 0]
  ------------------
  736|      0|            return -1;
  737|      0|        else if (b != NULL)
  ------------------
  |  Branch (737:18): [True: 0, False: 0]
  ------------------
  738|      0|            return 1;
  739|      0|        else
  740|      0|            return 0;
  741|      0|    }
  742|       |
  743|   135k|    bn_check_top(a);
  744|   135k|    bn_check_top(b);
  745|       |
  746|   135k|    if (a->neg != b->neg) {
  ------------------
  |  Branch (746:9): [True: 0, False: 135k]
  ------------------
  747|      0|        if (a->neg)
  ------------------
  |  Branch (747:13): [True: 0, False: 0]
  ------------------
  748|      0|            return -1;
  749|      0|        else
  750|      0|            return 1;
  751|      0|    }
  752|   135k|    if (a->neg == 0) {
  ------------------
  |  Branch (752:9): [True: 135k, False: 0]
  ------------------
  753|   135k|        gt = 1;
  754|   135k|        lt = -1;
  755|   135k|    } else {
  756|      0|        gt = -1;
  757|      0|        lt = 1;
  758|      0|    }
  759|       |
  760|   135k|    if (a->top > b->top)
  ------------------
  |  Branch (760:9): [True: 2.07k, False: 133k]
  ------------------
  761|  2.07k|        return gt;
  762|   133k|    if (a->top < b->top)
  ------------------
  |  Branch (762:9): [True: 77.8k, False: 56.0k]
  ------------------
  763|  77.8k|        return lt;
  764|   264k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (764:26): [True: 223k, False: 41.5k]
  ------------------
  765|   223k|        t1 = a->d[i];
  766|   223k|        t2 = b->d[i];
  767|   223k|        if (t1 > t2)
  ------------------
  |  Branch (767:13): [True: 5.52k, False: 217k]
  ------------------
  768|  5.52k|            return gt;
  769|   217k|        if (t1 < t2)
  ------------------
  |  Branch (769:13): [True: 8.91k, False: 208k]
  ------------------
  770|  8.91k|            return lt;
  771|   217k|    }
  772|  41.5k|    return 0;
  773|  56.0k|}
BN_set_bit:
  776|   121k|{
  777|   121k|    int i, j, k;
  778|       |
  779|   121k|    if (n < 0)
  ------------------
  |  Branch (779:9): [True: 0, False: 121k]
  ------------------
  780|      0|        return 0;
  781|       |
  782|   121k|    i = n / BN_BITS2;
  ------------------
  |  |   54|   121k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   121k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  783|   121k|    j = n % BN_BITS2;
  ------------------
  |  |   54|   121k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   121k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  784|   121k|    if (a->top <= i) {
  ------------------
  |  Branch (784:9): [True: 121k, False: 0]
  ------------------
  785|   121k|        if (bn_wexpand(a, i + 1) == NULL)
  ------------------
  |  Branch (785:13): [True: 0, False: 121k]
  ------------------
  786|      0|            return 0;
  787|   863k|        for (k = a->top; k < i + 1; k++)
  ------------------
  |  Branch (787:26): [True: 742k, False: 121k]
  ------------------
  788|   742k|            a->d[k] = 0;
  789|   121k|        a->top = i + 1;
  790|   121k|        a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   121k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  791|   121k|    }
  792|       |
  793|   121k|    a->d[i] |= (((BN_ULONG)1) << j);
  794|   121k|    bn_check_top(a);
  795|   121k|    return 1;
  796|   121k|}
BN_is_bit_set:
  817|  14.3M|{
  818|  14.3M|    int i, j;
  819|       |
  820|  14.3M|    bn_check_top(a);
  821|  14.3M|    if (n < 0)
  ------------------
  |  Branch (821:9): [True: 0, False: 14.3M]
  ------------------
  822|      0|        return 0;
  823|  14.3M|    i = n / BN_BITS2;
  ------------------
  |  |   54|  14.3M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  14.3M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  824|  14.3M|    j = n % BN_BITS2;
  ------------------
  |  |   54|  14.3M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  14.3M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  825|  14.3M|    if (a->top <= i)
  ------------------
  |  Branch (825:9): [True: 0, False: 14.3M]
  ------------------
  826|      0|        return 0;
  827|  14.3M|    return (int)(((a->d[i]) >> j) & ((BN_ULONG)1));
  828|  14.3M|}
BN_set_negative:
  853|  75.5k|{
  854|  75.5k|    if (b && !BN_is_zero(a))
  ------------------
  |  Branch (854:9): [True: 789, False: 74.7k]
  |  Branch (854:14): [True: 789, False: 0]
  ------------------
  855|    789|        a->neg = 1;
  856|  74.7k|    else
  857|  74.7k|        a->neg = 0;
  858|  75.5k|}
BN_security_bits:
  976|  6.80k|{
  977|  6.80k|    int secbits, bits;
  978|  6.80k|    if (L >= 15360)
  ------------------
  |  Branch (978:9): [True: 7, False: 6.79k]
  ------------------
  979|      7|        secbits = 256;
  980|  6.79k|    else if (L >= 7680)
  ------------------
  |  Branch (980:14): [True: 11, False: 6.78k]
  ------------------
  981|     11|        secbits = 192;
  982|  6.78k|    else if (L >= 3072)
  ------------------
  |  Branch (982:14): [True: 871, False: 5.91k]
  ------------------
  983|    871|        secbits = 128;
  984|  5.91k|    else if (L >= 2048)
  ------------------
  |  Branch (984:14): [True: 99, False: 5.81k]
  ------------------
  985|     99|        secbits = 112;
  986|  5.81k|    else if (L >= 1024)
  ------------------
  |  Branch (986:14): [True: 125, False: 5.69k]
  ------------------
  987|    125|        secbits = 80;
  988|  5.69k|    else
  989|  5.69k|        return 0;
  990|  1.11k|    if (N == -1)
  ------------------
  |  Branch (990:9): [True: 38, False: 1.07k]
  ------------------
  991|     38|        return secbits;
  992|  1.07k|    bits = N / 2;
  993|  1.07k|    if (bits < 80)
  ------------------
  |  Branch (993:9): [True: 243, False: 832]
  ------------------
  994|    243|        return 0;
  995|    832|    return bits >= secbits ? secbits : bits;
  ------------------
  |  Branch (995:12): [True: 831, False: 1]
  ------------------
  996|  1.07k|}
BN_zero_ex:
  999|  70.3M|{
 1000|  70.3M|    a->neg = 0;
 1001|  70.3M|    a->top = 0;
 1002|  70.3M|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  70.3M|#  define BN_FLG_FIXED_TOP 0
  ------------------
 1003|  70.3M|}
BN_abs_is_word:
 1006|  10.4M|{
 1007|  10.4M|    return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
  ------------------
  |  Branch (1007:13): [True: 454k, False: 9.98M]
  |  Branch (1007:30): [True: 355k, False: 99.2k]
  |  Branch (1007:50): [True: 0, False: 10.0M]
  |  Branch (1007:62): [True: 0, False: 0]
  ------------------
 1008|  10.4M|}
BN_is_zero:
 1011|  18.8M|{
 1012|  18.8M|    return a->top == 0;
 1013|  18.8M|}
BN_is_one:
 1016|  10.3M|{
 1017|  10.3M|    return BN_abs_is_word(a, 1) && !a->neg;
  ------------------
  |  Branch (1017:12): [True: 355k, False: 10.0M]
  |  Branch (1017:36): [True: 355k, False: 0]
  ------------------
 1018|  10.3M|}
BN_is_odd:
 1026|  3.30M|{
 1027|  3.30M|    return (a->top > 0) && (a->d[0] & 1);
  ------------------
  |  Branch (1027:12): [True: 3.30M, False: 650]
  |  Branch (1027:28): [True: 1.78M, False: 1.52M]
  ------------------
 1028|  3.30M|}
BN_is_negative:
 1031|   187k|{
 1032|   187k|    return (a->neg != 0);
 1033|   187k|}
BN_to_montgomery:
 1037|  65.8k|{
 1038|  65.8k|    return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx);
 1039|  65.8k|}
BN_get_flags:
 1075|  24.9M|{
 1076|  24.9M|    return b->flags & n;
 1077|  24.9M|}
bn_wexpand:
 1105|  87.6M|{
 1106|  87.6M|    return (words <= a->dmax) ? a : bn_expand2(a, words);
  ------------------
  |  Branch (1106:12): [True: 84.9M, False: 2.68M]
  ------------------
 1107|  87.6M|}
bn_correct_top:
 1132|  30.5M|{
 1133|  30.5M|    BN_ULONG *ftl;
  ------------------
  |  |   37|  30.5M|#  define BN_ULONG        unsigned long
  ------------------
 1134|  30.5M|    int tmp_top = a->top;
 1135|       |
 1136|  30.5M|    if (tmp_top > 0) {
  ------------------
  |  Branch (1136:9): [True: 30.5M, False: 13.7k]
  ------------------
 1137|  47.6M|        for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) {
  ------------------
  |  Branch (1137:38): [True: 47.5M, False: 100k]
  ------------------
 1138|  47.5M|            ftl--;
 1139|  47.5M|            if (*ftl != 0)
  ------------------
  |  Branch (1139:17): [True: 30.4M, False: 17.0M]
  ------------------
 1140|  30.4M|                break;
 1141|  47.5M|        }
 1142|  30.5M|        a->top = tmp_top;
 1143|  30.5M|    }
 1144|  30.5M|    if (a->top == 0)
  ------------------
  |  Branch (1144:9): [True: 113k, False: 30.4M]
  ------------------
 1145|   113k|        a->neg = 0;
 1146|  30.5M|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  30.5M|#  define BN_FLG_FIXED_TOP 0
  ------------------
 1147|  30.5M|    bn_pollute(a);
 1148|  30.5M|}
bn_lib.c:bn_free_d:
  203|  2.80M|{
  204|  2.80M|    if (BN_get_flags(a, BN_FLG_SECURE))
  ------------------
  |  |   68|  2.80M|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (204:9): [True: 0, False: 2.80M]
  ------------------
  205|      0|        OPENSSL_secure_clear_free(a->d, a->dmax * sizeof(a->d[0]));
  ------------------
  |  |  121|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  206|  2.80M|    else if (clear != 0)
  ------------------
  |  Branch (206:14): [True: 1.91M, False: 896k]
  ------------------
  207|  1.91M|        OPENSSL_clear_free(a->d, a->dmax * sizeof(a->d[0]));
  ------------------
  |  |  105|  1.91M|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.91M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.91M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  208|   896k|    else
  209|   896k|        OPENSSL_free(a->d);
  ------------------
  |  |  107|   896k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   896k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   896k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  210|  2.80M|}
bn_lib.c:bn_expand_internal:
  265|  2.73M|{
  266|  2.73M|    BN_ULONG *a = NULL;
  ------------------
  |  |   37|  2.73M|#  define BN_ULONG        unsigned long
  ------------------
  267|       |
  268|  2.73M|    if (words > (INT_MAX / (4 * BN_BITS2))) {
  ------------------
  |  |   54|  2.73M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.73M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (268:9): [True: 0, False: 2.73M]
  ------------------
  269|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  270|      0|        return NULL;
  271|      0|    }
  272|  2.73M|    if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
  ------------------
  |  |   59|  2.73M|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (272:9): [True: 0, False: 2.73M]
  ------------------
  273|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  274|      0|        return NULL;
  275|      0|    }
  276|  2.73M|    if (BN_get_flags(b, BN_FLG_SECURE))
  ------------------
  |  |   68|  2.73M|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (276:9): [True: 0, False: 2.73M]
  ------------------
  277|      0|        a = OPENSSL_secure_zalloc(words * sizeof(*a));
  ------------------
  |  |  117|      0|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  278|  2.73M|    else
  279|  2.73M|        a = OPENSSL_zalloc(words * sizeof(*a));
  ------------------
  |  |   99|  2.73M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  2.73M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  2.73M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  280|  2.73M|    if (a == NULL)
  ------------------
  |  Branch (280:9): [True: 0, False: 2.73M]
  ------------------
  281|      0|        return NULL;
  282|       |
  283|  2.73M|    assert(b->top <= words);
  284|  2.73M|    if (b->top > 0)
  ------------------
  |  Branch (284:9): [True: 273k, False: 2.46M]
  ------------------
  285|   273k|        memcpy(a, b->d, sizeof(*a) * b->top);
  286|       |
  287|  2.73M|    return a;
  288|  2.73M|}
bn_lib.c:bin2bn:
  434|   276k|{
  435|   276k|    int inc;
  436|   276k|    const unsigned char *s2;
  437|   276k|    int inc2;
  438|   276k|    int neg = 0, xor = 0, carry = 0;
  439|   276k|    unsigned int i;
  440|   276k|    unsigned int n;
  441|   276k|    BIGNUM *bn = NULL;
  442|       |
  443|       |    /* Negative length is not acceptable */
  444|   276k|    if (len < 0)
  ------------------
  |  Branch (444:9): [True: 0, False: 276k]
  ------------------
  445|      0|        return NULL;
  446|       |
  447|   276k|    if (ret == NULL)
  ------------------
  |  Branch (447:9): [True: 185k, False: 91.0k]
  ------------------
  448|   185k|        ret = bn = BN_new();
  449|   276k|    if (ret == NULL)
  ------------------
  |  Branch (449:9): [True: 0, False: 276k]
  ------------------
  450|      0|        return NULL;
  451|   276k|    bn_check_top(ret);
  452|       |
  453|       |    /*
  454|       |     * If the input has no bits, the number is considered zero.
  455|       |     * This makes calls with s==NULL and len==0 safe.
  456|       |     */
  457|   276k|    if (len == 0) {
  ------------------
  |  Branch (457:9): [True: 10.1k, False: 266k]
  ------------------
  458|  10.1k|        BN_clear(ret);
  459|  10.1k|        return ret;
  460|  10.1k|    }
  461|       |
  462|       |    /*
  463|       |     * The loop that does the work iterates from least to most
  464|       |     * significant BIGNUM chunk, so we adapt parameters to transfer
  465|       |     * input bytes accordingly.
  466|       |     */
  467|   266k|    if (endianness == LITTLE) {
  ------------------
  |  Branch (467:9): [True: 0, False: 266k]
  ------------------
  468|      0|        s2 = s + len - 1;
  469|      0|        inc2 = -1;
  470|      0|        inc = 1;
  471|   266k|    } else {
  472|   266k|        s2 = s;
  473|   266k|        inc2 = 1;
  474|   266k|        inc = -1;
  475|   266k|        s += len - 1;
  476|   266k|    }
  477|       |
  478|       |    /* Take note of the signedness of the input bytes*/
  479|   266k|    if (signedness == SIGNED) {
  ------------------
  |  Branch (479:9): [True: 0, False: 266k]
  ------------------
  480|      0|        neg = !!(*s2 & 0x80);
  481|      0|        xor = neg ? 0xff : 0x00;
  ------------------
  |  Branch (481:15): [True: 0, False: 0]
  ------------------
  482|      0|        carry = neg;
  483|      0|    }
  484|       |
  485|       |    /*
  486|       |     * Skip leading sign extensions (the value of |xor|).
  487|       |     * This is the only spot where |s2| and |inc2| are used.
  488|       |     */
  489|  1.02M|    for ( ; len > 0 && *s2 == xor; s2 += inc2, len--)
  ------------------
  |  Branch (489:13): [True: 1.01M, False: 14.0k]
  |  Branch (489:24): [True: 758k, False: 252k]
  ------------------
  490|   758k|        continue;
  491|       |
  492|       |    /*
  493|       |     * If there was a set of 0xff, we backtrack one byte unless the next
  494|       |     * one has a sign bit, as the last 0xff is then part of the actual
  495|       |     * number, rather then a mere sign extension.
  496|       |     */
  497|   266k|    if (xor == 0xff) {
  ------------------
  |  Branch (497:9): [True: 0, False: 266k]
  ------------------
  498|      0|        if (len == 0 || !(*s2 & 0x80))
  ------------------
  |  Branch (498:13): [True: 0, False: 0]
  |  Branch (498:25): [True: 0, False: 0]
  ------------------
  499|      0|            len++;
  500|      0|    }
  501|       |    /* If it was all zeros, we're done */
  502|   266k|    if (len == 0) {
  ------------------
  |  Branch (502:9): [True: 14.0k, False: 252k]
  ------------------
  503|  14.0k|        ret->top = 0;
  504|  14.0k|        return ret;
  505|  14.0k|    }
  506|   252k|    n = ((len - 1) / BN_BYTES) + 1; /* Number of resulting bignum chunks */
  ------------------
  |  |   38|   252k|#  define BN_BYTES        8
  ------------------
  507|   252k|    if (bn_wexpand(ret, (int)n) == NULL) {
  ------------------
  |  Branch (507:9): [True: 0, False: 252k]
  ------------------
  508|      0|        BN_free(bn);
  509|      0|        return NULL;
  510|      0|    }
  511|   252k|    ret->top = n;
  512|   252k|    ret->neg = neg;
  513|  1.90M|    for (i = 0; n-- > 0; i++) {
  ------------------
  |  Branch (513:17): [True: 1.65M, False: 252k]
  ------------------
  514|  1.65M|        BN_ULONG l = 0;        /* Accumulator */
  ------------------
  |  |   37|  1.65M|#  define BN_ULONG        unsigned long
  ------------------
  515|  1.65M|        unsigned int m = 0;    /* Offset in a bignum chunk, in bits */
  516|       |
  517|  14.0M|        for (; len > 0 && m < BN_BYTES * 8; len--, s += inc, m += 8) {
  ------------------
  |  |   38|  13.7M|#  define BN_BYTES        8
  ------------------
  |  Branch (517:16): [True: 13.7M, False: 252k]
  |  Branch (517:27): [True: 12.3M, False: 1.39M]
  ------------------
  518|  12.3M|            BN_ULONG byte_xored = *s ^ xor;
  ------------------
  |  |   37|  12.3M|#  define BN_ULONG        unsigned long
  ------------------
  519|  12.3M|            BN_ULONG byte = (byte_xored + carry) & 0xff;
  ------------------
  |  |   37|  12.3M|#  define BN_ULONG        unsigned long
  ------------------
  520|       |
  521|  12.3M|            carry = byte_xored > byte; /* Implicit 1 or 0 */
  522|  12.3M|            l |= (byte << m);
  523|  12.3M|        }
  524|  1.65M|        ret->d[i] = l;
  525|  1.65M|    }
  526|       |    /*
  527|       |     * need to call this due to clear byte at top if avoiding having the top
  528|       |     * bit set (-ve number)
  529|       |     */
  530|   252k|    bn_correct_top(ret);
  531|   252k|    return ret;
  532|   252k|}

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

BN_nnmod:
   14|  10.7M|{
   15|       |    /*
   16|       |     * like BN_mod, but returns non-negative remainder (i.e., 0 <= r < |d|
   17|       |     * always holds)
   18|       |     */
   19|       |
   20|  10.7M|    if (!(BN_mod(r, m, d, ctx)))
  ------------------
  |  |  277|  10.7M|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  ------------------
  |  Branch (20:9): [True: 0, False: 10.7M]
  ------------------
   21|      0|        return 0;
   22|  10.7M|    if (!r->neg)
  ------------------
  |  Branch (22:9): [True: 10.6M, False: 45.3k]
  ------------------
   23|  10.6M|        return 1;
   24|       |    /* now   -|d| < r < 0,  so we have to set  r := r + |d| */
   25|  45.3k|    return (d->neg ? BN_sub : BN_add) (r, r, d);
  ------------------
  |  Branch (25:13): [True: 0, False: 45.3k]
  ------------------
   26|  10.7M|}
bn_mod_add_fixed_top:
   50|  83.8k|{
   51|  83.8k|    size_t i, ai, bi, mtop = m->top;
   52|  83.8k|    BN_ULONG storage[1024 / BN_BITS2];
  ------------------
  |  |   37|  83.8k|#  define BN_ULONG        unsigned long
  ------------------
   53|  83.8k|    BN_ULONG carry, temp, mask, *rp, *tp = storage;
  ------------------
  |  |   37|  83.8k|#  define BN_ULONG        unsigned long
  ------------------
   54|  83.8k|    const BN_ULONG *ap, *bp;
   55|       |
   56|  83.8k|    if (bn_wexpand(r, mtop) == NULL)
  ------------------
  |  Branch (56:9): [True: 0, False: 83.8k]
  ------------------
   57|      0|        return 0;
   58|       |
   59|  83.8k|    if (mtop > sizeof(storage) / sizeof(storage[0])) {
  ------------------
  |  Branch (59:9): [True: 0, False: 83.8k]
  ------------------
   60|      0|        tp = OPENSSL_malloc(mtop * sizeof(BN_ULONG));
  ------------------
  |  |   97|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|      0|        if (tp == NULL)
  ------------------
  |  Branch (61:13): [True: 0, False: 0]
  ------------------
   62|      0|            return 0;
   63|      0|    }
   64|       |
   65|  83.8k|    ap = a->d != NULL ? a->d : tp;
  ------------------
  |  Branch (65:10): [True: 83.8k, False: 0]
  ------------------
   66|  83.8k|    bp = b->d != NULL ? b->d : tp;
  ------------------
  |  Branch (66:10): [True: 83.1k, False: 731]
  ------------------
   67|       |
   68|   497k|    for (i = 0, ai = 0, bi = 0, carry = 0; i < mtop;) {
  ------------------
  |  Branch (68:44): [True: 413k, False: 83.8k]
  ------------------
   69|   413k|        mask = (BN_ULONG)0 - ((i - a->top) >> (8 * sizeof(i) - 1));
   70|   413k|        temp = ((ap[ai] & mask) + carry) & BN_MASK2;
  ------------------
  |  |   94|   413k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   71|   413k|        carry = (temp < carry);
   72|       |
   73|   413k|        mask = (BN_ULONG)0 - ((i - b->top) >> (8 * sizeof(i) - 1));
   74|   413k|        tp[i] = ((bp[bi] & mask) + temp) & BN_MASK2;
  ------------------
  |  |   94|   413k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   75|   413k|        carry += (tp[i] < temp);
   76|       |
   77|   413k|        i++;
   78|   413k|        ai += (i - a->dmax) >> (8 * sizeof(i) - 1);
   79|   413k|        bi += (i - b->dmax) >> (8 * sizeof(i) - 1);
   80|   413k|    }
   81|  83.8k|    rp = r->d;
   82|  83.8k|    carry -= bn_sub_words(rp, tp, m->d, mtop);
   83|   497k|    for (i = 0; i < mtop; i++) {
  ------------------
  |  Branch (83:17): [True: 413k, False: 83.8k]
  ------------------
   84|   413k|        rp[i] = (carry & tp[i]) | (~carry & rp[i]);
   85|   413k|        ((volatile BN_ULONG *)tp)[i] = 0;
   86|   413k|    }
   87|  83.8k|    r->top = mtop;
   88|  83.8k|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  83.8k|#  define BN_FLG_FIXED_TOP 0
  ------------------
   89|  83.8k|    r->neg = 0;
   90|       |
   91|  83.8k|    if (tp != storage)
  ------------------
  |  Branch (91:9): [True: 0, False: 83.8k]
  ------------------
   92|      0|        OPENSSL_free(tp);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|       |
   94|  83.8k|    return 1;
   95|  83.8k|}
BN_mod_add_quick:
   99|  83.8k|{
  100|  83.8k|    int ret = bn_mod_add_fixed_top(r, a, b, m);
  101|       |
  102|  83.8k|    if (ret)
  ------------------
  |  Branch (102:9): [True: 83.8k, False: 0]
  ------------------
  103|  83.8k|        bn_correct_top(r);
  104|       |
  105|  83.8k|    return ret;
  106|  83.8k|}
BN_mod_sub_quick:
  186|  9.47k|{
  187|  9.47k|    if (!BN_sub(r, a, b))
  ------------------
  |  Branch (187:9): [True: 0, False: 9.47k]
  ------------------
  188|      0|        return 0;
  189|  9.47k|    if (r->neg)
  ------------------
  |  Branch (189:9): [True: 3.07k, False: 6.39k]
  ------------------
  190|  3.07k|        return BN_add(r, r, m);
  191|  6.39k|    return 1;
  192|  9.47k|}
BN_mod_mul:
  197|  10.3M|{
  198|  10.3M|    BIGNUM *t;
  199|  10.3M|    int ret = 0;
  200|       |
  201|  10.3M|    bn_check_top(a);
  202|  10.3M|    bn_check_top(b);
  203|  10.3M|    bn_check_top(m);
  204|       |
  205|  10.3M|    BN_CTX_start(ctx);
  206|  10.3M|    if ((t = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 10.3M]
  ------------------
  207|      0|        goto err;
  208|  10.3M|    if (a == b) {
  ------------------
  |  Branch (208:9): [True: 9.94M, False: 445k]
  ------------------
  209|  9.94M|        if (!BN_sqr(t, a, ctx))
  ------------------
  |  Branch (209:13): [True: 0, False: 9.94M]
  ------------------
  210|      0|            goto err;
  211|  9.94M|    } else {
  212|   445k|        if (!BN_mul(t, a, b, ctx))
  ------------------
  |  Branch (212:13): [True: 0, False: 445k]
  ------------------
  213|      0|            goto err;
  214|   445k|    }
  215|  10.3M|    if (!BN_nnmod(r, t, m, ctx))
  ------------------
  |  Branch (215:9): [True: 0, False: 10.3M]
  ------------------
  216|      0|        goto err;
  217|  10.3M|    bn_check_top(r);
  218|  10.3M|    ret = 1;
  219|  10.3M| err:
  220|  10.3M|    BN_CTX_end(ctx);
  221|  10.3M|    return ret;
  222|  10.3M|}
BN_mod_sqr:
  225|   453k|{
  226|   453k|    if (!BN_sqr(r, a, ctx))
  ------------------
  |  Branch (226:9): [True: 0, False: 453k]
  ------------------
  227|      0|        return 0;
  228|       |    /* r->neg == 0,  thus we don't need BN_nnmod */
  229|   453k|    return BN_mod(r, r, m, ctx);
  ------------------
  |  |  277|   453k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  ------------------
  230|   453k|}
BN_mod_lshift1_quick:
  245|  9.89k|{
  246|  9.89k|    if (!BN_lshift1(r, a))
  ------------------
  |  Branch (246:9): [True: 0, False: 9.89k]
  ------------------
  247|      0|        return 0;
  248|  9.89k|    bn_check_top(r);
  249|  9.89k|    if (BN_cmp(r, m) >= 0)
  ------------------
  |  Branch (249:9): [True: 3.93k, False: 5.95k]
  ------------------
  250|  3.93k|        return BN_sub(r, r, m);
  251|  5.95k|    return 1;
  252|  9.89k|}

BN_mod_mul_montgomery:
   28|   984k|{
   29|   984k|    int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx);
   30|       |
   31|   984k|    bn_correct_top(r);
   32|   984k|    bn_check_top(r);
   33|       |
   34|   984k|    return ret;
   35|   984k|}
bn_mul_mont_fixed_top:
   39|  5.03M|{
   40|  5.03M|    BIGNUM *tmp;
   41|  5.03M|    int ret = 0;
   42|  5.03M|    int num = mont->N.top;
   43|       |
   44|  5.03M|#if defined(OPENSSL_BN_ASM_MONT) && defined(MONT_WORD)
   45|  5.03M|    if (num > 1 && num <= BN_SOFT_LIMIT && a->top == num && b->top == num) {
  ------------------
  |  |   62|  10.0M|#  define BN_SOFT_LIMIT         (4096 / BN_BYTES)
  |  |  ------------------
  |  |  |  |   38|  5.03M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (45:9): [True: 5.03M, False: 0]
  |  Branch (45:20): [True: 5.03M, False: 0]
  |  Branch (45:44): [True: 4.98M, False: 51.5k]
  |  Branch (45:61): [True: 4.97M, False: 967]
  ------------------
   46|  4.97M|        if (bn_wexpand(r, num) == NULL)
  ------------------
  |  Branch (46:13): [True: 0, False: 4.97M]
  ------------------
   47|      0|            return 0;
   48|  4.97M|        if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) {
  ------------------
  |  Branch (48:13): [True: 4.97M, False: 0]
  ------------------
   49|  4.97M|            r->neg = a->neg ^ b->neg;
   50|  4.97M|            r->top = num;
   51|  4.97M|            r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  4.97M|#  define BN_FLG_FIXED_TOP 0
  ------------------
   52|  4.97M|            return 1;
   53|  4.97M|        }
   54|  4.97M|    }
   55|  52.4k|#endif
   56|       |
   57|  52.4k|    if ((a->top + b->top) > 2 * num)
  ------------------
  |  Branch (57:9): [True: 0, False: 52.4k]
  ------------------
   58|      0|        return 0;
   59|       |
   60|  52.4k|    BN_CTX_start(ctx);
   61|  52.4k|    tmp = BN_CTX_get(ctx);
   62|  52.4k|    if (tmp == NULL)
  ------------------
  |  Branch (62:9): [True: 0, False: 52.4k]
  ------------------
   63|      0|        goto err;
   64|       |
   65|  52.4k|    bn_check_top(tmp);
   66|  52.4k|    if (a == b) {
  ------------------
  |  Branch (66:9): [True: 11.0k, False: 41.4k]
  ------------------
   67|  11.0k|        if (!bn_sqr_fixed_top(tmp, a, ctx))
  ------------------
  |  Branch (67:13): [True: 0, False: 11.0k]
  ------------------
   68|      0|            goto err;
   69|  41.4k|    } else {
   70|  41.4k|        if (!bn_mul_fixed_top(tmp, a, b, ctx))
  ------------------
  |  Branch (70:13): [True: 0, False: 41.4k]
  ------------------
   71|      0|            goto err;
   72|  41.4k|    }
   73|       |    /* reduce from aRR to aR */
   74|  52.4k|#ifdef MONT_WORD
   75|  52.4k|    if (!bn_from_montgomery_word(r, tmp, mont))
  ------------------
  |  Branch (75:9): [True: 0, False: 52.4k]
  ------------------
   76|      0|        goto err;
   77|       |#else
   78|       |    if (!BN_from_montgomery(r, tmp, mont, ctx))
   79|       |        goto err;
   80|       |#endif
   81|  52.4k|    ret = 1;
   82|  52.4k| err:
   83|  52.4k|    BN_CTX_end(ctx);
   84|  52.4k|    return ret;
   85|  52.4k|}
BN_from_montgomery:
  164|  33.0k|{
  165|  33.0k|    int retn;
  166|       |
  167|  33.0k|    retn = bn_from_mont_fixed_top(ret, a, mont, ctx);
  168|  33.0k|    bn_correct_top(ret);
  169|  33.0k|    bn_check_top(ret);
  170|       |
  171|  33.0k|    return retn;
  172|  33.0k|}
bn_from_mont_fixed_top:
  176|  33.0k|{
  177|  33.0k|    int retn = 0;
  178|  33.0k|#ifdef MONT_WORD
  179|  33.0k|    BIGNUM *t;
  180|       |
  181|  33.0k|    BN_CTX_start(ctx);
  182|  33.0k|    if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) {
  ------------------
  |  Branch (182:9): [True: 33.0k, False: 0]
  |  Branch (182:34): [True: 33.0k, False: 0]
  ------------------
  183|  33.0k|        retn = bn_from_montgomery_word(ret, t, mont);
  184|  33.0k|    }
  185|  33.0k|    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|  33.0k|    return retn;
  220|  33.0k|}
bn_to_mont_fixed_top:
  224|  22.2k|{
  225|  22.2k|    return bn_mul_mont_fixed_top(r, a, &(mont->RR), mont, ctx);
  226|  22.2k|}
BN_MONT_CTX_new:
  229|  99.8k|{
  230|  99.8k|    BN_MONT_CTX *ret;
  231|       |
  232|  99.8k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |   97|  99.8k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  99.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  99.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (232:9): [True: 0, False: 99.8k]
  ------------------
  233|      0|        return NULL;
  234|       |
  235|  99.8k|    BN_MONT_CTX_init(ret);
  236|  99.8k|    ret->flags = BN_FLG_MALLOCED;
  ------------------
  |  |   58|  99.8k|# define BN_FLG_MALLOCED         0x01
  ------------------
  237|  99.8k|    return ret;
  238|  99.8k|}
BN_MONT_CTX_init:
  241|  99.8k|{
  242|  99.8k|    ctx->ri = 0;
  243|  99.8k|    bn_init(&ctx->RR);
  244|  99.8k|    bn_init(&ctx->N);
  245|  99.8k|    bn_init(&ctx->Ni);
  246|  99.8k|    ctx->n0[0] = ctx->n0[1] = 0;
  247|  99.8k|    ctx->flags = 0;
  248|  99.8k|}
BN_MONT_CTX_free:
  251|   186k|{
  252|   186k|    if (mont == NULL)
  ------------------
  |  Branch (252:9): [True: 86.4k, False: 99.8k]
  ------------------
  253|  86.4k|        return;
  254|  99.8k|    BN_clear_free(&mont->RR);
  255|  99.8k|    BN_clear_free(&mont->N);
  256|  99.8k|    BN_clear_free(&mont->Ni);
  257|  99.8k|    if (mont->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|  99.8k|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (257:9): [True: 99.8k, False: 0]
  ------------------
  258|  99.8k|        OPENSSL_free(mont);
  ------------------
  |  |  107|  99.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  99.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  99.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  259|  99.8k|}
BN_MONT_CTX_set:
  262|  59.9k|{
  263|  59.9k|    int i, ret = 0;
  264|  59.9k|    BIGNUM *Ri, *R;
  265|       |
  266|  59.9k|    if (BN_is_zero(mod))
  ------------------
  |  Branch (266:9): [True: 0, False: 59.9k]
  ------------------
  267|      0|        return 0;
  268|       |
  269|  59.9k|    BN_CTX_start(ctx);
  270|  59.9k|    if ((Ri = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (270:9): [True: 0, False: 59.9k]
  ------------------
  271|      0|        goto err;
  272|  59.9k|    R = &(mont->RR);            /* grab RR as a temp */
  273|  59.9k|    if (!BN_copy(&(mont->N), mod))
  ------------------
  |  Branch (273:9): [True: 0, False: 59.9k]
  ------------------
  274|      0|        goto err;               /* Set N */
  275|  59.9k|    if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|  59.9k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (275:9): [True: 0, False: 59.9k]
  ------------------
  276|      0|        BN_set_flags(&(mont->N), BN_FLG_CONSTTIME);
  ------------------
  |  |   67|      0|# define BN_FLG_CONSTTIME        0x04
  ------------------
  277|  59.9k|    mont->N.neg = 0;
  278|       |
  279|  59.9k|#ifdef MONT_WORD
  280|  59.9k|    {
  281|  59.9k|        BIGNUM tmod;
  282|  59.9k|        BN_ULONG buf[2];
  ------------------
  |  |   37|  59.9k|#  define BN_ULONG        unsigned long
  ------------------
  283|       |
  284|  59.9k|        bn_init(&tmod);
  285|  59.9k|        tmod.d = buf;
  286|  59.9k|        tmod.dmax = 2;
  287|  59.9k|        tmod.neg = 0;
  288|       |
  289|  59.9k|        if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|  59.9k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (289:13): [True: 0, False: 59.9k]
  ------------------
  290|      0|            BN_set_flags(&tmod, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|      0|# define BN_FLG_CONSTTIME        0x04
  ------------------
  291|       |
  292|  59.9k|        mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|  59.9k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  59.9k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                      mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|  59.9k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  59.9k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                      mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|  59.9k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  59.9k|#  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|  59.9k|        BN_zero(R);
  ------------------
  |  |  202|  59.9k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  340|  59.9k|        if (!(BN_set_bit(R, BN_BITS2)))
  ------------------
  |  |   54|  59.9k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  59.9k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (340:13): [True: 0, False: 59.9k]
  ------------------
  341|      0|            goto err;           /* R */
  342|       |
  343|  59.9k|        buf[0] = mod->d[0];     /* tmod = N mod word size */
  344|  59.9k|        buf[1] = 0;
  345|  59.9k|        tmod.top = buf[0] != 0 ? 1 : 0;
  ------------------
  |  Branch (345:20): [True: 59.9k, False: 0]
  ------------------
  346|       |        /* Ri = R^-1 mod N */
  347|  59.9k|        if (BN_is_one(&tmod))
  ------------------
  |  Branch (347:13): [True: 11.1k, False: 48.7k]
  ------------------
  348|  11.1k|            BN_zero(Ri);
  ------------------
  |  |  202|  11.1k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  349|  48.7k|        else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
  ------------------
  |  Branch (349:18): [True: 0, False: 48.7k]
  ------------------
  350|      0|            goto err;
  351|  59.9k|        if (!BN_lshift(Ri, Ri, BN_BITS2))
  ------------------
  |  |   54|  59.9k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  59.9k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (351:13): [True: 0, False: 59.9k]
  ------------------
  352|      0|            goto err;           /* R*Ri */
  353|  59.9k|        if (!BN_is_zero(Ri)) {
  ------------------
  |  Branch (353:13): [True: 48.7k, False: 11.1k]
  ------------------
  354|  48.7k|            if (!BN_sub_word(Ri, 1))
  ------------------
  |  Branch (354:17): [True: 0, False: 48.7k]
  ------------------
  355|      0|                goto err;
  356|  48.7k|        } else {                /* if N mod word size == 1 */
  357|       |
  358|  11.1k|            if (!BN_set_word(Ri, BN_MASK2))
  ------------------
  |  |   94|  11.1k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  |  Branch (358:17): [True: 0, False: 11.1k]
  ------------------
  359|      0|                goto err;       /* Ri-- (mod word size) */
  360|  11.1k|        }
  361|  59.9k|        if (!BN_div(Ri, NULL, Ri, &tmod, ctx))
  ------------------
  |  Branch (361:13): [True: 0, False: 59.9k]
  ------------------
  362|      0|            goto err;
  363|       |        /*
  364|       |         * Ni = (R*Ri-1)/N, keep only least significant word:
  365|       |         */
  366|  59.9k|        mont->n0[0] = (Ri->top > 0) ? Ri->d[0] : 0;
  ------------------
  |  Branch (366:23): [True: 59.9k, False: 0]
  ------------------
  367|  59.9k|        mont->n0[1] = 0;
  368|  59.9k|# endif
  369|  59.9k|    }
  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|  59.9k|    BN_zero(&(mont->RR));
  ------------------
  |  |  202|  59.9k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  393|  59.9k|    if (!BN_set_bit(&(mont->RR), mont->ri * 2))
  ------------------
  |  Branch (393:9): [True: 0, False: 59.9k]
  ------------------
  394|      0|        goto err;
  395|  59.9k|    if (!BN_mod(&(mont->RR), &(mont->RR), &(mont->N), ctx))
  ------------------
  |  |  277|  59.9k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  ------------------
  |  Branch (395:9): [True: 0, False: 59.9k]
  ------------------
  396|      0|        goto err;
  397|       |
  398|  79.9k|    for (i = mont->RR.top, ret = mont->N.top; i < ret; i++)
  ------------------
  |  Branch (398:47): [True: 19.9k, False: 59.9k]
  ------------------
  399|  19.9k|        mont->RR.d[i] = 0;
  400|  59.9k|    mont->RR.top = ret;
  401|  59.9k|    mont->RR.flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  59.9k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  402|       |
  403|  59.9k|    ret = 1;
  404|  59.9k| err:
  405|  59.9k|    BN_CTX_end(ctx);
  406|  59.9k|    return ret;
  407|  59.9k|}
BN_MONT_CTX_copy:
  410|  39.9k|{
  411|  39.9k|    if (to == from)
  ------------------
  |  Branch (411:9): [True: 0, False: 39.9k]
  ------------------
  412|      0|        return to;
  413|       |
  414|  39.9k|    if (!BN_copy(&(to->RR), &(from->RR)))
  ------------------
  |  Branch (414:9): [True: 0, False: 39.9k]
  ------------------
  415|      0|        return NULL;
  416|  39.9k|    if (!BN_copy(&(to->N), &(from->N)))
  ------------------
  |  Branch (416:9): [True: 0, False: 39.9k]
  ------------------
  417|      0|        return NULL;
  418|  39.9k|    if (!BN_copy(&(to->Ni), &(from->Ni)))
  ------------------
  |  Branch (418:9): [True: 0, False: 39.9k]
  ------------------
  419|      0|        return NULL;
  420|  39.9k|    to->ri = from->ri;
  421|  39.9k|    to->n0[0] = from->n0[0];
  422|  39.9k|    to->n0[1] = from->n0[1];
  423|  39.9k|    return to;
  424|  39.9k|}
bn_mont.c:bn_from_montgomery_word:
   89|  85.5k|{
   90|  85.5k|    BIGNUM *n;
   91|  85.5k|    BN_ULONG *ap, *np, *rp, n0, v, carry;
  ------------------
  |  |   37|  85.5k|#  define BN_ULONG        unsigned long
  ------------------
   92|  85.5k|    int nl, max, i;
   93|  85.5k|    unsigned int rtop;
   94|       |
   95|  85.5k|    n = &(mont->N);
   96|  85.5k|    nl = n->top;
   97|  85.5k|    if (nl == 0) {
  ------------------
  |  Branch (97:9): [True: 0, False: 85.5k]
  ------------------
   98|      0|        ret->top = 0;
   99|      0|        return 1;
  100|      0|    }
  101|       |
  102|  85.5k|    max = (2 * nl);             /* carry is stored separately */
  103|  85.5k|    if (bn_wexpand(r, max) == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 85.5k]
  ------------------
  104|      0|        return 0;
  105|       |
  106|  85.5k|    r->neg ^= n->neg;
  107|  85.5k|    np = n->d;
  108|  85.5k|    rp = r->d;
  109|       |
  110|       |    /* clear the top words of T */
  111|   758k|    for (rtop = r->top, i = 0; i < max; i++) {
  ------------------
  |  Branch (111:32): [True: 673k, False: 85.5k]
  ------------------
  112|   673k|        v = (BN_ULONG)0 - ((i - rtop) >> (8 * sizeof(rtop) - 1));
  113|   673k|        rp[i] &= v;
  114|   673k|    }
  115|       |
  116|  85.5k|    r->top = max;
  117|  85.5k|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  85.5k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  118|  85.5k|    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|   422k|    for (carry = 0, i = 0; i < nl; i++, rp++) {
  ------------------
  |  Branch (125:28): [True: 336k, False: 85.5k]
  ------------------
  126|   336k|        v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2);
  ------------------
  |  |   94|   336k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  127|   336k|        v = (v + carry + rp[nl]) & BN_MASK2;
  ------------------
  |  |   94|   336k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  128|   336k|        carry |= (v != rp[nl]);
  129|   336k|        carry &= (v <= rp[nl]);
  130|   336k|        rp[nl] = v;
  131|   336k|    }
  132|       |
  133|  85.5k|    if (bn_wexpand(ret, nl) == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 85.5k]
  ------------------
  134|      0|        return 0;
  135|  85.5k|    ret->top = nl;
  136|  85.5k|    ret->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  85.5k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  137|  85.5k|    ret->neg = r->neg;
  138|       |
  139|  85.5k|    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|  85.5k|    ap = &(r->d[nl]);
  146|       |
  147|  85.5k|    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|   422k|    for (i = 0; i < nl; i++) {
  ------------------
  |  Branch (153:17): [True: 336k, False: 85.5k]
  ------------------
  154|   336k|        rp[i] = (carry & ap[i]) | (~carry & rp[i]);
  155|   336k|        ap[i] = 0;
  156|   336k|    }
  157|       |
  158|  85.5k|    return 1;
  159|  85.5k|}

BN_mul:
  498|   465k|{
  499|   465k|    int ret = bn_mul_fixed_top(r, a, b, ctx);
  500|       |
  501|   465k|    bn_correct_top(r);
  502|   465k|    bn_check_top(r);
  503|       |
  504|   465k|    return ret;
  505|   465k|}
bn_mul_fixed_top:
  508|   507k|{
  509|   507k|    int ret = 0;
  510|   507k|    int top, al, bl;
  511|   507k|    BIGNUM *rr;
  512|   507k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  513|   507k|    int i;
  514|   507k|#endif
  515|   507k|#ifdef BN_RECURSION
  516|   507k|    BIGNUM *t = NULL;
  517|   507k|    int j = 0, k;
  518|   507k|#endif
  519|       |
  520|   507k|    bn_check_top(a);
  521|   507k|    bn_check_top(b);
  522|   507k|    bn_check_top(r);
  523|       |
  524|   507k|    al = a->top;
  525|   507k|    bl = b->top;
  526|       |
  527|   507k|    if ((al == 0) || (bl == 0)) {
  ------------------
  |  Branch (527:9): [True: 6.08k, False: 501k]
  |  Branch (527:22): [True: 439, False: 500k]
  ------------------
  528|  6.52k|        BN_zero(r);
  ------------------
  |  |  202|  6.52k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  529|  6.52k|        return 1;
  530|  6.52k|    }
  531|   500k|    top = al + bl;
  532|       |
  533|   500k|    BN_CTX_start(ctx);
  534|   500k|    if ((r == a) || (r == b)) {
  ------------------
  |  Branch (534:9): [True: 13.1k, False: 487k]
  |  Branch (534:21): [True: 0, False: 487k]
  ------------------
  535|  13.1k|        if ((rr = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (535:13): [True: 0, False: 13.1k]
  ------------------
  536|      0|            goto err;
  537|  13.1k|    } else
  538|   487k|        rr = r;
  539|       |
  540|   500k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  541|   500k|    i = al - bl;
  542|   500k|#endif
  543|   500k|#ifdef BN_MUL_COMBA
  544|   500k|    if (i == 0) {
  ------------------
  |  Branch (544:9): [True: 459k, False: 40.8k]
  ------------------
  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|   459k|        if (al == 8) {
  ------------------
  |  Branch (554:13): [True: 5.39k, False: 454k]
  ------------------
  555|  5.39k|            if (bn_wexpand(rr, 16) == NULL)
  ------------------
  |  Branch (555:17): [True: 0, False: 5.39k]
  ------------------
  556|      0|                goto err;
  557|  5.39k|            rr->top = 16;
  558|  5.39k|            bn_mul_comba8(rr->d, a->d, b->d);
  559|  5.39k|            goto end;
  560|  5.39k|        }
  561|   459k|    }
  562|   495k|#endif                          /* BN_MUL_COMBA */
  563|   495k|#ifdef BN_RECURSION
  564|   495k|    if ((al >= BN_MULL_SIZE_NORMAL) && (bl >= BN_MULL_SIZE_NORMAL)) {
  ------------------
  |  |  364|   495k|# define BN_MULL_SIZE_NORMAL                     (16)/* 32 */
  ------------------
                  if ((al >= BN_MULL_SIZE_NORMAL) && (bl >= BN_MULL_SIZE_NORMAL)) {
  ------------------
  |  |  364|      0|# define BN_MULL_SIZE_NORMAL                     (16)/* 32 */
  ------------------
  |  Branch (564:9): [True: 0, False: 495k]
  |  Branch (564:40): [True: 0, False: 0]
  ------------------
  565|      0|        if (i >= -1 && i <= 1) {
  ------------------
  |  Branch (565:13): [True: 0, False: 0]
  |  Branch (565:24): [True: 0, False: 0]
  ------------------
  566|       |            /*
  567|       |             * Find out the power of two lower or equal to the longest of the
  568|       |             * two numbers
  569|       |             */
  570|      0|            if (i >= 0) {
  ------------------
  |  Branch (570:17): [True: 0, False: 0]
  ------------------
  571|      0|                j = BN_num_bits_word((BN_ULONG)al);
  572|      0|            }
  573|      0|            if (i == -1) {
  ------------------
  |  Branch (573:17): [True: 0, False: 0]
  ------------------
  574|      0|                j = BN_num_bits_word((BN_ULONG)bl);
  575|      0|            }
  576|      0|            j = 1 << (j - 1);
  577|      0|            assert(j <= al || j <= bl);
  578|      0|            k = j + j;
  579|      0|            t = BN_CTX_get(ctx);
  580|      0|            if (t == NULL)
  ------------------
  |  Branch (580:17): [True: 0, False: 0]
  ------------------
  581|      0|                goto err;
  582|      0|            if (al > j || bl > j) {
  ------------------
  |  Branch (582:17): [True: 0, False: 0]
  |  Branch (582:27): [True: 0, False: 0]
  ------------------
  583|      0|                if (bn_wexpand(t, k * 4) == NULL)
  ------------------
  |  Branch (583:21): [True: 0, False: 0]
  ------------------
  584|      0|                    goto err;
  585|      0|                if (bn_wexpand(rr, k * 4) == NULL)
  ------------------
  |  Branch (585:21): [True: 0, False: 0]
  ------------------
  586|      0|                    goto err;
  587|      0|                bn_mul_part_recursive(rr->d, a->d, b->d,
  588|      0|                                      j, al - j, bl - j, t->d);
  589|      0|            } else {            /* al <= j || bl <= j */
  590|       |
  591|      0|                if (bn_wexpand(t, k * 2) == NULL)
  ------------------
  |  Branch (591:21): [True: 0, False: 0]
  ------------------
  592|      0|                    goto err;
  593|      0|                if (bn_wexpand(rr, k * 2) == NULL)
  ------------------
  |  Branch (593:21): [True: 0, False: 0]
  ------------------
  594|      0|                    goto err;
  595|      0|                bn_mul_recursive(rr->d, a->d, b->d, j, al - j, bl - j, t->d);
  596|      0|            }
  597|      0|            rr->top = top;
  598|      0|            goto end;
  599|      0|        }
  600|      0|    }
  601|   495k|#endif                          /* BN_RECURSION */
  602|   495k|    if (bn_wexpand(rr, top) == NULL)
  ------------------
  |  Branch (602:9): [True: 0, False: 495k]
  ------------------
  603|      0|        goto err;
  604|   495k|    rr->top = top;
  605|   495k|    bn_mul_normal(rr->d, a->d, al, b->d, bl);
  606|       |
  607|   495k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  608|   500k| end:
  609|   500k|#endif
  610|   500k|    rr->neg = a->neg ^ b->neg;
  611|   500k|    rr->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   500k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  612|   500k|    if (r != rr && BN_copy(r, rr) == NULL)
  ------------------
  |  Branch (612:9): [True: 13.1k, False: 487k]
  |  Branch (612:20): [True: 0, False: 13.1k]
  ------------------
  613|      0|        goto err;
  614|       |
  615|   500k|    ret = 1;
  616|   500k| err:
  617|   500k|    bn_check_top(r);
  618|   500k|    BN_CTX_end(ctx);
  619|   500k|    return ret;
  620|   500k|}
bn_mul_normal:
  623|   495k|{
  624|   495k|    BN_ULONG *rr;
  ------------------
  |  |   37|   495k|#  define BN_ULONG        unsigned long
  ------------------
  625|       |
  626|   495k|    if (na < nb) {
  ------------------
  |  Branch (626:9): [True: 35.9k, False: 459k]
  ------------------
  627|  35.9k|        int itmp;
  628|  35.9k|        BN_ULONG *ltmp;
  ------------------
  |  |   37|  35.9k|#  define BN_ULONG        unsigned long
  ------------------
  629|       |
  630|  35.9k|        itmp = na;
  631|  35.9k|        na = nb;
  632|  35.9k|        nb = itmp;
  633|  35.9k|        ltmp = a;
  634|  35.9k|        a = b;
  635|  35.9k|        b = ltmp;
  636|       |
  637|  35.9k|    }
  638|   495k|    rr = &(r[na]);
  639|   495k|    if (nb <= 0) {
  ------------------
  |  Branch (639:9): [True: 0, False: 495k]
  ------------------
  640|      0|        (void)bn_mul_words(r, a, na, 0);
  641|      0|        return;
  642|      0|    } else
  643|   495k|        rr[0] = bn_mul_words(r, a, na, b[0]);
  644|       |
  645|   503k|    for (;;) {
  646|   503k|        if (--nb <= 0)
  ------------------
  |  Branch (646:13): [True: 43.4k, False: 459k]
  ------------------
  647|  43.4k|            return;
  648|   459k|        rr[1] = bn_mul_add_words(&(r[1]), a, na, b[1]);
  649|   459k|        if (--nb <= 0)
  ------------------
  |  Branch (649:13): [True: 3.64k, False: 456k]
  ------------------
  650|  3.64k|            return;
  651|   456k|        rr[2] = bn_mul_add_words(&(r[2]), a, na, b[2]);
  652|   456k|        if (--nb <= 0)
  ------------------
  |  Branch (652:13): [True: 1.62k, False: 454k]
  ------------------
  653|  1.62k|            return;
  654|   454k|        rr[3] = bn_mul_add_words(&(r[3]), a, na, b[3]);
  655|   454k|        if (--nb <= 0)
  ------------------
  |  Branch (655:13): [True: 446k, False: 8.03k]
  ------------------
  656|   446k|            return;
  657|  8.03k|        rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]);
  658|  8.03k|        rr += 4;
  659|  8.03k|        r += 4;
  660|  8.03k|        b += 4;
  661|  8.03k|    }
  662|   495k|}

BN_nist_mod_224:
  467|  36.8k|{
  468|  36.8k|    int top = a->top, i;
  469|  36.8k|    int carry;
  470|  36.8k|    BN_ULONG *r_d, *a_d = a->d;
  ------------------
  |  |   37|  36.8k|#  define BN_ULONG        unsigned long
  ------------------
  471|  36.8k|    union {
  472|  36.8k|        BN_ULONG bn[BN_NIST_224_TOP];
  473|  36.8k|        unsigned int ui[BN_NIST_224_TOP * sizeof(BN_ULONG) /
  474|  36.8k|                        sizeof(unsigned int)];
  475|  36.8k|    } buf;
  476|  36.8k|    BN_ULONG c_d[BN_NIST_224_TOP], *res;
  ------------------
  |  |   37|  36.8k|#  define BN_ULONG        unsigned long
  ------------------
  477|  36.8k|    bn_addsub_f adjust;
  478|  36.8k|    static const BIGNUM ossl_bignum_nist_p_224_sqr = {
  479|  36.8k|        (BN_ULONG *)_nist_p_224_sqr,
  480|  36.8k|        OSSL_NELEM(_nist_p_224_sqr),
  ------------------
  |  |   14|  36.8k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  481|  36.8k|        OSSL_NELEM(_nist_p_224_sqr),
  ------------------
  |  |   14|  36.8k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  482|  36.8k|        0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|  36.8k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  483|  36.8k|    };
  484|       |
  485|  36.8k|    field = &ossl_bignum_nist_p_224; /* just to make sure */
  486|       |
  487|  36.8k|    if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_224_sqr) >= 0)
  ------------------
  |  Branch (487:9): [True: 0, False: 36.8k]
  |  Branch (487:30): [True: 0, False: 36.8k]
  ------------------
  488|      0|        return BN_nnmod(r, a, field, ctx);
  489|       |
  490|  36.8k|    i = BN_ucmp(field, a);
  491|  36.8k|    if (i == 0) {
  ------------------
  |  Branch (491:9): [True: 0, False: 36.8k]
  ------------------
  492|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  493|      0|        return 1;
  494|  36.8k|    } else if (i > 0)
  ------------------
  |  Branch (494:16): [True: 163, False: 36.6k]
  ------------------
  495|    163|        return (r == a) ? 1 : (BN_copy(r, a) != NULL);
  ------------------
  |  Branch (495:16): [True: 163, False: 0]
  ------------------
  496|       |
  497|  36.6k|    if (r != a) {
  ------------------
  |  Branch (497:9): [True: 0, False: 36.6k]
  ------------------
  498|      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 (498:13): [True: 0, False: 0]
  ------------------
  499|      0|            return 0;
  500|      0|        r_d = r->d;
  501|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  502|      0|    } else
  503|  36.6k|        r_d = a_d;
  504|       |
  505|  36.6k|#if BN_BITS2==64
  506|       |    /* copy upper 256 bits of 448 bit number ... */
  507|  36.6k|    nist_cp_bn_0(c_d, a_d + (BN_NIST_224_TOP - 1),
  ------------------
  |  |  265|  36.6k|#define nist_cp_bn_0(dst, src_in, top, max) \
  |  |  266|  36.6k|{                                           \
  |  |  267|  36.6k|    int ii;                                 \
  |  |  268|  36.6k|    const BN_ULONG *src = src_in;           \
  |  |  269|  36.6k|                                            \
  |  |  270|   182k|    for (ii = 0; ii < top; ii++)            \
  |  |  ------------------
  |  |  |  Branch (270:18): [True: 146k, False: 36.6k]
  |  |  ------------------
  |  |  271|   146k|        (dst)[ii] = src[ii];                \
  |  |  272|  37.1k|    for (; ii < max; ii++)                  \
  |  |  ------------------
  |  |  |  Branch (272:12): [True: 535, False: 36.6k]
  |  |  ------------------
  |  |  273|  36.6k|        (dst)[ii] = 0;                      \
  |  |  274|  36.6k|}
  ------------------
  508|  36.6k|                 top - (BN_NIST_224_TOP - 1), BN_NIST_224_TOP);
  509|       |    /* ... and right shift by 32 to obtain upper 224 bits */
  510|  36.6k|    nist_set_224(buf.bn, c_d, 14, 13, 12, 11, 10, 9, 8);
  ------------------
  |  |  455|  36.6k|        { \
  |  |  456|  36.6k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  457|  36.6k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  458|  36.6k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  459|  36.6k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  460|  36.6k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  461|  36.6k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  462|  36.6k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  463|  36.6k|        }
  ------------------
  511|       |    /* truncate lower part to 224 bits too */
  512|  36.6k|    r_d[BN_NIST_224_TOP - 1] &= BN_MASK2l;
  ------------------
  |  |   14|  36.6k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  r_d[BN_NIST_224_TOP - 1] &= BN_MASK2l;
  ------------------
  |  |   95|  36.6k|#  define BN_MASK2l       (0xffffffffL)
  ------------------
  513|       |#else
  514|       |    nist_cp_bn_0(buf.bn, a_d + BN_NIST_224_TOP, top - BN_NIST_224_TOP,
  515|       |                 BN_NIST_224_TOP);
  516|       |#endif
  517|       |
  518|       |#if defined(NIST_INT64) && BN_BITS2!=64
  519|       |    {
  520|       |        NIST_INT64 acc;         /* accumulator */
  521|       |        unsigned int *rp = (unsigned int *)r_d;
  522|       |        const unsigned int *bp = (const unsigned int *)buf.ui;
  523|       |
  524|       |        acc = rp[0];
  525|       |        acc -= bp[7 - 7];
  526|       |        acc -= bp[11 - 7];
  527|       |        rp[0] = (unsigned int)acc;
  528|       |        acc >>= 32;
  529|       |
  530|       |        acc += rp[1];
  531|       |        acc -= bp[8 - 7];
  532|       |        acc -= bp[12 - 7];
  533|       |        rp[1] = (unsigned int)acc;
  534|       |        acc >>= 32;
  535|       |
  536|       |        acc += rp[2];
  537|       |        acc -= bp[9 - 7];
  538|       |        acc -= bp[13 - 7];
  539|       |        rp[2] = (unsigned int)acc;
  540|       |        acc >>= 32;
  541|       |
  542|       |        acc += rp[3];
  543|       |        acc += bp[7 - 7];
  544|       |        acc += bp[11 - 7];
  545|       |        acc -= bp[10 - 7];
  546|       |        rp[3] = (unsigned int)acc;
  547|       |        acc >>= 32;
  548|       |
  549|       |        acc += rp[4];
  550|       |        acc += bp[8 - 7];
  551|       |        acc += bp[12 - 7];
  552|       |        acc -= bp[11 - 7];
  553|       |        rp[4] = (unsigned int)acc;
  554|       |        acc >>= 32;
  555|       |
  556|       |        acc += rp[5];
  557|       |        acc += bp[9 - 7];
  558|       |        acc += bp[13 - 7];
  559|       |        acc -= bp[12 - 7];
  560|       |        rp[5] = (unsigned int)acc;
  561|       |        acc >>= 32;
  562|       |
  563|       |        acc += rp[6];
  564|       |        acc += bp[10 - 7];
  565|       |        acc -= bp[13 - 7];
  566|       |        rp[6] = (unsigned int)acc;
  567|       |
  568|       |        carry = (int)(acc >> 32);
  569|       |# if BN_BITS2==64
  570|       |        rp[7] = carry;
  571|       |# endif
  572|       |    }
  573|       |#else
  574|  36.6k|    {
  575|  36.6k|        BN_ULONG t_d[BN_NIST_224_TOP];
  ------------------
  |  |   37|  36.6k|#  define BN_ULONG        unsigned long
  ------------------
  576|       |
  577|  36.6k|        nist_set_224(t_d, buf.bn, 10, 9, 8, 7, 0, 0, 0);
  ------------------
  |  |  455|  36.6k|        { \
  |  |  456|  36.6k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  457|  36.6k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  36.6k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  458|  36.6k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  459|  36.6k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  460|  36.6k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  461|  36.6k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  462|  36.6k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  463|  36.6k|        }
  ------------------
  578|  36.6k|        carry = (int)bn_add_words(r_d, r_d, t_d, BN_NIST_224_TOP);
  ------------------
  |  |   14|  36.6k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  579|  36.6k|        nist_set_224(t_d, buf.bn, 0, 13, 12, 11, 0, 0, 0);
  ------------------
  |  |  455|  36.6k|        { \
  |  |  456|  36.6k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  457|  36.6k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  36.6k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  458|  36.6k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  459|  36.6k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  460|  36.6k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  461|  36.6k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  462|  36.6k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  463|  36.6k|        }
  ------------------
  580|  36.6k|        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_224_TOP);
  ------------------
  |  |   14|  36.6k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  581|  36.6k|        nist_set_224(t_d, buf.bn, 13, 12, 11, 10, 9, 8, 7);
  ------------------
  |  |  455|  36.6k|        { \
  |  |  456|  36.6k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  36.6k|#  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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  457|  36.6k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  458|  36.6k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  36.6k|#  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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  459|  36.6k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  460|  36.6k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  36.6k|#  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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  461|  36.6k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  462|  36.6k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  36.6k|#  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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  463|  36.6k|        }
  ------------------
  582|  36.6k|        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_224_TOP);
  ------------------
  |  |   14|  36.6k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  583|  36.6k|        nist_set_224(t_d, buf.bn, 0, 0, 0, 0, 13, 12, 11);
  ------------------
  |  |  455|  36.6k|        { \
  |  |  456|  36.6k|        bn_cp_32(to, 0, from, (a7) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  36.6k|#  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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  457|  36.6k|        bn_cp_32(to, 1, from, (a6) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|#  define BN_MASK2h       (0xffffffff00000000L)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (291:43): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (291:63): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  36.6k|                                                :(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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  458|  36.6k|        bn_cp_32(to, 2, from, (a5) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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|  36.6k|                                                :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  36.6k|#  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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  459|  36.6k|        bn_cp_32(to, 3, from, (a4) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  36.6k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  460|  36.6k|        bn_cp_32(to, 4, from, (a3) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  461|  36.6k|        bn_cp_32(to, 5, from, (a2) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# define bn_32_set_0(to, n)              (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0));
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  36.6k|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (293:43): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:42): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  462|  36.6k|        bn_cp_32(to, 6, from, (a1) - 7) \
  |  |  ------------------
  |  |  |  |  294|  36.6k|# 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|  36.6k|# 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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  463|  36.6k|        }
  ------------------
  584|  36.6k|        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_224_TOP);
  ------------------
  |  |   14|  36.6k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  585|       |
  586|  36.6k|# if BN_BITS2==64
  587|  36.6k|        carry = (int)(r_d[BN_NIST_224_TOP - 1] >> 32);
  ------------------
  |  |   14|  36.6k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  588|  36.6k|# endif
  589|  36.6k|    }
  590|  36.6k|#endif
  591|  36.6k|    adjust = bn_sub_words;
  592|  36.6k|    if (carry > 0) {
  ------------------
  |  Branch (592:9): [True: 12.4k, False: 24.1k]
  ------------------
  593|  12.4k|        carry =
  594|  12.4k|            (int)bn_sub_words(r_d, r_d, _nist_p_224[carry - 1],
  595|  12.4k|                              BN_NIST_224_TOP);
  ------------------
  |  |   14|  12.4k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  12.4k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  12.4k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  12.4k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  12.4k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  596|  12.4k|#if BN_BITS2==64
  597|  12.4k|        carry = (int)(~(r_d[BN_NIST_224_TOP - 1] >> 32)) & 1;
  ------------------
  |  |   14|  12.4k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  12.4k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  12.4k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  12.4k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  12.4k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  598|  12.4k|#endif
  599|  24.1k|    } else if (carry < 0) {
  ------------------
  |  Branch (599:16): [True: 4.00k, False: 20.1k]
  ------------------
  600|       |        /*
  601|       |         * it's a bit more complicated logic in this case. if bn_add_words
  602|       |         * yields no carry, then result has to be adjusted by unconditionally
  603|       |         * *adding* the modulus. but if it does, then result has to be
  604|       |         * compared to the modulus and conditionally adjusted by
  605|       |         * *subtracting* the latter.
  606|       |         */
  607|  4.00k|        carry =
  608|  4.00k|            (int)bn_add_words(r_d, r_d, _nist_p_224[-carry - 1],
  609|  4.00k|                              BN_NIST_224_TOP);
  ------------------
  |  |   14|  4.00k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  4.00k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  4.00k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  4.00k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  4.00k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|  4.00k|        adjust = carry ? bn_sub_words : bn_add_words;
  ------------------
  |  Branch (610:18): [True: 4.00k, False: 0]
  ------------------
  611|  4.00k|    } else
  612|  20.1k|        carry = 1;
  613|       |
  614|       |    /* otherwise it's effectively same as in BN_nist_mod_192... */
  615|  36.6k|    res = ((*adjust) (c_d, r_d, _nist_p_224[0], BN_NIST_224_TOP) && carry)
  ------------------
  |  |   14|  36.6k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (615:12): [True: 36.6k, False: 0]
  |  Branch (615:69): [True: 36.6k, False: 0]
  ------------------
  616|  36.6k|        ? r_d
  617|  36.6k|        : c_d;
  618|  36.6k|    nist_cp_bn(r_d, res, BN_NIST_224_TOP);
  ------------------
  |  |   14|  36.6k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  619|  36.6k|    r->top = BN_NIST_224_TOP;
  ------------------
  |  |   14|  36.6k|#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  36.6k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  36.6k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  620|  36.6k|    bn_correct_top(r);
  621|       |
  622|  36.6k|    return 1;
  623|  36.6k|}
BN_nist_mod_384:
  876|  6.05k|{
  877|  6.05k|    int i, top = a->top;
  878|  6.05k|    int carry = 0;
  879|  6.05k|    register BN_ULONG *r_d, *a_d = a->d;
  880|  6.05k|    union {
  881|  6.05k|        BN_ULONG bn[BN_NIST_384_TOP];
  882|  6.05k|        unsigned int ui[BN_NIST_384_TOP * sizeof(BN_ULONG) /
  883|  6.05k|                        sizeof(unsigned int)];
  884|  6.05k|    } buf;
  885|  6.05k|    BN_ULONG c_d[BN_NIST_384_TOP], *res;
  ------------------
  |  |   37|  6.05k|#  define BN_ULONG        unsigned long
  ------------------
  886|  6.05k|    bn_addsub_f adjust;
  887|  6.05k|    static const BIGNUM ossl_bignum_nist_p_384_sqr = {
  888|  6.05k|        (BN_ULONG *)_nist_p_384_sqr,
  889|  6.05k|        OSSL_NELEM(_nist_p_384_sqr),
  ------------------
  |  |   14|  6.05k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  890|  6.05k|        OSSL_NELEM(_nist_p_384_sqr),
  ------------------
  |  |   14|  6.05k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  891|  6.05k|        0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|  6.05k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  892|  6.05k|    };
  893|       |
  894|  6.05k|    field = &ossl_bignum_nist_p_384; /* just to make sure */
  895|       |
  896|  6.05k|    if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_384_sqr) >= 0)
  ------------------
  |  Branch (896:9): [True: 0, False: 6.05k]
  |  Branch (896:30): [True: 0, False: 6.05k]
  ------------------
  897|      0|        return BN_nnmod(r, a, field, ctx);
  898|       |
  899|  6.05k|    i = BN_ucmp(field, a);
  900|  6.05k|    if (i == 0) {
  ------------------
  |  Branch (900:9): [True: 0, False: 6.05k]
  ------------------
  901|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  902|      0|        return 1;
  903|  6.05k|    } else if (i > 0)
  ------------------
  |  Branch (903:16): [True: 11, False: 6.04k]
  ------------------
  904|     11|        return (r == a) ? 1 : (BN_copy(r, a) != NULL);
  ------------------
  |  Branch (904:16): [True: 11, False: 0]
  ------------------
  905|       |
  906|  6.04k|    if (r != a) {
  ------------------
  |  Branch (906:9): [True: 0, False: 6.04k]
  ------------------
  907|      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 (907:13): [True: 0, False: 0]
  ------------------
  908|      0|            return 0;
  909|      0|        r_d = r->d;
  910|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  911|      0|    } else
  912|  6.04k|        r_d = a_d;
  913|       |
  914|  6.04k|    nist_cp_bn_0(buf.bn, a_d + BN_NIST_384_TOP, top - BN_NIST_384_TOP,
  ------------------
  |  |  265|  6.04k|#define nist_cp_bn_0(dst, src_in, top, max) \
  |  |  266|  6.04k|{                                           \
  |  |  267|  6.04k|    int ii;                                 \
  |  |  268|  6.04k|    const BN_ULONG *src = src_in;           \
  |  |  269|  6.04k|                                            \
  |  |  270|  42.2k|    for (ii = 0; ii < top; ii++)            \
  |  |  ------------------
  |  |  |  Branch (270:18): [True: 36.1k, False: 6.04k]
  |  |  ------------------
  |  |  271|  36.1k|        (dst)[ii] = src[ii];                \
  |  |  272|  6.13k|    for (; ii < max; ii++)                  \
  |  |  ------------------
  |  |  |  Branch (272:12): [True: 94, False: 6.04k]
  |  |  ------------------
  |  |  273|  6.04k|        (dst)[ii] = 0;                      \
  |  |  274|  6.04k|}
  ------------------
  915|  6.04k|                 BN_NIST_384_TOP);
  916|       |
  917|  6.04k|#if defined(NIST_INT64)
  918|  6.04k|    {
  919|  6.04k|        NIST_INT64 acc;         /* accumulator */
  ------------------
  |  |  299|  6.04k|#   define NIST_INT64 long long
  ------------------
  920|  6.04k|        unsigned int *rp = (unsigned int *)r_d;
  921|  6.04k|        const unsigned int *bp = (const unsigned int *)buf.ui;
  922|       |
  923|  6.04k|        acc = rp[0];
  924|  6.04k|        acc += bp[12 - 12];
  925|  6.04k|        acc += bp[21 - 12];
  926|  6.04k|        acc += bp[20 - 12];
  927|  6.04k|        acc -= bp[23 - 12];
  928|  6.04k|        rp[0] = (unsigned int)acc;
  929|  6.04k|        acc >>= 32;
  930|       |
  931|  6.04k|        acc += rp[1];
  932|  6.04k|        acc += bp[13 - 12];
  933|  6.04k|        acc += bp[22 - 12];
  934|  6.04k|        acc += bp[23 - 12];
  935|  6.04k|        acc -= bp[12 - 12];
  936|  6.04k|        acc -= bp[20 - 12];
  937|  6.04k|        rp[1] = (unsigned int)acc;
  938|  6.04k|        acc >>= 32;
  939|       |
  940|  6.04k|        acc += rp[2];
  941|  6.04k|        acc += bp[14 - 12];
  942|  6.04k|        acc += bp[23 - 12];
  943|  6.04k|        acc -= bp[13 - 12];
  944|  6.04k|        acc -= bp[21 - 12];
  945|  6.04k|        rp[2] = (unsigned int)acc;
  946|  6.04k|        acc >>= 32;
  947|       |
  948|  6.04k|        acc += rp[3];
  949|  6.04k|        acc += bp[15 - 12];
  950|  6.04k|        acc += bp[12 - 12];
  951|  6.04k|        acc += bp[20 - 12];
  952|  6.04k|        acc += bp[21 - 12];
  953|  6.04k|        acc -= bp[14 - 12];
  954|  6.04k|        acc -= bp[22 - 12];
  955|  6.04k|        acc -= bp[23 - 12];
  956|  6.04k|        rp[3] = (unsigned int)acc;
  957|  6.04k|        acc >>= 32;
  958|       |
  959|  6.04k|        acc += rp[4];
  960|  6.04k|        acc += bp[21 - 12];
  961|  6.04k|        acc += bp[21 - 12];
  962|  6.04k|        acc += bp[16 - 12];
  963|  6.04k|        acc += bp[13 - 12];
  964|  6.04k|        acc += bp[12 - 12];
  965|  6.04k|        acc += bp[20 - 12];
  966|  6.04k|        acc += bp[22 - 12];
  967|  6.04k|        acc -= bp[15 - 12];
  968|  6.04k|        acc -= bp[23 - 12];
  969|  6.04k|        acc -= bp[23 - 12];
  970|  6.04k|        rp[4] = (unsigned int)acc;
  971|  6.04k|        acc >>= 32;
  972|       |
  973|  6.04k|        acc += rp[5];
  974|  6.04k|        acc += bp[22 - 12];
  975|  6.04k|        acc += bp[22 - 12];
  976|  6.04k|        acc += bp[17 - 12];
  977|  6.04k|        acc += bp[14 - 12];
  978|  6.04k|        acc += bp[13 - 12];
  979|  6.04k|        acc += bp[21 - 12];
  980|  6.04k|        acc += bp[23 - 12];
  981|  6.04k|        acc -= bp[16 - 12];
  982|  6.04k|        rp[5] = (unsigned int)acc;
  983|  6.04k|        acc >>= 32;
  984|       |
  985|  6.04k|        acc += rp[6];
  986|  6.04k|        acc += bp[23 - 12];
  987|  6.04k|        acc += bp[23 - 12];
  988|  6.04k|        acc += bp[18 - 12];
  989|  6.04k|        acc += bp[15 - 12];
  990|  6.04k|        acc += bp[14 - 12];
  991|  6.04k|        acc += bp[22 - 12];
  992|  6.04k|        acc -= bp[17 - 12];
  993|  6.04k|        rp[6] = (unsigned int)acc;
  994|  6.04k|        acc >>= 32;
  995|       |
  996|  6.04k|        acc += rp[7];
  997|  6.04k|        acc += bp[19 - 12];
  998|  6.04k|        acc += bp[16 - 12];
  999|  6.04k|        acc += bp[15 - 12];
 1000|  6.04k|        acc += bp[23 - 12];
 1001|  6.04k|        acc -= bp[18 - 12];
 1002|  6.04k|        rp[7] = (unsigned int)acc;
 1003|  6.04k|        acc >>= 32;
 1004|       |
 1005|  6.04k|        acc += rp[8];
 1006|  6.04k|        acc += bp[20 - 12];
 1007|  6.04k|        acc += bp[17 - 12];
 1008|  6.04k|        acc += bp[16 - 12];
 1009|  6.04k|        acc -= bp[19 - 12];
 1010|  6.04k|        rp[8] = (unsigned int)acc;
 1011|  6.04k|        acc >>= 32;
 1012|       |
 1013|  6.04k|        acc += rp[9];
 1014|  6.04k|        acc += bp[21 - 12];
 1015|  6.04k|        acc += bp[18 - 12];
 1016|  6.04k|        acc += bp[17 - 12];
 1017|  6.04k|        acc -= bp[20 - 12];
 1018|  6.04k|        rp[9] = (unsigned int)acc;
 1019|  6.04k|        acc >>= 32;
 1020|       |
 1021|  6.04k|        acc += rp[10];
 1022|  6.04k|        acc += bp[22 - 12];
 1023|  6.04k|        acc += bp[19 - 12];
 1024|  6.04k|        acc += bp[18 - 12];
 1025|  6.04k|        acc -= bp[21 - 12];
 1026|  6.04k|        rp[10] = (unsigned int)acc;
 1027|  6.04k|        acc >>= 32;
 1028|       |
 1029|  6.04k|        acc += rp[11];
 1030|  6.04k|        acc += bp[23 - 12];
 1031|  6.04k|        acc += bp[20 - 12];
 1032|  6.04k|        acc += bp[19 - 12];
 1033|  6.04k|        acc -= bp[22 - 12];
 1034|  6.04k|        rp[11] = (unsigned int)acc;
 1035|       |
 1036|  6.04k|        carry = (int)(acc >> 32);
 1037|  6.04k|    }
 1038|       |#else
 1039|       |    {
 1040|       |        BN_ULONG t_d[BN_NIST_384_TOP];
 1041|       |
 1042|       |        /*
 1043|       |         * S1
 1044|       |         */
 1045|       |        nist_set_256(t_d, buf.bn, 0, 0, 0, 0, 0, 23 - 4, 22 - 4, 21 - 4);
 1046|       |        /* left shift */
 1047|       |        {
 1048|       |            register BN_ULONG *ap, t, c;
 1049|       |            ap = t_d;
 1050|       |            c = 0;
 1051|       |            for (i = 3; i != 0; --i) {
 1052|       |                t = *ap;
 1053|       |                *(ap++) = ((t << 1) | c) & BN_MASK2;
 1054|       |                c = (t & BN_TBIT) ? 1 : 0;
 1055|       |            }
 1056|       |            *ap = c;
 1057|       |        }
 1058|       |        carry =
 1059|       |            (int)bn_add_words(r_d + (128 / BN_BITS2), r_d + (128 / BN_BITS2),
 1060|       |                              t_d, BN_NIST_256_TOP);
 1061|       |        /*
 1062|       |         * S2
 1063|       |         */
 1064|       |        carry += (int)bn_add_words(r_d, r_d, buf.bn, BN_NIST_384_TOP);
 1065|       |        /*
 1066|       |         * S3
 1067|       |         */
 1068|       |        nist_set_384(t_d, buf.bn, 20, 19, 18, 17, 16, 15, 14, 13, 12, 23, 22,
 1069|       |                     21);
 1070|       |        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1071|       |        /*
 1072|       |         * S4
 1073|       |         */
 1074|       |        nist_set_384(t_d, buf.bn, 19, 18, 17, 16, 15, 14, 13, 12, 20, 0, 23,
 1075|       |                     0);
 1076|       |        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1077|       |        /*
 1078|       |         * S5
 1079|       |         */
 1080|       |        nist_set_384(t_d, buf.bn, 0, 0, 0, 0, 23, 22, 21, 20, 0, 0, 0, 0);
 1081|       |        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1082|       |        /*
 1083|       |         * S6
 1084|       |         */
 1085|       |        nist_set_384(t_d, buf.bn, 0, 0, 0, 0, 0, 0, 23, 22, 21, 0, 0, 20);
 1086|       |        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1087|       |        /*
 1088|       |         * D1
 1089|       |         */
 1090|       |        nist_set_384(t_d, buf.bn, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12,
 1091|       |                     23);
 1092|       |        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1093|       |        /*
 1094|       |         * D2
 1095|       |         */
 1096|       |        nist_set_384(t_d, buf.bn, 0, 0, 0, 0, 0, 0, 0, 23, 22, 21, 20, 0);
 1097|       |        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1098|       |        /*
 1099|       |         * D3
 1100|       |         */
 1101|       |        nist_set_384(t_d, buf.bn, 0, 0, 0, 0, 0, 0, 0, 23, 23, 0, 0, 0);
 1102|       |        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1103|       |
 1104|       |    }
 1105|       |#endif
 1106|       |    /* see BN_nist_mod_224 for explanation */
 1107|  6.04k|    adjust = bn_sub_words;
 1108|  6.04k|    if (carry > 0)
  ------------------
  |  Branch (1108:9): [True: 3.48k, False: 2.55k]
  ------------------
 1109|  3.48k|        carry =
 1110|  3.48k|            (int)bn_sub_words(r_d, r_d, _nist_p_384[carry - 1],
 1111|  3.48k|                              BN_NIST_384_TOP);
  ------------------
  |  |   16|  3.48k|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  3.48k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  3.48k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1112|  2.55k|    else if (carry < 0) {
  ------------------
  |  Branch (1112:14): [True: 304, False: 2.25k]
  ------------------
 1113|    304|        carry =
 1114|    304|            (int)bn_add_words(r_d, r_d, _nist_p_384[-carry - 1],
 1115|    304|                              BN_NIST_384_TOP);
  ------------------
  |  |   16|    304|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    304|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    304|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    304|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    304|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1116|    304|        adjust = carry ? bn_sub_words : bn_add_words;
  ------------------
  |  Branch (1116:18): [True: 304, False: 0]
  ------------------
 1117|    304|    } else
 1118|  2.25k|        carry = 1;
 1119|       |
 1120|  6.04k|    res = ((*adjust) (c_d, r_d, _nist_p_384[0], BN_NIST_384_TOP) && carry)
  ------------------
  |  |   16|  6.04k|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  6.04k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  6.04k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  6.04k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  6.04k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1120:12): [True: 6.04k, False: 0]
  |  Branch (1120:69): [True: 6.04k, False: 0]
  ------------------
 1121|  6.04k|        ? r_d
 1122|  6.04k|        : c_d;
 1123|  6.04k|    nist_cp_bn(r_d, res, BN_NIST_384_TOP);
  ------------------
  |  |   16|  6.04k|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  6.04k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  6.04k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  6.04k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  6.04k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1124|  6.04k|    r->top = BN_NIST_384_TOP;
  ------------------
  |  |   16|  6.04k|#define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  6.04k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  6.04k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  6.04k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  6.04k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1125|  6.04k|    bn_correct_top(r);
 1126|       |
 1127|  6.04k|    return 1;
 1128|  6.04k|}
BN_nist_mod_521:
 1136|  10.3k|{
 1137|  10.3k|    int top = a->top, i;
 1138|  10.3k|    BN_ULONG *r_d, *a_d = a->d, t_d[BN_NIST_521_TOP], val, tmp, *res;
  ------------------
  |  |   37|  10.3k|#  define BN_ULONG        unsigned long
  ------------------
 1139|  10.3k|    static const BIGNUM ossl_bignum_nist_p_521_sqr = {
 1140|  10.3k|        (BN_ULONG *)_nist_p_521_sqr,
 1141|  10.3k|        OSSL_NELEM(_nist_p_521_sqr),
  ------------------
  |  |   14|  10.3k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
 1142|  10.3k|        OSSL_NELEM(_nist_p_521_sqr),
  ------------------
  |  |   14|  10.3k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
 1143|  10.3k|        0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|  10.3k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
 1144|  10.3k|    };
 1145|       |
 1146|  10.3k|    field = &ossl_bignum_nist_p_521; /* just to make sure */
 1147|       |
 1148|  10.3k|    if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_521_sqr) >= 0)
  ------------------
  |  Branch (1148:9): [True: 0, False: 10.3k]
  |  Branch (1148:30): [True: 0, False: 10.3k]
  ------------------
 1149|      0|        return BN_nnmod(r, a, field, ctx);
 1150|       |
 1151|  10.3k|    i = BN_ucmp(field, a);
 1152|  10.3k|    if (i == 0) {
  ------------------
  |  Branch (1152:9): [True: 0, False: 10.3k]
  ------------------
 1153|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1154|      0|        return 1;
 1155|  10.3k|    } else if (i > 0)
  ------------------
  |  Branch (1155:16): [True: 967, False: 9.37k]
  ------------------
 1156|    967|        return (r == a) ? 1 : (BN_copy(r, a) != NULL);
  ------------------
  |  Branch (1156:16): [True: 967, False: 0]
  ------------------
 1157|       |
 1158|  9.37k|    if (r != a) {
  ------------------
  |  Branch (1158:9): [True: 0, False: 9.37k]
  ------------------
 1159|      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 (1159:13): [True: 0, False: 0]
  ------------------
 1160|      0|            return 0;
 1161|      0|        r_d = r->d;
 1162|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1163|      0|    } else
 1164|  9.37k|        r_d = a_d;
 1165|       |
 1166|       |    /* upper 521 bits, copy ... */
 1167|  9.37k|    nist_cp_bn_0(t_d, a_d + (BN_NIST_521_TOP - 1),
  ------------------
  |  |  265|  9.37k|#define nist_cp_bn_0(dst, src_in, top, max) \
  |  |  266|  9.37k|{                                           \
  |  |  267|  9.37k|    int ii;                                 \
  |  |  268|  9.37k|    const BN_ULONG *src = src_in;           \
  |  |  269|  9.37k|                                            \
  |  |  270|  88.6k|    for (ii = 0; ii < top; ii++)            \
  |  |  ------------------
  |  |  |  Branch (270:18): [True: 79.2k, False: 9.37k]
  |  |  ------------------
  |  |  271|  79.2k|        (dst)[ii] = src[ii];                \
  |  |  272|  14.4k|    for (; ii < max; ii++)                  \
  |  |  ------------------
  |  |  |  Branch (272:12): [True: 5.08k, False: 9.37k]
  |  |  ------------------
  |  |  273|  9.37k|        (dst)[ii] = 0;                      \
  |  |  274|  9.37k|}
  ------------------
 1168|  9.37k|                 top - (BN_NIST_521_TOP - 1), BN_NIST_521_TOP);
 1169|       |    /* ... and right shift */
 1170|  84.3k|    for (val = t_d[0], i = 0; i < BN_NIST_521_TOP - 1; i++) {
  ------------------
  |  |   17|  84.3k|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  84.3k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  84.3k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  84.3k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  84.3k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1170:31): [True: 75.0k, False: 9.37k]
  ------------------
 1171|       |#if 0
 1172|       |        /*
 1173|       |         * MSC ARM compiler [version 2013, presumably even earlier,
 1174|       |         * much earlier] miscompiles this code, but not one in
 1175|       |         * #else section. See RT#3541.
 1176|       |         */
 1177|       |        tmp = val >> BN_NIST_521_RSHIFT;
 1178|       |        val = t_d[i + 1];
 1179|       |        t_d[i] = (tmp | val << BN_NIST_521_LSHIFT) & BN_MASK2;
 1180|       |#else
 1181|  75.0k|        t_d[i] = (val >> BN_NIST_521_RSHIFT |
  ------------------
  |  | 1130|  75.0k|#define BN_NIST_521_RSHIFT      (521%BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|  75.0k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  75.0k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1182|  75.0k|                  (tmp = t_d[i + 1]) << BN_NIST_521_LSHIFT) & BN_MASK2;
  ------------------
  |  | 1131|  75.0k|#define BN_NIST_521_LSHIFT      (BN_BITS2-BN_NIST_521_RSHIFT)
  |  |  ------------------
  |  |  |  |   54|  75.0k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  75.0k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_LSHIFT      (BN_BITS2-BN_NIST_521_RSHIFT)
  |  |  ------------------
  |  |  |  | 1130|  75.0k|#define BN_NIST_521_RSHIFT      (521%BN_BITS2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|  75.0k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   38|  75.0k|#  define BN_BYTES        8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                (tmp = t_d[i + 1]) << BN_NIST_521_LSHIFT) & BN_MASK2;
  ------------------
  |  |   94|  75.0k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
 1183|  75.0k|        val = tmp;
 1184|  75.0k|#endif
 1185|  75.0k|    }
 1186|  9.37k|    t_d[i] = val >> BN_NIST_521_RSHIFT;
  ------------------
  |  | 1130|  9.37k|#define BN_NIST_521_RSHIFT      (521%BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|  9.37k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  9.37k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1187|       |    /* lower 521 bits */
 1188|  9.37k|    r_d[i] &= BN_NIST_521_TOP_MASK;
  ------------------
  |  | 1132|  9.37k|#define BN_NIST_521_TOP_MASK    ((BN_ULONG)BN_MASK2>>BN_NIST_521_LSHIFT)
  |  |  ------------------
  |  |  |  |   94|  9.37k|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP_MASK    ((BN_ULONG)BN_MASK2>>BN_NIST_521_LSHIFT)
  |  |  ------------------
  |  |  |  | 1131|  9.37k|#define BN_NIST_521_LSHIFT      (BN_BITS2-BN_NIST_521_RSHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|  9.37k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   38|  9.37k|#  define BN_BYTES        8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define BN_NIST_521_LSHIFT      (BN_BITS2-BN_NIST_521_RSHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1130|  9.37k|#define BN_NIST_521_RSHIFT      (521%BN_BITS2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   54|  9.37k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   38|  9.37k|#  define BN_BYTES        8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1189|       |
 1190|  9.37k|    bn_add_words(r_d, r_d, t_d, BN_NIST_521_TOP);
  ------------------
  |  |   17|  9.37k|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  9.37k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  9.37k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  9.37k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  9.37k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1191|  9.37k|    res = bn_sub_words(t_d, r_d, _nist_p_521,
  ------------------
  |  Branch (1191:11): [True: 8.81k, False: 561]
  ------------------
 1192|  9.37k|                       BN_NIST_521_TOP)
  ------------------
  |  |   17|  9.37k|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  9.37k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  9.37k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  9.37k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  9.37k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1193|  9.37k|        ? r_d
 1194|  9.37k|        : t_d;
 1195|  9.37k|    nist_cp_bn(r_d, res, BN_NIST_521_TOP);
  ------------------
  |  |   17|  9.37k|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  9.37k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  9.37k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  9.37k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  9.37k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1196|  9.37k|    r->top = BN_NIST_521_TOP;
  ------------------
  |  |   17|  9.37k|#define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  9.37k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  9.37k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521+BN_BITS2-1)/BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  9.37k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  9.37k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1197|  9.37k|    bn_correct_top(r);
 1198|       |
 1199|  9.37k|    return 1;
 1200|  9.37k|}
bn_nist.c:nist_cp_bn:
  277|  52.0k|{
  278|  52.0k|    int i;
  279|       |
  280|   319k|    for (i = 0; i < top; i++)
  ------------------
  |  Branch (280:17): [True: 267k, False: 52.0k]
  ------------------
  281|   267k|        dst[i] = src[i];
  282|  52.0k|}

BN_priv_rand_ex:
  119|  7.61k|{
  120|  7.61k|    return bnrand(PRIVATE, rnd, bits, top, bottom, strength, ctx);
  121|  7.61k|}
bn_rand.c:bnrand:
   25|  7.61k|{
   26|  7.61k|    unsigned char *buf = NULL;
   27|  7.61k|    int b, ret = 0, bit, bytes, mask;
   28|  7.61k|    OSSL_LIB_CTX *libctx = ossl_bn_get_libctx(ctx);
   29|       |
   30|  7.61k|    if (bits == 0) {
  ------------------
  |  Branch (30:9): [True: 0, False: 7.61k]
  ------------------
   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|  7.61k|    if (bits < 0 || (bits == 1 && top > 0))
  ------------------
  |  Branch (36:9): [True: 0, False: 7.61k]
  |  Branch (36:22): [True: 0, False: 7.61k]
  |  Branch (36:35): [True: 0, False: 0]
  ------------------
   37|      0|        goto toosmall;
   38|       |
   39|  7.61k|    bytes = (bits + 7) / 8;
   40|  7.61k|    bit = (bits - 1) % 8;
   41|  7.61k|    mask = 0xff << (bit + 1);
   42|       |
   43|  7.61k|    buf = OPENSSL_malloc(bytes);
  ------------------
  |  |   97|  7.61k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  7.61k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  7.61k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|  7.61k|    if (buf == NULL)
  ------------------
  |  Branch (44:9): [True: 0, False: 7.61k]
  ------------------
   45|      0|        goto err;
   46|       |
   47|       |    /* make a random number and set the top and bottom bits */
   48|  7.61k|    b = flag == NORMAL ? RAND_bytes_ex(libctx, buf, bytes, strength)
  ------------------
  |  Branch (48:9): [True: 0, False: 7.61k]
  ------------------
   49|  7.61k|                       : RAND_priv_bytes_ex(libctx, buf, bytes, strength);
   50|  7.61k|    if (b <= 0)
  ------------------
  |  Branch (50:9): [True: 0, False: 7.61k]
  ------------------
   51|      0|        goto err;
   52|       |
   53|  7.61k|    if (flag == TESTING) {
  ------------------
  |  Branch (53:9): [True: 0, False: 7.61k]
  ------------------
   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|  7.61k|    if (top >= 0) {
  ------------------
  |  Branch (72:9): [True: 30, False: 7.58k]
  ------------------
   73|     30|        if (top) {
  ------------------
  |  Branch (73:13): [True: 0, False: 30]
  ------------------
   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|     30|        } else {
   81|     30|            buf[0] |= (1 << bit);
   82|     30|        }
   83|     30|    }
   84|  7.61k|    buf[0] &= ~mask;
   85|  7.61k|    if (bottom)                 /* set bottom bit if requested */
  ------------------
  |  Branch (85:9): [True: 0, False: 7.61k]
  ------------------
   86|      0|        buf[bytes - 1] |= 1;
   87|  7.61k|    if (!BN_bin2bn(buf, bytes, rnd))
  ------------------
  |  Branch (87:9): [True: 0, False: 7.61k]
  ------------------
   88|      0|        goto err;
   89|  7.61k|    ret = 1;
   90|  7.61k| err:
   91|  7.61k|    OPENSSL_clear_free(buf, bytes);
  ------------------
  |  |  105|  7.61k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  7.61k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  7.61k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  7.61k|    bn_check_top(rnd);
   93|  7.61k|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   97|      0|    return 0;
   98|  7.61k|}

BN_lshift1:
   15|  9.89k|{
   16|  9.89k|    register BN_ULONG *ap, *rp, t, c;
   17|  9.89k|    int i;
   18|       |
   19|  9.89k|    bn_check_top(r);
   20|  9.89k|    bn_check_top(a);
   21|       |
   22|  9.89k|    if (r != a) {
  ------------------
  |  Branch (22:9): [True: 9.89k, False: 0]
  ------------------
   23|  9.89k|        r->neg = a->neg;
   24|  9.89k|        if (bn_wexpand(r, a->top + 1) == NULL)
  ------------------
  |  Branch (24:13): [True: 0, False: 9.89k]
  ------------------
   25|      0|            return 0;
   26|  9.89k|        r->top = a->top;
   27|  9.89k|    } else {
   28|      0|        if (bn_wexpand(r, a->top + 1) == NULL)
  ------------------
  |  Branch (28:13): [True: 0, False: 0]
  ------------------
   29|      0|            return 0;
   30|      0|    }
   31|  9.89k|    ap = a->d;
   32|  9.89k|    rp = r->d;
   33|  9.89k|    c = 0;
   34|  48.9k|    for (i = 0; i < a->top; i++) {
  ------------------
  |  Branch (34:17): [True: 39.0k, False: 9.89k]
  ------------------
   35|  39.0k|        t = *(ap++);
   36|  39.0k|        *(rp++) = ((t << 1) | c) & BN_MASK2;
  ------------------
  |  |   94|  39.0k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   37|  39.0k|        c = t >> (BN_BITS2 - 1);
  ------------------
  |  |   54|  39.0k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  39.0k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
   38|  39.0k|    }
   39|  9.89k|    *rp = c;
   40|  9.89k|    r->top += c;
   41|  9.89k|    bn_check_top(r);
   42|  9.89k|    return 1;
   43|  9.89k|}
BN_rshift1:
   46|  3.05M|{
   47|  3.05M|    BN_ULONG *ap, *rp, t, c;
  ------------------
  |  |   37|  3.05M|#  define BN_ULONG        unsigned long
  ------------------
   48|  3.05M|    int i;
   49|       |
   50|  3.05M|    bn_check_top(r);
   51|  3.05M|    bn_check_top(a);
   52|       |
   53|  3.05M|    if (BN_is_zero(a)) {
  ------------------
  |  Branch (53:9): [True: 0, False: 3.05M]
  ------------------
   54|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
   55|      0|        return 1;
   56|      0|    }
   57|  3.05M|    i = a->top;
   58|  3.05M|    ap = a->d;
   59|  3.05M|    if (a != r) {
  ------------------
  |  Branch (59:9): [True: 5.31k, False: 3.04M]
  ------------------
   60|  5.31k|        if (bn_wexpand(r, i) == NULL)
  ------------------
  |  Branch (60:13): [True: 0, False: 5.31k]
  ------------------
   61|      0|            return 0;
   62|  5.31k|        r->neg = a->neg;
   63|  5.31k|    }
   64|  3.05M|    rp = r->d;
   65|  3.05M|    r->top = i;
   66|  3.05M|    t = ap[--i];
   67|  3.05M|    rp[i] = t >> 1;
   68|  3.05M|    c = t << (BN_BITS2 - 1);
  ------------------
  |  |   54|  3.05M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.05M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
   69|  3.05M|    r->top -= (t == 1);
   70|  4.78M|    while (i > 0) {
  ------------------
  |  Branch (70:12): [True: 1.72M, False: 3.05M]
  ------------------
   71|  1.72M|        t = ap[--i];
   72|  1.72M|        rp[i] = ((t >> 1) & BN_MASK2) | c;
  ------------------
  |  |   94|  1.72M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   73|  1.72M|        c = t << (BN_BITS2 - 1);
  ------------------
  |  |   54|  1.72M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.72M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
   74|  1.72M|    }
   75|  3.05M|    if (!r->top)
  ------------------
  |  Branch (75:9): [True: 0, False: 3.05M]
  ------------------
   76|      0|        r->neg = 0; /* don't allow negative zero */
   77|  3.05M|    bn_check_top(r);
   78|  3.05M|    return 1;
   79|  3.05M|}
BN_lshift:
   82|  84.2k|{
   83|  84.2k|    int ret;
   84|       |
   85|  84.2k|    if (n < 0) {
  ------------------
  |  Branch (85:9): [True: 0, False: 84.2k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   87|      0|        return 0;
   88|      0|    }
   89|       |
   90|  84.2k|    ret = bn_lshift_fixed_top(r, a, n);
   91|       |
   92|  84.2k|    bn_correct_top(r);
   93|  84.2k|    bn_check_top(r);
   94|       |
   95|  84.2k|    return ret;
   96|  84.2k|}
bn_lshift_fixed_top:
  105|  11.7M|{
  106|  11.7M|    int i, nw;
  107|  11.7M|    unsigned int lb, rb;
  108|  11.7M|    BN_ULONG *t, *f;
  ------------------
  |  |   37|  11.7M|#  define BN_ULONG        unsigned long
  ------------------
  109|  11.7M|    BN_ULONG l, m, rmask = 0;
  ------------------
  |  |   37|  11.7M|#  define BN_ULONG        unsigned long
  ------------------
  110|       |
  111|  11.7M|    assert(n >= 0);
  112|       |
  113|  11.7M|    bn_check_top(r);
  114|  11.7M|    bn_check_top(a);
  115|       |
  116|  11.7M|    nw = n / BN_BITS2;
  ------------------
  |  |   54|  11.7M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.7M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  117|  11.7M|    if (bn_wexpand(r, a->top + nw + 1) == NULL)
  ------------------
  |  Branch (117:9): [True: 0, False: 11.7M]
  ------------------
  118|      0|        return 0;
  119|       |
  120|  11.7M|    if (a->top != 0) {
  ------------------
  |  Branch (120:9): [True: 11.6M, False: 18.7k]
  ------------------
  121|  11.6M|        lb = (unsigned int)n % BN_BITS2;
  ------------------
  |  |   54|  11.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  122|  11.6M|        rb = BN_BITS2 - lb;
  ------------------
  |  |   54|  11.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  123|  11.6M|        rb %= BN_BITS2;            /* say no to undefined behaviour */
  ------------------
  |  |   54|  11.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  124|  11.6M|        rmask = (BN_ULONG)0 - rb;  /* rmask = 0 - (rb != 0) */
  125|  11.6M|        rmask |= rmask >> 8;
  126|  11.6M|        f = &(a->d[0]);
  127|  11.6M|        t = &(r->d[nw]);
  128|  11.6M|        l = f[a->top - 1];
  129|  11.6M|        t[a->top] = (l >> rb) & rmask;
  130|  79.1M|        for (i = a->top - 1; i > 0; i--) {
  ------------------
  |  Branch (130:30): [True: 67.4M, False: 11.6M]
  ------------------
  131|  67.4M|            m = l << lb;
  132|  67.4M|            l = f[i - 1];
  133|  67.4M|            t[i] = (m | ((l >> rb) & rmask)) & BN_MASK2;
  ------------------
  |  |   94|  67.4M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  134|  67.4M|        }
  135|  11.6M|        t[0] = (l << lb) & BN_MASK2;
  ------------------
  |  |   94|  11.6M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  136|  11.6M|    } else {
  137|       |        /* shouldn't happen, but formally required */
  138|  18.7k|        r->d[nw] = 0;
  139|  18.7k|    }
  140|  11.7M|    if (nw != 0)
  ------------------
  |  Branch (140:9): [True: 59.9k, False: 11.6M]
  ------------------
  141|  59.9k|        memset(r->d, 0, sizeof(*t) * nw);
  142|       |
  143|  11.7M|    r->neg = a->neg;
  144|  11.7M|    r->top = a->top + nw + 1;
  145|  11.7M|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  11.7M|#  define BN_FLG_FIXED_TOP 0
  ------------------
  146|       |
  147|  11.7M|    return 1;
  148|  11.7M|}
BN_rshift:
  151|  3.09M|{
  152|  3.09M|    int ret = 0;
  153|       |
  154|  3.09M|    if (n < 0) {
  ------------------
  |  Branch (154:9): [True: 0, False: 3.09M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  156|      0|        return 0;
  157|      0|    }
  158|       |
  159|  3.09M|    ret = bn_rshift_fixed_top(r, a, n);
  160|       |
  161|  3.09M|    bn_correct_top(r);
  162|  3.09M|    bn_check_top(r);
  163|       |
  164|  3.09M|    return ret;
  165|  3.09M|}
bn_rshift_fixed_top:
  174|  14.6M|{
  175|  14.6M|    int i, top, nw;
  176|  14.6M|    unsigned int lb, rb;
  177|  14.6M|    BN_ULONG *t, *f;
  ------------------
  |  |   37|  14.6M|#  define BN_ULONG        unsigned long
  ------------------
  178|  14.6M|    BN_ULONG l, m, mask;
  ------------------
  |  |   37|  14.6M|#  define BN_ULONG        unsigned long
  ------------------
  179|       |
  180|  14.6M|    bn_check_top(r);
  181|  14.6M|    bn_check_top(a);
  182|       |
  183|  14.6M|    assert(n >= 0);
  184|       |
  185|  14.6M|    nw = n / BN_BITS2;
  ------------------
  |  |   54|  14.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  14.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  186|  14.6M|    if (nw >= a->top) {
  ------------------
  |  Branch (186:9): [True: 0, False: 14.6M]
  ------------------
  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|  14.6M|    rb = (unsigned int)n % BN_BITS2;
  ------------------
  |  |   54|  14.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  14.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  193|  14.6M|    lb = BN_BITS2 - rb;
  ------------------
  |  |   54|  14.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  14.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  194|  14.6M|    lb %= BN_BITS2;            /* say no to undefined behaviour */
  ------------------
  |  |   54|  14.6M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  14.6M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  195|  14.6M|    mask = (BN_ULONG)0 - lb;   /* mask = 0 - (lb != 0) */
  196|  14.6M|    mask |= mask >> 8;
  197|  14.6M|    top = a->top - nw;
  198|  14.6M|    if (r != a && bn_wexpand(r, top) == NULL)
  ------------------
  |  Branch (198:9): [True: 11.5M, False: 3.08M]
  |  Branch (198:19): [True: 0, False: 11.5M]
  ------------------
  199|      0|        return 0;
  200|       |
  201|  14.6M|    t = &(r->d[0]);
  202|  14.6M|    f = &(a->d[nw]);
  203|  14.6M|    l = f[0];
  204|  48.9M|    for (i = 0; i < top - 1; i++) {
  ------------------
  |  Branch (204:17): [True: 34.2M, False: 14.6M]
  ------------------
  205|  34.2M|        m = f[i + 1];
  206|  34.2M|        t[i] = (l >> rb) | ((m << lb) & mask);
  207|  34.2M|        l = m;
  208|  34.2M|    }
  209|  14.6M|    t[i] = l >> rb;
  210|       |
  211|  14.6M|    r->neg = a->neg;
  212|  14.6M|    r->top = top;
  213|  14.6M|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  14.6M|#  define BN_FLG_FIXED_TOP 0
  ------------------
  214|       |
  215|  14.6M|    return 1;
  216|  14.6M|}

BN_sqr:
   18|  10.4M|{
   19|  10.4M|    int ret = bn_sqr_fixed_top(r, a, ctx);
   20|       |
   21|  10.4M|    bn_correct_top(r);
   22|  10.4M|    bn_check_top(r);
   23|       |
   24|  10.4M|    return ret;
   25|  10.4M|}
bn_sqr_fixed_top:
   28|  10.4M|{
   29|  10.4M|    int max, al;
   30|  10.4M|    int ret = 0;
   31|  10.4M|    BIGNUM *tmp, *rr;
   32|       |
   33|  10.4M|    bn_check_top(a);
   34|       |
   35|  10.4M|    al = a->top;
   36|  10.4M|    if (al <= 0) {
  ------------------
  |  Branch (36:9): [True: 868, False: 10.4M]
  ------------------
   37|    868|        r->top = 0;
   38|    868|        r->neg = 0;
   39|    868|        return 1;
   40|    868|    }
   41|       |
   42|  10.4M|    BN_CTX_start(ctx);
   43|  10.4M|    rr = (a != r) ? r : BN_CTX_get(ctx);
  ------------------
  |  Branch (43:10): [True: 10.2M, False: 214k]
  ------------------
   44|  10.4M|    tmp = BN_CTX_get(ctx);
   45|  10.4M|    if (rr == NULL || tmp == NULL)
  ------------------
  |  Branch (45:9): [True: 0, False: 10.4M]
  |  Branch (45:23): [True: 0, False: 10.4M]
  ------------------
   46|      0|        goto err;
   47|       |
   48|  10.4M|    max = 2 * al;               /* Non-zero (from above) */
   49|  10.4M|    if (bn_wexpand(rr, max) == NULL)
  ------------------
  |  Branch (49:9): [True: 0, False: 10.4M]
  ------------------
   50|      0|        goto err;
   51|       |
   52|  10.4M|    if (al == 4) {
  ------------------
  |  Branch (52:9): [True: 10.4M, False: 36.9k]
  ------------------
   53|       |#ifndef BN_SQR_COMBA
   54|       |        BN_ULONG t[8];
   55|       |        bn_sqr_normal(rr->d, a->d, 4, t);
   56|       |#else
   57|  10.4M|        bn_sqr_comba4(rr->d, a->d);
   58|  10.4M|#endif
   59|  10.4M|    } else if (al == 8) {
  ------------------
  |  Branch (59:16): [True: 5.85k, False: 31.0k]
  ------------------
   60|       |#ifndef BN_SQR_COMBA
   61|       |        BN_ULONG t[16];
   62|       |        bn_sqr_normal(rr->d, a->d, 8, t);
   63|       |#else
   64|  5.85k|        bn_sqr_comba8(rr->d, a->d);
   65|  5.85k|#endif
   66|  31.0k|    } else {
   67|  31.0k|#if defined(BN_RECURSION)
   68|  31.0k|        if (al < BN_SQR_RECURSIVE_SIZE_NORMAL) {
  ------------------
  |  |  366|  31.0k|# define BN_SQR_RECURSIVE_SIZE_NORMAL            (16)/* 32 */
  ------------------
  |  Branch (68:13): [True: 31.0k, False: 0]
  ------------------
   69|  31.0k|            BN_ULONG t[BN_SQR_RECURSIVE_SIZE_NORMAL * 2];
  ------------------
  |  |   37|  31.0k|#  define BN_ULONG        unsigned long
  ------------------
   70|  31.0k|            bn_sqr_normal(rr->d, a->d, al, t);
   71|  31.0k|        } 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|  31.0k|    }
   93|       |
   94|  10.4M|    rr->neg = 0;
   95|  10.4M|    rr->top = max;
   96|  10.4M|    rr->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  10.4M|#  define BN_FLG_FIXED_TOP 0
  ------------------
   97|  10.4M|    if (r != rr && BN_copy(r, rr) == NULL)
  ------------------
  |  Branch (97:9): [True: 214k, False: 10.2M]
  |  Branch (97:20): [True: 0, False: 214k]
  ------------------
   98|      0|        goto err;
   99|       |
  100|  10.4M|    ret = 1;
  101|  10.4M| err:
  102|  10.4M|    bn_check_top(rr);
  103|  10.4M|    bn_check_top(tmp);
  104|  10.4M|    BN_CTX_end(ctx);
  105|  10.4M|    return ret;
  106|  10.4M|}
bn_sqr_normal:
  110|  31.0k|{
  111|  31.0k|    int i, j, max;
  112|  31.0k|    const BN_ULONG *ap;
  113|  31.0k|    BN_ULONG *rp;
  ------------------
  |  |   37|  31.0k|#  define BN_ULONG        unsigned long
  ------------------
  114|       |
  115|  31.0k|    max = n * 2;
  116|  31.0k|    ap = a;
  117|  31.0k|    rp = r;
  118|  31.0k|    rp[0] = rp[max - 1] = 0;
  119|  31.0k|    rp++;
  120|  31.0k|    j = n;
  121|       |
  122|  31.0k|    if (--j > 0) {
  ------------------
  |  Branch (122:9): [True: 23.5k, False: 7.51k]
  ------------------
  123|  23.5k|        ap++;
  124|  23.5k|        rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
  125|  23.5k|        rp += 2;
  126|  23.5k|    }
  127|       |
  128|   102k|    for (i = n - 2; i > 0; i--) {
  ------------------
  |  Branch (128:21): [True: 71.5k, False: 31.0k]
  ------------------
  129|  71.5k|        j--;
  130|  71.5k|        ap++;
  131|  71.5k|        rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]);
  132|  71.5k|        rp += 2;
  133|  71.5k|    }
  134|       |
  135|  31.0k|    bn_add_words(r, r, r, max);
  136|       |
  137|       |    /* There will not be a carry */
  138|       |
  139|  31.0k|    bn_sqr_words(tmp, a, n);
  140|       |
  141|  31.0k|    bn_add_words(r, r, tmp, max);
  142|  31.0k|}

BN_mod_sqrt:
   20|  14.6k|{
   21|  14.6k|    BIGNUM *ret = in;
   22|  14.6k|    int err = 1;
   23|  14.6k|    int r;
   24|  14.6k|    BIGNUM *A, *b, *q, *t, *x, *y;
   25|  14.6k|    int e, i, j;
   26|  14.6k|    int used_ctx = 0;
   27|       |
   28|  14.6k|    if (!BN_is_odd(p) || BN_abs_is_word(p, 1)) {
  ------------------
  |  Branch (28:9): [True: 0, False: 14.6k]
  |  Branch (28:26): [True: 0, False: 14.6k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|       |
   47|  14.6k|    if (BN_is_zero(a) || BN_is_one(a)) {
  ------------------
  |  Branch (47:9): [True: 0, False: 14.6k]
  |  Branch (47:26): [True: 0, False: 14.6k]
  ------------------
   48|      0|        if (ret == NULL)
  ------------------
  |  Branch (48:13): [True: 0, False: 0]
  ------------------
   49|      0|            ret = BN_new();
   50|      0|        if (ret == NULL)
  ------------------
  |  Branch (50:13): [True: 0, False: 0]
  ------------------
   51|      0|            goto end;
   52|      0|        if (!BN_set_word(ret, BN_is_one(a))) {
  ------------------
  |  Branch (52:13): [True: 0, False: 0]
  ------------------
   53|      0|            if (ret != in)
  ------------------
  |  Branch (53:17): [True: 0, False: 0]
  ------------------
   54|      0|                BN_free(ret);
   55|      0|            return NULL;
   56|      0|        }
   57|      0|        bn_check_top(ret);
   58|      0|        return ret;
   59|      0|    }
   60|       |
   61|  14.6k|    BN_CTX_start(ctx);
   62|  14.6k|    used_ctx = 1;
   63|  14.6k|    A = BN_CTX_get(ctx);
   64|  14.6k|    b = BN_CTX_get(ctx);
   65|  14.6k|    q = BN_CTX_get(ctx);
   66|  14.6k|    t = BN_CTX_get(ctx);
   67|  14.6k|    x = BN_CTX_get(ctx);
   68|  14.6k|    y = BN_CTX_get(ctx);
   69|  14.6k|    if (y == NULL)
  ------------------
  |  Branch (69:9): [True: 0, False: 14.6k]
  ------------------
   70|      0|        goto end;
   71|       |
   72|  14.6k|    if (ret == NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 14.6k]
  ------------------
   73|      0|        ret = BN_new();
   74|  14.6k|    if (ret == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 14.6k]
  ------------------
   75|      0|        goto end;
   76|       |
   77|       |    /* A = a mod p */
   78|  14.6k|    if (!BN_nnmod(A, a, p, ctx))
  ------------------
  |  Branch (78:9): [True: 0, False: 14.6k]
  ------------------
   79|      0|        goto end;
   80|       |
   81|       |    /* now write  |p| - 1  as  2^e*q  where  q  is odd */
   82|  14.6k|    e = 1;
   83|   519k|    while (!BN_is_bit_set(p, e))
  ------------------
  |  Branch (83:12): [True: 505k, False: 14.6k]
  ------------------
   84|   505k|        e++;
   85|       |    /* we'll set  q  later (if needed) */
   86|       |
   87|  14.6k|    if (e == 1) {
  ------------------
  |  Branch (87:9): [True: 8.94k, False: 5.72k]
  ------------------
   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|  8.94k|        if (!BN_rshift(q, p, 2))
  ------------------
  |  Branch (96:13): [True: 0, False: 8.94k]
  ------------------
   97|      0|            goto end;
   98|  8.94k|        q->neg = 0;
   99|  8.94k|        if (!BN_add_word(q, 1))
  ------------------
  |  Branch (99:13): [True: 0, False: 8.94k]
  ------------------
  100|      0|            goto end;
  101|  8.94k|        if (!BN_mod_exp(ret, A, q, p, ctx))
  ------------------
  |  Branch (101:13): [True: 0, False: 8.94k]
  ------------------
  102|      0|            goto end;
  103|  8.94k|        err = 0;
  104|  8.94k|        goto vrfy;
  105|  8.94k|    }
  106|       |
  107|  5.72k|    if (e == 2) {
  ------------------
  |  Branch (107:9): [True: 415, False: 5.31k]
  ------------------
  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|    415|        if (!BN_mod_lshift1_quick(t, A, p))
  ------------------
  |  Branch (137:13): [True: 0, False: 415]
  ------------------
  138|      0|            goto end;
  139|       |
  140|       |        /* b := (2*a)^((|p|-5)/8) */
  141|    415|        if (!BN_rshift(q, p, 3))
  ------------------
  |  Branch (141:13): [True: 0, False: 415]
  ------------------
  142|      0|            goto end;
  143|    415|        q->neg = 0;
  144|    415|        if (!BN_mod_exp(b, t, q, p, ctx))
  ------------------
  |  Branch (144:13): [True: 0, False: 415]
  ------------------
  145|      0|            goto end;
  146|       |
  147|       |        /* y := b^2 */
  148|    415|        if (!BN_mod_sqr(y, b, p, ctx))
  ------------------
  |  Branch (148:13): [True: 0, False: 415]
  ------------------
  149|      0|            goto end;
  150|       |
  151|       |        /* t := (2*a)*b^2 - 1 */
  152|    415|        if (!BN_mod_mul(t, t, y, p, ctx))
  ------------------
  |  Branch (152:13): [True: 0, False: 415]
  ------------------
  153|      0|            goto end;
  154|    415|        if (!BN_sub_word(t, 1))
  ------------------
  |  Branch (154:13): [True: 0, False: 415]
  ------------------
  155|      0|            goto end;
  156|       |
  157|       |        /* x = a*b*t */
  158|    415|        if (!BN_mod_mul(x, A, b, p, ctx))
  ------------------
  |  Branch (158:13): [True: 0, False: 415]
  ------------------
  159|      0|            goto end;
  160|    415|        if (!BN_mod_mul(x, x, t, p, ctx))
  ------------------
  |  Branch (160:13): [True: 0, False: 415]
  ------------------
  161|      0|            goto end;
  162|       |
  163|    415|        if (!BN_copy(ret, x))
  ------------------
  |  Branch (163:13): [True: 0, False: 415]
  ------------------
  164|      0|            goto end;
  165|    415|        err = 0;
  166|    415|        goto vrfy;
  167|    415|    }
  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|  5.31k|    if (!BN_copy(q, p))
  ------------------
  |  Branch (173:9): [True: 0, False: 5.31k]
  ------------------
  174|      0|        goto end;               /* use 'q' as temp */
  175|  5.31k|    q->neg = 0;
  176|  5.31k|    i = 2;
  177|  53.1k|    do {
  178|       |        /*
  179|       |         * For efficiency, try small numbers first; if this fails, try random
  180|       |         * numbers.
  181|       |         */
  182|  53.1k|        if (i < 22) {
  ------------------
  |  Branch (182:13): [True: 53.1k, False: 0]
  ------------------
  183|  53.1k|            if (!BN_set_word(y, i))
  ------------------
  |  Branch (183:17): [True: 0, False: 53.1k]
  ------------------
  184|      0|                goto end;
  185|  53.1k|        } else {
  186|      0|            if (!BN_priv_rand_ex(y, BN_num_bits(p), 0, 0, 0, ctx))
  ------------------
  |  Branch (186:17): [True: 0, False: 0]
  ------------------
  187|      0|                goto end;
  188|      0|            if (BN_ucmp(y, p) >= 0) {
  ------------------
  |  Branch (188:17): [True: 0, False: 0]
  ------------------
  189|      0|                if (!(p->neg ? BN_add : BN_sub) (y, y, p))
  ------------------
  |  Branch (189:21): [True: 0, False: 0]
  |  Branch (189:23): [True: 0, False: 0]
  ------------------
  190|      0|                    goto end;
  191|      0|            }
  192|       |            /* now 0 <= y < |p| */
  193|      0|            if (BN_is_zero(y))
  ------------------
  |  Branch (193:17): [True: 0, False: 0]
  ------------------
  194|      0|                if (!BN_set_word(y, i))
  ------------------
  |  Branch (194:21): [True: 0, False: 0]
  ------------------
  195|      0|                    goto end;
  196|      0|        }
  197|       |
  198|  53.1k|        r = BN_kronecker(y, q, ctx); /* here 'q' is |p| */
  199|  53.1k|        if (r < -1)
  ------------------
  |  Branch (199:13): [True: 0, False: 53.1k]
  ------------------
  200|      0|            goto end;
  201|  53.1k|        if (r == 0) {
  ------------------
  |  Branch (201:13): [True: 0, False: 53.1k]
  ------------------
  202|       |            /* m divides p */
  203|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  204|      0|            goto end;
  205|      0|        }
  206|  53.1k|    }
  207|  53.1k|    while (r == 1 && ++i < 82);
  ------------------
  |  Branch (207:12): [True: 47.8k, False: 5.31k]
  |  Branch (207:22): [True: 47.8k, False: 0]
  ------------------
  208|       |
  209|  5.31k|    if (r != -1) {
  ------------------
  |  Branch (209:9): [True: 0, False: 5.31k]
  ------------------
  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|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  216|      0|        goto end;
  217|      0|    }
  218|       |
  219|       |    /* Here's our actual 'q': */
  220|  5.31k|    if (!BN_rshift(q, q, e))
  ------------------
  |  Branch (220:9): [True: 0, False: 5.31k]
  ------------------
  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|  5.31k|    if (!BN_mod_exp(y, y, q, p, ctx))
  ------------------
  |  Branch (227:9): [True: 0, False: 5.31k]
  ------------------
  228|      0|        goto end;
  229|  5.31k|    if (BN_is_one(y)) {
  ------------------
  |  Branch (229:9): [True: 0, False: 5.31k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|  5.31k|    if (!BN_rshift1(t, q))
  ------------------
  |  Branch (254:9): [True: 0, False: 5.31k]
  ------------------
  255|      0|        goto end;
  256|       |
  257|       |    /* x := a^((q-1)/2) */
  258|  5.31k|    if (BN_is_zero(t)) {        /* special case: p = 2^e + 1 */
  ------------------
  |  Branch (258:9): [True: 0, False: 5.31k]
  ------------------
  259|      0|        if (!BN_nnmod(t, A, p, ctx))
  ------------------
  |  Branch (259:13): [True: 0, False: 0]
  ------------------
  260|      0|            goto end;
  261|      0|        if (BN_is_zero(t)) {
  ------------------
  |  Branch (261:13): [True: 0, False: 0]
  ------------------
  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|      0|        } else if (!BN_one(x))
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (266:20): [True: 0, False: 0]
  ------------------
  267|      0|            goto end;
  268|  5.31k|    } else {
  269|  5.31k|        if (!BN_mod_exp(x, A, t, p, ctx))
  ------------------
  |  Branch (269:13): [True: 0, False: 5.31k]
  ------------------
  270|      0|            goto end;
  271|  5.31k|        if (BN_is_zero(x)) {
  ------------------
  |  Branch (271:13): [True: 0, False: 5.31k]
  ------------------
  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|  5.31k|    }
  278|       |
  279|       |    /* b := a*x^2  (= a^q) */
  280|  5.31k|    if (!BN_mod_sqr(b, x, p, ctx))
  ------------------
  |  Branch (280:9): [True: 0, False: 5.31k]
  ------------------
  281|      0|        goto end;
  282|  5.31k|    if (!BN_mod_mul(b, b, A, p, ctx))
  ------------------
  |  Branch (282:9): [True: 0, False: 5.31k]
  ------------------
  283|      0|        goto end;
  284|       |
  285|       |    /* x := a*x    (= a^((q+1)/2)) */
  286|  5.31k|    if (!BN_mod_mul(x, x, A, p, ctx))
  ------------------
  |  Branch (286:9): [True: 0, False: 5.31k]
  ------------------
  287|      0|        goto end;
  288|       |
  289|   215k|    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|   215k|        if (BN_is_one(b)) {
  ------------------
  |  Branch (300:13): [True: 4.51k, False: 211k]
  ------------------
  301|  4.51k|            if (!BN_copy(ret, x))
  ------------------
  |  Branch (301:17): [True: 0, False: 4.51k]
  ------------------
  302|      0|                goto end;
  303|  4.51k|            err = 0;
  304|  4.51k|            goto vrfy;
  305|  4.51k|        }
  306|       |
  307|       |        /* Find the smallest i, 0 < i < e, such that b^(2^i) = 1. */
  308|  9.95M|        for (i = 1; i < e; i++) {
  ------------------
  |  Branch (308:21): [True: 9.94M, False: 802]
  ------------------
  309|  9.94M|            if (i == 1) {
  ------------------
  |  Branch (309:17): [True: 211k, False: 9.73M]
  ------------------
  310|   211k|                if (!BN_mod_sqr(t, b, p, ctx))
  ------------------
  |  Branch (310:21): [True: 0, False: 211k]
  ------------------
  311|      0|                    goto end;
  312|       |
  313|  9.73M|            } else {
  314|  9.73M|                if (!BN_mod_mul(t, t, t, p, ctx))
  ------------------
  |  Branch (314:21): [True: 0, False: 9.73M]
  ------------------
  315|      0|                    goto end;
  316|  9.73M|            }
  317|  9.94M|            if (BN_is_one(t))
  ------------------
  |  Branch (317:17): [True: 210k, False: 9.73M]
  ------------------
  318|   210k|                break;
  319|  9.94M|        }
  320|       |        /* If not found, a is not a square or p is not prime. */
  321|   211k|        if (i >= e) {
  ------------------
  |  Branch (321:13): [True: 802, False: 210k]
  ------------------
  322|    802|            ERR_raise(ERR_LIB_BN, BN_R_NOT_A_SQUARE);
  ------------------
  |  |  401|    802|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    802|    (ERR_new(),                                                 \
  |  |  |  |  404|    802|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    802|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    802|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    802|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    802|     ERR_set_error)
  |  |  ------------------
  ------------------
  323|    802|            goto end;
  324|    802|        }
  325|       |
  326|       |        /* t := y^2^(e - i - 1) */
  327|   210k|        if (!BN_copy(t, y))
  ------------------
  |  Branch (327:13): [True: 0, False: 210k]
  ------------------
  328|      0|            goto end;
  329|   424k|        for (j = e - i - 1; j > 0; j--) {
  ------------------
  |  Branch (329:29): [True: 214k, False: 210k]
  ------------------
  330|   214k|            if (!BN_mod_sqr(t, t, p, ctx))
  ------------------
  |  Branch (330:17): [True: 0, False: 214k]
  ------------------
  331|      0|                goto end;
  332|   214k|        }
  333|   210k|        if (!BN_mod_mul(y, t, t, p, ctx))
  ------------------
  |  Branch (333:13): [True: 0, False: 210k]
  ------------------
  334|      0|            goto end;
  335|   210k|        if (!BN_mod_mul(x, x, t, p, ctx))
  ------------------
  |  Branch (335:13): [True: 0, False: 210k]
  ------------------
  336|      0|            goto end;
  337|   210k|        if (!BN_mod_mul(b, b, y, p, ctx))
  ------------------
  |  Branch (337:13): [True: 0, False: 210k]
  ------------------
  338|      0|            goto end;
  339|   210k|        e = i;
  340|   210k|    }
  341|       |
  342|  13.8k| vrfy:
  343|  13.8k|    if (!err) {
  ------------------
  |  Branch (343:9): [True: 13.8k, 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|  13.8k|        if (!BN_mod_sqr(x, ret, p, ctx))
  ------------------
  |  Branch (349:13): [True: 0, False: 13.8k]
  ------------------
  350|      0|            err = 1;
  351|       |
  352|  13.8k|        if (!err && 0 != BN_cmp(x, A)) {
  ------------------
  |  Branch (352:13): [True: 13.8k, False: 0]
  |  Branch (352:21): [True: 4.12k, False: 9.74k]
  ------------------
  353|  4.12k|            ERR_raise(ERR_LIB_BN, BN_R_NOT_A_SQUARE);
  ------------------
  |  |  401|  4.12k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  4.12k|    (ERR_new(),                                                 \
  |  |  |  |  404|  4.12k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  4.12k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  4.12k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  4.12k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  4.12k|     ERR_set_error)
  |  |  ------------------
  ------------------
  354|  4.12k|            err = 1;
  355|  4.12k|        }
  356|  13.8k|    }
  357|       |
  358|  14.6k| end:
  359|  14.6k|    if (err) {
  ------------------
  |  Branch (359:9): [True: 4.92k, False: 9.74k]
  ------------------
  360|  4.92k|        if (ret != in)
  ------------------
  |  Branch (360:13): [True: 0, False: 4.92k]
  ------------------
  361|      0|            BN_clear_free(ret);
  362|  4.92k|        ret = NULL;
  363|  4.92k|    }
  364|  14.6k|    if (used_ctx)
  ------------------
  |  Branch (364:9): [True: 14.6k, False: 0]
  ------------------
  365|  14.6k|        BN_CTX_end(ctx);
  366|  14.6k|    bn_check_top(ret);
  367|  14.6k|    return ret;
  368|  13.8k|}

BN_div_word:
   62|  8.02k|{
   63|  8.02k|    BN_ULONG ret = 0;
  ------------------
  |  |   37|  8.02k|#  define BN_ULONG        unsigned long
  ------------------
   64|  8.02k|    int i, j;
   65|       |
   66|  8.02k|    bn_check_top(a);
   67|  8.02k|    w &= BN_MASK2;
  ------------------
  |  |   94|  8.02k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   68|       |
   69|  8.02k|    if (!w)
  ------------------
  |  Branch (69:9): [True: 0, False: 8.02k]
  ------------------
   70|       |        /* actually this an error (division by zero) */
   71|      0|        return (BN_ULONG)-1;
   72|  8.02k|    if (a->top == 0)
  ------------------
  |  Branch (72:9): [True: 0, False: 8.02k]
  ------------------
   73|      0|        return 0;
   74|       |
   75|       |    /* normalize input (so bn_div_words doesn't complain) */
   76|  8.02k|    j = BN_BITS2 - BN_num_bits_word(w);
  ------------------
  |  |   54|  8.02k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  8.02k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
   77|  8.02k|    w <<= j;
   78|  8.02k|    if (!BN_lshift(a, a, j))
  ------------------
  |  Branch (78:9): [True: 0, False: 8.02k]
  ------------------
   79|      0|        return (BN_ULONG)-1;
   80|       |
   81|  23.6k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (81:26): [True: 15.6k, False: 8.02k]
  ------------------
   82|  15.6k|        BN_ULONG l, d;
  ------------------
  |  |   37|  15.6k|#  define BN_ULONG        unsigned long
  ------------------
   83|       |
   84|  15.6k|        l = a->d[i];
   85|  15.6k|        d = bn_div_words(ret, l, w);
   86|  15.6k|        ret = (l - ((d * w) & BN_MASK2)) & BN_MASK2;
  ------------------
  |  |   94|  15.6k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
                      ret = (l - ((d * w) & BN_MASK2)) & BN_MASK2;
  ------------------
  |  |   94|  15.6k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   87|  15.6k|        a->d[i] = d;
   88|  15.6k|    }
   89|  8.02k|    if ((a->top > 0) && (a->d[a->top - 1] == 0))
  ------------------
  |  Branch (89:9): [True: 8.02k, False: 0]
  |  Branch (89:25): [True: 8.00k, False: 20]
  ------------------
   90|  8.00k|        a->top--;
   91|  8.02k|    ret >>= j;
   92|  8.02k|    if (!a->top)
  ------------------
  |  Branch (92:9): [True: 3.52k, False: 4.50k]
  ------------------
   93|  3.52k|        a->neg = 0; /* don't allow negative zero */
   94|  8.02k|    bn_check_top(a);
   95|  8.02k|    return ret;
   96|  8.02k|}
BN_add_word:
   99|  42.7k|{
  100|  42.7k|    BN_ULONG l;
  ------------------
  |  |   37|  42.7k|#  define BN_ULONG        unsigned long
  ------------------
  101|  42.7k|    int i;
  102|       |
  103|  42.7k|    bn_check_top(a);
  104|  42.7k|    w &= BN_MASK2;
  ------------------
  |  |   94|  42.7k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  105|       |
  106|       |    /* degenerate case: w is zero */
  107|  42.7k|    if (!w)
  ------------------
  |  Branch (107:9): [True: 8.25k, False: 34.4k]
  ------------------
  108|  8.25k|        return 1;
  109|       |    /* degenerate case: a is zero */
  110|  34.4k|    if (BN_is_zero(a))
  ------------------
  |  Branch (110:9): [True: 3.06k, False: 31.4k]
  ------------------
  111|  3.06k|        return BN_set_word(a, w);
  112|       |    /* handle 'a' when negative */
  113|  31.4k|    if (a->neg) {
  ------------------
  |  Branch (113:9): [True: 0, False: 31.4k]
  ------------------
  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|  79.3k|    for (i = 0; w != 0 && i < a->top; i++) {
  ------------------
  |  Branch (120:17): [True: 47.9k, False: 31.4k]
  |  Branch (120:27): [True: 47.9k, False: 0]
  ------------------
  121|  47.9k|        a->d[i] = l = (a->d[i] + w) & BN_MASK2;
  ------------------
  |  |   94|  47.9k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  122|  47.9k|        w = (w > l) ? 1 : 0;
  ------------------
  |  Branch (122:13): [True: 16.5k, False: 31.4k]
  ------------------
  123|  47.9k|    }
  124|  31.4k|    if (w && i == a->top) {
  ------------------
  |  Branch (124:9): [True: 0, False: 31.4k]
  |  Branch (124:14): [True: 0, False: 0]
  ------------------
  125|      0|        if (bn_wexpand(a, a->top + 1) == NULL)
  ------------------
  |  Branch (125:13): [True: 0, False: 0]
  ------------------
  126|      0|            return 0;
  127|      0|        a->top++;
  128|      0|        a->d[i] = w;
  129|      0|    }
  130|  31.4k|    bn_check_top(a);
  131|  31.4k|    return 1;
  132|  31.4k|}
BN_sub_word:
  135|  50.6k|{
  136|  50.6k|    int i;
  137|       |
  138|  50.6k|    bn_check_top(a);
  139|  50.6k|    w &= BN_MASK2;
  ------------------
  |  |   94|  50.6k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  140|       |
  141|       |    /* degenerate case: w is zero */
  142|  50.6k|    if (!w)
  ------------------
  |  Branch (142:9): [True: 0, False: 50.6k]
  ------------------
  143|      0|        return 1;
  144|       |    /* degenerate case: a is zero */
  145|  50.6k|    if (BN_is_zero(a)) {
  ------------------
  |  Branch (145:9): [True: 0, False: 50.6k]
  ------------------
  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|  50.6k|    if (a->neg) {
  ------------------
  |  Branch (152:9): [True: 0, False: 50.6k]
  ------------------
  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|  50.6k|    if ((a->top == 1) && (a->d[0] < w)) {
  ------------------
  |  Branch (159:9): [True: 318, False: 50.3k]
  |  Branch (159:26): [True: 0, False: 318]
  ------------------
  160|      0|        a->d[0] = w - a->d[0];
  161|      0|        a->neg = 1;
  162|      0|        return 1;
  163|      0|    }
  164|  50.6k|    i = 0;
  165|  99.4k|    for (;;) {
  166|  99.4k|        if (a->d[i] >= w) {
  ------------------
  |  Branch (166:13): [True: 50.6k, False: 48.7k]
  ------------------
  167|  50.6k|            a->d[i] -= w;
  168|  50.6k|            break;
  169|  50.6k|        } else {
  170|  48.7k|            a->d[i] = (a->d[i] - w) & BN_MASK2;
  ------------------
  |  |   94|  48.7k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  171|  48.7k|            i++;
  172|  48.7k|            w = 1;
  173|  48.7k|        }
  174|  99.4k|    }
  175|  50.6k|    if ((a->d[i] == 0) && (i == (a->top - 1)))
  ------------------
  |  Branch (175:9): [True: 2.80k, False: 47.8k]
  |  Branch (175:27): [True: 2.79k, False: 2]
  ------------------
  176|  2.79k|        a->top--;
  177|  50.6k|    bn_check_top(a);
  178|  50.6k|    return 1;
  179|  50.6k|}
BN_mul_word:
  182|   332k|{
  183|   332k|    BN_ULONG ll;
  ------------------
  |  |   37|   332k|#  define BN_ULONG        unsigned long
  ------------------
  184|       |
  185|   332k|    bn_check_top(a);
  186|   332k|    w &= BN_MASK2;
  ------------------
  |  |   94|   332k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  187|   332k|    if (a->top) {
  ------------------
  |  Branch (187:9): [True: 332k, False: 0]
  ------------------
  188|   332k|        if (w == 0)
  ------------------
  |  Branch (188:13): [True: 0, False: 332k]
  ------------------
  189|      0|            BN_zero(a);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  190|   332k|        else {
  191|   332k|            ll = bn_mul_words(a->d, a->d, a->top, w);
  192|   332k|            if (ll) {
  ------------------
  |  Branch (192:17): [True: 330k, False: 1.43k]
  ------------------
  193|   330k|                if (bn_wexpand(a, a->top + 1) == NULL)
  ------------------
  |  Branch (193:21): [True: 0, False: 330k]
  ------------------
  194|      0|                    return 0;
  195|   330k|                a->d[a->top++] = ll;
  196|   330k|            }
  197|   332k|        }
  198|   332k|    }
  199|   332k|    bn_check_top(a);
  200|   332k|    return 1;
  201|   332k|}

ossl_bsearch:
   16|  1.44M|{
   17|  1.44M|    const char *base_ = base;
   18|  1.44M|    int l, h, i = 0, c = 0;
   19|  1.44M|    const char *p = NULL;
   20|       |
   21|  1.44M|    if (num == 0)
  ------------------
  |  Branch (21:9): [True: 0, False: 1.44M]
  ------------------
   22|      0|        return NULL;
   23|  1.44M|    l = 0;
   24|  1.44M|    h = num;
   25|  14.7M|    while (l < h) {
  ------------------
  |  Branch (25:12): [True: 13.7M, False: 974k]
  ------------------
   26|  13.7M|        i = (l + h) / 2;
   27|  13.7M|        p = &(base_[i * size]);
   28|  13.7M|        c = (*cmp) (key, p);
   29|  13.7M|        if (c < 0)
  ------------------
  |  Branch (29:13): [True: 10.1M, False: 3.58M]
  ------------------
   30|  10.1M|            h = i;
   31|  3.58M|        else if (c > 0)
  ------------------
  |  Branch (31:18): [True: 3.11M, False: 470k]
  ------------------
   32|  3.11M|            l = i + 1;
   33|   470k|        else
   34|   470k|            break;
   35|  13.7M|    }
   36|  1.44M|    if (c != 0 && !(flags & OSSL_BSEARCH_VALUE_ON_NOMATCH))
  ------------------
  |  |  149|   974k|# define OSSL_BSEARCH_VALUE_ON_NOMATCH            0x01
  ------------------
  |  Branch (36:9): [True: 974k, False: 470k]
  |  Branch (36:19): [True: 974k, False: 0]
  ------------------
   37|   974k|        p = NULL;
   38|   470k|    else if (c == 0 && (flags & OSSL_BSEARCH_FIRST_VALUE_ON_MATCH)) {
  ------------------
  |  |  150|   470k|# define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
  ------------------
  |  Branch (38:14): [True: 470k, False: 0]
  |  Branch (38:24): [True: 0, False: 470k]
  ------------------
   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.44M|    return p;
   44|  1.44M|}

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|   121k|{
   23|   121k|    BUF_MEM *ret;
   24|       |
   25|   121k|    ret = BUF_MEM_new();
   26|   121k|    if (ret != NULL)
  ------------------
  |  Branch (26:9): [True: 121k, False: 0]
  ------------------
   27|   121k|        ret->flags = flags;
   28|   121k|    return ret;
   29|   121k|}
BUF_MEM_new:
   32|   524k|{
   33|   524k|    BUF_MEM *ret;
   34|       |
   35|   524k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   99|   524k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   524k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   524k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|   524k|    if (ret == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 524k]
  ------------------
   37|      0|        return NULL;
   38|   524k|    return ret;
   39|   524k|}
BUF_MEM_free:
   42|   415k|{
   43|   415k|    if (a == NULL)
  ------------------
  |  Branch (43:9): [True: 423, False: 414k]
  ------------------
   44|    423|        return;
   45|   414k|    if (a->data != NULL) {
  ------------------
  |  Branch (45:9): [True: 160k, False: 254k]
  ------------------
   46|   160k|        if (a->flags & BUF_MEM_FLAG_SECURE)
  ------------------
  |  |   49|   160k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (46:13): [True: 0, False: 160k]
  ------------------
   47|      0|            OPENSSL_secure_clear_free(a->data, a->max);
  ------------------
  |  |  121|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|   160k|        else
   49|   160k|            OPENSSL_clear_free(a->data, a->max);
  ------------------
  |  |  105|   160k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   160k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   160k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   50|   160k|    }
   51|   414k|    OPENSSL_free(a);
  ------------------
  |  |  107|   414k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   414k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   414k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|   414k|}
BUF_MEM_grow:
   72|   145k|{
   73|   145k|    char *ret;
   74|   145k|    size_t n;
   75|       |
   76|   145k|    if (str->length >= len) {
  ------------------
  |  Branch (76:9): [True: 196, False: 144k]
  ------------------
   77|    196|        str->length = len;
   78|    196|        return len;
   79|    196|    }
   80|   144k|    if (str->max >= len) {
  ------------------
  |  Branch (80:9): [True: 223, False: 144k]
  ------------------
   81|    223|        if (str->data != NULL)
  ------------------
  |  Branch (81:13): [True: 223, False: 0]
  ------------------
   82|    223|            memset(&str->data[str->length], 0, len - str->length);
   83|    223|        str->length = len;
   84|    223|        return len;
   85|    223|    }
   86|       |    /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
   87|   144k|    if (len > LIMIT_BEFORE_EXPANSION) {
  ------------------
  |  |   19|   144k|#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
  ------------------
  |  Branch (87:9): [True: 0, False: 144k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   89|      0|        return 0;
   90|      0|    }
   91|   144k|    n = (len + 3) / 3 * 4;
   92|   144k|    if ((str->flags & BUF_MEM_FLAG_SECURE))
  ------------------
  |  |   49|   144k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (92:9): [True: 0, False: 144k]
  ------------------
   93|      0|        ret = sec_alloc_realloc(str, n);
   94|   144k|    else
   95|   144k|        ret = OPENSSL_realloc(str->data, n);
  ------------------
  |  |  101|   144k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   144k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   144k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   96|   144k|    if (ret == NULL) {
  ------------------
  |  Branch (96:9): [True: 0, False: 144k]
  ------------------
   97|      0|        len = 0;
   98|   144k|    } else {
   99|   144k|        str->data = ret;
  100|   144k|        str->max = n;
  101|   144k|        memset(&str->data[str->length], 0, len - str->length);
  102|   144k|        str->length = len;
  103|   144k|    }
  104|   144k|    return len;
  105|   144k|}
BUF_MEM_grow_clean:
  108|  9.95M|{
  109|  9.95M|    char *ret;
  110|  9.95M|    size_t n;
  111|       |
  112|  9.95M|    if (str->length >= len) {
  ------------------
  |  Branch (112:9): [True: 12, False: 9.95M]
  ------------------
  113|     12|        if (str->data != NULL)
  ------------------
  |  Branch (113:13): [True: 12, False: 0]
  ------------------
  114|     12|            memset(&str->data[len], 0, str->length - len);
  115|     12|        str->length = len;
  116|     12|        return len;
  117|     12|    }
  118|  9.95M|    if (str->max >= len) {
  ------------------
  |  Branch (118:9): [True: 8.34M, False: 1.60M]
  ------------------
  119|  8.34M|        memset(&str->data[str->length], 0, len - str->length);
  120|  8.34M|        str->length = len;
  121|  8.34M|        return len;
  122|  8.34M|    }
  123|       |    /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
  124|  1.60M|    if (len > LIMIT_BEFORE_EXPANSION) {
  ------------------
  |  |   19|  1.60M|#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
  ------------------
  |  Branch (124:9): [True: 0, False: 1.60M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        return 0;
  127|      0|    }
  128|  1.60M|    n = (len + 3) / 3 * 4;
  129|  1.60M|    if ((str->flags & BUF_MEM_FLAG_SECURE))
  ------------------
  |  |   49|  1.60M|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (129:9): [True: 0, False: 1.60M]
  ------------------
  130|      0|        ret = sec_alloc_realloc(str, n);
  131|  1.60M|    else
  132|  1.60M|        ret = OPENSSL_clear_realloc(str->data, str->max, n);
  ------------------
  |  |  103|  1.60M|        CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.60M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.60M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  133|  1.60M|    if (ret == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 1.60M]
  ------------------
  134|      0|        len = 0;
  135|  1.60M|    } else {
  136|  1.60M|        str->data = ret;
  137|  1.60M|        str->max = n;
  138|  1.60M|        memset(&str->data[str->length], 0, len - str->length);
  139|  1.60M|        str->length = len;
  140|  1.60M|    }
  141|  1.60M|    return len;
  142|  1.60M|}

ossl_err_load_CMP_strings:
  177|      2|{
  178|      2|# ifndef OPENSSL_NO_ERR
  179|      2|    if (ERR_reason_error_string(CMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (179:9): [True: 2, False: 0]
  ------------------
  180|      2|        ERR_load_strings_const(CMP_str_reasons);
  181|      2|# endif
  182|      2|    return 1;
  183|      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|  19.1k|{
   49|  19.1k|    if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  19.1k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (49:9): [True: 1.83k, False: 17.3k]
  ------------------
   50|  1.83k|        CMS_SignerInfo *si = (CMS_SignerInfo *)*pval;
   51|  1.83k|        EVP_PKEY_free(si->pkey);
   52|  1.83k|        X509_free(si->signer);
   53|  1.83k|        EVP_MD_CTX_free(si->mctx);
   54|  1.83k|    }
   55|  19.1k|    return 1;
   56|  19.1k|}
cms_asn1.c:cms_rek_cb:
  124|  8.24k|{
  125|  8.24k|    CMS_RecipientEncryptedKey *rek = (CMS_RecipientEncryptedKey *)*pval;
  126|  8.24k|    if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  8.24k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (126:9): [True: 1.07k, False: 7.16k]
  ------------------
  127|  1.07k|        EVP_PKEY_free(rek->pkey);
  128|  1.07k|    }
  129|  8.24k|    return 1;
  130|  8.24k|}
cms_asn1.c:cms_kari_cb:
  150|  22.2k|{
  151|  22.2k|    CMS_KeyAgreeRecipientInfo *kari = (CMS_KeyAgreeRecipientInfo *)*pval;
  152|  22.2k|    if (operation == ASN1_OP_NEW_POST) {
  ------------------
  |  |  743|  22.2k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (152:9): [True: 1.99k, False: 20.2k]
  ------------------
  153|  1.99k|        kari->ctx = EVP_CIPHER_CTX_new();
  154|  1.99k|        if (kari->ctx == NULL)
  ------------------
  |  Branch (154:13): [True: 0, False: 1.99k]
  ------------------
  155|      0|            return 0;
  156|  1.99k|        EVP_CIPHER_CTX_set_flags(kari->ctx, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW);
  ------------------
  |  |  362|  1.99k|# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1
  ------------------
  157|  1.99k|        kari->pctx = NULL;
  158|  20.2k|    } else if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  20.2k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (158:16): [True: 1.99k, False: 18.2k]
  ------------------
  159|  1.99k|        EVP_PKEY_CTX_free(kari->pctx);
  160|  1.99k|        EVP_CIPHER_CTX_free(kari->ctx);
  161|  1.99k|    }
  162|  22.2k|    return 1;
  163|  22.2k|}
cms_asn1.c:cms_ri_cb:
  201|  75.3k|{
  202|  75.3k|    if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  75.3k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (202:9): [True: 8.33k, False: 66.9k]
  ------------------
  203|  8.33k|        CMS_RecipientInfo *ri = (CMS_RecipientInfo *)*pval;
  204|  8.33k|        if (ri->type == CMS_RECIPINFO_TRANS) {
  ------------------
  |  |  164|  8.33k|# define CMS_RECIPINFO_TRANS             0
  ------------------
  |  Branch (204:13): [True: 1.27k, False: 7.05k]
  ------------------
  205|  1.27k|            CMS_KeyTransRecipientInfo *ktri = ri->d.ktri;
  206|  1.27k|            EVP_PKEY_free(ktri->pkey);
  207|  1.27k|            X509_free(ktri->recip);
  208|  1.27k|            EVP_PKEY_CTX_free(ktri->pctx);
  209|  7.05k|        } else if (ri->type == CMS_RECIPINFO_KEK) {
  ------------------
  |  |  166|  7.05k|# define CMS_RECIPINFO_KEK               2
  ------------------
  |  Branch (209:20): [True: 466, False: 6.59k]
  ------------------
  210|    466|            CMS_KEKRecipientInfo *kekri = ri->d.kekri;
  211|    466|            OPENSSL_clear_free(kekri->key, kekri->keylen);
  ------------------
  |  |  105|    466|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    466|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    466|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  212|  6.59k|        } else if (ri->type == CMS_RECIPINFO_PASS) {
  ------------------
  |  |  167|  6.59k|# define CMS_RECIPINFO_PASS              3
  ------------------
  |  Branch (212:20): [True: 995, False: 5.59k]
  ------------------
  213|    995|            CMS_PasswordRecipientInfo *pwri = ri->d.pwri;
  214|    995|            OPENSSL_clear_free(pwri->pass, pwri->passlen);
  ------------------
  |  |  105|    995|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    995|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    995|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  215|    995|        }
  216|  8.33k|    }
  217|  75.3k|    return 1;
  218|  75.3k|}
cms_asn1.c:cms_cb:
  296|  44.2k|{
  297|  44.2k|    ASN1_STREAM_ARG *sarg = exarg;
  298|  44.2k|    CMS_ContentInfo *cms = NULL;
  299|  44.2k|    if (pval)
  ------------------
  |  Branch (299:9): [True: 44.2k, False: 0]
  ------------------
  300|  44.2k|        cms = (CMS_ContentInfo *)*pval;
  301|      0|    else
  302|      0|        return 1;
  303|  44.2k|    switch (operation) {
  ------------------
  |  Branch (303:13): [True: 44.2k, False: 0]
  ------------------
  304|       |
  305|      0|    case ASN1_OP_STREAM_PRE:
  ------------------
  |  |  752|      0|# define ASN1_OP_STREAM_PRE      10
  ------------------
  |  Branch (305:5): [True: 0, False: 44.2k]
  ------------------
  306|      0|        if (CMS_stream(&sarg->boundary, cms) <= 0)
  ------------------
  |  Branch (306:13): [True: 0, False: 0]
  ------------------
  307|      0|            return 0;
  308|       |        /* fall through */
  309|      0|    case ASN1_OP_DETACHED_PRE:
  ------------------
  |  |  754|      0|# define ASN1_OP_DETACHED_PRE    12
  ------------------
  |  Branch (309:5): [True: 0, False: 44.2k]
  ------------------
  310|      0|        sarg->ndef_bio = CMS_dataInit(cms, sarg->out);
  311|      0|        if (!sarg->ndef_bio)
  ------------------
  |  Branch (311:13): [True: 0, False: 0]
  ------------------
  312|      0|            return 0;
  313|      0|        break;
  314|       |
  315|      0|    case ASN1_OP_STREAM_POST:
  ------------------
  |  |  753|      0|# define ASN1_OP_STREAM_POST     11
  ------------------
  |  Branch (315:5): [True: 0, False: 44.2k]
  ------------------
  316|      0|    case ASN1_OP_DETACHED_POST:
  ------------------
  |  |  755|      0|# define ASN1_OP_DETACHED_POST   13
  ------------------
  |  Branch (316:5): [True: 0, False: 44.2k]
  ------------------
  317|      0|        if (CMS_dataFinal(cms, sarg->ndef_bio) <= 0)
  ------------------
  |  Branch (317:13): [True: 0, False: 0]
  ------------------
  318|      0|            return 0;
  319|      0|        break;
  320|       |
  321|  44.2k|    }
  322|  44.2k|    return 1;
  323|  44.2k|}

ossl_cms_env_enc_content_free:
   55|    955|{
   56|    955|    if (cms_get_enveloped_type_simple(cinf) != 0) {
  ------------------
  |  Branch (56:9): [True: 303, False: 652]
  ------------------
   57|    303|        CMS_EncryptedContentInfo *ec = ossl_cms_get0_env_enc_content(cinf);
   58|    303|        if (ec != NULL)
  ------------------
  |  Branch (58:13): [True: 303, False: 0]
  ------------------
   59|    303|            OPENSSL_clear_free(ec->key, ec->keylen);
  ------------------
  |  |  105|    303|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    303|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    303|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   60|    303|    }
   61|    955|}
ossl_cms_get0_env_enc_content:
  159|    303|{
  160|    303|    switch (cms_get_enveloped_type(cms)) {
  161|    303|    case CMS_ENVELOPED_STANDARD:
  ------------------
  |  |   26|    303|#define CMS_ENVELOPED_STANDARD 1
  ------------------
  |  Branch (161:5): [True: 303, False: 0]
  ------------------
  162|    303|        return cms->d.envelopedData == NULL ? NULL
  ------------------
  |  Branch (162:16): [True: 0, False: 303]
  ------------------
  163|    303|            : cms->d.envelopedData->encryptedContentInfo;
  164|       |
  165|      0|    case CMS_ENVELOPED_AUTH:
  ------------------
  |  |   27|      0|#define CMS_ENVELOPED_AUTH     2
  ------------------
  |  Branch (165:5): [True: 0, False: 303]
  ------------------
  166|      0|        return cms->d.authEnvelopedData == NULL ? NULL
  ------------------
  |  Branch (166:16): [True: 0, False: 0]
  ------------------
  167|      0|            : cms->d.authEnvelopedData->authEncryptedContentInfo;
  168|       |
  169|      0|    default:
  ------------------
  |  Branch (169:5): [True: 0, False: 303]
  ------------------
  170|      0|        return NULL;
  171|    303|    }
  172|    303|}
CMS_get0_RecipientInfos:
  175|    955|{
  176|    955|    switch (cms_get_enveloped_type(cms)) {
  177|    303|    case CMS_ENVELOPED_STANDARD:
  ------------------
  |  |   26|    303|#define CMS_ENVELOPED_STANDARD 1
  ------------------
  |  Branch (177:5): [True: 303, False: 652]
  ------------------
  178|    303|        return cms->d.envelopedData->recipientInfos;
  179|       |
  180|      0|    case CMS_ENVELOPED_AUTH:
  ------------------
  |  |   27|      0|#define CMS_ENVELOPED_AUTH     2
  ------------------
  |  Branch (180:5): [True: 0, False: 955]
  ------------------
  181|      0|        return cms->d.authEnvelopedData->recipientInfos;
  182|       |
  183|    652|    default:
  ------------------
  |  Branch (183:5): [True: 652, False: 303]
  ------------------
  184|    652|        return NULL;
  185|    955|    }
  186|    955|}
ossl_cms_RecipientInfos_set_cmsctx:
  189|    955|{
  190|    955|    int i;
  191|    955|    CMS_RecipientInfo *ri;
  192|    955|    const CMS_CTX *ctx = ossl_cms_get0_cmsctx(cms);
  193|    955|    STACK_OF(CMS_RecipientInfo) *rinfos = CMS_get0_RecipientInfos(cms);
  ------------------
  |  |   31|    955|# define STACK_OF(type) struct stack_st_##type
  ------------------
  194|       |
  195|  2.78k|    for (i = 0; i < sk_CMS_RecipientInfo_num(rinfos); i++) {
  ------------------
  |  |   99|  2.78k|#define sk_CMS_RecipientInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RecipientInfo_sk_type(sk))
  ------------------
  |  Branch (195:17): [True: 1.82k, False: 955]
  ------------------
  196|  1.82k|        ri = sk_CMS_RecipientInfo_value(rinfos, i);
  ------------------
  |  |  100|  1.82k|#define sk_CMS_RecipientInfo_value(sk, idx) ((CMS_RecipientInfo *)OPENSSL_sk_value(ossl_check_const_CMS_RecipientInfo_sk_type(sk), (idx)))
  ------------------
  197|  1.82k|        if (ri != NULL) {
  ------------------
  |  Branch (197:13): [True: 1.82k, False: 0]
  ------------------
  198|  1.82k|            switch (ri->type) {
  199|    187|            case CMS_RECIPINFO_AGREE:
  ------------------
  |  |  165|    187|# define CMS_RECIPINFO_AGREE             1
  ------------------
  |  Branch (199:13): [True: 187, False: 1.63k]
  ------------------
  200|    187|                ri->d.kari->cms_ctx = ctx;
  201|    187|                break;
  202|    276|            case CMS_RECIPINFO_TRANS:
  ------------------
  |  |  164|    276|# define CMS_RECIPINFO_TRANS             0
  ------------------
  |  Branch (202:13): [True: 276, False: 1.55k]
  ------------------
  203|    276|                ri->d.ktri->cms_ctx = ctx;
  204|    276|                ossl_x509_set0_libctx(ri->d.ktri->recip,
  205|    276|                                      ossl_cms_ctx_get0_libctx(ctx),
  206|    276|                                      ossl_cms_ctx_get0_propq(ctx));
  207|    276|                break;
  208|     11|            case CMS_RECIPINFO_KEK:
  ------------------
  |  |  166|     11|# define CMS_RECIPINFO_KEK               2
  ------------------
  |  Branch (208:13): [True: 11, False: 1.81k]
  ------------------
  209|     11|                ri->d.kekri->cms_ctx = ctx;
  210|     11|                break;
  211|    266|            case CMS_RECIPINFO_PASS:
  ------------------
  |  |  167|    266|# define CMS_RECIPINFO_PASS              3
  ------------------
  |  Branch (211:13): [True: 266, False: 1.56k]
  ------------------
  212|    266|                ri->d.pwri->cms_ctx = ctx;
  213|    266|                break;
  214|  1.08k|            default:
  ------------------
  |  Branch (214:13): [True: 1.08k, False: 740]
  ------------------
  215|  1.08k|                break;
  216|  1.82k|            }
  217|  1.82k|        }
  218|  1.82k|    }
  219|    955|}
cms_env.c:cms_get_enveloped_type_simple:
   30|  2.21k|{
   31|  2.21k|    int nid = OBJ_obj2nid(cms->contentType);
   32|       |
   33|  2.21k|    switch (nid) {
   34|    909|    case NID_pkcs7_enveloped:
  ------------------
  |  |  683|    909|#define NID_pkcs7_enveloped             23
  ------------------
  |  Branch (34:5): [True: 909, False: 1.30k]
  ------------------
   35|    909|        return CMS_ENVELOPED_STANDARD;
  ------------------
  |  |   26|    909|#define CMS_ENVELOPED_STANDARD 1
  ------------------
   36|       |
   37|      0|    case NID_id_smime_ct_authEnvelopedData:
  ------------------
  |  |  854|      0|#define NID_id_smime_ct_authEnvelopedData               1059
  ------------------
  |  Branch (37:5): [True: 0, False: 2.21k]
  ------------------
   38|      0|        return CMS_ENVELOPED_AUTH;
  ------------------
  |  |   27|      0|#define CMS_ENVELOPED_AUTH     2
  ------------------
   39|       |
   40|  1.30k|    default:
  ------------------
  |  Branch (40:5): [True: 1.30k, False: 909]
  ------------------
   41|  1.30k|        return 0;
   42|  2.21k|    }
   43|  2.21k|}
cms_env.c:cms_get_enveloped_type:
   46|  1.25k|{
   47|  1.25k|    int ret = cms_get_enveloped_type_simple(cms);
   48|       |
   49|  1.25k|    if (ret == 0)
  ------------------
  |  Branch (49:9): [True: 652, False: 606]
  ------------------
   50|  1.25k|        ERR_raise(ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA);
  ------------------
  |  |  401|    652|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    652|    (ERR_new(),                                                 \
  |  |  |  |  404|    652|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    652|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    652|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    652|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    652|     ERR_set_error)
  |  |  ------------------
  ------------------
   51|  1.25k|    return ret;
   52|  1.25k|}

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

d2i_CMS_bio:
   38|  8.56k|{
   39|  8.56k|    CMS_ContentInfo *ci;
   40|  8.56k|    const CMS_CTX *ctx = ossl_cms_get0_cmsctx(cms == NULL ? NULL : *cms);
  ------------------
  |  Branch (40:47): [True: 8.56k, False: 0]
  ------------------
   41|       |
   42|  8.56k|    ci = ASN1_item_d2i_bio_ex(ASN1_ITEM_rptr(CMS_ContentInfo), bp, cms,
  ------------------
  |  |  426|  8.56k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   43|  8.56k|                              ossl_cms_ctx_get0_libctx(ctx),
   44|  8.56k|                              ossl_cms_ctx_get0_propq(ctx));
   45|  8.56k|    if (ci != NULL) {
  ------------------
  |  Branch (45:9): [True: 955, False: 7.60k]
  ------------------
   46|    955|        ERR_set_mark();
   47|    955|        ossl_cms_resolve_libctx(ci);
   48|    955|        ERR_pop_to_mark();
   49|    955|    }
   50|  8.56k|    return ci;
   51|  8.56k|}
i2d_CMS_bio:
   54|    955|{
   55|    955|    return ASN1_item_i2d_bio(ASN1_ITEM_rptr(CMS_ContentInfo), bp, cms);
  ------------------
  |  |  426|    955|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   56|    955|}

CMS_ContentInfo_free:
   75|    955|{
   76|    955|    if (cms != NULL) {
  ------------------
  |  Branch (76:9): [True: 955, False: 0]
  ------------------
   77|    955|        ossl_cms_env_enc_content_free(cms);
   78|    955|        OPENSSL_free(cms->ctx.propq);
  ------------------
  |  |  107|    955|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    955|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    955|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|    955|        ASN1_item_free((ASN1_VALUE *)cms, ASN1_ITEM_rptr(CMS_ContentInfo));
  ------------------
  |  |  426|    955|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   80|    955|    }
   81|    955|}
ossl_cms_get0_cmsctx:
   84|  11.4k|{
   85|  11.4k|    return cms != NULL ? &cms->ctx : NULL;
  ------------------
  |  Branch (85:12): [True: 2.86k, False: 8.56k]
  ------------------
   86|  11.4k|}
ossl_cms_ctx_get0_libctx:
   89|  9.79k|{
   90|  9.79k|    return ctx != NULL ? ctx->libctx : NULL;
  ------------------
  |  Branch (90:12): [True: 1.23k, False: 8.56k]
  ------------------
   91|  9.79k|}
ossl_cms_ctx_get0_propq:
   94|  9.79k|{
   95|  9.79k|    return ctx != NULL ? ctx->propq : NULL;
  ------------------
  |  Branch (95:12): [True: 1.23k, False: 8.56k]
  ------------------
   96|  9.79k|}
ossl_cms_resolve_libctx:
   99|    955|{
  100|    955|    int i;
  101|    955|    CMS_CertificateChoices *cch;
  102|    955|    STACK_OF(CMS_CertificateChoices) **pcerts;
  ------------------
  |  |   31|    955|# define STACK_OF(type) struct stack_st_##type
  ------------------
  103|    955|    const CMS_CTX *ctx = ossl_cms_get0_cmsctx(ci);
  104|    955|    OSSL_LIB_CTX *libctx = ossl_cms_ctx_get0_libctx(ctx);
  105|    955|    const char *propq = ossl_cms_ctx_get0_propq(ctx);
  106|       |
  107|    955|    ossl_cms_SignerInfos_set_cmsctx(ci);
  108|    955|    ossl_cms_RecipientInfos_set_cmsctx(ci);
  109|       |
  110|    955|    pcerts = cms_get0_certificate_choices(ci);
  111|    955|    if (pcerts != NULL) {
  ------------------
  |  Branch (111:9): [True: 186, False: 769]
  ------------------
  112|   115k|        for (i = 0; i < sk_CMS_CertificateChoices_num(*pcerts); i++) {
  ------------------
  |  Branch (112:21): [True: 114k, False: 186]
  ------------------
  113|   114k|            cch = sk_CMS_CertificateChoices_value(*pcerts, i);
  114|   114k|            if (cch->type == CMS_CERTCHOICE_CERT)
  ------------------
  |  |  318|   114k|# define CMS_CERTCHOICE_CERT             0
  ------------------
  |  Branch (114:17): [True: 57, False: 114k]
  ------------------
  115|     57|                ossl_x509_set0_libctx(cch->d.certificate, libctx, propq);
  116|   114k|        }
  117|    186|    }
  118|    955|}
cms_lib.c:cms_get0_certificate_choices:
  484|    955|{
  485|    955|    switch (OBJ_obj2nid(cms->contentType)) {
  486|       |
  487|    185|    case NID_pkcs7_signed:
  ------------------
  |  |  679|    185|#define NID_pkcs7_signed                22
  ------------------
  |  Branch (487:5): [True: 185, False: 770]
  ------------------
  488|    185|        return &cms->d.signedData->certificates;
  489|       |
  490|    303|    case NID_pkcs7_enveloped:
  ------------------
  |  |  683|    303|#define NID_pkcs7_enveloped             23
  ------------------
  |  Branch (490:5): [True: 303, False: 652]
  ------------------
  491|    303|        if (cms->d.envelopedData->originatorInfo == NULL)
  ------------------
  |  Branch (491:13): [True: 302, False: 1]
  ------------------
  492|    302|            return NULL;
  493|      1|        return &cms->d.envelopedData->originatorInfo->certificates;
  494|       |
  495|      0|    case NID_id_smime_ct_authEnvelopedData:
  ------------------
  |  |  854|      0|#define NID_id_smime_ct_authEnvelopedData               1059
  ------------------
  |  Branch (495:5): [True: 0, False: 955]
  ------------------
  496|      0|        if (cms->d.authEnvelopedData->originatorInfo == NULL)
  ------------------
  |  Branch (496:13): [True: 0, False: 0]
  ------------------
  497|      0|            return NULL;
  498|      0|        return &cms->d.authEnvelopedData->originatorInfo->certificates;
  499|       |
  500|    467|    default:
  ------------------
  |  Branch (500:5): [True: 467, False: 488]
  ------------------
  501|    467|        ERR_raise(ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_TYPE);
  ------------------
  |  |  401|    467|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    467|    (ERR_new(),                                                 \
  |  |  |  |  404|    467|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    467|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    467|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    467|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    467|     ERR_set_error)
  |  |  ------------------
  ------------------
  502|    467|        return NULL;
  503|       |
  504|    955|    }
  505|    955|}

ossl_cms_SignerInfos_set_cmsctx:
  528|    955|{
  529|    955|    int i;
  530|    955|    CMS_SignerInfo *si;
  531|    955|    STACK_OF(CMS_SignerInfo) *sinfos;
  ------------------
  |  |   31|    955|# define STACK_OF(type) struct stack_st_##type
  ------------------
  532|    955|    const CMS_CTX *ctx = ossl_cms_get0_cmsctx(cms);
  533|       |
  534|    955|    ERR_set_mark();
  535|    955|    sinfos = CMS_get0_SignerInfos(cms);
  536|    955|    ERR_pop_to_mark(); /* removes error in case sinfos == NULL */
  537|       |
  538|  2.12k|    for (i = 0; i < sk_CMS_SignerInfo_num(sinfos); i++) {
  ------------------
  |  |   47|  2.12k|#define sk_CMS_SignerInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_SignerInfo_sk_type(sk))
  ------------------
  |  Branch (538:17): [True: 1.17k, False: 955]
  ------------------
  539|  1.17k|        si = sk_CMS_SignerInfo_value(sinfos, i);
  ------------------
  |  |   48|  1.17k|#define sk_CMS_SignerInfo_value(sk, idx) ((CMS_SignerInfo *)OPENSSL_sk_value(ossl_check_const_CMS_SignerInfo_sk_type(sk), (idx)))
  ------------------
  540|  1.17k|        if (si != NULL)
  ------------------
  |  Branch (540:13): [True: 1.17k, False: 0]
  ------------------
  541|  1.17k|            si->cms_ctx = ctx;
  542|  1.17k|    }
  543|    955|}
CMS_get0_SignerInfos:
  586|    955|{
  587|    955|    CMS_SignedData *sd = cms_get0_signed(cms);
  588|       |
  589|    955|    return sd != NULL ? sd->signerInfos : NULL;
  ------------------
  |  Branch (589:12): [True: 185, False: 770]
  ------------------
  590|    955|}
cms_sd.c:cms_get0_signed:
   28|    955|{
   29|    955|    if (OBJ_obj2nid(cms->contentType) != NID_pkcs7_signed) {
  ------------------
  |  |  679|    955|#define NID_pkcs7_signed                22
  ------------------
  |  Branch (29:9): [True: 770, False: 185]
  ------------------
   30|    770|        ERR_raise(ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA);
  ------------------
  |  |  401|    770|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    770|    (ERR_new(),                                                 \
  |  |  |  |  404|    770|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    770|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    770|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    770|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    770|     ERR_set_error)
  |  |  ------------------
  ------------------
   31|    770|        return NULL;
   32|    770|    }
   33|    185|    return cms->d.signedData;
   34|    955|}

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|}

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|}

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

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

NCONF_new_ex:
  183|      1|{
  184|      1|    CONF *ret;
  185|       |
  186|      1|    if (meth == NULL)
  ------------------
  |  Branch (186:9): [True: 1, False: 0]
  ------------------
  187|      1|        meth = NCONF_default();
  188|       |
  189|      1|    ret = meth->create(meth);
  190|      1|    if (ret == NULL) {
  ------------------
  |  Branch (190:9): [True: 0, False: 1]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  192|      0|        return NULL;
  193|      0|    }
  194|      1|    ret->libctx = libctx;
  195|       |
  196|      1|    return ret;
  197|      1|}
NCONF_free:
  205|      1|{
  206|      1|    if (conf == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 1]
  ------------------
  207|      0|        return;
  208|      1|    conf->meth->destroy(conf);
  209|      1|}
NCONF_load:
  251|      1|{
  252|      1|    if (conf == NULL) {
  ------------------
  |  Branch (252:9): [True: 0, False: 1]
  ------------------
  253|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  254|      0|        return 0;
  255|      0|    }
  256|       |
  257|      1|    return conf->meth->load(conf, file, eline);
  258|      1|}

CONF_modules_load_file_ex:
  182|      1|{
  183|      1|    char *file = NULL;
  184|      1|    CONF *conf = NULL;
  185|      1|    int ret = 0, diagnostics = 0;
  186|       |
  187|      1|    ERR_set_mark();
  188|       |
  189|      1|    if (filename == NULL) {
  ------------------
  |  Branch (189:9): [True: 1, False: 0]
  ------------------
  190|      1|        file = CONF_get1_default_config_file();
  191|      1|        if (file == NULL)
  ------------------
  |  Branch (191:13): [True: 0, False: 1]
  ------------------
  192|      0|            goto err;
  193|      1|        if (*file == '\0') {
  ------------------
  |  Branch (193:13): [True: 0, False: 1]
  ------------------
  194|       |            /* Do not try to load an empty file name but do not error out */
  195|      0|            ret = 1;
  196|      0|            goto err;
  197|      0|        }
  198|      1|    } else {
  199|      0|        file = (char *)filename;
  200|      0|    }
  201|       |
  202|      1|    conf = NCONF_new_ex(libctx, NULL);
  203|      1|    if (conf == NULL)
  ------------------
  |  Branch (203:9): [True: 0, False: 1]
  ------------------
  204|      0|        goto err;
  205|       |
  206|      1|    if (NCONF_load(conf, file, NULL) <= 0) {
  ------------------
  |  Branch (206:9): [True: 1, False: 0]
  ------------------
  207|      1|        if ((flags & CONF_MFLAGS_IGNORE_MISSING_FILE) &&
  ------------------
  |  |  110|      1|# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
  ------------------
  |  Branch (207:13): [True: 1, False: 0]
  ------------------
  208|      1|            (ERR_GET_REASON(ERR_peek_last_error()) == CONF_R_NO_SUCH_FILE)) {
  ------------------
  |  |   36|      1|# define CONF_R_NO_SUCH_FILE                              114
  ------------------
  |  Branch (208:13): [True: 1, False: 0]
  ------------------
  209|      1|            ret = 1;
  210|      1|        }
  211|      1|        goto err;
  212|      1|    }
  213|       |
  214|      0|    ret = CONF_modules_load(conf, appname, flags);
  215|      0|    diagnostics = conf_diagnostics(conf);
  216|       |
  217|      1| err:
  218|      1|    if (filename == NULL)
  ------------------
  |  Branch (218:9): [True: 1, False: 0]
  ------------------
  219|      1|        OPENSSL_free(file);
  ------------------
  |  |  107|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  220|      1|    NCONF_free(conf);
  221|       |
  222|      1|    if ((flags & CONF_MFLAGS_IGNORE_RETURN_CODES) != 0 && !diagnostics)
  ------------------
  |  |  107|      1|# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
  ------------------
  |  Branch (222:9): [True: 1, False: 0]
  |  Branch (222:59): [True: 1, False: 0]
  ------------------
  223|      1|        ret = 1;
  224|       |
  225|      1|    if (ret > 0)
  ------------------
  |  Branch (225:9): [True: 1, False: 0]
  ------------------
  226|      1|        ERR_pop_to_mark();
  227|      0|    else
  228|      0|        ERR_clear_last_mark();
  229|       |
  230|      1|    return ret;
  231|      0|}
CONF_modules_unload:
  482|      2|{
  483|      2|    int i;
  484|      2|    CONF_MODULE *md;
  485|       |
  486|      2|    if (!conf_modules_finish_int()) /* also inits module list lock */
  ------------------
  |  Branch (486:9): [True: 0, False: 2]
  ------------------
  487|      0|        return;
  488|       |
  489|      2|    if (!CRYPTO_THREAD_write_lock(module_list_lock))
  ------------------
  |  Branch (489:9): [True: 0, False: 2]
  ------------------
  490|      0|        return;
  491|       |
  492|       |    /* unload modules in reverse order */
  493|      2|    for (i = sk_CONF_MODULE_num(supported_modules) - 1; i >= 0; i--) {
  ------------------
  |  Branch (493:57): [True: 0, False: 2]
  ------------------
  494|      0|        md = sk_CONF_MODULE_value(supported_modules, i);
  495|       |        /* If static or in use and 'all' not set ignore it */
  496|      0|        if (((md->links > 0) || !md->dso) && !all)
  ------------------
  |  Branch (496:14): [True: 0, False: 0]
  |  Branch (496:33): [True: 0, False: 0]
  |  Branch (496:46): [True: 0, False: 0]
  ------------------
  497|      0|            continue;
  498|       |        /* Since we're working in reverse this is OK */
  499|      0|        (void)sk_CONF_MODULE_delete(supported_modules, i);
  500|      0|        module_free(md);
  501|      0|    }
  502|       |
  503|      2|    if (sk_CONF_MODULE_num(supported_modules) == 0) {
  ------------------
  |  Branch (503:9): [True: 0, False: 2]
  ------------------
  504|      0|        sk_CONF_MODULE_free(supported_modules);
  505|      0|        supported_modules = NULL;
  506|      0|    }
  507|       |
  508|      2|    CRYPTO_THREAD_unlock(module_list_lock);
  509|      2|}
ossl_config_modules_free:
  576|      2|{
  577|      2|    CONF_modules_unload(1); /* calls CONF_modules_finish */
  578|      2|    module_lists_free();
  579|      2|}
CONF_get1_default_config_file:
  630|      1|{
  631|      1|    const char *t;
  632|      1|    char *file, *sep = "";
  633|      1|    size_t size;
  634|       |
  635|      1|    if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL)
  ------------------
  |  Branch (635:9): [True: 0, False: 1]
  ------------------
  636|      0|        return OPENSSL_strdup(file);
  ------------------
  |  |  111|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  637|       |
  638|      1|    t = X509_get_default_cert_area();
  639|      1|#ifndef OPENSSL_SYS_VMS
  640|      1|    sep = "/";
  641|      1|#endif
  642|      1|    size = strlen(t) + strlen(sep) + strlen(OPENSSL_CONF) + 1;
  ------------------
  |  |   81|      1|# define OPENSSL_CONF             "openssl.cnf"
  ------------------
  643|      1|    file = OPENSSL_malloc(size);
  ------------------
  |  |   97|      1|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  644|       |
  645|      1|    if (file == NULL)
  ------------------
  |  Branch (645:9): [True: 0, False: 1]
  ------------------
  646|      0|        return NULL;
  647|      1|    BIO_snprintf(file, size, "%s%s%s", t, sep, OPENSSL_CONF);
  ------------------
  |  |   81|      1|# define OPENSSL_CONF             "openssl.cnf"
  ------------------
  648|       |
  649|      1|    return file;
  650|      1|}
conf_mod.c:do_init_module_list_lock:
  100|      2|{
  101|      2|    module_list_lock = CRYPTO_THREAD_lock_new();
  102|      2|    if (module_list_lock == NULL) {
  ------------------
  |  Branch (102:9): [True: 0, False: 2]
  ------------------
  103|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  104|      0|        return 0;
  105|      0|    }
  106|       |
  107|      2|    return 1;
  108|      2|}
conf_mod.c:conf_modules_finish_int:
  522|      2|{
  523|      2|    CONF_IMODULE *imod;
  524|       |
  525|      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 (525:9): [True: 0, False: 2]
  ------------------
  526|      0|        return 0;
  527|       |
  528|       |    /* If module_list_lock is NULL here it means we were already unloaded */
  529|      2|    if (module_list_lock == NULL
  ------------------
  |  Branch (529:9): [True: 0, False: 2]
  ------------------
  530|      2|        || !CRYPTO_THREAD_write_lock(module_list_lock))
  ------------------
  |  Branch (530:12): [True: 0, False: 2]
  ------------------
  531|      0|        return 0;
  532|       |
  533|      2|    while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  ------------------
  |  Branch (533:12): [True: 0, False: 2]
  ------------------
  534|      0|        imod = sk_CONF_IMODULE_pop(initialized_modules);
  535|      0|        module_finish(imod);
  536|      0|    }
  537|      2|    sk_CONF_IMODULE_free(initialized_modules);
  538|      2|    initialized_modules = NULL;
  539|       |
  540|      2|    CRYPTO_THREAD_unlock(module_list_lock);
  541|       |
  542|      2|    return 1;
  543|      2|}
conf_mod.c:module_lists_free:
   88|      2|{
   89|      2|    CRYPTO_THREAD_lock_free(module_list_lock);
   90|      2|    module_list_lock = NULL;
   91|       |
   92|      2|    sk_CONF_MODULE_free(supported_modules);
   93|      2|    supported_modules = NULL;
   94|       |
   95|      2|    sk_CONF_IMODULE_free(initialized_modules);
   96|      2|    initialized_modules = NULL;
   97|      2|}

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

ossl_lib_ctx_write_lock:
   55|     16|{
   56|     16|    return CRYPTO_THREAD_write_lock(ossl_lib_ctx_get_concrete(ctx)->lock);
   57|     16|}
ossl_lib_ctx_read_lock:
   60|    220|{
   61|    220|    return CRYPTO_THREAD_read_lock(ossl_lib_ctx_get_concrete(ctx)->lock);
   62|    220|}
ossl_lib_ctx_unlock:
   65|    236|{
   66|    236|    return CRYPTO_THREAD_unlock(ossl_lib_ctx_get_concrete(ctx)->lock);
   67|    236|}
ossl_lib_ctx_default_deinit:
  387|      2|{
  388|      2|    if (!default_context_inited)
  ------------------
  |  Branch (388:9): [True: 0, False: 2]
  ------------------
  389|      0|        return;
  390|      2|    context_deinit(&default_context_int);
  391|      2|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  392|      2|    default_context_inited = 0;
  393|      2|}
OSSL_LIB_CTX_get0_global_default:
  487|      1|{
  488|      1|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (488:9): [True: 0, False: 1]
  ------------------
  489|      0|        return NULL;
  490|       |
  491|      1|    return &default_context_int;
  492|      1|}
ossl_release_default_drbg_ctx:
  508|      1|{
  509|       |    /* early release of the DRBG in global default libctx */
  510|      1|    if (default_context_int.drbg != NULL) {
  ------------------
  |  Branch (510:9): [True: 1, False: 0]
  ------------------
  511|      1|        ossl_rand_ctx_free(default_context_int.drbg);
  512|      1|        default_context_int.drbg = NULL;
  513|      1|    }
  514|      1|}
ossl_lib_ctx_get_concrete:
  518|  1.38M|{
  519|  1.38M|#ifndef FIPS_MODULE
  520|  1.38M|    if (ctx == NULL)
  ------------------
  |  Branch (520:9): [True: 1.11M, False: 270k]
  ------------------
  521|  1.11M|        return get_default_context();
  522|   270k|#endif
  523|   270k|    return ctx;
  524|  1.38M|}
ossl_lib_ctx_is_default:
  527|  1.76k|{
  528|  1.76k|#ifndef FIPS_MODULE
  529|  1.76k|    if (ctx == NULL || ctx == get_default_context())
  ------------------
  |  Branch (529:9): [True: 1.75k, False: 7]
  |  Branch (529:24): [True: 7, False: 0]
  ------------------
  530|  1.76k|        return 1;
  531|      0|#endif
  532|      0|    return 0;
  533|  1.76k|}
ossl_lib_ctx_get_data:
  545|   409k|{
  546|   409k|    void *p;
  547|       |
  548|   409k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  549|   409k|    if (ctx == NULL)
  ------------------
  |  Branch (549:9): [True: 0, False: 409k]
  ------------------
  550|      0|        return NULL;
  551|       |
  552|   409k|    switch (index) {
  553|    803|    case OSSL_LIB_CTX_PROPERTY_STRING_INDEX:
  ------------------
  |  |  101|    803|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  |  Branch (553:5): [True: 803, False: 408k]
  ------------------
  554|    803|        return ctx->property_string_data;
  555|  23.9k|    case OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX:
  ------------------
  |  |   98|  23.9k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
  |  Branch (555:5): [True: 23.9k, False: 385k]
  ------------------
  556|  23.9k|        return ctx->evp_method_store;
  557|  1.75k|    case OSSL_LIB_CTX_PROVIDER_STORE_INDEX:
  ------------------
  |  |   99|  1.75k|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  |  Branch (557:5): [True: 1.75k, False: 407k]
  ------------------
  558|  1.75k|        return ctx->provider_store;
  559|   312k|    case OSSL_LIB_CTX_NAMEMAP_INDEX:
  ------------------
  |  |  102|   312k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  |  Branch (559:5): [True: 312k, False: 96.8k]
  ------------------
  560|   312k|        return ctx->namemap;
  561|    236|    case OSSL_LIB_CTX_PROPERTY_DEFN_INDEX:
  ------------------
  |  |  100|    236|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
  |  Branch (561:5): [True: 236, False: 408k]
  ------------------
  562|    236|        return ctx->property_defns;
  563|      5|    case OSSL_LIB_CTX_GLOBAL_PROPERTIES:
  ------------------
  |  |  114|      5|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  |  Branch (563:5): [True: 5, False: 409k]
  ------------------
  564|      5|        return ctx->global_properties;
  565|  7.62k|    case OSSL_LIB_CTX_DRBG_INDEX:
  ------------------
  |  |  103|  7.62k|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  |  Branch (565:5): [True: 7.62k, False: 401k]
  ------------------
  566|  7.62k|        return ctx->drbg;
  567|      0|    case OSSL_LIB_CTX_DRBG_NONCE_INDEX:
  ------------------
  |  |  104|      0|# define OSSL_LIB_CTX_DRBG_NONCE_INDEX               6
  ------------------
  |  Branch (567:5): [True: 0, False: 409k]
  ------------------
  568|      0|        return ctx->drbg_nonce;
  569|      0|#ifndef FIPS_MODULE
  570|      0|    case OSSL_LIB_CTX_PROVIDER_CONF_INDEX:
  ------------------
  |  |  116|      0|# define OSSL_LIB_CTX_PROVIDER_CONF_INDEX           16
  ------------------
  |  Branch (570:5): [True: 0, False: 409k]
  ------------------
  571|      0|        return ctx->provider_conf;
  572|      0|    case OSSL_LIB_CTX_BIO_CORE_INDEX:
  ------------------
  |  |  117|      0|# define OSSL_LIB_CTX_BIO_CORE_INDEX                17
  ------------------
  |  Branch (572:5): [True: 0, False: 409k]
  ------------------
  573|      0|        return ctx->bio_core;
  574|      0|    case OSSL_LIB_CTX_CHILD_PROVIDER_INDEX:
  ------------------
  |  |  118|      0|# define OSSL_LIB_CTX_CHILD_PROVIDER_INDEX          18
  ------------------
  |  Branch (574:5): [True: 0, False: 409k]
  ------------------
  575|      0|        return ctx->child_provider;
  576|  3.56k|    case OSSL_LIB_CTX_DECODER_STORE_INDEX:
  ------------------
  |  |  111|  3.56k|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  |  Branch (576:5): [True: 3.56k, False: 405k]
  ------------------
  577|  3.56k|        return ctx->decoder_store;
  578|  58.8k|    case OSSL_LIB_CTX_DECODER_CACHE_INDEX:
  ------------------
  |  |  120|  58.8k|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  |  Branch (578:5): [True: 58.8k, False: 350k]
  ------------------
  579|  58.8k|        return ctx->decoder_cache;
  580|      0|    case OSSL_LIB_CTX_ENCODER_STORE_INDEX:
  ------------------
  |  |  110|      0|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  |  Branch (580:5): [True: 0, False: 409k]
  ------------------
  581|      0|        return ctx->encoder_store;
  582|      0|    case OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX:
  ------------------
  |  |  115|      0|# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX      15
  ------------------
  |  Branch (582:5): [True: 0, False: 409k]
  ------------------
  583|      0|        return ctx->store_loader_store;
  584|      0|    case OSSL_LIB_CTX_SELF_TEST_CB_INDEX:
  ------------------
  |  |  112|      0|# define OSSL_LIB_CTX_SELF_TEST_CB_INDEX            12
  ------------------
  |  Branch (584:5): [True: 0, False: 409k]
  ------------------
  585|      0|        return ctx->self_test_cb;
  586|      0|#endif
  587|      0|#ifndef OPENSSL_NO_THREAD_POOL
  588|      0|    case OSSL_LIB_CTX_THREAD_INDEX:
  ------------------
  |  |  119|      0|# define OSSL_LIB_CTX_THREAD_INDEX                  19
  ------------------
  |  Branch (588:5): [True: 0, False: 409k]
  ------------------
  589|      0|        return ctx->threads;
  590|      0|#endif
  591|       |
  592|      0|    case OSSL_LIB_CTX_RAND_CRNGT_INDEX: {
  ------------------
  |  |  105|      0|# define OSSL_LIB_CTX_RAND_CRNGT_INDEX               7
  ------------------
  |  Branch (592:5): [True: 0, False: 409k]
  ------------------
  593|       |
  594|       |        /*
  595|       |         * rand_crngt must be lazily initialized because it calls into
  596|       |         * libctx, so must not be called from context_init, else a deadlock
  597|       |         * will occur.
  598|       |         *
  599|       |         * We use a separate lock because code called by the instantiation
  600|       |         * of rand_crngt is liable to try and take the libctx lock.
  601|       |         */
  602|      0|        if (CRYPTO_THREAD_read_lock(ctx->rand_crngt_lock) != 1)
  ------------------
  |  Branch (602:13): [True: 0, False: 0]
  ------------------
  603|      0|            return NULL;
  604|       |
  605|      0|        if (ctx->rand_crngt == NULL) {
  ------------------
  |  Branch (605:13): [True: 0, False: 0]
  ------------------
  606|      0|            CRYPTO_THREAD_unlock(ctx->rand_crngt_lock);
  607|       |
  608|      0|            if (CRYPTO_THREAD_write_lock(ctx->rand_crngt_lock) != 1)
  ------------------
  |  Branch (608:17): [True: 0, False: 0]
  ------------------
  609|      0|                return NULL;
  610|       |
  611|      0|            if (ctx->rand_crngt == NULL)
  ------------------
  |  Branch (611:17): [True: 0, False: 0]
  ------------------
  612|      0|                ctx->rand_crngt = ossl_rand_crng_ctx_new(ctx);
  613|      0|        }
  614|       |
  615|      0|        p = ctx->rand_crngt;
  616|       |
  617|      0|        CRYPTO_THREAD_unlock(ctx->rand_crngt_lock);
  618|       |
  619|      0|        return p;
  620|      0|    }
  621|       |
  622|       |#ifdef FIPS_MODULE
  623|       |    case OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX:
  624|       |        return ctx->thread_event_handler;
  625|       |
  626|       |    case OSSL_LIB_CTX_FIPS_PROV_INDEX:
  627|       |        return ctx->fips_prov;
  628|       |#endif
  629|       |
  630|      0|    default:
  ------------------
  |  Branch (630:5): [True: 0, False: 409k]
  ------------------
  631|      0|        return NULL;
  632|   409k|    }
  633|   409k|}
ossl_lib_ctx_get_ex_data_global:
  636|   972k|{
  637|   972k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  638|   972k|    if (ctx == NULL)
  ------------------
  |  Branch (638:9): [True: 0, False: 972k]
  ------------------
  639|      0|        return NULL;
  640|   972k|    return &ctx->global;
  641|   972k|}
context.c:context_deinit:
  344|      2|{
  345|      2|    if (ctx == NULL)
  ------------------
  |  Branch (345:9): [True: 0, False: 2]
  ------------------
  346|      0|        return 1;
  347|       |
  348|      2|    ossl_ctx_thread_stop(ctx);
  349|       |
  350|      2|    context_deinit_objs(ctx);
  351|       |
  352|      2|    ossl_crypto_cleanup_all_ex_data_int(ctx);
  353|       |
  354|      2|    CRYPTO_THREAD_lock_free(ctx->rand_crngt_lock);
  355|      2|    CRYPTO_THREAD_lock_free(ctx->lock);
  356|      2|    ctx->rand_crngt_lock = NULL;
  357|      2|    ctx->lock = NULL;
  358|      2|    return 1;
  359|      2|}
context.c:context_deinit_objs:
  217|      2|{
  218|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  219|      2|    if (ctx->evp_method_store != NULL) {
  ------------------
  |  Branch (219:9): [True: 2, False: 0]
  ------------------
  220|      2|        ossl_method_store_free(ctx->evp_method_store);
  221|      2|        ctx->evp_method_store = NULL;
  222|      2|    }
  223|       |
  224|       |    /* P2. */
  225|      2|    if (ctx->drbg != NULL) {
  ------------------
  |  Branch (225:9): [True: 1, False: 1]
  ------------------
  226|      1|        ossl_rand_ctx_free(ctx->drbg);
  227|      1|        ctx->drbg = NULL;
  228|      1|    }
  229|       |
  230|      2|#ifndef FIPS_MODULE
  231|       |    /* P2. */
  232|      2|    if (ctx->provider_conf != NULL) {
  ------------------
  |  Branch (232:9): [True: 2, False: 0]
  ------------------
  233|      2|        ossl_prov_conf_ctx_free(ctx->provider_conf);
  234|      2|        ctx->provider_conf = NULL;
  235|      2|    }
  236|       |
  237|       |    /*
  238|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  239|       |     * provider store
  240|       |     */
  241|      2|    if (ctx->decoder_store != NULL) {
  ------------------
  |  Branch (241:9): [True: 2, False: 0]
  ------------------
  242|      2|        ossl_method_store_free(ctx->decoder_store);
  243|      2|        ctx->decoder_store = NULL;
  244|      2|    }
  245|      2|    if (ctx->decoder_cache != NULL) {
  ------------------
  |  Branch (245:9): [True: 2, False: 0]
  ------------------
  246|      2|        ossl_decoder_cache_free(ctx->decoder_cache);
  247|      2|        ctx->decoder_cache = NULL;
  248|      2|    }
  249|       |
  250|       |
  251|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  252|      2|    if (ctx->encoder_store != NULL) {
  ------------------
  |  Branch (252:9): [True: 2, False: 0]
  ------------------
  253|      2|        ossl_method_store_free(ctx->encoder_store);
  254|      2|        ctx->encoder_store = NULL;
  255|      2|    }
  256|       |
  257|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  258|      2|    if (ctx->store_loader_store != NULL) {
  ------------------
  |  Branch (258:9): [True: 2, False: 0]
  ------------------
  259|      2|        ossl_method_store_free(ctx->store_loader_store);
  260|      2|        ctx->store_loader_store = NULL;
  261|      2|    }
  262|      2|#endif
  263|       |
  264|       |    /* P1. Needs to be freed before the child provider data is freed */
  265|      2|    if (ctx->provider_store != NULL) {
  ------------------
  |  Branch (265:9): [True: 2, False: 0]
  ------------------
  266|      2|        ossl_provider_store_free(ctx->provider_store);
  267|      2|        ctx->provider_store = NULL;
  268|      2|    }
  269|       |
  270|       |    /* Default priority. */
  271|      2|    if (ctx->property_string_data != NULL) {
  ------------------
  |  Branch (271:9): [True: 2, False: 0]
  ------------------
  272|      2|        ossl_property_string_data_free(ctx->property_string_data);
  273|      2|        ctx->property_string_data = NULL;
  274|      2|    }
  275|       |
  276|      2|    if (ctx->namemap != NULL) {
  ------------------
  |  Branch (276:9): [True: 2, False: 0]
  ------------------
  277|      2|        ossl_stored_namemap_free(ctx->namemap);
  278|      2|        ctx->namemap = NULL;
  279|      2|    }
  280|       |
  281|      2|    if (ctx->property_defns != NULL) {
  ------------------
  |  Branch (281:9): [True: 2, False: 0]
  ------------------
  282|      2|        ossl_property_defns_free(ctx->property_defns);
  283|      2|        ctx->property_defns = NULL;
  284|      2|    }
  285|       |
  286|      2|    if (ctx->global_properties != NULL) {
  ------------------
  |  Branch (286:9): [True: 2, False: 0]
  ------------------
  287|      2|        ossl_ctx_global_properties_free(ctx->global_properties);
  288|      2|        ctx->global_properties = NULL;
  289|      2|    }
  290|       |
  291|      2|#ifndef FIPS_MODULE
  292|      2|    if (ctx->bio_core != NULL) {
  ------------------
  |  Branch (292:9): [True: 2, False: 0]
  ------------------
  293|      2|        ossl_bio_core_globals_free(ctx->bio_core);
  294|      2|        ctx->bio_core = NULL;
  295|      2|    }
  296|      2|#endif
  297|       |
  298|      2|    if (ctx->drbg_nonce != NULL) {
  ------------------
  |  Branch (298:9): [True: 2, False: 0]
  ------------------
  299|      2|        ossl_prov_drbg_nonce_ctx_free(ctx->drbg_nonce);
  300|      2|        ctx->drbg_nonce = NULL;
  301|      2|    }
  302|       |
  303|      2|#ifndef FIPS_MODULE
  304|      2|    if (ctx->self_test_cb != NULL) {
  ------------------
  |  Branch (304:9): [True: 2, False: 0]
  ------------------
  305|      2|        ossl_self_test_set_callback_free(ctx->self_test_cb);
  306|      2|        ctx->self_test_cb = NULL;
  307|      2|    }
  308|      2|#endif
  309|       |
  310|      2|    if (ctx->rand_crngt != NULL) {
  ------------------
  |  Branch (310:9): [True: 0, False: 2]
  ------------------
  311|      0|        ossl_rand_crng_ctx_free(ctx->rand_crngt);
  312|      0|        ctx->rand_crngt = NULL;
  313|      0|    }
  314|       |
  315|       |#ifdef FIPS_MODULE
  316|       |    if (ctx->thread_event_handler != NULL) {
  317|       |        ossl_thread_event_ctx_free(ctx->thread_event_handler);
  318|       |        ctx->thread_event_handler = NULL;
  319|       |    }
  320|       |
  321|       |    if (ctx->fips_prov != NULL) {
  322|       |        ossl_fips_prov_ossl_ctx_free(ctx->fips_prov);
  323|       |        ctx->fips_prov = NULL;
  324|       |    }
  325|       |#endif
  326|       |
  327|      2|#ifndef OPENSSL_NO_THREAD_POOL
  328|      2|    if (ctx->threads != NULL) {
  ------------------
  |  Branch (328:9): [True: 2, False: 0]
  ------------------
  329|      2|        ossl_threads_ctx_free(ctx->threads);
  330|      2|        ctx->threads = NULL;
  331|      2|    }
  332|      2|#endif
  333|       |
  334|       |    /* Low priority. */
  335|      2|#ifndef FIPS_MODULE
  336|      2|    if (ctx->child_provider != NULL) {
  ------------------
  |  Branch (336:9): [True: 2, False: 0]
  ------------------
  337|      2|        ossl_child_prov_ctx_free(ctx->child_provider);
  338|      2|        ctx->child_provider = NULL;
  339|      2|    }
  340|      2|#endif
  341|      2|}
context.c:context_init:
   81|      2|{
   82|      2|    int exdata_done = 0;
   83|       |
   84|      2|    ctx->lock = CRYPTO_THREAD_lock_new();
   85|      2|    if (ctx->lock == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 2]
  ------------------
   86|      0|        return 0;
   87|       |
   88|      2|    ctx->rand_crngt_lock = CRYPTO_THREAD_lock_new();
   89|      2|    if (ctx->rand_crngt_lock == NULL)
  ------------------
  |  Branch (89:9): [True: 0, False: 2]
  ------------------
   90|      0|        goto err;
   91|       |
   92|       |    /* Initialize ex_data. */
   93|      2|    if (!ossl_do_ex_data_init(ctx))
  ------------------
  |  Branch (93:9): [True: 0, False: 2]
  ------------------
   94|      0|        goto err;
   95|      2|    exdata_done = 1;
   96|       |
   97|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
   98|      2|    ctx->evp_method_store = ossl_method_store_new(ctx);
   99|      2|    if (ctx->evp_method_store == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 2]
  ------------------
  100|      0|        goto err;
  101|       |
  102|      2|#ifndef FIPS_MODULE
  103|       |    /* P2. Must be freed before the provider store is freed */
  104|      2|    ctx->provider_conf = ossl_prov_conf_ctx_new(ctx);
  105|      2|    if (ctx->provider_conf == NULL)
  ------------------
  |  Branch (105:9): [True: 0, False: 2]
  ------------------
  106|      0|        goto err;
  107|      2|#endif
  108|       |
  109|       |    /* P2. */
  110|      2|    ctx->drbg = ossl_rand_ctx_new(ctx);
  111|      2|    if (ctx->drbg == NULL)
  ------------------
  |  Branch (111:9): [True: 0, False: 2]
  ------------------
  112|      0|        goto err;
  113|       |
  114|      2|#ifndef FIPS_MODULE
  115|       |    /*
  116|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  117|       |     * provider store
  118|       |     */
  119|      2|    ctx->decoder_store = ossl_method_store_new(ctx);
  120|      2|    if (ctx->decoder_store == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 2]
  ------------------
  121|      0|        goto err;
  122|      2|    ctx->decoder_cache = ossl_decoder_cache_new(ctx);
  123|      2|    if (ctx->decoder_cache == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 2]
  ------------------
  124|      0|        goto err;
  125|       |
  126|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  127|      2|    ctx->encoder_store = ossl_method_store_new(ctx);
  128|      2|    if (ctx->encoder_store == NULL)
  ------------------
  |  Branch (128:9): [True: 0, False: 2]
  ------------------
  129|      0|        goto err;
  130|       |
  131|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  132|      2|    ctx->store_loader_store = ossl_method_store_new(ctx);
  133|      2|    if (ctx->store_loader_store == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 2]
  ------------------
  134|      0|        goto err;
  135|      2|#endif
  136|       |
  137|       |    /* P1. Needs to be freed before the child provider data is freed */
  138|      2|    ctx->provider_store = ossl_provider_store_new(ctx);
  139|      2|    if (ctx->provider_store == NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 2]
  ------------------
  140|      0|        goto err;
  141|       |
  142|       |    /* Default priority. */
  143|      2|    ctx->property_string_data = ossl_property_string_data_new(ctx);
  144|      2|    if (ctx->property_string_data == NULL)
  ------------------
  |  Branch (144:9): [True: 0, False: 2]
  ------------------
  145|      0|        goto err;
  146|       |
  147|      2|    ctx->namemap = ossl_stored_namemap_new(ctx);
  148|      2|    if (ctx->namemap == NULL)
  ------------------
  |  Branch (148:9): [True: 0, False: 2]
  ------------------
  149|      0|        goto err;
  150|       |
  151|      2|    ctx->property_defns = ossl_property_defns_new(ctx);
  152|      2|    if (ctx->property_defns == NULL)
  ------------------
  |  Branch (152:9): [True: 0, False: 2]
  ------------------
  153|      0|        goto err;
  154|       |
  155|      2|    ctx->global_properties = ossl_ctx_global_properties_new(ctx);
  156|      2|    if (ctx->global_properties == NULL)
  ------------------
  |  Branch (156:9): [True: 0, False: 2]
  ------------------
  157|      0|        goto err;
  158|       |
  159|      2|#ifndef FIPS_MODULE
  160|      2|    ctx->bio_core = ossl_bio_core_globals_new(ctx);
  161|      2|    if (ctx->bio_core == NULL)
  ------------------
  |  Branch (161:9): [True: 0, False: 2]
  ------------------
  162|      0|        goto err;
  163|      2|#endif
  164|       |
  165|      2|    ctx->drbg_nonce = ossl_prov_drbg_nonce_ctx_new(ctx);
  166|      2|    if (ctx->drbg_nonce == NULL)
  ------------------
  |  Branch (166:9): [True: 0, False: 2]
  ------------------
  167|      0|        goto err;
  168|       |
  169|      2|#ifndef FIPS_MODULE
  170|      2|    ctx->self_test_cb = ossl_self_test_set_callback_new(ctx);
  171|      2|    if (ctx->self_test_cb == NULL)
  ------------------
  |  Branch (171:9): [True: 0, False: 2]
  ------------------
  172|      0|        goto err;
  173|      2|#endif
  174|       |
  175|       |#ifdef FIPS_MODULE
  176|       |    ctx->thread_event_handler = ossl_thread_event_ctx_new(ctx);
  177|       |    if (ctx->thread_event_handler == NULL)
  178|       |        goto err;
  179|       |
  180|       |    ctx->fips_prov = ossl_fips_prov_ossl_ctx_new(ctx);
  181|       |    if (ctx->fips_prov == NULL)
  182|       |        goto err;
  183|       |#endif
  184|       |
  185|      2|#ifndef OPENSSL_NO_THREAD_POOL
  186|      2|    ctx->threads = ossl_threads_ctx_new(ctx);
  187|      2|    if (ctx->threads == NULL)
  ------------------
  |  Branch (187:9): [True: 0, False: 2]
  ------------------
  188|      0|        goto err;
  189|      2|#endif
  190|       |
  191|       |    /* Low priority. */
  192|      2|#ifndef FIPS_MODULE
  193|      2|    ctx->child_provider = ossl_child_prov_ctx_new(ctx);
  194|      2|    if (ctx->child_provider == NULL)
  ------------------
  |  Branch (194:9): [True: 0, False: 2]
  ------------------
  195|      0|        goto err;
  196|      2|#endif
  197|       |
  198|       |    /* Everything depends on properties, so we also pre-initialise that */
  199|      2|    if (!ossl_property_parse_init(ctx))
  ------------------
  |  Branch (199:9): [True: 0, False: 2]
  ------------------
  200|      0|        goto err;
  201|       |
  202|      2|    return 1;
  203|       |
  204|      0| err:
  205|      0|    context_deinit_objs(ctx);
  206|       |
  207|      0|    if (exdata_done)
  ------------------
  |  Branch (207:9): [True: 0, False: 0]
  ------------------
  208|      0|        ossl_crypto_cleanup_all_ex_data_int(ctx);
  209|       |
  210|      0|    CRYPTO_THREAD_lock_free(ctx->rand_crngt_lock);
  211|      0|    CRYPTO_THREAD_lock_free(ctx->lock);
  212|      0|    memset(ctx, '\0', sizeof(*ctx));
  213|      0|    return 0;
  214|      2|}
context.c:default_context_do_init:
  370|      2|{
  371|      2|    if (!CRYPTO_THREAD_init_local(&default_context_thread_local, NULL))
  ------------------
  |  Branch (371:9): [True: 0, False: 2]
  ------------------
  372|      0|        goto err;
  373|       |
  374|      2|    if (!context_init(&default_context_int))
  ------------------
  |  Branch (374:9): [True: 0, False: 2]
  ------------------
  375|      0|        goto deinit_thread;
  376|       |
  377|      2|    default_context_inited = 1;
  378|      2|    return 1;
  379|       |
  380|      0|deinit_thread:
  381|      0|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  382|      0|err:
  383|      0|    return 0;
  384|      0|}
context.c:get_default_context:
  404|  1.11M|{
  405|  1.11M|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  406|       |
  407|  1.11M|    if (current_defctx == NULL)
  ------------------
  |  Branch (407:9): [True: 1.11M, False: 0]
  ------------------
  408|  1.11M|        current_defctx = &default_context_int;
  409|  1.11M|    return current_defctx;
  410|  1.11M|}
context.c:get_thread_default_context:
  396|  1.11M|{
  397|  1.11M|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|  1.11M|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1.11M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (397:9): [True: 0, False: 1.11M]
  ------------------
  398|      0|        return NULL;
  399|       |
  400|  1.11M|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  401|  1.11M|}

ossl_algorithm_do_all:
  149|  1.75k|{
  150|  1.75k|    struct algorithm_data_st cbdata = { 0, };
  151|       |
  152|  1.75k|    cbdata.libctx = libctx;
  153|  1.75k|    cbdata.operation_id = operation_id;
  154|  1.75k|    cbdata.pre = pre;
  155|  1.75k|    cbdata.reserve_store = reserve_store;
  156|  1.75k|    cbdata.fn = fn;
  157|  1.75k|    cbdata.unreserve_store = unreserve_store;
  158|  1.75k|    cbdata.post = post;
  159|  1.75k|    cbdata.data = data;
  160|       |
  161|  1.75k|    if (provider == NULL) {
  ------------------
  |  Branch (161:9): [True: 1.75k, False: 0]
  ------------------
  162|  1.75k|        ossl_provider_doall_activated(libctx, algorithm_do_this, &cbdata);
  163|  1.75k|    } 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|  1.75k|}
ossl_algorithm_get1_first_name:
  181|    220|{
  182|    220|    const char *first_name_end = NULL;
  183|    220|    size_t first_name_len = 0;
  184|    220|    char *ret;
  185|       |
  186|    220|    if (algo->algorithm_names == NULL)
  ------------------
  |  Branch (186:9): [True: 0, False: 220]
  ------------------
  187|      0|        return NULL;
  188|       |
  189|    220|    first_name_end = strchr(algo->algorithm_names, ':');
  190|    220|    if (first_name_end == NULL)
  ------------------
  |  Branch (190:9): [True: 107, False: 113]
  ------------------
  191|    107|        first_name_len = strlen(algo->algorithm_names);
  192|    113|    else
  193|    113|        first_name_len = first_name_end - algo->algorithm_names;
  194|       |
  195|    220|    ret = OPENSSL_strndup(algo->algorithm_names, first_name_len);
  ------------------
  |  |  113|    220|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    220|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    220|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  196|    220|    return ret;
  197|    220|}
core_algorithm.c:algorithm_do_this:
  103|  1.75k|{
  104|  1.75k|    struct algorithm_data_st *data = cbdata;
  105|  1.75k|    int first_operation = 1;
  106|  1.75k|    int last_operation = OSSL_OP__HIGHEST;
  ------------------
  |  |  269|  1.75k|# define OSSL_OP__HIGHEST                           22
  ------------------
  107|  1.75k|    int cur_operation;
  108|  1.75k|    int ok = 1;
  109|       |
  110|  1.75k|    if (data->operation_id != 0)
  ------------------
  |  Branch (110:9): [True: 1.75k, False: 0]
  ------------------
  111|  1.75k|        first_operation = last_operation = data->operation_id;
  112|       |
  113|  1.75k|    for (cur_operation = first_operation;
  114|  3.51k|         cur_operation <= last_operation;
  ------------------
  |  Branch (114:10): [True: 1.75k, False: 1.75k]
  ------------------
  115|  1.75k|         cur_operation++) {
  116|  1.75k|        int no_store = 0;        /* Assume caching is ok */
  117|  1.75k|        const OSSL_ALGORITHM *map = NULL;
  118|  1.75k|        int ret = 0;
  119|       |
  120|  1.75k|        map = ossl_provider_query_operation(provider, cur_operation,
  121|  1.75k|                                            &no_store);
  122|  1.75k|        ret = algorithm_do_map(provider, map, cur_operation, no_store, data);
  123|  1.75k|        ossl_provider_unquery_operation(provider, cur_operation, map);
  124|       |
  125|  1.75k|        if (ret < 0)
  ------------------
  |  Branch (125:13): [True: 0, False: 1.75k]
  ------------------
  126|       |            /* Hard error, bail out immediately! */
  127|      0|            return 0;
  128|       |
  129|       |        /* If post-condition not fulfilled, set general failure */
  130|  1.75k|        if (!ret)
  ------------------
  |  Branch (130:13): [True: 0, False: 1.75k]
  ------------------
  131|      0|            ok = 0;
  132|  1.75k|    }
  133|       |
  134|  1.75k|    return ok;
  135|  1.75k|}
core_algorithm.c:algorithm_do_map:
   44|  1.75k|{
   45|  1.75k|    struct algorithm_data_st *data = cbdata;
   46|  1.75k|    int ret = 0;
   47|       |
   48|  1.75k|    if (!data->reserve_store(no_store, data->data))
  ------------------
  |  Branch (48:9): [True: 0, False: 1.75k]
  ------------------
   49|       |        /* Error, bail out! */
   50|      0|        return -1;
   51|       |
   52|       |    /* Do we fulfill pre-conditions? */
   53|  1.75k|    if (data->pre == NULL) {
  ------------------
  |  Branch (53:9): [True: 0, False: 1.75k]
  ------------------
   54|       |        /* If there is no pre-condition function, assume "yes" */
   55|      0|        ret = 1;
   56|  1.75k|    } else if (!data->pre(provider, cur_operation, no_store, data->data,
  ------------------
  |  Branch (56:16): [True: 0, False: 1.75k]
  ------------------
   57|  1.75k|                          &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|  1.75k|    if (ret == 0) {
  ------------------
  |  Branch (68:9): [True: 1.75k, False: 5]
  ------------------
   69|  1.75k|        ret = 1;
   70|  1.75k|        goto end;
   71|  1.75k|    }
   72|       |
   73|      5|    if (map != NULL) {
  ------------------
  |  Branch (73:9): [True: 5, False: 0]
  ------------------
   74|      5|        const OSSL_ALGORITHM *thismap;
   75|       |
   76|    225|        for (thismap = map; thismap->algorithm_names != NULL; thismap++)
  ------------------
  |  Branch (76:29): [True: 220, False: 5]
  ------------------
   77|    220|            data->fn(provider, thismap, no_store, data->data);
   78|      5|    }
   79|       |
   80|       |    /* Do we fulfill post-conditions? */
   81|      5|    if (data->post == NULL) {
  ------------------
  |  Branch (81:9): [True: 0, False: 5]
  ------------------
   82|       |        /* If there is no post-condition function, assume "yes" */
   83|      0|        ret = 1;
   84|      5|    } else if (!data->post(provider, cur_operation, no_store, data->data,
  ------------------
  |  Branch (84:16): [True: 0, False: 5]
  ------------------
   85|      5|                           &ret)) {
   86|       |        /* Error, bail out! */
   87|      0|        ret = -1;
   88|      0|    }
   89|       |
   90|  1.75k| end:
   91|  1.75k|    data->unreserve_store(data->data);
   92|       |
   93|  1.75k|    return ret;
   94|      5|}

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

ossl_stored_namemap_new:
   65|      2|{
   66|      2|    OSSL_NAMEMAP *namemap = ossl_namemap_new();
   67|       |
   68|      2|    if (namemap != NULL)
  ------------------
  |  Branch (68:9): [True: 2, False: 0]
  ------------------
   69|      2|        namemap->stored = 1;
   70|       |
   71|      2|    return namemap;
   72|      2|}
ossl_stored_namemap_free:
   75|      2|{
   76|      2|    OSSL_NAMEMAP *namemap = vnamemap;
   77|       |
   78|      2|    if (namemap != NULL) {
  ------------------
  |  Branch (78:9): [True: 2, False: 0]
  ------------------
   79|       |        /* Pretend it isn't stored, or ossl_namemap_free() will do nothing */
   80|      2|        namemap->stored = 0;
   81|      2|        ossl_namemap_free(namemap);
   82|      2|    }
   83|      2|}
ossl_namemap_empty:
   91|   312k|{
   92|       |#ifdef TSAN_REQUIRES_LOCKING
   93|       |    /* No TSAN support */
   94|       |    int rv;
   95|       |
   96|       |    if (namemap == NULL)
   97|       |        return 1;
   98|       |
   99|       |    if (!CRYPTO_THREAD_read_lock(namemap->lock))
  100|       |        return -1;
  101|       |    rv = namemap->max_number == 0;
  102|       |    CRYPTO_THREAD_unlock(namemap->lock);
  103|       |    return rv;
  104|       |#else
  105|       |    /* Have TSAN support */
  106|   312k|    return namemap == NULL || tsan_load(&namemap->max_number) == 0;
  ------------------
  |  |   61|   312k|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (106:12): [True: 0, False: 312k]
  |  Branch (106:31): [True: 1, False: 312k]
  ------------------
  107|   312k|#endif
  108|   312k|}
ossl_namemap_doall_names:
  132|  29.8k|{
  133|  29.8k|    DOALL_NAMES_DATA cbdata;
  134|  29.8k|    size_t num_names;
  135|  29.8k|    int i;
  136|       |
  137|  29.8k|    cbdata.number = number;
  138|  29.8k|    cbdata.found = 0;
  139|       |
  140|  29.8k|    if (namemap == NULL)
  ------------------
  |  Branch (140:9): [True: 0, False: 29.8k]
  ------------------
  141|      0|        return 0;
  142|       |
  143|       |    /*
  144|       |     * We collect all the names first under a read lock. Subsequently we call
  145|       |     * the user function, so that we're not holding the read lock when in user
  146|       |     * code. This could lead to deadlocks.
  147|       |     */
  148|  29.8k|    if (!CRYPTO_THREAD_read_lock(namemap->lock))
  ------------------
  |  Branch (148:9): [True: 0, False: 29.8k]
  ------------------
  149|      0|        return 0;
  150|       |
  151|  29.8k|    num_names = lh_NAMENUM_ENTRY_num_items(namemap->namenum);
  152|  29.8k|    if (num_names == 0) {
  ------------------
  |  Branch (152:9): [True: 0, False: 29.8k]
  ------------------
  153|      0|        CRYPTO_THREAD_unlock(namemap->lock);
  154|      0|        return 0;
  155|      0|    }
  156|  29.8k|    cbdata.names = OPENSSL_malloc(sizeof(*cbdata.names) * num_names);
  ------------------
  |  |   97|  29.8k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  29.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  29.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  157|  29.8k|    if (cbdata.names == NULL) {
  ------------------
  |  Branch (157:9): [True: 0, False: 29.8k]
  ------------------
  158|      0|        CRYPTO_THREAD_unlock(namemap->lock);
  159|      0|        return 0;
  160|      0|    }
  161|  29.8k|    lh_NAMENUM_ENTRY_doall_DOALL_NAMES_DATA(namemap->namenum, do_name,
  162|  29.8k|                                            &cbdata);
  163|  29.8k|    CRYPTO_THREAD_unlock(namemap->lock);
  164|       |
  165|   151k|    for (i = 0; i < cbdata.found; i++)
  ------------------
  |  Branch (165:17): [True: 121k, False: 29.8k]
  ------------------
  166|   121k|        fn(cbdata.names[i], data);
  167|       |
  168|  29.8k|    OPENSSL_free(cbdata.names);
  ------------------
  |  |  107|  29.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  29.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  29.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  169|  29.8k|    return 1;
  170|  29.8k|}
ossl_namemap_name2num:
  186|   300k|{
  187|   300k|    int number;
  188|       |
  189|   300k|#ifndef FIPS_MODULE
  190|   300k|    if (namemap == NULL)
  ------------------
  |  Branch (190:9): [True: 0, False: 300k]
  ------------------
  191|      0|        namemap = ossl_namemap_stored(NULL);
  192|   300k|#endif
  193|       |
  194|   300k|    if (namemap == NULL)
  ------------------
  |  Branch (194:9): [True: 0, False: 300k]
  ------------------
  195|      0|        return 0;
  196|       |
  197|   300k|    if (!CRYPTO_THREAD_read_lock(namemap->lock))
  ------------------
  |  Branch (197:9): [True: 0, False: 300k]
  ------------------
  198|      0|        return 0;
  199|   300k|    number = namemap_name2num(namemap, name);
  200|   300k|    CRYPTO_THREAD_unlock(namemap->lock);
  201|       |
  202|   300k|    return number;
  203|   300k|}
ossl_namemap_name2num_n:
  207|    222|{
  208|    222|    char *tmp;
  209|    222|    int ret;
  210|       |
  211|    222|    if (name == NULL || (tmp = OPENSSL_strndup(name, name_len)) == NULL)
  ------------------
  |  |  113|    222|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    222|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    222|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (211:9): [True: 0, False: 222]
  |  Branch (211:25): [True: 0, False: 222]
  ------------------
  212|      0|        return 0;
  213|       |
  214|    222|    ret = ossl_namemap_name2num(namemap, tmp);
  215|    222|    OPENSSL_free(tmp);
  ------------------
  |  |  107|    222|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    222|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    222|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  216|    222|    return ret;
  217|    222|}
ossl_namemap_add_name:
  279|    653|{
  280|    653|    int tmp_number;
  281|       |
  282|    653|#ifndef FIPS_MODULE
  283|    653|    if (namemap == NULL)
  ------------------
  |  Branch (283:9): [True: 0, False: 653]
  ------------------
  284|      0|        namemap = ossl_namemap_stored(NULL);
  285|    653|#endif
  286|       |
  287|    653|    if (name == NULL || *name == 0 || namemap == NULL)
  ------------------
  |  Branch (287:9): [True: 0, False: 653]
  |  Branch (287:25): [True: 0, False: 653]
  |  Branch (287:39): [True: 0, False: 653]
  ------------------
  288|      0|        return 0;
  289|       |
  290|    653|    if (!CRYPTO_THREAD_write_lock(namemap->lock))
  ------------------
  |  Branch (290:9): [True: 0, False: 653]
  ------------------
  291|      0|        return 0;
  292|    653|    tmp_number = namemap_add_name(namemap, number, name);
  293|    653|    CRYPTO_THREAD_unlock(namemap->lock);
  294|    653|    return tmp_number;
  295|    653|}
ossl_namemap_add_names:
  299|    220|{
  300|    220|    char *tmp, *p, *q, *endp;
  301|       |
  302|       |    /* Check that we have a namemap */
  303|    220|    if (!ossl_assert(namemap != NULL)) {
  ------------------
  |  |   52|    220|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    220|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (303:9): [True: 0, False: 220]
  ------------------
  304|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  305|      0|        return 0;
  306|      0|    }
  307|       |
  308|    220|    if ((tmp = OPENSSL_strdup(names)) == NULL)
  ------------------
  |  |  111|    220|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    220|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    220|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (308:9): [True: 0, False: 220]
  ------------------
  309|      0|        return 0;
  310|       |
  311|    220|    if (!CRYPTO_THREAD_write_lock(namemap->lock)) {
  ------------------
  |  Branch (311:9): [True: 0, False: 220]
  ------------------
  312|      0|        OPENSSL_free(tmp);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  313|      0|        return 0;
  314|      0|    }
  315|       |    /*
  316|       |     * Check that no name is an empty string, and that all names have at
  317|       |     * most one numeric identity together.
  318|       |     */
  319|    617|    for (p = tmp; *p != '\0'; p = q) {
  ------------------
  |  Branch (319:19): [True: 397, False: 220]
  ------------------
  320|    397|        int this_number;
  321|    397|        size_t l;
  322|       |
  323|    397|        if ((q = strchr(p, separator)) == NULL) {
  ------------------
  |  Branch (323:13): [True: 220, False: 177]
  ------------------
  324|    220|            l = strlen(p);       /* offset to \0 */
  325|    220|            q = p + l;
  326|    220|        } else {
  327|    177|            l = q - p;           /* offset to the next separator */
  328|    177|            *q++ = '\0';
  329|    177|        }
  330|       |
  331|    397|        if (*p == '\0') {
  ------------------
  |  Branch (331:13): [True: 0, False: 397]
  ------------------
  332|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  333|      0|            number = 0;
  334|      0|            goto end;
  335|      0|        }
  336|       |
  337|    397|        this_number = namemap_name2num(namemap, p);
  338|       |
  339|    397|        if (number == 0) {
  ------------------
  |  Branch (339:13): [True: 261, False: 136]
  ------------------
  340|    261|            number = this_number;
  341|    261|        } else if (this_number != 0 && this_number != number) {
  ------------------
  |  Branch (341:20): [True: 112, False: 24]
  |  Branch (341:40): [True: 0, False: 112]
  ------------------
  342|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  ------------------
  343|      0|                           "\"%s\" has an existing different identity %d (from \"%s\")",
  344|      0|                           p, this_number, names);
  345|      0|            number = 0;
  346|      0|            goto end;
  347|      0|        }
  348|    397|    }
  349|    220|    endp = p;
  350|       |
  351|       |    /* Now that we have checked, register all names */
  352|    617|    for (p = tmp; p < endp; p = q) {
  ------------------
  |  Branch (352:19): [True: 397, False: 220]
  ------------------
  353|    397|        int this_number;
  354|       |
  355|    397|        q = p + strlen(p) + 1;
  356|       |
  357|    397|        this_number = namemap_add_name(namemap, number, p);
  358|    397|        if (number == 0) {
  ------------------
  |  Branch (358:13): [True: 80, False: 317]
  ------------------
  359|     80|            number = this_number;
  360|    317|        } else if (this_number != number) {
  ------------------
  |  Branch (360:20): [True: 0, False: 317]
  ------------------
  361|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  362|      0|                           "Got number %d when expecting %d",
  363|      0|                           this_number, number);
  364|      0|            number = 0;
  365|      0|            goto end;
  366|      0|        }
  367|    397|    }
  368|       |
  369|    220| end:
  370|    220|    CRYPTO_THREAD_unlock(namemap->lock);
  371|    220|    OPENSSL_free(tmp);
  ------------------
  |  |  107|    220|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    220|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    220|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  372|    220|    return number;
  373|    220|}
ossl_namemap_stored:
  471|   312k|{
  472|   312k|#ifndef FIPS_MODULE
  473|   312k|    int nms;
  474|   312k|#endif
  475|   312k|    OSSL_NAMEMAP *namemap =
  476|   312k|        ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_NAMEMAP_INDEX);
  ------------------
  |  |  102|   312k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  477|       |
  478|   312k|    if (namemap == NULL)
  ------------------
  |  Branch (478:9): [True: 0, False: 312k]
  ------------------
  479|      0|        return NULL;
  480|       |
  481|   312k|#ifndef FIPS_MODULE
  482|   312k|    nms = ossl_namemap_empty(namemap);
  483|   312k|    if (nms < 0) {
  ------------------
  |  Branch (483:9): [True: 0, False: 312k]
  ------------------
  484|       |        /*
  485|       |         * Could not get lock to make the count, so maybe internal objects
  486|       |         * weren't added. This seems safest.
  487|       |         */
  488|      0|        return NULL;
  489|      0|    }
  490|   312k|    if (nms == 1) {
  ------------------
  |  Branch (490:9): [True: 1, False: 312k]
  ------------------
  491|      1|        int i, end;
  492|       |
  493|       |        /* Before pilfering, we make sure the legacy database is populated */
  494|      1|        OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS
  ------------------
  |  |  451|      1|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
  495|      1|                            | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
  ------------------
  |  |  452|      1|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
  496|       |
  497|      1|        OBJ_NAME_do_all(OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|      1|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
  498|      1|                        get_legacy_cipher_names, namemap);
  499|      1|        OBJ_NAME_do_all(OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|      1|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  500|      1|                        get_legacy_md_names, namemap);
  501|       |
  502|       |        /* We also pilfer data from the legacy EVP_PKEY_ASN1_METHODs */
  503|     17|        for (i = 0, end = EVP_PKEY_asn1_get_count(); i < end; i++)
  ------------------
  |  Branch (503:54): [True: 16, False: 1]
  ------------------
  504|     16|            get_legacy_pkey_meth_names(EVP_PKEY_asn1_get0(i), namemap);
  505|      1|    }
  506|   312k|#endif
  507|       |
  508|   312k|    return namemap;
  509|   312k|}
ossl_namemap_new:
  512|      2|{
  513|      2|    OSSL_NAMEMAP *namemap;
  514|       |
  515|      2|    if ((namemap = OPENSSL_zalloc(sizeof(*namemap))) != NULL
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (515:9): [True: 2, False: 0]
  ------------------
  516|      2|        && (namemap->lock = CRYPTO_THREAD_lock_new()) != NULL
  ------------------
  |  Branch (516:12): [True: 2, False: 0]
  ------------------
  517|      2|        && (namemap->namenum =
  ------------------
  |  Branch (517:12): [True: 2, False: 0]
  ------------------
  518|      2|            lh_NAMENUM_ENTRY_new(namenum_hash, namenum_cmp)) != NULL)
  519|      2|        return namemap;
  520|       |
  521|      0|    ossl_namemap_free(namemap);
  522|      0|    return NULL;
  523|      2|}
ossl_namemap_free:
  526|      2|{
  527|      2|    if (namemap == NULL || namemap->stored)
  ------------------
  |  Branch (527:9): [True: 0, False: 2]
  |  Branch (527:28): [True: 0, False: 2]
  ------------------
  528|      0|        return;
  529|       |
  530|      2|    lh_NAMENUM_ENTRY_doall(namemap->namenum, namenum_free);
  531|      2|    lh_NAMENUM_ENTRY_free(namemap->namenum);
  532|       |
  533|      2|    CRYPTO_THREAD_lock_free(namemap->lock);
  534|      2|    OPENSSL_free(namemap);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  535|      2|}
core_namemap.c:do_name:
  117|  12.0M|{
  118|  12.0M|    if (namenum->number == data->number)
  ------------------
  |  Branch (118:9): [True: 121k, False: 11.9M]
  ------------------
  119|   121k|        data->names[data->found++] = namenum->name;
  120|  12.0M|}
core_namemap.c:namemap_name2num:
  175|   302k|{
  176|   302k|    NAMENUM_ENTRY *namenum_entry, namenum_tmpl;
  177|       |
  178|   302k|    namenum_tmpl.name = (char *)name;
  179|   302k|    namenum_tmpl.number = 0;
  180|   302k|    namenum_entry =
  181|   302k|        lh_NAMENUM_ENTRY_retrieve(namemap->namenum, &namenum_tmpl);
  182|   302k|    return namenum_entry != NULL ? namenum_entry->number : 0;
  ------------------
  |  Branch (182:12): [True: 293k, False: 8.99k]
  ------------------
  183|   302k|}
core_namemap.c:namemap_add_name:
  249|  1.05k|{
  250|  1.05k|    NAMENUM_ENTRY *namenum = NULL;
  251|  1.05k|    int tmp_number;
  252|       |
  253|       |    /* If it already exists, we don't add it */
  254|  1.05k|    if ((tmp_number = namemap_name2num(namemap, name)) != 0)
  ------------------
  |  Branch (254:9): [True: 645, False: 405]
  ------------------
  255|    645|        return tmp_number;
  256|       |
  257|    405|    if ((namenum = OPENSSL_zalloc(sizeof(*namenum))) == NULL)
  ------------------
  |  |   99|    405|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    405|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    405|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (257:9): [True: 0, False: 405]
  ------------------
  258|      0|        return 0;
  259|       |
  260|    405|    if ((namenum->name = OPENSSL_strdup(name)) == NULL)
  ------------------
  |  |  111|    405|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    405|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    405|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (260:9): [True: 0, False: 405]
  ------------------
  261|      0|        goto err;
  262|       |
  263|       |    /* The tsan_counter use here is safe since we're under lock */
  264|    405|    namenum->number =
  265|    405|        number != 0 ? number : 1 + tsan_counter(&namemap->max_number);
  ------------------
  |  |  150|    197|# define tsan_counter(ptr) tsan_add((ptr), 1)
  |  |  ------------------
  |  |  |  |   63|    602|#   define tsan_add(ptr, n) atomic_fetch_add_explicit((ptr), (n), memory_order_relaxed)
  |  |  ------------------
  ------------------
  |  Branch (265:9): [True: 208, False: 197]
  ------------------
  266|    405|    (void)lh_NAMENUM_ENTRY_insert(namemap->namenum, namenum);
  267|       |
  268|    405|    if (lh_NAMENUM_ENTRY_error(namemap->namenum))
  ------------------
  |  Branch (268:9): [True: 0, False: 405]
  ------------------
  269|      0|        goto err;
  270|    405|    return namenum->number;
  271|       |
  272|      0| err:
  273|      0|    namenum_free(namenum);
  274|      0|    return 0;
  275|    405|}
core_namemap.c:get_legacy_cipher_names:
  410|    183|{
  411|    183|    const EVP_CIPHER *cipher = (void *)OBJ_NAME_get(on->name, on->type);
  412|       |
  413|    183|    if (cipher != NULL)
  ------------------
  |  Branch (413:9): [True: 183, False: 0]
  ------------------
  414|    183|        get_legacy_evp_names(NID_undef, EVP_CIPHER_get_type(cipher), NULL, arg);
  ------------------
  |  |   18|    183|#define NID_undef                       0
  ------------------
  415|    183|}
core_namemap.c:get_legacy_evp_names:
  386|    259|{
  387|    259|    int num = 0;
  388|    259|    ASN1_OBJECT *obj;
  389|       |
  390|    259|    if (base_nid != NID_undef) {
  ------------------
  |  |   18|    259|#define NID_undef                       0
  ------------------
  |  Branch (390:9): [True: 5, False: 254]
  ------------------
  391|      5|        num = ossl_namemap_add_name(arg, num, OBJ_nid2sn(base_nid));
  392|      5|        num = ossl_namemap_add_name(arg, num, OBJ_nid2ln(base_nid));
  393|      5|    }
  394|       |
  395|    259|    if (nid != NID_undef) {
  ------------------
  |  |   18|    259|#define NID_undef                       0
  ------------------
  |  Branch (395:9): [True: 211, False: 48]
  ------------------
  396|    211|        num = ossl_namemap_add_name(arg, num, OBJ_nid2sn(nid));
  397|    211|        num = ossl_namemap_add_name(arg, num, OBJ_nid2ln(nid));
  398|    211|        if ((obj = OBJ_nid2obj(nid)) != NULL) {
  ------------------
  |  Branch (398:13): [True: 211, False: 0]
  ------------------
  399|    211|            char txtoid[OSSL_MAX_NAME_SIZE];
  400|       |
  401|    211|            if (OBJ_obj2txt(txtoid, sizeof(txtoid), obj, 1) > 0)
  ------------------
  |  Branch (401:17): [True: 210, False: 1]
  ------------------
  402|    210|                num = ossl_namemap_add_name(arg, num, txtoid);
  403|    211|        }
  404|    211|    }
  405|    259|    if (pem_name != NULL)
  ------------------
  |  Branch (405:9): [True: 11, False: 248]
  ------------------
  406|     11|        num = ossl_namemap_add_name(arg, num, pem_name);
  407|    259|}
core_namemap.c:get_legacy_md_names:
  418|     59|{
  419|     59|    const EVP_MD *md = (void *)OBJ_NAME_get(on->name, on->type);
  420|       |
  421|     59|    if (md != NULL)
  ------------------
  |  Branch (421:9): [True: 59, False: 0]
  ------------------
  422|     59|        get_legacy_evp_names(0, EVP_MD_get_type(md), NULL, arg);
  423|     59|}
core_namemap.c:get_legacy_pkey_meth_names:
  427|     16|{
  428|     16|    int nid = 0, base_nid = 0, flags = 0;
  429|     16|    const char *pem_name = NULL;
  430|       |
  431|     16|    EVP_PKEY_asn1_get0_info(&nid, &base_nid, &flags, NULL, &pem_name, ameth);
  432|     16|    if (nid != NID_undef) {
  ------------------
  |  |   18|     16|#define NID_undef                       0
  ------------------
  |  Branch (432:9): [True: 16, False: 0]
  ------------------
  433|     16|        if ((flags & ASN1_PKEY_ALIAS) == 0) {
  ------------------
  |  | 1549|     16|# define ASN1_PKEY_ALIAS         0x1
  ------------------
  |  Branch (433:13): [True: 10, False: 6]
  ------------------
  434|     10|            switch (nid) {
  435|      1|            case EVP_PKEY_DHX:
  ------------------
  |  |   68|      1|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5295|      1|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (435:13): [True: 1, False: 9]
  ------------------
  436|       |                /* We know that the name "DHX" is used too */
  437|      1|                get_legacy_evp_names(0, nid, "DHX", arg);
  438|       |                /* FALLTHRU */
  439|     10|            default:
  ------------------
  |  Branch (439:13): [True: 9, False: 1]
  ------------------
  440|     10|                get_legacy_evp_names(0, nid, pem_name, arg);
  441|     10|            }
  442|     10|        } else {
  443|       |            /*
  444|       |             * Treat aliases carefully, some of them are undesirable, or
  445|       |             * should not be treated as such for providers.
  446|       |             */
  447|       |
  448|      6|            switch (nid) {
  449|      1|            case EVP_PKEY_SM2:
  ------------------
  |  |   70|      1|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1228|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (449:13): [True: 1, False: 5]
  ------------------
  450|       |                /*
  451|       |                 * SM2 is a separate keytype with providers, not an alias for
  452|       |                 * EC.
  453|       |                 */
  454|      1|                get_legacy_evp_names(0, nid, pem_name, arg);
  455|      1|                break;
  456|      5|            default:
  ------------------
  |  Branch (456:13): [True: 5, False: 1]
  ------------------
  457|       |                /* Use the short name of the base nid as the common reference */
  458|      5|                get_legacy_evp_names(base_nid, nid, pem_name, arg);
  459|      6|            }
  460|      6|        }
  461|     16|    }
  462|     16|}
core_namemap.c:namenum_hash:
   46|   302k|{
   47|   302k|    return ossl_lh_strcasehash(n->name);
   48|   302k|}
core_namemap.c:namenum_cmp:
   51|   293k|{
   52|   293k|    return OPENSSL_strcasecmp(a->name, b->name);
   53|   293k|}
core_namemap.c:namenum_free:
   56|    405|{
   57|    405|    if (n != NULL)
  ------------------
  |  Branch (57:9): [True: 405, False: 0]
  ------------------
   58|    405|        OPENSSL_free(n->name);
  ------------------
  |  |  107|    405|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    405|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    405|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   59|    405|    OPENSSL_free(n);
  ------------------
  |  |  107|    405|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    405|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    405|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   60|    405|}

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

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

ossl_err_load_CRMF_strings:
   65|      2|{
   66|      2|# ifndef OPENSSL_NO_ERR
   67|      2|    if (ERR_reason_error_string(CRMF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (67:9): [True: 2, False: 0]
  ------------------
   68|      2|        ERR_load_strings_const(CRMF_str_reasons);
   69|      2|# endif
   70|      2|    return 1;
   71|      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|}

ossl_ctype_check:
  253|  1.55M|{
  254|  1.55M|    const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
  255|  1.55M|    const int a = ossl_toascii(c);
  ------------------
  |  |   56|  1.55M|#  define ossl_toascii(c)       (c)
  ------------------
  256|       |
  257|  1.55M|    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
  ------------------
  |  Branch (257:12): [True: 1.55M, False: 0]
  |  Branch (257:22): [True: 1.54M, False: 2.93k]
  |  Branch (257:33): [True: 119k, False: 1.42M]
  ------------------
  258|  1.55M|}
ossl_isdigit:
  270|   200k|{
  271|   200k|    int a = ossl_toascii(c);
  ------------------
  |  |   56|   200k|#  define ossl_toascii(c)       (c)
  ------------------
  272|       |
  273|   200k|    return ASCII_IS_DIGIT(a);
  ------------------
  |  |  265|   200k|#define ASCII_IS_DIGIT(c)   (c >= 0x30 && c <= 0x39)
  |  |  ------------------
  |  |  |  Branch (265:30): [True: 200k, False: 0]
  |  |  |  Branch (265:43): [True: 9.00k, False: 191k]
  |  |  ------------------
  ------------------
  274|   200k|}
ossl_tolower:
  297|  14.3M|{
  298|  14.3M|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  14.3M|#  define ossl_toascii(c)       (c)
  ------------------
  299|       |
  300|  14.3M|    return ASCII_IS_UPPER(a) ? c ^ case_change : c;
  ------------------
  |  |  266|  14.3M|#define ASCII_IS_UPPER(c)   (c >= 0x41 && c <= 0x5A)
  |  |  ------------------
  |  |  |  Branch (266:30): [True: 11.2M, False: 3.10M]
  |  |  |  Branch (266:43): [True: 3.64M, False: 7.59M]
  |  |  ------------------
  ------------------
  301|  14.3M|}

dh_ameth.c:dh_pub_decode:
   61|  7.55k|{
   62|  7.55k|    const unsigned char *p, *pm;
   63|  7.55k|    int pklen, pmlen;
   64|  7.55k|    int ptype;
   65|  7.55k|    const void *pval;
   66|  7.55k|    const ASN1_STRING *pstr;
   67|  7.55k|    X509_ALGOR *palg;
   68|  7.55k|    ASN1_INTEGER *public_key = NULL;
   69|       |
   70|  7.55k|    DH *dh = NULL;
   71|       |
   72|  7.55k|    if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
  ------------------
  |  Branch (72:9): [True: 0, False: 7.55k]
  ------------------
   73|      0|        return 0;
   74|  7.55k|    X509_ALGOR_get0(NULL, &ptype, &pval, palg);
   75|       |
   76|  7.55k|    if (ptype != V_ASN1_SEQUENCE) {
  ------------------
  |  |   74|  7.55k|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (76:9): [True: 377, False: 7.17k]
  ------------------
   77|    377|        ERR_raise(ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR);
  ------------------
  |  |  401|    377|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    377|    (ERR_new(),                                                 \
  |  |  |  |  404|    377|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    377|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    377|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    377|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    377|     ERR_set_error)
  |  |  ------------------
  ------------------
   78|    377|        goto err;
   79|    377|    }
   80|       |
   81|  7.17k|    pstr = pval;
   82|  7.17k|    pm = pstr->data;
   83|  7.17k|    pmlen = pstr->length;
   84|       |
   85|  7.17k|    if ((dh = d2i_dhp(pkey, &pm, pmlen)) == NULL) {
  ------------------
  |  Branch (85:9): [True: 1.96k, False: 5.21k]
  ------------------
   86|  1.96k|        ERR_raise(ERR_LIB_DH, DH_R_DECODE_ERROR);
  ------------------
  |  |  401|  1.96k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.96k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.96k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  1.96k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  1.96k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  1.96k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.96k|     ERR_set_error)
  |  |  ------------------
  ------------------
   87|  1.96k|        goto err;
   88|  1.96k|    }
   89|       |
   90|  5.21k|    if ((public_key = d2i_ASN1_INTEGER(NULL, &p, pklen)) == NULL) {
  ------------------
  |  Branch (90:9): [True: 586, False: 4.62k]
  ------------------
   91|    586|        ERR_raise(ERR_LIB_DH, DH_R_DECODE_ERROR);
  ------------------
  |  |  401|    586|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    586|    (ERR_new(),                                                 \
  |  |  |  |  404|    586|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    586|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    586|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    586|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    586|     ERR_set_error)
  |  |  ------------------
  ------------------
   92|    586|        goto err;
   93|    586|    }
   94|       |
   95|       |    /* We have parameters now set public key */
   96|  4.62k|    if ((dh->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)) == NULL) {
  ------------------
  |  Branch (96:9): [True: 0, False: 4.62k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   98|      0|        goto err;
   99|      0|    }
  100|       |
  101|  4.62k|    ASN1_INTEGER_free(public_key);
  102|  4.62k|    EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, dh);
  103|  4.62k|    return 1;
  104|       |
  105|  2.93k| err:
  106|  2.93k|    ASN1_INTEGER_free(public_key);
  107|  2.93k|    DH_free(dh);
  108|  2.93k|    return 0;
  109|  4.62k|}
dh_ameth.c:d2i_dhp:
   36|  7.17k|{
   37|  7.17k|    DH *dh = NULL;
   38|  7.17k|    int is_dhx = (pkey->ameth == &ossl_dhx_asn1_meth);
   39|       |
   40|  7.17k|    if (is_dhx)
  ------------------
  |  Branch (40:9): [True: 4.27k, False: 2.90k]
  ------------------
   41|  4.27k|        dh = d2i_DHxparams(NULL, pp, length);
   42|  2.90k|    else
   43|  2.90k|        dh = d2i_DHparams(NULL, pp, length);
   44|       |
   45|  7.17k|    return dh;
   46|  7.17k|}
dh_ameth.c:int_dh_free:
   56|  7.55k|{
   57|  7.55k|    DH_free(pkey->pkey.dh);
   58|  7.55k|}

d2i_DHxparams:
   94|  4.27k|{
   95|  4.27k|    FFC_PARAMS *params;
   96|  4.27k|    int_dhx942_dh *dhx = NULL;
   97|  4.27k|    DH *dh = NULL;
   98|       |
   99|  4.27k|    dh = DH_new();
  100|  4.27k|    if (dh == NULL)
  ------------------
  |  Branch (100:9): [True: 0, False: 4.27k]
  ------------------
  101|      0|        return NULL;
  102|  4.27k|    dhx = d2i_int_dhx(NULL, pp, length);
  103|  4.27k|    if (dhx == NULL) {
  ------------------
  |  Branch (103:9): [True: 1.20k, False: 3.06k]
  ------------------
  104|  1.20k|        DH_free(dh);
  105|  1.20k|        return NULL;
  106|  1.20k|    }
  107|       |
  108|  3.06k|    if (a != NULL) {
  ------------------
  |  Branch (108:9): [True: 0, False: 3.06k]
  ------------------
  109|      0|        DH_free(*a);
  110|      0|        *a = dh;
  111|      0|    }
  112|       |
  113|  3.06k|    params = &dh->params;
  114|  3.06k|    DH_set0_pqg(dh, dhx->p, dhx->q, dhx->g);
  115|  3.06k|    ossl_ffc_params_set0_j(params, dhx->j);
  116|       |
  117|  3.06k|    if (dhx->vparams != NULL) {
  ------------------
  |  Branch (117:9): [True: 0, False: 3.06k]
  ------------------
  118|       |        /* The counter has a maximum value of 4 * numbits(p) - 1 */
  119|      0|        size_t counter = (size_t)BN_get_word(dhx->vparams->counter);
  120|      0|        ossl_ffc_params_set_validate_params(params, dhx->vparams->seed->data,
  121|      0|                                            dhx->vparams->seed->length,
  122|      0|                                            counter);
  123|      0|        ASN1_BIT_STRING_free(dhx->vparams->seed);
  124|      0|        BN_free(dhx->vparams->counter);
  125|      0|        OPENSSL_free(dhx->vparams);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  126|      0|        dhx->vparams = NULL;
  127|      0|    }
  128|       |
  129|  3.06k|    OPENSSL_free(dhx);
  ------------------
  |  |  107|  3.06k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.06k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.06k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|  3.06k|    DH_clear_flags(dh, DH_FLAG_TYPE_MASK);
  ------------------
  |  |  106|  3.06k|#  define DH_FLAG_TYPE_MASK             0xF000
  ------------------
  131|  3.06k|    DH_set_flags(dh, DH_FLAG_TYPE_DHX);
  ------------------
  |  |  108|  3.06k|#  define DH_FLAG_TYPE_DHX              0x1000
  ------------------
  132|  3.06k|    return dh;
  133|  4.27k|}
dh_asn1.c:dh_cb:
   27|  8.72k|{
   28|  8.72k|    if (operation == ASN1_OP_NEW_PRE) {
  ------------------
  |  |  742|  8.72k|# define ASN1_OP_NEW_PRE         0
  ------------------
  |  Branch (28:9): [True: 2.90k, False: 5.81k]
  ------------------
   29|  2.90k|        *pval = (ASN1_VALUE *)DH_new();
   30|  2.90k|        if (*pval != NULL)
  ------------------
  |  Branch (30:13): [True: 2.90k, False: 0]
  ------------------
   31|  2.90k|            return 2;
   32|      0|        return 0;
   33|  5.81k|    } else if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  5.81k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (33:16): [True: 762, False: 5.05k]
  ------------------
   34|    762|        DH_free((DH *)*pval);
   35|    762|        *pval = NULL;
   36|    762|        return 2;
   37|  5.05k|    } else if (operation == ASN1_OP_D2I_POST) {
  ------------------
  |  |  747|  5.05k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (37:16): [True: 2.14k, False: 2.90k]
  ------------------
   38|  2.14k|        DH *dh = (DH *)*pval;
   39|       |
   40|  2.14k|        DH_clear_flags(dh, DH_FLAG_TYPE_MASK);
  ------------------
  |  |  106|  2.14k|#  define DH_FLAG_TYPE_MASK             0xF000
  ------------------
   41|  2.14k|        DH_set_flags(dh, DH_FLAG_TYPE_DH);
  ------------------
  |  |  107|  2.14k|#  define DH_FLAG_TYPE_DH               0x0000
  ------------------
   42|  2.14k|        ossl_dh_cache_named_group(dh);
   43|  2.14k|        dh->dirty_cnt++;
   44|  2.14k|    }
   45|  5.05k|    return 1;
   46|  8.72k|}

ossl_dh_params_todata:
   92|  4.62k|{
   93|  4.62k|    long l = DH_get_length(dh);
   94|       |
   95|  4.62k|    if (!ossl_ffc_params_todata(ossl_dh_get0_params(dh), bld, params))
  ------------------
  |  Branch (95:9): [True: 0, False: 4.62k]
  ------------------
   96|      0|        return 0;
   97|  4.62k|    if (l > 0
  ------------------
  |  Branch (97:9): [True: 1.12k, False: 3.50k]
  ------------------
   98|  4.62k|        && !ossl_param_build_set_long(bld, params, OSSL_PKEY_PARAM_DH_PRIV_LEN, l))
  ------------------
  |  |  321|  1.12k|# define OSSL_PKEY_PARAM_DH_PRIV_LEN "priv_len"
  ------------------
  |  Branch (98:12): [True: 0, False: 1.12k]
  ------------------
   99|      0|        return 0;
  100|  4.62k|    return 1;
  101|  4.62k|}
ossl_dh_key_todata:
  105|  4.62k|{
  106|  4.62k|    const BIGNUM *priv = NULL, *pub = NULL;
  107|       |
  108|  4.62k|    if (dh == NULL)
  ------------------
  |  Branch (108:9): [True: 0, False: 4.62k]
  ------------------
  109|      0|        return 0;
  110|       |
  111|  4.62k|    DH_get0_key(dh, &pub, &priv);
  112|  4.62k|    if (priv != NULL
  ------------------
  |  Branch (112:9): [True: 0, False: 4.62k]
  ------------------
  113|  4.62k|        && include_private
  ------------------
  |  Branch (113:12): [True: 0, False: 0]
  ------------------
  114|  4.62k|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PRIV_KEY, priv))
  ------------------
  |  |  372|      0|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  |  Branch (114:12): [True: 0, False: 0]
  ------------------
  115|      0|        return 0;
  116|  4.62k|    if (pub != NULL
  ------------------
  |  Branch (116:9): [True: 4.62k, False: 0]
  ------------------
  117|  4.62k|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PUB_KEY, pub))
  ------------------
  |  |  374|  4.62k|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  |  Branch (117:12): [True: 0, False: 4.62k]
  ------------------
  118|      0|        return 0;
  119|       |
  120|  4.62k|    return 1;
  121|  4.62k|}
ossl_dh_is_foreign:
  124|  2.09k|{
  125|  2.09k|#ifndef FIPS_MODULE
  126|  2.09k|    if (dh->engine != NULL || ossl_dh_get_method(dh) != DH_OpenSSL())
  ------------------
  |  Branch (126:9): [True: 0, False: 2.09k]
  |  Branch (126:31): [True: 0, False: 2.09k]
  ------------------
  127|      0|        return 1;
  128|  2.09k|#endif
  129|  2.09k|    return 0;
  130|  2.09k|}

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

ossl_dh_cache_named_group:
   57|  5.21k|{
   58|  5.21k|    const DH_NAMED_GROUP *group;
   59|       |
   60|  5.21k|    if (dh == NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 5.21k]
  ------------------
   61|      0|        return;
   62|       |
   63|  5.21k|    dh->params.nid = NID_undef; /* flush cached value */
  ------------------
  |  |   18|  5.21k|#define NID_undef                       0
  ------------------
   64|       |
   65|       |    /* Exit if p or g is not set */
   66|  5.21k|    if (dh->params.p == NULL
  ------------------
  |  Branch (66:9): [True: 0, False: 5.21k]
  ------------------
   67|  5.21k|        || dh->params.g == NULL)
  ------------------
  |  Branch (67:12): [True: 0, False: 5.21k]
  ------------------
   68|      0|        return;
   69|       |
   70|  5.21k|    if ((group = ossl_ffc_numbers_to_dh_named_group(dh->params.p,
  ------------------
  |  Branch (70:9): [True: 0, False: 5.21k]
  ------------------
   71|  5.21k|                                                    dh->params.q,
   72|  5.21k|                                                    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|  5.21k|}

DH_OpenSSL:
  174|  2.09k|{
  175|  2.09k|    return &dh_ossl;
  176|  2.09k|}
DH_get_default_method:
  179|  7.17k|{
  180|  7.17k|    return default_DH_method;
  181|  7.17k|}
dh_key.c:dh_init:
  195|  7.17k|{
  196|  7.17k|    dh->flags |= DH_FLAG_CACHE_MONT_P;
  ------------------
  |  |  104|  7.17k|#  define DH_FLAG_CACHE_MONT_P     0x01
  ------------------
  197|  7.17k|    ossl_ffc_params_init(&dh->params);
  198|  7.17k|    dh->dirty_cnt++;
  199|  7.17k|    return 1;
  200|  7.17k|}
dh_key.c:dh_finish:
  203|  7.17k|{
  204|  7.17k|    BN_MONT_CTX_free(dh->method_mont_p);
  205|  7.17k|    return 1;
  206|  7.17k|}

ossl_dh_get_method:
   53|  2.09k|{
   54|  2.09k|    return dh->meth;
   55|  2.09k|}
DH_new:
   58|  7.17k|{
   59|  7.17k|    return dh_new_intern(NULL, NULL);
   60|  7.17k|}
DH_free:
  135|  24.6k|{
  136|  24.6k|    int i;
  137|       |
  138|  24.6k|    if (r == NULL)
  ------------------
  |  Branch (138:9): [True: 12.8k, False: 11.8k]
  ------------------
  139|  12.8k|        return;
  140|       |
  141|  11.8k|    CRYPTO_DOWN_REF(&r->references, &i);
  142|  11.8k|    REF_PRINT_COUNT("DH", r);
  ------------------
  |  |  289|  11.8k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  11.8k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  11.8k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  11.8k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  143|  11.8k|    if (i > 0)
  ------------------
  |  Branch (143:9): [True: 4.62k, False: 7.17k]
  ------------------
  144|  4.62k|        return;
  145|  7.17k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|  7.17k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 7.17k]
  |  |  ------------------
  ------------------
  146|       |
  147|  7.17k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (147:9): [True: 7.17k, False: 0]
  |  Branch (147:28): [True: 7.17k, False: 0]
  ------------------
  148|  7.17k|        r->meth->finish(r);
  149|  7.17k|#if !defined(FIPS_MODULE)
  150|  7.17k|# if !defined(OPENSSL_NO_ENGINE)
  151|  7.17k|    ENGINE_finish(r->engine);
  152|  7.17k|# endif
  153|  7.17k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data);
  ------------------
  |  |  224|  7.17k|# define CRYPTO_EX_INDEX_DH               6
  ------------------
  154|  7.17k|#endif
  155|       |
  156|  7.17k|    CRYPTO_THREAD_lock_free(r->lock);
  157|  7.17k|    CRYPTO_FREE_REF(&r->references);
  158|       |
  159|  7.17k|    ossl_ffc_params_cleanup(&r->params);
  160|  7.17k|    BN_clear_free(r->pub_key);
  161|  7.17k|    BN_clear_free(r->priv_key);
  162|  7.17k|    OPENSSL_free(r);
  ------------------
  |  |  107|  7.17k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  7.17k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  7.17k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|  7.17k|}
DH_up_ref:
  166|  4.62k|{
  167|  4.62k|    int i;
  168|       |
  169|  4.62k|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (169:9): [True: 0, False: 4.62k]
  ------------------
  170|      0|        return 0;
  171|       |
  172|  4.62k|    REF_PRINT_COUNT("DH", r);
  ------------------
  |  |  289|  4.62k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  4.62k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  4.62k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  4.62k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|  4.62k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|  4.62k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 4.62k]
  |  |  ------------------
  ------------------
  174|  4.62k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (174:13): [True: 4.62k, False: 0]
  ------------------
  175|  4.62k|}
ossl_dh_set0_libctx:
  178|  4.62k|{
  179|  4.62k|    d->libctx = libctx;
  180|  4.62k|}
DH_bits:
  195|  4.62k|{
  196|  4.62k|    if (dh->params.p != NULL)
  ------------------
  |  Branch (196:9): [True: 4.62k, False: 0]
  ------------------
  197|  4.62k|        return BN_num_bits(dh->params.p);
  198|      0|    return -1;
  199|  4.62k|}
DH_size:
  202|  4.62k|{
  203|  4.62k|    if (dh->params.p != NULL)
  ------------------
  |  Branch (203:9): [True: 4.62k, False: 0]
  ------------------
  204|  4.62k|        return BN_num_bytes(dh->params.p);
  ------------------
  |  |  189|  4.62k|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  205|      0|    return -1;
  206|  4.62k|}
DH_security_bits:
  209|  4.62k|{
  210|  4.62k|    int N;
  211|       |
  212|  4.62k|    if (dh->params.q != NULL)
  ------------------
  |  Branch (212:9): [True: 2.53k, False: 2.09k]
  ------------------
  213|  2.53k|        N = BN_num_bits(dh->params.q);
  214|  2.09k|    else if (dh->length)
  ------------------
  |  Branch (214:14): [True: 1.19k, False: 896]
  ------------------
  215|  1.19k|        N = dh->length;
  216|    896|    else
  217|    896|        N = -1;
  218|  4.62k|    if (dh->params.p != NULL)
  ------------------
  |  Branch (218:9): [True: 4.62k, False: 0]
  ------------------
  219|  4.62k|        return BN_security_bits(BN_num_bits(dh->params.p), N);
  220|      0|    return -1;
  221|  4.62k|}
DH_set0_pqg:
  230|  3.06k|{
  231|       |    /*
  232|       |     * If the fields p and g in dh are NULL, the corresponding input
  233|       |     * parameters MUST be non-NULL.  q may remain NULL.
  234|       |     */
  235|  3.06k|    if ((dh->params.p == NULL && p == NULL)
  ------------------
  |  Branch (235:10): [True: 3.06k, False: 0]
  |  Branch (235:34): [True: 0, False: 3.06k]
  ------------------
  236|  3.06k|        || (dh->params.g == NULL && g == NULL))
  ------------------
  |  Branch (236:13): [True: 3.06k, False: 0]
  |  Branch (236:37): [True: 0, False: 3.06k]
  ------------------
  237|      0|        return 0;
  238|       |
  239|  3.06k|    ossl_ffc_params_set0_pqg(&dh->params, p, q, g);
  240|  3.06k|    ossl_dh_cache_named_group(dh);
  241|  3.06k|    dh->dirty_cnt++;
  242|  3.06k|    return 1;
  243|  3.06k|}
DH_get_length:
  246|  4.62k|{
  247|  4.62k|    return dh->length;
  248|  4.62k|}
DH_get0_key:
  258|  4.62k|{
  259|  4.62k|    if (pub_key != NULL)
  ------------------
  |  Branch (259:9): [True: 4.62k, False: 0]
  ------------------
  260|  4.62k|        *pub_key = dh->pub_key;
  261|  4.62k|    if (priv_key != NULL)
  ------------------
  |  Branch (261:9): [True: 4.62k, False: 0]
  ------------------
  262|  4.62k|        *priv_key = dh->priv_key;
  263|  4.62k|}
DH_clear_flags:
  306|  5.21k|{
  307|  5.21k|    dh->flags &= ~flags;
  308|  5.21k|}
DH_set_flags:
  316|  5.21k|{
  317|  5.21k|    dh->flags |= flags;
  318|  5.21k|}
ossl_dh_get0_params:
  328|  4.62k|{
  329|  4.62k|    return &dh->params;
  330|  4.62k|}
dh_lib.c:dh_new_intern:
   75|  7.17k|{
   76|  7.17k|    DH *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   99|  7.17k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  7.17k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  7.17k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|       |
   78|  7.17k|    if (ret == NULL)
  ------------------
  |  Branch (78:9): [True: 0, False: 7.17k]
  ------------------
   79|      0|        return NULL;
   80|       |
   81|  7.17k|    ret->lock = CRYPTO_THREAD_lock_new();
   82|  7.17k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (82:9): [True: 0, False: 7.17k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   84|      0|        OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   85|      0|        return NULL;
   86|      0|    }
   87|       |
   88|  7.17k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (88:9): [True: 0, False: 7.17k]
  ------------------
   89|      0|        CRYPTO_THREAD_lock_free(ret->lock);
   90|      0|        OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   91|      0|        return NULL;
   92|      0|    }
   93|       |
   94|  7.17k|    ret->libctx = libctx;
   95|  7.17k|    ret->meth = DH_get_default_method();
   96|  7.17k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   97|  7.17k|    ret->flags = ret->meth->flags;  /* early default init */
   98|  7.17k|    if (engine) {
  ------------------
  |  Branch (98:9): [True: 0, False: 7.17k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|  7.17k|        ret->engine = ENGINE_get_default_DH();
  106|  7.17k|    if (ret->engine) {
  ------------------
  |  Branch (106:9): [True: 0, False: 7.17k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  110|      0|            goto err;
  111|      0|        }
  112|      0|    }
  113|  7.17k|#endif
  114|       |
  115|  7.17k|    ret->flags = ret->meth->flags;
  116|       |
  117|  7.17k|#ifndef FIPS_MODULE
  118|  7.17k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data))
  ------------------
  |  |  224|  7.17k|# define CRYPTO_EX_INDEX_DH               6
  ------------------
  |  Branch (118:9): [True: 0, False: 7.17k]
  ------------------
  119|      0|        goto err;
  120|  7.17k|#endif /* FIPS_MODULE */
  121|       |
  122|  7.17k|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (122:9): [True: 7.17k, False: 0]
  |  Branch (122:38): [True: 0, False: 7.17k]
  ------------------
  123|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  124|      0|        goto err;
  125|      0|    }
  126|       |
  127|  7.17k|    return ret;
  128|       |
  129|      0| err:
  130|      0|    DH_free(ret);
  131|      0|    return NULL;
  132|  7.17k|}

dsa_ameth.c:dsa_pub_decode:
   30|  5.29k|{
   31|  5.29k|    const unsigned char *p, *pm;
   32|  5.29k|    int pklen, pmlen;
   33|  5.29k|    int ptype;
   34|  5.29k|    const void *pval;
   35|  5.29k|    const ASN1_STRING *pstr;
   36|  5.29k|    X509_ALGOR *palg;
   37|  5.29k|    ASN1_INTEGER *public_key = NULL;
   38|       |
   39|  5.29k|    DSA *dsa = NULL;
   40|       |
   41|  5.29k|    if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
  ------------------
  |  Branch (41:9): [True: 0, False: 5.29k]
  ------------------
   42|      0|        return 0;
   43|  5.29k|    X509_ALGOR_get0(NULL, &ptype, &pval, palg);
   44|       |
   45|  5.29k|    if (ptype == V_ASN1_SEQUENCE) {
  ------------------
  |  |   74|  5.29k|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (45:9): [True: 3.81k, False: 1.47k]
  ------------------
   46|  3.81k|        pstr = pval;
   47|  3.81k|        pm = pstr->data;
   48|  3.81k|        pmlen = pstr->length;
   49|       |
   50|  3.81k|        if ((dsa = d2i_DSAparams(NULL, &pm, pmlen)) == NULL) {
  ------------------
  |  Branch (50:13): [True: 1.50k, False: 2.30k]
  ------------------
   51|  1.50k|            ERR_raise(ERR_LIB_DSA, DSA_R_DECODE_ERROR);
  ------------------
  |  |  401|  1.50k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.50k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.50k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  1.50k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  1.50k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  1.50k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.50k|     ERR_set_error)
  |  |  ------------------
  ------------------
   52|  1.50k|            goto err;
   53|  1.50k|        }
   54|       |
   55|  3.81k|    } else if ((ptype == V_ASN1_NULL) || (ptype == V_ASN1_UNDEF)) {
  ------------------
  |  |   67|  1.47k|# define V_ASN1_NULL                     5
  ------------------
                  } else if ((ptype == V_ASN1_NULL) || (ptype == V_ASN1_UNDEF)) {
  ------------------
  |  |   60|  1.42k|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (55:16): [True: 51, False: 1.42k]
  |  Branch (55:42): [True: 1.31k, False: 106]
  ------------------
   56|  1.36k|        if ((dsa = DSA_new()) == NULL) {
  ------------------
  |  Branch (56:13): [True: 0, False: 1.36k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   58|      0|            goto err;
   59|      0|        }
   60|  1.36k|    } else {
   61|    106|        ERR_raise(ERR_LIB_DSA, DSA_R_PARAMETER_ENCODING_ERROR);
  ------------------
  |  |  401|    106|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    106|    (ERR_new(),                                                 \
  |  |  |  |  404|    106|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    106|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    106|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    106|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    106|     ERR_set_error)
  |  |  ------------------
  ------------------
   62|    106|        goto err;
   63|    106|    }
   64|       |
   65|  3.67k|    if ((public_key = d2i_ASN1_INTEGER(NULL, &p, pklen)) == NULL) {
  ------------------
  |  Branch (65:9): [True: 1.09k, False: 2.58k]
  ------------------
   66|  1.09k|        ERR_raise(ERR_LIB_DSA, DSA_R_DECODE_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  1.09k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  1.09k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  1.09k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.09k|     ERR_set_error)
  |  |  ------------------
  ------------------
   67|  1.09k|        goto err;
   68|  1.09k|    }
   69|       |
   70|  2.58k|    if ((dsa->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)) == NULL) {
  ------------------
  |  Branch (70:9): [True: 0, False: 2.58k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   72|      0|        goto err;
   73|      0|    }
   74|       |
   75|  2.58k|    dsa->dirty_cnt++;
   76|  2.58k|    ASN1_INTEGER_free(public_key);
   77|  2.58k|    EVP_PKEY_assign_DSA(pkey, dsa);
  ------------------
  |  |  503|  2.58k|#  define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\
  |  |  ------------------
  |  |  |  |   62|  2.58k|# define EVP_PKEY_DSA    NID_dsa
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  2.58k|#define NID_dsa         116
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  504|  2.58k|                                        (dsa))
  ------------------
   78|  2.58k|    return 1;
   79|       |
   80|  2.70k| err:
   81|  2.70k|    ASN1_INTEGER_free(public_key);
   82|  2.70k|    DSA_free(dsa);
   83|  2.70k|    return 0;
   84|       |
   85|  2.58k|}
dsa_ameth.c:int_dsa_free:
  268|  5.29k|{
  269|  5.29k|    DSA_free(pkey->pkey.dsa);
  270|  5.29k|}

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

ossl_dsa_is_foreign:
   67|  2.58k|{
   68|  2.58k|#ifndef FIPS_MODULE
   69|  2.58k|    if (dsa->engine != NULL || DSA_get_method((DSA *)dsa) != DSA_OpenSSL())
  ------------------
  |  Branch (69:9): [True: 0, False: 2.58k]
  |  Branch (69:32): [True: 0, False: 2.58k]
  ------------------
   70|      0|        return 1;
   71|  2.58k|#endif
   72|  2.58k|    return 0;
   73|  2.58k|}

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|  2.58k|{
  130|  2.58k|    return d->meth;
  131|  2.58k|}
DSA_new:
  206|  5.34k|{
  207|  5.34k|    return dsa_new_intern(NULL, NULL);
  208|  5.34k|}
DSA_free:
  212|  17.7k|{
  213|  17.7k|    int i;
  214|       |
  215|  17.7k|    if (r == NULL)
  ------------------
  |  Branch (215:9): [True: 9.84k, False: 7.92k]
  ------------------
  216|  9.84k|        return;
  217|       |
  218|  7.92k|    CRYPTO_DOWN_REF(&r->references, &i);
  219|  7.92k|    REF_PRINT_COUNT("DSA", r);
  ------------------
  |  |  289|  7.92k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  7.92k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  7.92k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  7.92k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  220|  7.92k|    if (i > 0)
  ------------------
  |  Branch (220:9): [True: 2.58k, False: 5.34k]
  ------------------
  221|  2.58k|        return;
  222|  5.34k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|  5.34k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 5.34k]
  |  |  ------------------
  ------------------
  223|       |
  224|  5.34k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (224:9): [True: 5.34k, False: 0]
  |  Branch (224:28): [True: 5.34k, False: 0]
  ------------------
  225|  5.34k|        r->meth->finish(r);
  226|  5.34k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
  227|  5.34k|    ENGINE_finish(r->engine);
  228|  5.34k|#endif
  229|       |
  230|  5.34k|#ifndef FIPS_MODULE
  231|  5.34k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data);
  ------------------
  |  |  225|  5.34k|# define CRYPTO_EX_INDEX_DSA              7
  ------------------
  232|  5.34k|#endif
  233|       |
  234|  5.34k|    CRYPTO_THREAD_lock_free(r->lock);
  235|  5.34k|    CRYPTO_FREE_REF(&r->references);
  236|       |
  237|  5.34k|    ossl_ffc_params_cleanup(&r->params);
  238|  5.34k|    BN_clear_free(r->pub_key);
  239|  5.34k|    BN_clear_free(r->priv_key);
  240|  5.34k|    OPENSSL_free(r);
  ------------------
  |  |  107|  5.34k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  5.34k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  5.34k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  241|  5.34k|}
DSA_up_ref:
  244|  2.58k|{
  245|  2.58k|    int i;
  246|       |
  247|  2.58k|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (247:9): [True: 0, False: 2.58k]
  ------------------
  248|      0|        return 0;
  249|       |
  250|  2.58k|    REF_PRINT_COUNT("DSA", r);
  ------------------
  |  |  289|  2.58k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  2.58k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  2.58k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  2.58k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  251|  2.58k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|  2.58k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 2.58k]
  |  |  ------------------
  ------------------
  252|  2.58k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (252:13): [True: 2.58k, False: 0]
  ------------------
  253|  2.58k|}
ossl_dsa_set0_libctx:
  256|  2.17k|{
  257|  2.17k|    d->libctx = libctx;
  258|  2.17k|}
DSA_get0_pqg:
  262|  2.58k|{
  263|  2.58k|    ossl_ffc_params_get0_pqg(&d->params, p, q, g);
  264|  2.58k|}
DSA_get0_key:
  309|  2.17k|{
  310|  2.17k|    if (pub_key != NULL)
  ------------------
  |  Branch (310:9): [True: 2.17k, False: 0]
  ------------------
  311|  2.17k|        *pub_key = d->pub_key;
  312|  2.17k|    if (priv_key != NULL)
  ------------------
  |  Branch (312:9): [True: 2.17k, False: 0]
  ------------------
  313|  2.17k|        *priv_key = d->priv_key;
  314|  2.17k|}
DSA_security_bits:
  332|  2.17k|{
  333|  2.17k|    if (d->params.p != NULL && d->params.q != NULL)
  ------------------
  |  Branch (333:9): [True: 2.17k, False: 0]
  |  Branch (333:32): [True: 2.17k, False: 0]
  ------------------
  334|  2.17k|        return BN_security_bits(BN_num_bits(d->params.p),
  335|  2.17k|                                BN_num_bits(d->params.q));
  336|      0|    return -1;
  337|  2.17k|}
DSA_bits:
  340|  2.17k|{
  341|  2.17k|    if (dsa->params.p != NULL)
  ------------------
  |  Branch (341:9): [True: 2.17k, False: 0]
  ------------------
  342|  2.17k|        return BN_num_bits(dsa->params.p);
  343|      0|    return -1;
  344|  2.17k|}
ossl_dsa_get0_params:
  347|  2.17k|{
  348|  2.17k|    return &dsa->params;
  349|  2.17k|}
dsa_lib.c:dsa_new_intern:
  134|  5.34k|{
  135|  5.34k|    DSA *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   99|  5.34k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  5.34k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  5.34k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|       |
  137|  5.34k|    if (ret == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 5.34k]
  ------------------
  138|      0|        return NULL;
  139|       |
  140|  5.34k|    ret->lock = CRYPTO_THREAD_lock_new();
  141|  5.34k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (141:9): [True: 0, False: 5.34k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  143|      0|        OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  144|      0|        return NULL;
  145|      0|    }
  146|       |
  147|  5.34k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 5.34k]
  ------------------
  148|      0|        CRYPTO_THREAD_lock_free(ret->lock);
  149|      0|        OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  150|      0|        return NULL;
  151|      0|    }
  152|       |
  153|  5.34k|    ret->libctx = libctx;
  154|  5.34k|    ret->meth = DSA_get_default_method();
  155|  5.34k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
  156|  5.34k|    ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW; /* early default init */
  ------------------
  |  |   99|  5.34k|#   define DSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
  157|  5.34k|    if (engine) {
  ------------------
  |  Branch (157:9): [True: 0, False: 5.34k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|  5.34k|        ret->engine = ENGINE_get_default_DSA();
  165|  5.34k|    if (ret->engine) {
  ------------------
  |  Branch (165:9): [True: 0, False: 5.34k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  169|      0|            goto err;
  170|      0|        }
  171|      0|    }
  172|  5.34k|#endif
  173|       |
  174|  5.34k|    ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |   99|  5.34k|#   define DSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
  175|       |
  176|  5.34k|#ifndef FIPS_MODULE
  177|  5.34k|    if (!ossl_crypto_new_ex_data_ex(libctx, CRYPTO_EX_INDEX_DSA, ret,
  ------------------
  |  |  225|  5.34k|# define CRYPTO_EX_INDEX_DSA              7
  ------------------
  |  Branch (177:9): [True: 0, False: 5.34k]
  ------------------
  178|  5.34k|                                    &ret->ex_data))
  179|      0|        goto err;
  180|  5.34k|#endif
  181|       |
  182|  5.34k|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (182:9): [True: 5.34k, False: 0]
  |  Branch (182:38): [True: 0, False: 5.34k]
  ------------------
  183|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  184|      0|        goto err;
  185|      0|    }
  186|       |
  187|  5.34k|    return ret;
  188|       |
  189|      0| err:
  190|      0|    DSA_free(ret);
  191|      0|    return NULL;
  192|  5.34k|}

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

i2d_DSA_SIG:
   79|  2.17k|{
   80|  2.17k|    BUF_MEM *buf = NULL;
   81|  2.17k|    size_t encoded_len;
   82|  2.17k|    WPACKET pkt;
   83|       |
   84|  2.17k|    if (ppout == NULL) {
  ------------------
  |  Branch (84:9): [True: 2.17k, False: 0]
  ------------------
   85|  2.17k|        if (!WPACKET_init_null(&pkt, 0))
  ------------------
  |  Branch (85:13): [True: 0, False: 2.17k]
  ------------------
   86|      0|            return -1;
   87|  2.17k|    } else if (*ppout == NULL) {
  ------------------
  |  Branch (87:16): [True: 0, False: 0]
  ------------------
   88|      0|        if ((buf = BUF_MEM_new()) == NULL
  ------------------
  |  Branch (88:13): [True: 0, False: 0]
  ------------------
   89|      0|                || !WPACKET_init_len(&pkt, buf, 0)) {
  ------------------
  |  Branch (89:20): [True: 0, False: 0]
  ------------------
   90|      0|            BUF_MEM_free(buf);
   91|      0|            return -1;
   92|      0|        }
   93|      0|    } 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|  2.17k|    if (!ossl_encode_der_dsa_sig(&pkt, sig->r, sig->s)
  ------------------
  |  Branch (98:9): [True: 3, False: 2.17k]
  ------------------
   99|  2.17k|            || !WPACKET_get_total_written(&pkt, &encoded_len)
  ------------------
  |  Branch (99:16): [True: 0, False: 2.17k]
  ------------------
  100|  2.17k|            || !WPACKET_finish(&pkt)) {
  ------------------
  |  Branch (100:16): [True: 0, False: 2.17k]
  ------------------
  101|      3|        BUF_MEM_free(buf);
  102|      3|        WPACKET_cleanup(&pkt);
  103|      3|        return -1;
  104|      3|    }
  105|       |
  106|  2.17k|    if (ppout != NULL) {
  ------------------
  |  Branch (106:9): [True: 0, False: 2.17k]
  ------------------
  107|      0|        if (*ppout == NULL) {
  ------------------
  |  Branch (107:13): [True: 0, False: 0]
  ------------------
  108|      0|            *ppout = (unsigned char *)buf->data;
  109|      0|            buf->data = NULL;
  110|      0|            BUF_MEM_free(buf);
  111|      0|        } else {
  112|      0|            *ppout += encoded_len;
  113|      0|        }
  114|      0|    }
  115|       |
  116|  2.17k|    return (int)encoded_len;
  117|  2.17k|}
DSA_size:
  120|  2.17k|{
  121|  2.17k|    int ret = -1;
  122|  2.17k|    DSA_SIG sig;
  123|       |
  124|  2.17k|    if (dsa->params.q != NULL) {
  ------------------
  |  Branch (124:9): [True: 2.17k, False: 0]
  ------------------
  125|  2.17k|        sig.r = sig.s = dsa->params.q;
  126|  2.17k|        ret = i2d_DSA_SIG(&sig, NULL);
  127|       |
  128|  2.17k|        if (ret < 0)
  ------------------
  |  Branch (128:13): [True: 3, False: 2.17k]
  ------------------
  129|      3|            ret = 0;
  130|  2.17k|    }
  131|  2.17k|    return ret;
  132|  2.17k|}

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", dso);
  ------------------
  |  |  289|      0|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|      0|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|      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);
  ------------------
  |  |  281|      0|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281: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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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);
  ------------------
  |  |  193|      0|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
   75|      0|    OPENSSL_free(dso->filename);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|      0|    OPENSSL_free(dso->loaded_filename);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|      0|    CRYPTO_FREE_REF(&dso->references);
   78|      0|    OPENSSL_free(dso);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|      0|    return 1;
   80|      0|}

ossl_ec_GF2m_simple_set_compressed_coordinates:
   43|  7.75k|{
   44|  7.75k|    BIGNUM *tmp, *x, *y, *z;
   45|  7.75k|    int ret = 0, z0;
   46|  7.75k|#ifndef FIPS_MODULE
   47|  7.75k|    BN_CTX *new_ctx = NULL;
   48|       |
   49|  7.75k|    if (ctx == NULL) {
  ------------------
  |  Branch (49:9): [True: 0, False: 7.75k]
  ------------------
   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|  7.75k|#endif
   55|       |
   56|  7.75k|    y_bit = (y_bit != 0) ? 1 : 0;
  ------------------
  |  Branch (56:13): [True: 2.70k, False: 5.05k]
  ------------------
   57|       |
   58|  7.75k|    BN_CTX_start(ctx);
   59|  7.75k|    tmp = BN_CTX_get(ctx);
   60|  7.75k|    x = BN_CTX_get(ctx);
   61|  7.75k|    y = BN_CTX_get(ctx);
   62|  7.75k|    z = BN_CTX_get(ctx);
   63|  7.75k|    if (z == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 7.75k]
  ------------------
   64|      0|        goto err;
   65|       |
   66|  7.75k|    if (!BN_GF2m_mod_arr(x, x_, group->poly))
  ------------------
  |  Branch (66:9): [True: 0, False: 7.75k]
  ------------------
   67|      0|        goto err;
   68|  7.75k|    if (BN_is_zero(x)) {
  ------------------
  |  Branch (68:9): [True: 1.12k, False: 6.62k]
  ------------------
   69|  1.12k|        if (!BN_GF2m_mod_sqrt_arr(y, group->b, group->poly, ctx))
  ------------------
  |  Branch (69:13): [True: 0, False: 1.12k]
  ------------------
   70|      0|            goto err;
   71|  6.62k|    } else {
   72|  6.62k|        if (!group->meth->field_sqr(group, tmp, x, ctx))
  ------------------
  |  Branch (72:13): [True: 0, False: 6.62k]
  ------------------
   73|      0|            goto err;
   74|  6.62k|        if (!group->meth->field_div(group, tmp, group->b, tmp, ctx))
  ------------------
  |  Branch (74:13): [True: 0, False: 6.62k]
  ------------------
   75|      0|            goto err;
   76|  6.62k|        if (!BN_GF2m_add(tmp, group->a, tmp))
  ------------------
  |  Branch (76:13): [True: 0, False: 6.62k]
  ------------------
   77|      0|            goto err;
   78|  6.62k|        if (!BN_GF2m_add(tmp, x, tmp))
  ------------------
  |  Branch (78:13): [True: 0, False: 6.62k]
  ------------------
   79|      0|            goto err;
   80|  6.62k|        ERR_set_mark();
   81|  6.62k|        if (!BN_GF2m_mod_solve_quad_arr(z, tmp, group->poly, ctx)) {
  ------------------
  |  Branch (81:13): [True: 1.80k, False: 4.82k]
  ------------------
   82|  1.80k|#ifndef FIPS_MODULE
   83|  1.80k|            unsigned long err = ERR_peek_last_error();
   84|       |
   85|  1.80k|            if (ERR_GET_LIB(err) == ERR_LIB_BN
  ------------------
  |  |   73|  3.61k|# define ERR_LIB_BN              3
  ------------------
  |  Branch (85:17): [True: 1.80k, False: 0]
  ------------------
   86|  1.80k|                && ERR_GET_REASON(err) == BN_R_NO_SOLUTION) {
  ------------------
  |  |   40|  1.80k|# define BN_R_NO_SOLUTION                                 116
  ------------------
  |  Branch (86:20): [True: 1.80k, False: 0]
  ------------------
   87|  1.80k|                ERR_pop_to_mark();
   88|  1.80k|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT);
  ------------------
  |  |  401|  1.80k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.80k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.80k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  1.80k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  1.80k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  1.80k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.80k|     ERR_set_error)
  |  |  ------------------
  ------------------
   89|  1.80k|            } else
   90|      0|#endif
   91|      0|            {
   92|      0|                ERR_clear_last_mark();
   93|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   94|      0|            }
   95|  1.80k|            goto err;
   96|  1.80k|        }
   97|  4.82k|        ERR_clear_last_mark();
   98|  4.82k|        z0 = (BN_is_odd(z)) ? 1 : 0;
  ------------------
  |  Branch (98:14): [True: 2.60k, False: 2.21k]
  ------------------
   99|  4.82k|        if (!group->meth->field_mul(group, y, x, z, ctx))
  ------------------
  |  Branch (99:13): [True: 0, False: 4.82k]
  ------------------
  100|      0|            goto err;
  101|  4.82k|        if (z0 != y_bit) {
  ------------------
  |  Branch (101:13): [True: 2.71k, False: 2.10k]
  ------------------
  102|  2.71k|            if (!BN_GF2m_add(y, y, x))
  ------------------
  |  Branch (102:17): [True: 0, False: 2.71k]
  ------------------
  103|      0|                goto err;
  104|  2.71k|        }
  105|  4.82k|    }
  106|       |
  107|  5.94k|    if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (107:9): [True: 0, False: 5.94k]
  ------------------
  108|      0|        goto err;
  109|       |
  110|  5.94k|    ret = 1;
  111|       |
  112|  7.75k| err:
  113|  7.75k|    BN_CTX_end(ctx);
  114|  7.75k|#ifndef FIPS_MODULE
  115|  7.75k|    BN_CTX_free(new_ctx);
  116|  7.75k|#endif
  117|  7.75k|    return ret;
  118|  5.94k|}
ossl_ec_GF2m_simple_oct2point:
  259|  12.2k|{
  260|  12.2k|    point_conversion_form_t form;
  261|  12.2k|    int y_bit, m;
  262|  12.2k|    BIGNUM *x, *y, *yxi;
  263|  12.2k|    size_t field_len, enc_len;
  264|  12.2k|    int ret = 0;
  265|  12.2k|#ifndef FIPS_MODULE
  266|  12.2k|    BN_CTX *new_ctx = NULL;
  267|  12.2k|#endif
  268|       |
  269|  12.2k|    if (len == 0) {
  ------------------
  |  Branch (269:9): [True: 122, False: 12.1k]
  ------------------
  270|    122|        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|    122|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    122|    (ERR_new(),                                                 \
  |  |  |  |  404|    122|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    122|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    122|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    122|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    122|     ERR_set_error)
  |  |  ------------------
  ------------------
  271|    122|        return 0;
  272|    122|    }
  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|  12.1k|    y_bit = buf[0] & 1;
  286|  12.1k|    form = buf[0] & ~1U;
  287|       |
  288|  12.1k|    if ((form != 0) && (form != POINT_CONVERSION_COMPRESSED)
  ------------------
  |  Branch (288:9): [True: 9.34k, False: 2.78k]
  |  Branch (288:24): [True: 1.32k, False: 8.01k]
  ------------------
  289|  12.1k|        && (form != POINT_CONVERSION_UNCOMPRESSED)
  ------------------
  |  Branch (289:12): [True: 1.22k, False: 106]
  ------------------
  290|  12.1k|        && (form != POINT_CONVERSION_HYBRID)) {
  ------------------
  |  Branch (290:12): [True: 106, False: 1.11k]
  ------------------
  291|    106|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|    106|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    106|    (ERR_new(),                                                 \
  |  |  |  |  404|    106|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    106|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    106|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    106|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    106|     ERR_set_error)
  |  |  ------------------
  ------------------
  292|    106|        return 0;
  293|    106|    }
  294|  12.0k|    if ((form == 0 || form == POINT_CONVERSION_UNCOMPRESSED) && y_bit) {
  ------------------
  |  Branch (294:10): [True: 2.78k, False: 9.23k]
  |  Branch (294:23): [True: 106, False: 9.13k]
  |  Branch (294:65): [True: 75, False: 2.81k]
  ------------------
  295|     75|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     75|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     75|    (ERR_new(),                                                 \
  |  |  |  |  404|     75|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     75|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     75|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     75|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     75|     ERR_set_error)
  |  |  ------------------
  ------------------
  296|     75|        return 0;
  297|     75|    }
  298|       |
  299|       |    /* The point at infinity is represented by a single zero octet. */
  300|  11.9k|    if (form == 0) {
  ------------------
  |  Branch (300:9): [True: 2.78k, False: 9.16k]
  ------------------
  301|  2.78k|        if (len != 1) {
  ------------------
  |  Branch (301:13): [True: 421, False: 2.35k]
  ------------------
  302|    421|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|    421|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    421|    (ERR_new(),                                                 \
  |  |  |  |  404|    421|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    421|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    421|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    421|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    421|     ERR_set_error)
  |  |  ------------------
  ------------------
  303|    421|            return 0;
  304|    421|        }
  305|       |
  306|  2.35k|        return EC_POINT_set_to_infinity(group, point);
  307|  2.78k|    }
  308|       |
  309|  9.16k|    m = EC_GROUP_get_degree(group);
  310|  9.16k|    field_len = (m + 7) / 8;
  311|  9.16k|    enc_len =
  312|  9.16k|        (form ==
  ------------------
  |  Branch (312:9): [True: 8.01k, False: 1.15k]
  ------------------
  313|  9.16k|         POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;
  314|       |
  315|  9.16k|    if (len != enc_len) {
  ------------------
  |  Branch (315:9): [True: 231, False: 8.93k]
  ------------------
  316|    231|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|    231|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    231|    (ERR_new(),                                                 \
  |  |  |  |  404|    231|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    231|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    231|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    231|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    231|     ERR_set_error)
  |  |  ------------------
  ------------------
  317|    231|        return 0;
  318|    231|    }
  319|       |
  320|  8.93k|#ifndef FIPS_MODULE
  321|  8.93k|    if (ctx == NULL) {
  ------------------
  |  Branch (321:9): [True: 8.93k, False: 0]
  ------------------
  322|  8.93k|        ctx = new_ctx = BN_CTX_new();
  323|  8.93k|        if (ctx == NULL)
  ------------------
  |  Branch (323:13): [True: 0, False: 8.93k]
  ------------------
  324|      0|            return 0;
  325|  8.93k|    }
  326|  8.93k|#endif
  327|       |
  328|  8.93k|    BN_CTX_start(ctx);
  329|  8.93k|    x = BN_CTX_get(ctx);
  330|  8.93k|    y = BN_CTX_get(ctx);
  331|  8.93k|    yxi = BN_CTX_get(ctx);
  332|  8.93k|    if (yxi == NULL)
  ------------------
  |  Branch (332:9): [True: 0, False: 8.93k]
  ------------------
  333|      0|        goto err;
  334|       |
  335|  8.93k|    if (!BN_bin2bn(buf + 1, field_len, x))
  ------------------
  |  Branch (335:9): [True: 0, False: 8.93k]
  ------------------
  336|      0|        goto err;
  337|  8.93k|    if (BN_num_bits(x) > m) {
  ------------------
  |  Branch (337:9): [True: 52, False: 8.88k]
  ------------------
  338|     52|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     52|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     52|    (ERR_new(),                                                 \
  |  |  |  |  404|     52|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     52|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     52|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     52|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     52|     ERR_set_error)
  |  |  ------------------
  ------------------
  339|     52|        goto err;
  340|     52|    }
  341|       |
  342|  8.88k|    if (form == POINT_CONVERSION_COMPRESSED) {
  ------------------
  |  Branch (342:9): [True: 7.75k, False: 1.13k]
  ------------------
  343|  7.75k|        if (!EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx))
  ------------------
  |  Branch (343:13): [True: 1.80k, False: 5.94k]
  ------------------
  344|  1.80k|            goto err;
  345|  7.75k|    } else {
  346|  1.13k|        if (!BN_bin2bn(buf + 1 + field_len, field_len, y))
  ------------------
  |  Branch (346:13): [True: 0, False: 1.13k]
  ------------------
  347|      0|            goto err;
  348|  1.13k|        if (BN_num_bits(y) > m) {
  ------------------
  |  Branch (348:13): [True: 36, False: 1.09k]
  ------------------
  349|     36|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     36|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     36|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     36|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     36|     ERR_set_error)
  |  |  ------------------
  ------------------
  350|     36|            goto err;
  351|     36|        }
  352|  1.09k|        if (form == POINT_CONVERSION_HYBRID) {
  ------------------
  |  Branch (352:13): [True: 1.06k, False: 34]
  ------------------
  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|  1.06k|            if (BN_is_zero(x)) {
  ------------------
  |  Branch (358:17): [True: 98, False: 962]
  ------------------
  359|     98|                if (y_bit != 0) {
  ------------------
  |  Branch (359:21): [True: 18, False: 80]
  ------------------
  360|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     18|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     18|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     18|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     18|     ERR_set_error)
  |  |  ------------------
  ------------------
  361|     18|                    goto err;
  362|     18|                }
  363|    962|            } else {
  364|    962|                if (!group->meth->field_div(group, yxi, y, x, ctx))
  ------------------
  |  Branch (364:21): [True: 0, False: 962]
  ------------------
  365|      0|                    goto err;
  366|    962|                if (y_bit != BN_is_odd(yxi)) {
  ------------------
  |  Branch (366:21): [True: 181, False: 781]
  ------------------
  367|    181|                    ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|    181|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    181|    (ERR_new(),                                                 \
  |  |  |  |  404|    181|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    181|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    181|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    181|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    181|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|    181|                    goto err;
  369|    181|                }
  370|    962|            }
  371|  1.06k|        }
  372|       |
  373|       |        /*
  374|       |         * EC_POINT_set_affine_coordinates is responsible for checking that
  375|       |         * the point is on the curve.
  376|       |         */
  377|    895|        if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (377:13): [True: 894, False: 1]
  ------------------
  378|    894|            goto err;
  379|    895|    }
  380|       |
  381|  5.95k|    ret = 1;
  382|       |
  383|  8.93k| err:
  384|  8.93k|    BN_CTX_end(ctx);
  385|  8.93k|#ifndef FIPS_MODULE
  386|  8.93k|    BN_CTX_free(new_ctx);
  387|  8.93k|#endif
  388|  8.93k|    return ret;
  389|  5.95k|}

ossl_ec_GF2m_simple_group_init:
   29|  24.5k|{
   30|  24.5k|    group->field = BN_new();
   31|  24.5k|    group->a = BN_new();
   32|  24.5k|    group->b = BN_new();
   33|       |
   34|  24.5k|    if (group->field == NULL || group->a == NULL || group->b == NULL) {
  ------------------
  |  Branch (34:9): [True: 0, False: 24.5k]
  |  Branch (34:33): [True: 0, False: 24.5k]
  |  Branch (34:53): [True: 0, False: 24.5k]
  ------------------
   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|  24.5k|    return 1;
   41|  24.5k|}
ossl_ec_GF2m_simple_group_finish:
   48|  24.5k|{
   49|  24.5k|    BN_free(group->field);
   50|  24.5k|    BN_free(group->a);
   51|  24.5k|    BN_free(group->b);
   52|  24.5k|}
ossl_ec_GF2m_simple_group_copy:
   76|  12.2k|{
   77|  12.2k|    if (!BN_copy(dest->field, src->field))
  ------------------
  |  Branch (77:9): [True: 0, False: 12.2k]
  ------------------
   78|      0|        return 0;
   79|  12.2k|    if (!BN_copy(dest->a, src->a))
  ------------------
  |  Branch (79:9): [True: 0, False: 12.2k]
  ------------------
   80|      0|        return 0;
   81|  12.2k|    if (!BN_copy(dest->b, src->b))
  ------------------
  |  Branch (81:9): [True: 0, False: 12.2k]
  ------------------
   82|      0|        return 0;
   83|  12.2k|    dest->poly[0] = src->poly[0];
   84|  12.2k|    dest->poly[1] = src->poly[1];
   85|  12.2k|    dest->poly[2] = src->poly[2];
   86|  12.2k|    dest->poly[3] = src->poly[3];
   87|  12.2k|    dest->poly[4] = src->poly[4];
   88|  12.2k|    dest->poly[5] = src->poly[5];
   89|  12.2k|    if (bn_wexpand(dest->a, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) ==
  ------------------
  |  |   54|  12.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  if (bn_wexpand(dest->a, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) ==
  ------------------
  |  |   54|  12.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (89:9): [True: 0, False: 12.2k]
  ------------------
   90|  12.2k|        NULL)
   91|      0|        return 0;
   92|  12.2k|    if (bn_wexpand(dest->b, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) ==
  ------------------
  |  |   54|  12.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  if (bn_wexpand(dest->b, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) ==
  ------------------
  |  |   54|  12.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (92:9): [True: 0, False: 12.2k]
  ------------------
   93|  12.2k|        NULL)
   94|      0|        return 0;
   95|  12.2k|    bn_set_all_zero(dest->a);
   96|  12.2k|    bn_set_all_zero(dest->b);
   97|  12.2k|    return 1;
   98|  12.2k|}
ossl_ec_GF2m_simple_group_set_curve:
  104|  12.2k|{
  105|  12.2k|    int ret = 0, i;
  106|       |
  107|       |    /* group->field */
  108|  12.2k|    if (!BN_copy(group->field, p))
  ------------------
  |  Branch (108:9): [True: 0, False: 12.2k]
  ------------------
  109|      0|        goto err;
  110|  12.2k|    i = BN_GF2m_poly2arr(group->field, group->poly, 6) - 1;
  111|  12.2k|    if ((i != 5) && (i != 3)) {
  ------------------
  |  Branch (111:9): [True: 6.62k, False: 5.62k]
  |  Branch (111:21): [True: 0, False: 6.62k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  113|      0|        goto err;
  114|      0|    }
  115|       |
  116|       |    /* group->a */
  117|  12.2k|    if (!BN_GF2m_mod_arr(group->a, a, group->poly))
  ------------------
  |  Branch (117:9): [True: 0, False: 12.2k]
  ------------------
  118|      0|        goto err;
  119|  12.2k|    if (bn_wexpand(group->a, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2)
  ------------------
  |  |   54|  12.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  if (bn_wexpand(group->a, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2)
  ------------------
  |  |   54|  12.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 12.2k]
  ------------------
  120|  12.2k|        == NULL)
  121|      0|        goto err;
  122|  12.2k|    bn_set_all_zero(group->a);
  123|       |
  124|       |    /* group->b */
  125|  12.2k|    if (!BN_GF2m_mod_arr(group->b, b, group->poly))
  ------------------
  |  Branch (125:9): [True: 0, False: 12.2k]
  ------------------
  126|      0|        goto err;
  127|  12.2k|    if (bn_wexpand(group->b, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2)
  ------------------
  |  |   54|  12.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                  if (bn_wexpand(group->b, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2)
  ------------------
  |  |   54|  12.2k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  12.2k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (127:9): [True: 0, False: 12.2k]
  ------------------
  128|  12.2k|        == NULL)
  129|      0|        goto err;
  130|  12.2k|    bn_set_all_zero(group->b);
  131|       |
  132|  12.2k|    ret = 1;
  133|  12.2k| err:
  134|  12.2k|    return ret;
  135|  12.2k|}
ossl_ec_GF2m_simple_group_get_degree:
  172|  17.4k|{
  173|  17.4k|    return BN_num_bits(group->field) - 1;
  174|  17.4k|}
ossl_ec_GF2m_simple_point_init:
  223|  49.0k|{
  224|  49.0k|    point->X = BN_new();
  225|  49.0k|    point->Y = BN_new();
  226|  49.0k|    point->Z = BN_new();
  227|       |
  228|  49.0k|    if (point->X == NULL || point->Y == NULL || point->Z == NULL) {
  ------------------
  |  Branch (228:9): [True: 0, False: 49.0k]
  |  Branch (228:29): [True: 0, False: 49.0k]
  |  Branch (228:49): [True: 0, False: 49.0k]
  ------------------
  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|  49.0k|    return 1;
  235|  49.0k|}
ossl_ec_GF2m_simple_point_finish:
  239|  49.0k|{
  240|  49.0k|    BN_free(point->X);
  241|  49.0k|    BN_free(point->Y);
  242|  49.0k|    BN_free(point->Z);
  243|  49.0k|}
ossl_ec_GF2m_simple_point_copy:
  259|  24.5k|{
  260|  24.5k|    if (!BN_copy(dest->X, src->X))
  ------------------
  |  Branch (260:9): [True: 0, False: 24.5k]
  ------------------
  261|      0|        return 0;
  262|  24.5k|    if (!BN_copy(dest->Y, src->Y))
  ------------------
  |  Branch (262:9): [True: 0, False: 24.5k]
  ------------------
  263|      0|        return 0;
  264|  24.5k|    if (!BN_copy(dest->Z, src->Z))
  ------------------
  |  Branch (264:9): [True: 0, False: 24.5k]
  ------------------
  265|      0|        return 0;
  266|  24.5k|    dest->Z_is_one = src->Z_is_one;
  267|  24.5k|    dest->curve_name = src->curve_name;
  268|       |
  269|  24.5k|    return 1;
  270|  24.5k|}
ossl_ec_GF2m_simple_point_set_to_infinity:
  278|  2.35k|{
  279|  2.35k|    point->Z_is_one = 0;
  280|  2.35k|    BN_zero(point->Z);
  ------------------
  |  |  202|  2.35k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  281|  2.35k|    return 1;
  282|  2.35k|}
ossl_ec_GF2m_simple_point_set_affine_coordinates:
  293|  19.0k|{
  294|  19.0k|    int ret = 0;
  295|  19.0k|    if (x == NULL || y == NULL) {
  ------------------
  |  Branch (295:9): [True: 0, False: 19.0k]
  |  Branch (295:22): [True: 0, False: 19.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  297|      0|        return 0;
  298|      0|    }
  299|       |
  300|  19.0k|    if (!BN_copy(point->X, x))
  ------------------
  |  Branch (300:9): [True: 0, False: 19.0k]
  ------------------
  301|      0|        goto err;
  302|  19.0k|    BN_set_negative(point->X, 0);
  303|  19.0k|    if (!BN_copy(point->Y, y))
  ------------------
  |  Branch (303:9): [True: 0, False: 19.0k]
  ------------------
  304|      0|        goto err;
  305|  19.0k|    BN_set_negative(point->Y, 0);
  306|  19.0k|    if (!BN_copy(point->Z, BN_value_one()))
  ------------------
  |  Branch (306:9): [True: 0, False: 19.0k]
  ------------------
  307|      0|        goto err;
  308|  19.0k|    BN_set_negative(point->Z, 0);
  309|  19.0k|    point->Z_is_one = 1;
  310|  19.0k|    ret = 1;
  311|       |
  312|  19.0k| err:
  313|  19.0k|    return ret;
  314|  19.0k|}
ossl_ec_GF2m_simple_is_at_infinity:
  499|  19.0k|{
  500|  19.0k|    return BN_is_zero(point->Z);
  501|  19.0k|}
ossl_ec_GF2m_simple_is_on_curve:
  510|  19.0k|{
  511|  19.0k|    int ret = -1;
  512|  19.0k|    BIGNUM *lh, *y2;
  513|  19.0k|    int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *,
  514|  19.0k|                      const BIGNUM *, BN_CTX *);
  515|  19.0k|    int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
  516|  19.0k|#ifndef FIPS_MODULE
  517|  19.0k|    BN_CTX *new_ctx = NULL;
  518|  19.0k|#endif
  519|       |
  520|  19.0k|    if (EC_POINT_is_at_infinity(group, point))
  ------------------
  |  Branch (520:9): [True: 0, False: 19.0k]
  ------------------
  521|      0|        return 1;
  522|       |
  523|  19.0k|    field_mul = group->meth->field_mul;
  524|  19.0k|    field_sqr = group->meth->field_sqr;
  525|       |
  526|       |    /* only support affine coordinates */
  527|  19.0k|    if (!point->Z_is_one)
  ------------------
  |  Branch (527:9): [True: 0, False: 19.0k]
  ------------------
  528|      0|        return -1;
  529|       |
  530|  19.0k|#ifndef FIPS_MODULE
  531|  19.0k|    if (ctx == NULL) {
  ------------------
  |  Branch (531:9): [True: 0, False: 19.0k]
  ------------------
  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|  19.0k|#endif
  537|       |
  538|  19.0k|    BN_CTX_start(ctx);
  539|  19.0k|    y2 = BN_CTX_get(ctx);
  540|  19.0k|    lh = BN_CTX_get(ctx);
  541|  19.0k|    if (lh == NULL)
  ------------------
  |  Branch (541:9): [True: 0, False: 19.0k]
  ------------------
  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|  19.0k|    if (!BN_GF2m_add(lh, point->X, group->a))
  ------------------
  |  Branch (550:9): [True: 0, False: 19.0k]
  ------------------
  551|      0|        goto err;
  552|  19.0k|    if (!field_mul(group, lh, lh, point->X, ctx))
  ------------------
  |  Branch (552:9): [True: 0, False: 19.0k]
  ------------------
  553|      0|        goto err;
  554|  19.0k|    if (!BN_GF2m_add(lh, lh, point->Y))
  ------------------
  |  Branch (554:9): [True: 0, False: 19.0k]
  ------------------
  555|      0|        goto err;
  556|  19.0k|    if (!field_mul(group, lh, lh, point->X, ctx))
  ------------------
  |  Branch (556:9): [True: 0, False: 19.0k]
  ------------------
  557|      0|        goto err;
  558|  19.0k|    if (!BN_GF2m_add(lh, lh, group->b))
  ------------------
  |  Branch (558:9): [True: 0, False: 19.0k]
  ------------------
  559|      0|        goto err;
  560|  19.0k|    if (!field_sqr(group, y2, point->Y, ctx))
  ------------------
  |  Branch (560:9): [True: 0, False: 19.0k]
  ------------------
  561|      0|        goto err;
  562|  19.0k|    if (!BN_GF2m_add(lh, lh, y2))
  ------------------
  |  Branch (562:9): [True: 0, False: 19.0k]
  ------------------
  563|      0|        goto err;
  564|  19.0k|    ret = BN_is_zero(lh);
  565|       |
  566|  19.0k| err:
  567|  19.0k|    BN_CTX_end(ctx);
  568|  19.0k|#ifndef FIPS_MODULE
  569|  19.0k|    BN_CTX_free(new_ctx);
  570|  19.0k|#endif
  571|  19.0k|    return ret;
  572|  19.0k|}
ossl_ec_GF2m_simple_field_mul:
  697|  43.0k|{
  698|  43.0k|    return BN_GF2m_mod_mul_arr(r, a, b, group->poly, ctx);
  699|  43.0k|}
ossl_ec_GF2m_simple_field_sqr:
  704|  25.7k|{
  705|  25.7k|    return BN_GF2m_mod_sqr_arr(r, a, group->poly, ctx);
  706|  25.7k|}
ossl_ec_GF2m_simple_field_div:
  711|  7.58k|{
  712|  7.58k|    return BN_GF2m_mod_div(r, a, b, group->field, ctx);
  713|  7.58k|}
EC_GF2m_simple_method:
  940|  12.2k|{
  941|  12.2k|    static const EC_METHOD ret = {
  942|  12.2k|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|  12.2k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  943|  12.2k|        NID_X9_62_characteristic_two_field,
  ------------------
  |  |  156|  12.2k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  944|  12.2k|        ossl_ec_GF2m_simple_group_init,
  945|  12.2k|        ossl_ec_GF2m_simple_group_finish,
  946|  12.2k|        ossl_ec_GF2m_simple_group_clear_finish,
  947|  12.2k|        ossl_ec_GF2m_simple_group_copy,
  948|  12.2k|        ossl_ec_GF2m_simple_group_set_curve,
  949|  12.2k|        ossl_ec_GF2m_simple_group_get_curve,
  950|  12.2k|        ossl_ec_GF2m_simple_group_get_degree,
  951|  12.2k|        ossl_ec_group_simple_order_bits,
  952|  12.2k|        ossl_ec_GF2m_simple_group_check_discriminant,
  953|  12.2k|        ossl_ec_GF2m_simple_point_init,
  954|  12.2k|        ossl_ec_GF2m_simple_point_finish,
  955|  12.2k|        ossl_ec_GF2m_simple_point_clear_finish,
  956|  12.2k|        ossl_ec_GF2m_simple_point_copy,
  957|  12.2k|        ossl_ec_GF2m_simple_point_set_to_infinity,
  958|  12.2k|        ossl_ec_GF2m_simple_point_set_affine_coordinates,
  959|  12.2k|        ossl_ec_GF2m_simple_point_get_affine_coordinates,
  960|  12.2k|        0, /* point_set_compressed_coordinates */
  961|  12.2k|        0, /* point2oct */
  962|  12.2k|        0, /* oct2point */
  963|  12.2k|        ossl_ec_GF2m_simple_add,
  964|  12.2k|        ossl_ec_GF2m_simple_dbl,
  965|  12.2k|        ossl_ec_GF2m_simple_invert,
  966|  12.2k|        ossl_ec_GF2m_simple_is_at_infinity,
  967|  12.2k|        ossl_ec_GF2m_simple_is_on_curve,
  968|  12.2k|        ossl_ec_GF2m_simple_cmp,
  969|  12.2k|        ossl_ec_GF2m_simple_make_affine,
  970|  12.2k|        ossl_ec_GF2m_simple_points_make_affine,
  971|  12.2k|        ec_GF2m_simple_points_mul,
  972|  12.2k|        0, /* precompute_mult */
  973|  12.2k|        0, /* have_precompute_mult */
  974|  12.2k|        ossl_ec_GF2m_simple_field_mul,
  975|  12.2k|        ossl_ec_GF2m_simple_field_sqr,
  976|  12.2k|        ossl_ec_GF2m_simple_field_div,
  977|  12.2k|        ec_GF2m_simple_field_inv,
  978|  12.2k|        0, /* field_encode */
  979|  12.2k|        0, /* field_decode */
  980|  12.2k|        0, /* field_set_to_one */
  981|  12.2k|        ossl_ec_key_simple_priv2oct,
  982|  12.2k|        ossl_ec_key_simple_oct2priv,
  983|  12.2k|        0, /* set private */
  984|  12.2k|        ossl_ec_key_simple_generate_key,
  985|  12.2k|        ossl_ec_key_simple_check_key,
  986|  12.2k|        ossl_ec_key_simple_generate_public_key,
  987|  12.2k|        0, /* keycopy */
  988|  12.2k|        0, /* keyfinish */
  989|  12.2k|        ossl_ecdh_simple_compute_key,
  990|  12.2k|        ossl_ecdsa_simple_sign_setup,
  991|  12.2k|        ossl_ecdsa_simple_sign_sig,
  992|  12.2k|        ossl_ecdsa_simple_verify_sig,
  993|  12.2k|        0, /* field_inverse_mod_ord */
  994|  12.2k|        0, /* blind_coordinates */
  995|  12.2k|        ec_GF2m_simple_ladder_pre,
  996|  12.2k|        ec_GF2m_simple_ladder_step,
  997|  12.2k|        ec_GF2m_simple_ladder_post
  998|  12.2k|    };
  999|       |
 1000|  12.2k|    return &ret;
 1001|  12.2k|}

ec_ameth.c:eckey_pub_decode:
  101|  34.3k|{
  102|  34.3k|    const unsigned char *p = NULL;
  103|  34.3k|    int pklen;
  104|  34.3k|    EC_KEY *eckey = NULL;
  105|  34.3k|    X509_ALGOR *palg;
  106|  34.3k|    OSSL_LIB_CTX *libctx = NULL;
  107|  34.3k|    const char *propq = NULL;
  108|       |
  109|  34.3k|    if (!ossl_x509_PUBKEY_get0_libctx(&libctx, &propq, pubkey)
  ------------------
  |  Branch (109:9): [True: 0, False: 34.3k]
  ------------------
  110|  34.3k|        || !X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
  ------------------
  |  Branch (110:12): [True: 0, False: 34.3k]
  ------------------
  111|      0|        return 0;
  112|  34.3k|    eckey = ossl_ec_key_param_from_x509_algor(palg, libctx, propq);
  113|       |
  114|  34.3k|    if (!eckey)
  ------------------
  |  Branch (114:9): [True: 4.66k, False: 29.7k]
  ------------------
  115|  4.66k|        return 0;
  116|       |
  117|       |    /* We have parameters now set public key */
  118|  29.7k|    if (!o2i_ECPublicKey(&eckey, &p, pklen)) {
  ------------------
  |  Branch (118:9): [True: 11.2k, False: 18.4k]
  ------------------
  119|  11.2k|        ERR_raise(ERR_LIB_EC, EC_R_DECODE_ERROR);
  ------------------
  |  |  401|  11.2k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  11.2k|    (ERR_new(),                                                 \
  |  |  |  |  404|  11.2k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  11.2k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  11.2k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  11.2k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  11.2k|     ERR_set_error)
  |  |  ------------------
  ------------------
  120|  11.2k|        goto ecerr;
  121|  11.2k|    }
  122|       |
  123|  18.4k|    EVP_PKEY_assign_EC_KEY(pkey, eckey);
  ------------------
  |  |  514|  18.4k|        EVP_PKEY_assign((pkey), EVP_PKEY_EC, (eckey))
  |  |  ------------------
  |  |  |  |   69|  18.4k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  18.4k|#define NID_X9_62_id_ecPublicKey                408
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|  18.4k|    return 1;
  125|       |
  126|  11.2k| ecerr:
  127|  11.2k|    EC_KEY_free(eckey);
  128|  11.2k|    return 0;
  129|  29.7k|}
ec_ameth.c:int_ec_free:
  273|  34.3k|{
  274|  34.3k|    EC_KEY_free(pkey->pkey.ec);
  275|  34.3k|}

d2i_ECPKParameters:
  886|  5.57k|{
  887|  5.57k|    EC_GROUP *group = NULL;
  888|  5.57k|    ECPKPARAMETERS *params = NULL;
  889|  5.57k|    const unsigned char *p = *in;
  890|       |
  891|  5.57k|    if ((params = d2i_ECPKPARAMETERS(NULL, &p, len)) == NULL) {
  ------------------
  |  Branch (891:9): [True: 5.57k, False: 0]
  ------------------
  892|  5.57k|        ECPKPARAMETERS_free(params);
  893|  5.57k|        return NULL;
  894|  5.57k|    }
  895|       |
  896|      0|    if ((group = EC_GROUP_new_from_ecpkparameters(params)) == NULL) {
  ------------------
  |  Branch (896:9): [True: 0, False: 0]
  ------------------
  897|      0|        ECPKPARAMETERS_free(params);
  898|      0|        return NULL;
  899|      0|    }
  900|       |
  901|      0|    if (params->type == ECPKPARAMETERS_TYPE_EXPLICIT)
  ------------------
  |  Branch (901:9): [True: 0, False: 0]
  ------------------
  902|      0|        group->decoded_from_explicit_params = 1;
  903|       |
  904|      0|    if (a) {
  ------------------
  |  Branch (904:9): [True: 0, False: 0]
  ------------------
  905|      0|        EC_GROUP_free(*a);
  906|      0|        *a = group;
  907|      0|    }
  908|       |
  909|      0|    ECPKPARAMETERS_free(params);
  910|      0|    *in = p;
  911|      0|    return group;
  912|      0|}
d2i_ECParameters:
 1098|  2.78k|{
 1099|  2.78k|    EC_KEY *ret;
 1100|       |
 1101|  2.78k|    if (in == NULL || *in == NULL) {
  ------------------
  |  Branch (1101:9): [True: 0, False: 2.78k]
  |  Branch (1101:23): [True: 0, False: 2.78k]
  ------------------
 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1103|      0|        return NULL;
 1104|      0|    }
 1105|       |
 1106|  2.78k|    if (a == NULL || *a == NULL) {
  ------------------
  |  Branch (1106:9): [True: 0, False: 2.78k]
  |  Branch (1106:22): [True: 0, False: 2.78k]
  ------------------
 1107|      0|        if ((ret = EC_KEY_new()) == NULL) {
  ------------------
  |  Branch (1107:13): [True: 0, False: 0]
  ------------------
 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1109|      0|            return NULL;
 1110|      0|        }
 1111|      0|    } else
 1112|  2.78k|        ret = *a;
 1113|       |
 1114|  2.78k|    if (!d2i_ECPKParameters(&ret->group, in, len)) {
  ------------------
  |  Branch (1114:9): [True: 2.78k, False: 0]
  ------------------
 1115|  2.78k|        if (a == NULL || *a != ret)
  ------------------
  |  Branch (1115:13): [True: 0, False: 2.78k]
  |  Branch (1115:26): [True: 0, False: 2.78k]
  ------------------
 1116|      0|             EC_KEY_free(ret);
 1117|  2.78k|        else
 1118|  2.78k|            ret->dirty_cnt++;
 1119|  2.78k|        return NULL;
 1120|  2.78k|    }
 1121|       |
 1122|      0|    if (EC_GROUP_get_curve_name(ret->group) == NID_sm2)
  ------------------
  |  | 1228|      0|#define NID_sm2         1172
  ------------------
  |  Branch (1122:9): [True: 0, False: 0]
  ------------------
 1123|      0|        EC_KEY_set_flags(ret, EC_FLAG_SM2_RANGE);
  ------------------
  |  |  962|      0|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
 1124|       |
 1125|      0|    ret->dirty_cnt++;
 1126|       |
 1127|      0|    if (a)
  ------------------
  |  Branch (1127:9): [True: 0, False: 0]
  ------------------
 1128|      0|        *a = ret;
 1129|       |
 1130|      0|    return ret;
 1131|  2.78k|}
o2i_ECPublicKey:
 1134|  29.7k|{
 1135|  29.7k|    EC_KEY *ret = NULL;
 1136|       |
 1137|  29.7k|    if (a == NULL || (*a) == NULL || (*a)->group == NULL) {
  ------------------
  |  Branch (1137:9): [True: 0, False: 29.7k]
  |  Branch (1137:22): [True: 0, False: 29.7k]
  |  Branch (1137:38): [True: 0, False: 29.7k]
  ------------------
 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1142|      0|        return 0;
 1143|      0|    }
 1144|  29.7k|    ret = *a;
 1145|       |    /* EC_KEY_opt2key updates dirty_cnt */
 1146|  29.7k|    if (!EC_KEY_oct2key(ret, *in, len, NULL)) {
  ------------------
  |  Branch (1146:9): [True: 11.2k, False: 18.4k]
  ------------------
 1147|  11.2k|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|  11.2k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  11.2k|    (ERR_new(),                                                 \
  |  |  |  |  404|  11.2k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  11.2k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  11.2k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  11.2k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  11.2k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1148|  11.2k|        return 0;
 1149|  11.2k|    }
 1150|  18.4k|    *in += len;
 1151|  18.4k|    return ret;
 1152|  29.7k|}
i2d_ECDSA_SIG:
 1240|  18.4k|{
 1241|  18.4k|    BUF_MEM *buf = NULL;
 1242|  18.4k|    size_t encoded_len;
 1243|  18.4k|    WPACKET pkt;
 1244|       |
 1245|  18.4k|    if (ppout == NULL) {
  ------------------
  |  Branch (1245:9): [True: 18.4k, False: 0]
  ------------------
 1246|  18.4k|        if (!WPACKET_init_null(&pkt, 0))
  ------------------
  |  Branch (1246:13): [True: 0, False: 18.4k]
  ------------------
 1247|      0|            return -1;
 1248|  18.4k|    } else if (*ppout == NULL) {
  ------------------
  |  Branch (1248:16): [True: 0, False: 0]
  ------------------
 1249|      0|        if ((buf = BUF_MEM_new()) == NULL
  ------------------
  |  Branch (1249:13): [True: 0, False: 0]
  ------------------
 1250|      0|                || !WPACKET_init_len(&pkt, buf, 0)) {
  ------------------
  |  Branch (1250:20): [True: 0, False: 0]
  ------------------
 1251|      0|            BUF_MEM_free(buf);
 1252|      0|            return -1;
 1253|      0|        }
 1254|      0|    } 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|  18.4k|    if (!ossl_encode_der_dsa_sig(&pkt, sig->r, sig->s)
  ------------------
  |  Branch (1259:9): [True: 0, False: 18.4k]
  ------------------
 1260|  18.4k|            || !WPACKET_get_total_written(&pkt, &encoded_len)
  ------------------
  |  Branch (1260:16): [True: 0, False: 18.4k]
  ------------------
 1261|  18.4k|            || !WPACKET_finish(&pkt)) {
  ------------------
  |  Branch (1261:16): [True: 0, False: 18.4k]
  ------------------
 1262|      0|        BUF_MEM_free(buf);
 1263|      0|        WPACKET_cleanup(&pkt);
 1264|      0|        return -1;
 1265|      0|    }
 1266|       |
 1267|  18.4k|    if (ppout != NULL) {
  ------------------
  |  Branch (1267:9): [True: 0, False: 18.4k]
  ------------------
 1268|      0|        if (*ppout == NULL) {
  ------------------
  |  Branch (1268:13): [True: 0, False: 0]
  ------------------
 1269|      0|            *ppout = (unsigned char *)buf->data;
 1270|      0|            buf->data = NULL;
 1271|      0|            BUF_MEM_free(buf);
 1272|      0|        } else {
 1273|      0|            *ppout += encoded_len;
 1274|      0|        }
 1275|      0|    }
 1276|       |
 1277|  18.4k|    return (int)encoded_len;
 1278|  18.4k|}
ECDSA_size:
 1310|  18.4k|{
 1311|  18.4k|    int ret;
 1312|  18.4k|    ECDSA_SIG sig;
 1313|  18.4k|    const EC_GROUP *group;
 1314|  18.4k|    const BIGNUM *bn;
 1315|       |
 1316|  18.4k|    if (ec == NULL)
  ------------------
  |  Branch (1316:9): [True: 0, False: 18.4k]
  ------------------
 1317|      0|        return 0;
 1318|  18.4k|    group = EC_KEY_get0_group(ec);
 1319|  18.4k|    if (group == NULL)
  ------------------
  |  Branch (1319:9): [True: 0, False: 18.4k]
  ------------------
 1320|      0|        return 0;
 1321|       |
 1322|  18.4k|    bn = EC_GROUP_get0_order(group);
 1323|  18.4k|    if (bn == NULL)
  ------------------
  |  Branch (1323:9): [True: 0, False: 18.4k]
  ------------------
 1324|      0|        return 0;
 1325|       |
 1326|  18.4k|    sig.r = sig.s = (BIGNUM *)bn;
 1327|  18.4k|    ret = i2d_ECDSA_SIG(&sig, NULL);
 1328|       |
 1329|  18.4k|    if (ret < 0)
  ------------------
  |  Branch (1329:9): [True: 0, False: 18.4k]
  ------------------
 1330|      0|        ret = 0;
 1331|  18.4k|    return ret;
 1332|  18.4k|}

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

EC_GROUP_new_by_curve_name_ex:
 3291|  31.1k|{
 3292|  31.1k|    EC_GROUP *ret = NULL;
 3293|  31.1k|    const ec_list_element *curve;
 3294|       |
 3295|  31.1k|    if ((curve = ec_curve_nid2curve(nid)) == NULL
  ------------------
  |  Branch (3295:9): [True: 1.38k, False: 29.7k]
  ------------------
 3296|  31.1k|        || (ret = ec_group_new_from_data(libctx, propq, *curve)) == NULL) {
  ------------------
  |  Branch (3296:12): [True: 0, False: 29.7k]
  ------------------
 3297|  1.38k|#ifndef FIPS_MODULE
 3298|  1.38k|        ERR_raise_data(ERR_LIB_EC, EC_R_UNKNOWN_GROUP,
  ------------------
  |  |  403|  1.38k|    (ERR_new(),                                                 \
  |  |  404|  1.38k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  279|  1.38k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|  1.38k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|  1.38k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|  1.38k|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EC, EC_R_UNKNOWN_GROUP,
  ------------------
  |  |   86|  1.38k|# define ERR_LIB_EC              16
  ------------------
                      ERR_raise_data(ERR_LIB_EC, EC_R_UNKNOWN_GROUP,
  ------------------
  |  |   97|  1.38k|#  define EC_R_UNKNOWN_GROUP                               129
  ------------------
 3299|  1.38k|                       "name=%s", OBJ_nid2sn(nid));
 3300|       |#else
 3301|       |        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_GROUP);
 3302|       |#endif
 3303|  1.38k|        return NULL;
 3304|  1.38k|    }
 3305|       |
 3306|  29.7k|    return ret;
 3307|  31.1k|}
ec_curve.c:ec_curve_nid2curve:
 3129|  31.1k|{
 3130|  31.1k|    size_t i;
 3131|       |
 3132|  31.1k|    if (nid <= 0)
  ------------------
  |  Branch (3132:9): [True: 911, False: 30.2k]
  ------------------
 3133|    911|        return NULL;
 3134|       |
 3135|   981k|    for (i = 0; i < curve_list_length; i++) {
  ------------------
  |  | 3126|   981k|#define curve_list_length OSSL_NELEM(curve_list)
  |  |  ------------------
  |  |  |  |   14|   981k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
  |  Branch (3135:17): [True: 981k, False: 476]
  ------------------
 3136|   981k|        if (curve_list[i].nid == nid)
  ------------------
  |  Branch (3136:13): [True: 29.7k, False: 951k]
  ------------------
 3137|  29.7k|            return &curve_list[i];
 3138|   981k|    }
 3139|    476|    return NULL;
 3140|  30.2k|}
ec_curve.c:ec_group_new_from_data:
 3145|  29.7k|{
 3146|  29.7k|    EC_GROUP *group = NULL;
 3147|  29.7k|    EC_POINT *P = NULL;
 3148|  29.7k|    BN_CTX *ctx = NULL;
 3149|  29.7k|    BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL, *order =
 3150|  29.7k|        NULL;
 3151|  29.7k|    int ok = 0;
 3152|  29.7k|    int seed_len, param_len;
 3153|  29.7k|    const EC_METHOD *meth;
 3154|  29.7k|    const EC_CURVE_DATA *data;
 3155|  29.7k|    const unsigned char *params;
 3156|       |
 3157|       |    /* If no curve data curve method must handle everything */
 3158|  29.7k|    if (curve.data == NULL)
  ------------------
  |  Branch (3158:9): [True: 0, False: 29.7k]
  ------------------
 3159|      0|        return ossl_ec_group_new_ex(libctx, propq,
 3160|      0|                                    curve.meth != NULL ? curve.meth() : NULL);
  ------------------
  |  Branch (3160:37): [True: 0, False: 0]
  ------------------
 3161|       |
 3162|  29.7k|    if ((ctx = BN_CTX_new_ex(libctx)) == NULL) {
  ------------------
  |  Branch (3162:9): [True: 0, False: 29.7k]
  ------------------
 3163|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3164|      0|        goto err;
 3165|      0|    }
 3166|       |
 3167|  29.7k|    data = curve.data;
 3168|  29.7k|    seed_len = data->seed_len;
 3169|  29.7k|    param_len = data->param_len;
 3170|  29.7k|    params = (const unsigned char *)(data + 1); /* skip header */
 3171|  29.7k|    params += seed_len;         /* skip seed */
 3172|       |
 3173|  29.7k|    if ((p = BN_bin2bn(params + 0 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3173:9): [True: 0, False: 29.7k]
  ------------------
 3174|  29.7k|        || (a = BN_bin2bn(params + 1 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3174:12): [True: 0, False: 29.7k]
  ------------------
 3175|  29.7k|        || (b = BN_bin2bn(params + 2 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (3175:12): [True: 0, False: 29.7k]
  ------------------
 3176|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3177|      0|        goto err;
 3178|      0|    }
 3179|       |
 3180|  29.7k|    if (curve.meth != 0) {
  ------------------
  |  Branch (3180:9): [True: 7.26k, False: 22.4k]
  ------------------
 3181|  7.26k|        meth = curve.meth();
 3182|  7.26k|        if (((group = ossl_ec_group_new_ex(libctx, propq, meth)) == NULL) ||
  ------------------
  |  Branch (3182:13): [True: 0, False: 7.26k]
  ------------------
 3183|  7.26k|            (!(group->meth->group_set_curve(group, p, a, b, ctx)))) {
  ------------------
  |  Branch (3183:13): [True: 0, False: 7.26k]
  ------------------
 3184|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3185|      0|            goto err;
 3186|      0|        }
 3187|  22.4k|    } else if (data->field_type == NID_X9_62_prime_field) {
  ------------------
  |  |  152|  22.4k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (3187:16): [True: 10.2k, False: 12.2k]
  ------------------
 3188|  10.2k|        if ((group = EC_GROUP_new_curve_GFp(p, a, b, ctx)) == NULL) {
  ------------------
  |  Branch (3188:13): [True: 0, False: 10.2k]
  ------------------
 3189|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3190|      0|            goto err;
 3191|      0|        }
 3192|  10.2k|    }
 3193|  12.2k|#ifndef OPENSSL_NO_EC2M
 3194|  12.2k|    else {                      /* field_type ==
 3195|       |                                 * NID_X9_62_characteristic_two_field */
 3196|       |
 3197|  12.2k|        if ((group = EC_GROUP_new_curve_GF2m(p, a, b, ctx)) == NULL) {
  ------------------
  |  Branch (3197:13): [True: 0, False: 12.2k]
  ------------------
 3198|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3199|      0|            goto err;
 3200|      0|        }
 3201|  12.2k|    }
 3202|  29.7k|#endif
 3203|       |
 3204|  29.7k|    EC_GROUP_set_curve_name(group, curve.nid);
 3205|       |
 3206|  29.7k|    if ((P = EC_POINT_new(group)) == NULL) {
  ------------------
  |  Branch (3206:9): [True: 0, False: 29.7k]
  ------------------
 3207|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3208|      0|        goto err;
 3209|      0|    }
 3210|       |
 3211|  29.7k|    if ((x = BN_bin2bn(params + 3 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3211:9): [True: 0, False: 29.7k]
  ------------------
 3212|  29.7k|        || (y = BN_bin2bn(params + 4 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (3212:12): [True: 0, False: 29.7k]
  ------------------
 3213|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3214|      0|        goto err;
 3215|      0|    }
 3216|  29.7k|    if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) {
  ------------------
  |  Branch (3216:9): [True: 0, False: 29.7k]
  ------------------
 3217|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3218|      0|        goto err;
 3219|      0|    }
 3220|  29.7k|    if ((order = BN_bin2bn(params + 5 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3220:9): [True: 0, False: 29.7k]
  ------------------
 3221|  29.7k|        || !BN_set_word(x, (BN_ULONG)data->cofactor)) {
  ------------------
  |  Branch (3221:12): [True: 0, False: 29.7k]
  ------------------
 3222|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3223|      0|        goto err;
 3224|      0|    }
 3225|  29.7k|    if (!EC_GROUP_set_generator(group, P, order, x)) {
  ------------------
  |  Branch (3225:9): [True: 0, False: 29.7k]
  ------------------
 3226|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3227|      0|        goto err;
 3228|      0|    }
 3229|  29.7k|    if (seed_len) {
  ------------------
  |  Branch (3229:9): [True: 18.3k, False: 11.3k]
  ------------------
 3230|  18.3k|        if (!EC_GROUP_set_seed(group, params - seed_len, seed_len)) {
  ------------------
  |  Branch (3230:13): [True: 0, False: 18.3k]
  ------------------
 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3232|      0|            goto err;
 3233|      0|        }
 3234|  18.3k|    }
 3235|       |
 3236|  29.7k|#ifndef FIPS_MODULE
 3237|  29.7k|    if (EC_GROUP_get_asn1_flag(group) == OPENSSL_EC_NAMED_CURVE) {
  ------------------
  |  |   31|  29.7k|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  |  Branch (3237:9): [True: 29.7k, False: 0]
  ------------------
 3238|       |        /*
 3239|       |         * Some curves don't have an associated OID: for those we should not
 3240|       |         * default to `OPENSSL_EC_NAMED_CURVE` encoding of parameters and
 3241|       |         * instead set the ASN1 flag to `OPENSSL_EC_EXPLICIT_CURVE`.
 3242|       |         *
 3243|       |         * Note that `OPENSSL_EC_NAMED_CURVE` is set as the default ASN1 flag on
 3244|       |         * `EC_GROUP_new()`, when we don't have enough elements to determine if
 3245|       |         * an OID for the curve name actually exists.
 3246|       |         * We could implement this check on `EC_GROUP_set_curve_name()` but
 3247|       |         * overloading the simple setter with this lookup could have a negative
 3248|       |         * performance impact and unexpected consequences.
 3249|       |         */
 3250|  29.7k|        ASN1_OBJECT *asn1obj = OBJ_nid2obj(curve.nid);
 3251|       |
 3252|  29.7k|        if (asn1obj == NULL) {
  ------------------
  |  Branch (3252:13): [True: 0, False: 29.7k]
  ------------------
 3253|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 3254|      0|            goto err;
 3255|      0|        }
 3256|  29.7k|        if (OBJ_length(asn1obj) == 0)
  ------------------
  |  Branch (3256:13): [True: 0, False: 29.7k]
  ------------------
 3257|      0|            EC_GROUP_set_asn1_flag(group, OPENSSL_EC_EXPLICIT_CURVE);
  ------------------
  |  |   30|      0|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
 3258|       |
 3259|  29.7k|        ASN1_OBJECT_free(asn1obj);
 3260|  29.7k|    }
 3261|       |#else
 3262|       |    /*
 3263|       |     * Inside the FIPS module we do not support explicit curves anyway
 3264|       |     * so the above check is not necessary.
 3265|       |     *
 3266|       |     * Skipping it is also necessary because `OBJ_length()` and
 3267|       |     * `ASN1_OBJECT_free()` are not available within the FIPS module
 3268|       |     * boundaries.
 3269|       |     */
 3270|       |#endif
 3271|       |
 3272|  29.7k|    ok = 1;
 3273|  29.7k| err:
 3274|  29.7k|    if (!ok) {
  ------------------
  |  Branch (3274:9): [True: 0, False: 29.7k]
  ------------------
 3275|      0|        EC_GROUP_free(group);
 3276|      0|        group = NULL;
 3277|      0|    }
 3278|  29.7k|    EC_POINT_free(P);
 3279|  29.7k|    BN_CTX_free(ctx);
 3280|  29.7k|    BN_free(p);
 3281|  29.7k|    BN_free(a);
 3282|  29.7k|    BN_free(b);
 3283|  29.7k|    BN_free(order);
 3284|  29.7k|    BN_free(x);
 3285|  29.7k|    BN_free(y);
 3286|  29.7k|    return group;
 3287|  29.7k|}

EC_GROUP_new_curve_GFp:
   23|  10.2k|{
   24|  10.2k|    const EC_METHOD *meth;
   25|  10.2k|    EC_GROUP *ret;
   26|       |
   27|  10.2k|#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|       |     *                                              <appro>
   48|       |     */
   49|  10.2k|    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|  10.2k|    ret = ossl_ec_group_new_ex(ossl_bn_get_libctx(ctx), NULL, meth);
   58|  10.2k|    if (ret == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 10.2k]
  ------------------
   59|      0|        return NULL;
   60|       |
   61|  10.2k|    if (!EC_GROUP_set_curve(ret, p, a, b, ctx)) {
  ------------------
  |  Branch (61:9): [True: 0, False: 10.2k]
  ------------------
   62|      0|        EC_GROUP_free(ret);
   63|      0|        return NULL;
   64|      0|    }
   65|       |
   66|  10.2k|    return ret;
   67|  10.2k|}
EC_GROUP_new_curve_GF2m:
   72|  12.2k|{
   73|  12.2k|    const EC_METHOD *meth;
   74|  12.2k|    EC_GROUP *ret;
   75|       |
   76|  12.2k|    meth = EC_GF2m_simple_method();
   77|       |
   78|  12.2k|    ret = ossl_ec_group_new_ex(ossl_bn_get_libctx(ctx), NULL, meth);
   79|  12.2k|    if (ret == NULL)
  ------------------
  |  Branch (79:9): [True: 0, False: 12.2k]
  ------------------
   80|      0|        return NULL;
   81|       |
   82|  12.2k|    if (!EC_GROUP_set_curve(ret, p, a, b, ctx)) {
  ------------------
  |  Branch (82:9): [True: 0, False: 12.2k]
  ------------------
   83|      0|        EC_GROUP_free(ret);
   84|      0|        return NULL;
   85|      0|    }
   86|       |
   87|  12.2k|    return ret;
   88|  12.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_ex:
   41|  34.3k|{
   42|  34.3k|    return ossl_ec_key_new_method_int(ctx, propq, NULL);
   43|  34.3k|}
EC_KEY_free:
   72|   103k|{
   73|   103k|    int i;
   74|       |
   75|   103k|    if (r == NULL)
  ------------------
  |  Branch (75:9): [True: 50.4k, False: 52.8k]
  ------------------
   76|  50.4k|        return;
   77|       |
   78|  52.8k|    CRYPTO_DOWN_REF(&r->references, &i);
   79|  52.8k|    REF_PRINT_COUNT("EC_KEY", r);
  ------------------
  |  |  289|  52.8k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  52.8k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  52.8k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  52.8k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|  52.8k|    if (i > 0)
  ------------------
  |  Branch (80:9): [True: 18.4k, False: 34.3k]
  ------------------
   81|  18.4k|        return;
   82|  34.3k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|  34.3k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 34.3k]
  |  |  ------------------
  ------------------
   83|       |
   84|  34.3k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (84:9): [True: 34.3k, False: 0]
  |  Branch (84:28): [True: 0, False: 34.3k]
  ------------------
   85|      0|        r->meth->finish(r);
   86|       |
   87|  34.3k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   88|  34.3k|    ENGINE_finish(r->engine);
   89|  34.3k|#endif
   90|       |
   91|  34.3k|    if (r->group && r->group->meth->keyfinish)
  ------------------
  |  Branch (91:9): [True: 29.7k, False: 4.66k]
  |  Branch (91:21): [True: 0, False: 29.7k]
  ------------------
   92|      0|        r->group->meth->keyfinish(r);
   93|       |
   94|  34.3k|#ifndef FIPS_MODULE
   95|  34.3k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EC_KEY, r, &r->ex_data);
  ------------------
  |  |  226|  34.3k|# define CRYPTO_EX_INDEX_EC_KEY           8
  ------------------
   96|  34.3k|#endif
   97|  34.3k|    CRYPTO_FREE_REF(&r->references);
   98|  34.3k|    EC_GROUP_free(r->group);
   99|  34.3k|    EC_POINT_free(r->pub_key);
  100|  34.3k|    BN_clear_free(r->priv_key);
  101|  34.3k|    OPENSSL_free(r->propq);
  ------------------
  |  |  107|  34.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  34.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  34.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|       |
  103|  34.3k|    OPENSSL_clear_free((void *)r, sizeof(EC_KEY));
  ------------------
  |  |  105|  34.3k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  34.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  34.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|  34.3k|}
EC_KEY_up_ref:
  194|  18.4k|{
  195|  18.4k|    int i;
  196|       |
  197|  18.4k|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (197:9): [True: 0, False: 18.4k]
  ------------------
  198|      0|        return 0;
  199|       |
  200|  18.4k|    REF_PRINT_COUNT("EC_KEY", r);
  ------------------
  |  |  289|  18.4k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  18.4k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  18.4k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  18.4k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  201|  18.4k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|  18.4k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 18.4k]
  |  |  ------------------
  ------------------
  202|  18.4k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (202:13): [True: 18.4k, False: 0]
  ------------------
  203|  18.4k|}
ossl_ec_key_get_libctx:
  746|  36.9k|{
  747|  36.9k|    return key->libctx;
  748|  36.9k|}
ossl_ec_key_get0_propq:
  751|  18.4k|{
  752|  18.4k|    return key->propq;
  753|  18.4k|}
ossl_ec_key_set0_libctx:
  756|  18.4k|{
  757|  18.4k|    key->libctx = libctx;
  758|       |    /* Do we need to propagate this to the group? */
  759|  18.4k|}
EC_KEY_get0_group:
  762|  92.3k|{
  763|  92.3k|    return key->group;
  764|  92.3k|}
EC_KEY_set_group:
  767|  29.7k|{
  768|  29.7k|    if (key->meth->set_group != NULL && key->meth->set_group(key, group) == 0)
  ------------------
  |  Branch (768:9): [True: 0, False: 29.7k]
  |  Branch (768:41): [True: 0, False: 0]
  ------------------
  769|      0|        return 0;
  770|  29.7k|    EC_GROUP_free(key->group);
  771|  29.7k|    key->group = EC_GROUP_dup(group);
  772|  29.7k|    if (key->group != NULL && EC_GROUP_get_curve_name(key->group) == NID_sm2)
  ------------------
  |  | 1228|  29.7k|#define NID_sm2         1172
  ------------------
  |  Branch (772:9): [True: 29.7k, False: 0]
  |  Branch (772:31): [True: 1, False: 29.7k]
  ------------------
  773|      1|        EC_KEY_set_flags(key, EC_FLAG_SM2_RANGE);
  ------------------
  |  |  962|      1|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
  774|       |
  775|  29.7k|    key->dirty_cnt++;
  776|  29.7k|    return (key->group == NULL) ? 0 : 1;
  ------------------
  |  Branch (776:12): [True: 0, False: 29.7k]
  ------------------
  777|  29.7k|}
EC_KEY_get0_private_key:
  780|  18.4k|{
  781|  18.4k|    return key->priv_key;
  782|  18.4k|}
EC_KEY_get0_public_key:
  880|  18.4k|{
  881|  18.4k|    return key->pub_key;
  882|  18.4k|}
EC_KEY_get_enc_flags:
  896|  18.4k|{
  897|  18.4k|    return key->enc_flag;
  898|  18.4k|}
EC_KEY_get_conv_form:
  906|  18.4k|{
  907|  18.4k|    return key->conv_form;
  908|  18.4k|}
EC_KEY_get_flags:
  933|  55.4k|{
  934|  55.4k|    return key->flags;
  935|  55.4k|}
EC_KEY_set_flags:
  938|      1|{
  939|      1|    key->flags |= flags;
  940|      1|    key->dirty_cnt++;
  941|      1|}
EC_KEY_oct2key:
  966|  29.7k|{
  967|  29.7k|    if (key == NULL || key->group == NULL)
  ------------------
  |  Branch (967:9): [True: 0, False: 29.7k]
  |  Branch (967:24): [True: 0, False: 29.7k]
  ------------------
  968|      0|        return 0;
  969|  29.7k|    if (key->pub_key == NULL)
  ------------------
  |  Branch (969:9): [True: 29.7k, False: 0]
  ------------------
  970|  29.7k|        key->pub_key = EC_POINT_new(key->group);
  971|  29.7k|    if (key->pub_key == NULL)
  ------------------
  |  Branch (971:9): [True: 0, False: 29.7k]
  ------------------
  972|      0|        return 0;
  973|  29.7k|    if (EC_POINT_oct2point(key->group, key->pub_key, buf, len, ctx) == 0)
  ------------------
  |  Branch (973:9): [True: 11.2k, False: 18.4k]
  ------------------
  974|  11.2k|        return 0;
  975|  18.4k|    key->dirty_cnt++;
  976|       |    /*
  977|       |     * Save the point conversion form.
  978|       |     * For non-custom curves the first octet of the buffer (excluding
  979|       |     * the last significant bit) contains the point conversion form.
  980|       |     * EC_POINT_oct2point() has already performed sanity checking of
  981|       |     * the buffer so we know it is valid.
  982|       |     */
  983|  18.4k|    if ((key->group->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0)
  ------------------
  |  |   29|  18.4k|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (983:9): [True: 18.4k, False: 0]
  ------------------
  984|  18.4k|        key->conv_form = (point_conversion_form_t)(buf[0] & ~0x01);
  985|  18.4k|    return 1;
  986|  29.7k|}

EC_KEY_OpenSSL:
   41|  18.4k|{
   42|  18.4k|    return &openssl_ec_key_method;
   43|  18.4k|}
EC_KEY_get_default_method:
   46|  34.3k|{
   47|  34.3k|    return default_ec_key_meth;
   48|  34.3k|}
EC_KEY_get_method:
   59|  18.4k|{
   60|  18.4k|    return key->meth;
   61|  18.4k|}
ossl_ec_key_new_method_int:
   83|  34.3k|{
   84|  34.3k|    EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   99|  34.3k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  34.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  34.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   85|       |
   86|  34.3k|    if (ret == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 34.3k]
  ------------------
   87|      0|        return NULL;
   88|       |
   89|  34.3k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 34.3k]
  ------------------
   90|      0|        OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   91|      0|        return NULL;
   92|      0|    }
   93|       |
   94|  34.3k|    ret->libctx = libctx;
   95|  34.3k|    if (propq != NULL) {
  ------------------
  |  Branch (95:9): [True: 0, False: 34.3k]
  ------------------
   96|      0|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  111|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   97|      0|        if (ret->propq == NULL)
  ------------------
  |  Branch (97:13): [True: 0, False: 0]
  ------------------
   98|      0|            goto err;
   99|      0|    }
  100|       |
  101|  34.3k|    ret->meth = EC_KEY_get_default_method();
  102|  34.3k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  103|  34.3k|    if (engine != NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 34.3k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|  34.3k|        ret->engine = ENGINE_get_default_EC();
  111|  34.3k|    if (ret->engine != NULL) {
  ------------------
  |  Branch (111:9): [True: 0, False: 34.3k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  115|      0|            goto err;
  116|      0|        }
  117|      0|    }
  118|  34.3k|#endif
  119|       |
  120|  34.3k|    ret->version = 1;
  121|  34.3k|    ret->conv_form = POINT_CONVERSION_UNCOMPRESSED;
  122|       |
  123|       |/* No ex_data inside the FIPS provider */
  124|  34.3k|#ifndef FIPS_MODULE
  125|  34.3k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_EC_KEY, ret, &ret->ex_data)) {
  ------------------
  |  |  226|  34.3k|# define CRYPTO_EX_INDEX_EC_KEY           8
  ------------------
  |  Branch (125:9): [True: 0, False: 34.3k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  127|      0|        goto err;
  128|      0|    }
  129|  34.3k|#endif
  130|       |
  131|  34.3k|    if (ret->meth->init != NULL && ret->meth->init(ret) == 0) {
  ------------------
  |  Branch (131:9): [True: 0, False: 34.3k]
  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  133|      0|        goto err;
  134|      0|    }
  135|  34.3k|    return ret;
  136|       |
  137|      0| err:
  138|      0|    EC_KEY_free(ret);
  139|      0|    return NULL;
  140|  34.3k|}

ossl_ec_group_new_ex:
   31|  59.4k|{
   32|  59.4k|    EC_GROUP *ret;
   33|       |
   34|  59.4k|    if (meth == NULL) {
  ------------------
  |  Branch (34:9): [True: 0, False: 59.4k]
  ------------------
   35|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   36|      0|        return NULL;
   37|      0|    }
   38|  59.4k|    if (meth->group_init == 0) {
  ------------------
  |  Branch (38:9): [True: 0, False: 59.4k]
  ------------------
   39|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   40|      0|        return NULL;
   41|      0|    }
   42|       |
   43|  59.4k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   99|  59.4k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  59.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  59.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|  59.4k|    if (ret == NULL)
  ------------------
  |  Branch (44:9): [True: 0, False: 59.4k]
  ------------------
   45|      0|        return NULL;
   46|       |
   47|  59.4k|    ret->libctx = libctx;
   48|  59.4k|    if (propq != NULL) {
  ------------------
  |  Branch (48:9): [True: 0, False: 59.4k]
  ------------------
   49|      0|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  111|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   50|      0|        if (ret->propq == NULL)
  ------------------
  |  Branch (50:13): [True: 0, False: 0]
  ------------------
   51|      0|            goto err;
   52|      0|    }
   53|  59.4k|    ret->meth = meth;
   54|  59.4k|    if ((ret->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
  ------------------
  |  |   29|  59.4k|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (54:9): [True: 59.4k, False: 0]
  ------------------
   55|  59.4k|        ret->order = BN_new();
   56|  59.4k|        if (ret->order == NULL)
  ------------------
  |  Branch (56:13): [True: 0, False: 59.4k]
  ------------------
   57|      0|            goto err;
   58|  59.4k|        ret->cofactor = BN_new();
   59|  59.4k|        if (ret->cofactor == NULL)
  ------------------
  |  Branch (59:13): [True: 0, False: 59.4k]
  ------------------
   60|      0|            goto err;
   61|  59.4k|    }
   62|  59.4k|    ret->asn1_flag = OPENSSL_EC_EXPLICIT_CURVE;
  ------------------
  |  |   30|  59.4k|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
   63|  59.4k|    ret->asn1_form = POINT_CONVERSION_UNCOMPRESSED;
   64|  59.4k|    if (!meth->group_init(ret))
  ------------------
  |  Branch (64:9): [True: 0, False: 59.4k]
  ------------------
   65|      0|        goto err;
   66|  59.4k|    return ret;
   67|       |
   68|      0| err:
   69|      0|    BN_free(ret->order);
   70|      0|    BN_free(ret->cofactor);
   71|      0|    OPENSSL_free(ret->propq);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   72|      0|    OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|      0|    return NULL;
   74|  59.4k|}
EC_pre_comp_free:
   86|  59.4k|{
   87|  59.4k|    switch (group->pre_comp_type) {
  ------------------
  |  Branch (87:13): [True: 0, False: 59.4k]
  ------------------
   88|  59.4k|    case PCT_none:
  ------------------
  |  Branch (88:5): [True: 59.4k, False: 0]
  ------------------
   89|  59.4k|        break;
   90|      0|    case PCT_nistz256:
  ------------------
  |  Branch (90:5): [True: 0, False: 59.4k]
  ------------------
   91|      0|#ifdef ECP_NISTZ256_ASM
   92|      0|        EC_nistz256_pre_comp_free(group->pre_comp.nistz256);
   93|      0|#endif
   94|      0|        break;
   95|      0|#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
   96|      0|    case PCT_nistp224:
  ------------------
  |  Branch (96:5): [True: 0, False: 59.4k]
  ------------------
   97|      0|        EC_nistp224_pre_comp_free(group->pre_comp.nistp224);
   98|      0|        break;
   99|      0|    case PCT_nistp256:
  ------------------
  |  Branch (99:5): [True: 0, False: 59.4k]
  ------------------
  100|      0|        EC_nistp256_pre_comp_free(group->pre_comp.nistp256);
  101|      0|        break;
  102|      0|    case PCT_nistp384:
  ------------------
  |  Branch (102:5): [True: 0, False: 59.4k]
  ------------------
  103|      0|        ossl_ec_nistp384_pre_comp_free(group->pre_comp.nistp384);
  104|      0|        break;
  105|      0|    case PCT_nistp521:
  ------------------
  |  Branch (105:5): [True: 0, False: 59.4k]
  ------------------
  106|      0|        EC_nistp521_pre_comp_free(group->pre_comp.nistp521);
  107|      0|        break;
  108|       |#else
  109|       |    case PCT_nistp224:
  110|       |    case PCT_nistp256:
  111|       |    case PCT_nistp384:
  112|       |    case PCT_nistp521:
  113|       |        break;
  114|       |#endif
  115|      0|    case PCT_ec:
  ------------------
  |  Branch (115:5): [True: 0, False: 59.4k]
  ------------------
  116|      0|        EC_ec_pre_comp_free(group->pre_comp.ec);
  117|      0|        break;
  118|  59.4k|    }
  119|  59.4k|    group->pre_comp.ec = NULL;
  120|  59.4k|}
EC_GROUP_free:
  123|   101k|{
  124|   101k|    if (!group)
  ------------------
  |  Branch (124:9): [True: 41.8k, False: 59.4k]
  ------------------
  125|  41.8k|        return;
  126|       |
  127|  59.4k|    if (group->meth->group_finish != 0)
  ------------------
  |  Branch (127:9): [True: 59.4k, False: 0]
  ------------------
  128|  59.4k|        group->meth->group_finish(group);
  129|       |
  130|  59.4k|    EC_pre_comp_free(group);
  131|  59.4k|    BN_MONT_CTX_free(group->mont_data);
  132|  59.4k|    EC_POINT_free(group->generator);
  133|  59.4k|    BN_free(group->order);
  134|  59.4k|    BN_free(group->cofactor);
  135|  59.4k|    OPENSSL_free(group->seed);
  ------------------
  |  |  107|  59.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  59.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  59.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|  59.4k|    OPENSSL_free(group->propq);
  ------------------
  |  |  107|  59.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  59.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  59.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|  59.4k|    OPENSSL_free(group);
  ------------------
  |  |  107|  59.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  59.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  59.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  138|  59.4k|}
EC_GROUP_copy:
  162|  29.7k|{
  163|  29.7k|    if (dest->meth->group_copy == 0) {
  ------------------
  |  Branch (163:9): [True: 0, False: 29.7k]
  ------------------
  164|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  165|      0|        return 0;
  166|      0|    }
  167|  29.7k|    if (dest->meth != src->meth) {
  ------------------
  |  Branch (167:9): [True: 0, False: 29.7k]
  ------------------
  168|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  169|      0|        return 0;
  170|      0|    }
  171|  29.7k|    if (dest == src)
  ------------------
  |  Branch (171:9): [True: 0, False: 29.7k]
  ------------------
  172|      0|        return 1;
  173|       |
  174|  29.7k|    dest->libctx = src->libctx;
  175|  29.7k|    dest->curve_name = src->curve_name;
  176|       |
  177|       |    /* Copy precomputed */
  178|  29.7k|    dest->pre_comp_type = src->pre_comp_type;
  179|  29.7k|    switch (src->pre_comp_type) {
  ------------------
  |  Branch (179:13): [True: 0, False: 29.7k]
  ------------------
  180|  29.7k|    case PCT_none:
  ------------------
  |  Branch (180:5): [True: 29.7k, False: 0]
  ------------------
  181|  29.7k|        dest->pre_comp.ec = NULL;
  182|  29.7k|        break;
  183|      0|    case PCT_nistz256:
  ------------------
  |  Branch (183:5): [True: 0, False: 29.7k]
  ------------------
  184|      0|#ifdef ECP_NISTZ256_ASM
  185|      0|        dest->pre_comp.nistz256 = EC_nistz256_pre_comp_dup(src->pre_comp.nistz256);
  186|      0|#endif
  187|      0|        break;
  188|      0|#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
  189|      0|    case PCT_nistp224:
  ------------------
  |  Branch (189:5): [True: 0, False: 29.7k]
  ------------------
  190|      0|        dest->pre_comp.nistp224 = EC_nistp224_pre_comp_dup(src->pre_comp.nistp224);
  191|      0|        break;
  192|      0|    case PCT_nistp256:
  ------------------
  |  Branch (192:5): [True: 0, False: 29.7k]
  ------------------
  193|      0|        dest->pre_comp.nistp256 = EC_nistp256_pre_comp_dup(src->pre_comp.nistp256);
  194|      0|        break;
  195|      0|    case PCT_nistp384:
  ------------------
  |  Branch (195:5): [True: 0, False: 29.7k]
  ------------------
  196|      0|        dest->pre_comp.nistp384 = ossl_ec_nistp384_pre_comp_dup(src->pre_comp.nistp384);
  197|      0|        break;
  198|      0|    case PCT_nistp521:
  ------------------
  |  Branch (198:5): [True: 0, False: 29.7k]
  ------------------
  199|      0|        dest->pre_comp.nistp521 = EC_nistp521_pre_comp_dup(src->pre_comp.nistp521);
  200|      0|        break;
  201|       |#else
  202|       |    case PCT_nistp224:
  203|       |    case PCT_nistp256:
  204|       |    case PCT_nistp384:
  205|       |    case PCT_nistp521:
  206|       |        break;
  207|       |#endif
  208|      0|    case PCT_ec:
  ------------------
  |  Branch (208:5): [True: 0, False: 29.7k]
  ------------------
  209|      0|        dest->pre_comp.ec = EC_ec_pre_comp_dup(src->pre_comp.ec);
  210|      0|        break;
  211|  29.7k|    }
  212|       |
  213|  29.7k|    if (src->mont_data != NULL) {
  ------------------
  |  Branch (213:9): [True: 29.7k, False: 0]
  ------------------
  214|  29.7k|        if (dest->mont_data == NULL) {
  ------------------
  |  Branch (214:13): [True: 29.7k, False: 0]
  ------------------
  215|  29.7k|            dest->mont_data = BN_MONT_CTX_new();
  216|  29.7k|            if (dest->mont_data == NULL)
  ------------------
  |  Branch (216:17): [True: 0, False: 29.7k]
  ------------------
  217|      0|                return 0;
  218|  29.7k|        }
  219|  29.7k|        if (!BN_MONT_CTX_copy(dest->mont_data, src->mont_data))
  ------------------
  |  Branch (219:13): [True: 0, False: 29.7k]
  ------------------
  220|      0|            return 0;
  221|  29.7k|    } else {
  222|       |        /* src->generator == NULL */
  223|      0|        BN_MONT_CTX_free(dest->mont_data);
  224|      0|        dest->mont_data = NULL;
  225|      0|    }
  226|       |
  227|  29.7k|    if (src->generator != NULL) {
  ------------------
  |  Branch (227:9): [True: 29.7k, False: 0]
  ------------------
  228|  29.7k|        if (dest->generator == NULL) {
  ------------------
  |  Branch (228:13): [True: 29.7k, False: 0]
  ------------------
  229|  29.7k|            dest->generator = EC_POINT_new(dest);
  230|  29.7k|            if (dest->generator == NULL)
  ------------------
  |  Branch (230:17): [True: 0, False: 29.7k]
  ------------------
  231|      0|                return 0;
  232|  29.7k|        }
  233|  29.7k|        if (!EC_POINT_copy(dest->generator, src->generator))
  ------------------
  |  Branch (233:13): [True: 0, False: 29.7k]
  ------------------
  234|      0|            return 0;
  235|  29.7k|    } else {
  236|       |        /* src->generator == NULL */
  237|      0|        EC_POINT_clear_free(dest->generator);
  238|      0|        dest->generator = NULL;
  239|      0|    }
  240|       |
  241|  29.7k|    if ((src->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
  ------------------
  |  |   29|  29.7k|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (241:9): [True: 29.7k, False: 0]
  ------------------
  242|  29.7k|        if (!BN_copy(dest->order, src->order))
  ------------------
  |  Branch (242:13): [True: 0, False: 29.7k]
  ------------------
  243|      0|            return 0;
  244|  29.7k|        if (!BN_copy(dest->cofactor, src->cofactor))
  ------------------
  |  Branch (244:13): [True: 0, False: 29.7k]
  ------------------
  245|      0|            return 0;
  246|  29.7k|    }
  247|       |
  248|  29.7k|    dest->asn1_flag = src->asn1_flag;
  249|  29.7k|    dest->asn1_form = src->asn1_form;
  250|  29.7k|    dest->decoded_from_explicit_params = src->decoded_from_explicit_params;
  251|       |
  252|  29.7k|    if (src->seed) {
  ------------------
  |  Branch (252:9): [True: 18.3k, False: 11.3k]
  ------------------
  253|  18.3k|        OPENSSL_free(dest->seed);
  ------------------
  |  |  107|  18.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  18.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  18.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  254|  18.3k|        if ((dest->seed = OPENSSL_malloc(src->seed_len)) == NULL)
  ------------------
  |  |   97|  18.3k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  18.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  18.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (254:13): [True: 0, False: 18.3k]
  ------------------
  255|      0|            return 0;
  256|  18.3k|        if (!memcpy(dest->seed, src->seed, src->seed_len))
  ------------------
  |  Branch (256:13): [True: 0, False: 18.3k]
  ------------------
  257|      0|            return 0;
  258|  18.3k|        dest->seed_len = src->seed_len;
  259|  18.3k|    } else {
  260|  11.3k|        OPENSSL_free(dest->seed);
  ------------------
  |  |  107|  11.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  11.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  11.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|  11.3k|        dest->seed = NULL;
  262|  11.3k|        dest->seed_len = 0;
  263|  11.3k|    }
  264|       |
  265|  29.7k|    return dest->meth->group_copy(dest, src);
  266|  29.7k|}
EC_GROUP_dup:
  269|  29.7k|{
  270|  29.7k|    EC_GROUP *t = NULL;
  271|  29.7k|    int ok = 0;
  272|       |
  273|  29.7k|    if (a == NULL)
  ------------------
  |  Branch (273:9): [True: 0, False: 29.7k]
  ------------------
  274|      0|        return NULL;
  275|       |
  276|  29.7k|    if ((t = ossl_ec_group_new_ex(a->libctx, a->propq, a->meth)) == NULL)
  ------------------
  |  Branch (276:9): [True: 0, False: 29.7k]
  ------------------
  277|      0|        return NULL;
  278|  29.7k|    if (!EC_GROUP_copy(t, a))
  ------------------
  |  Branch (278:9): [True: 0, False: 29.7k]
  ------------------
  279|      0|        goto err;
  280|       |
  281|  29.7k|    ok = 1;
  282|       |
  283|  29.7k| err:
  284|  29.7k|    if (!ok) {
  ------------------
  |  Branch (284:9): [True: 0, False: 29.7k]
  ------------------
  285|      0|        EC_GROUP_free(t);
  286|      0|        return NULL;
  287|      0|    }
  288|  29.7k|        return t;
  289|  29.7k|}
EC_GROUP_set_generator:
  368|  29.7k|{
  369|  29.7k|    if (generator == NULL) {
  ------------------
  |  Branch (369:9): [True: 0, False: 29.7k]
  ------------------
  370|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  371|      0|        return 0;
  372|      0|    }
  373|       |
  374|       |    /* require group->field >= 1 */
  375|  29.7k|    if (group->field == NULL || BN_is_zero(group->field)
  ------------------
  |  Branch (375:9): [True: 0, False: 29.7k]
  |  Branch (375:33): [True: 0, False: 29.7k]
  ------------------
  376|  29.7k|        || BN_is_negative(group->field)) {
  ------------------
  |  Branch (376:12): [True: 0, False: 29.7k]
  ------------------
  377|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  378|      0|        return 0;
  379|      0|    }
  380|       |
  381|       |    /*-
  382|       |     * - require order >= 1
  383|       |     * - enforce upper bound due to Hasse thm: order can be no more than one bit
  384|       |     *   longer than field cardinality
  385|       |     */
  386|  29.7k|    if (order == NULL || BN_is_zero(order) || BN_is_negative(order)
  ------------------
  |  Branch (386:9): [True: 0, False: 29.7k]
  |  Branch (386:26): [True: 0, False: 29.7k]
  |  Branch (386:47): [True: 0, False: 29.7k]
  ------------------
  387|  29.7k|        || BN_num_bits(order) > BN_num_bits(group->field) + 1) {
  ------------------
  |  Branch (387:12): [True: 0, False: 29.7k]
  ------------------
  388|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  389|      0|        return 0;
  390|      0|    }
  391|       |
  392|       |    /*-
  393|       |     * Unfortunately the cofactor is an optional field in many standards.
  394|       |     * Internally, the lib uses 0 cofactor as a marker for "unknown cofactor".
  395|       |     * So accept cofactor == NULL or cofactor >= 0.
  396|       |     */
  397|  29.7k|    if (cofactor != NULL && BN_is_negative(cofactor)) {
  ------------------
  |  Branch (397:9): [True: 29.7k, False: 0]
  |  Branch (397:29): [True: 0, False: 29.7k]
  ------------------
  398|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  399|      0|        return 0;
  400|      0|    }
  401|       |
  402|  29.7k|    if (group->generator == NULL) {
  ------------------
  |  Branch (402:9): [True: 29.7k, False: 0]
  ------------------
  403|  29.7k|        group->generator = EC_POINT_new(group);
  404|  29.7k|        if (group->generator == NULL)
  ------------------
  |  Branch (404:13): [True: 0, False: 29.7k]
  ------------------
  405|      0|            return 0;
  406|  29.7k|    }
  407|  29.7k|    if (!EC_POINT_copy(group->generator, generator))
  ------------------
  |  Branch (407:9): [True: 0, False: 29.7k]
  ------------------
  408|      0|        return 0;
  409|       |
  410|  29.7k|    if (!BN_copy(group->order, order))
  ------------------
  |  Branch (410:9): [True: 0, False: 29.7k]
  ------------------
  411|      0|        return 0;
  412|       |
  413|       |    /* Either take the provided positive cofactor, or try to compute it */
  414|  29.7k|    if (cofactor != NULL && !BN_is_zero(cofactor)) {
  ------------------
  |  Branch (414:9): [True: 29.7k, False: 0]
  |  Branch (414:29): [True: 29.7k, False: 0]
  ------------------
  415|  29.7k|        if (!BN_copy(group->cofactor, cofactor))
  ------------------
  |  Branch (415:13): [True: 0, False: 29.7k]
  ------------------
  416|      0|            return 0;
  417|  29.7k|    } else if (!ec_guess_cofactor(group)) {
  ------------------
  |  Branch (417:16): [True: 0, False: 0]
  ------------------
  418|      0|        BN_zero(group->cofactor);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  419|      0|        return 0;
  420|      0|    }
  421|       |
  422|       |    /*
  423|       |     * Some groups have an order with
  424|       |     * factors of two, which makes the Montgomery setup fail.
  425|       |     * |group->mont_data| will be NULL in this case.
  426|       |     */
  427|  29.7k|    if (BN_is_odd(group->order)) {
  ------------------
  |  Branch (427:9): [True: 29.7k, False: 0]
  ------------------
  428|  29.7k|        return ec_precompute_mont_data(group);
  429|  29.7k|    }
  430|       |
  431|      0|    BN_MONT_CTX_free(group->mont_data);
  432|      0|    group->mont_data = NULL;
  433|      0|    return 1;
  434|  29.7k|}
EC_GROUP_get0_order:
  457|  18.4k|{
  458|  18.4k|    return group->order;
  459|  18.4k|}
EC_GROUP_order_bits:
  462|  36.9k|{
  463|  36.9k|    return group->meth->group_order_bits(group);
  464|  36.9k|}
EC_GROUP_set_curve_name:
  484|  29.7k|{
  485|  29.7k|    group->curve_name = nid;
  486|  29.7k|    group->asn1_flag =
  487|  29.7k|        (nid != NID_undef)
  ------------------
  |  |   18|  29.7k|#define NID_undef                       0
  ------------------
  |  Branch (487:9): [True: 29.7k, False: 0]
  ------------------
  488|  29.7k|        ? OPENSSL_EC_NAMED_CURVE
  ------------------
  |  |   31|  29.7k|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  489|  29.7k|        : OPENSSL_EC_EXPLICIT_CURVE;
  ------------------
  |  |   30|  29.7k|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
  490|  29.7k|}
EC_GROUP_get_curve_name:
  493|  85.1k|{
  494|  85.1k|    return group->curve_name;
  495|  85.1k|}
EC_GROUP_get_field_type:
  503|  53.5k|{
  504|  53.5k|    return group->meth->field_type;
  505|  53.5k|}
EC_GROUP_set_asn1_flag:
  508|  29.7k|{
  509|  29.7k|    group->asn1_flag = flag;
  510|  29.7k|}
EC_GROUP_get_asn1_flag:
  513|  48.2k|{
  514|  48.2k|    return group->asn1_flag;
  515|  48.2k|}
EC_GROUP_get_point_conversion_form:
  525|  18.4k|{
  526|  18.4k|    return group->asn1_form;
  527|  18.4k|}
EC_GROUP_set_seed:
  530|  18.3k|{
  531|  18.3k|    OPENSSL_free(group->seed);
  ------------------
  |  |  107|  18.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  18.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  18.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  532|  18.3k|    group->seed = NULL;
  533|  18.3k|    group->seed_len = 0;
  534|       |
  535|  18.3k|    if (!len || !p)
  ------------------
  |  Branch (535:9): [True: 0, False: 18.3k]
  |  Branch (535:17): [True: 0, False: 18.3k]
  ------------------
  536|      0|        return 1;
  537|       |
  538|  18.3k|    if ((group->seed = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |   97|  18.3k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  18.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  18.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (538:9): [True: 0, False: 18.3k]
  ------------------
  539|      0|        return 0;
  540|  18.3k|    memcpy(group->seed, p, len);
  541|  18.3k|    group->seed_len = len;
  542|       |
  543|  18.3k|    return len;
  544|  18.3k|}
EC_GROUP_set_curve:
  558|  22.4k|{
  559|  22.4k|    if (group->meth->group_set_curve == 0) {
  ------------------
  |  Branch (559:9): [True: 0, False: 22.4k]
  ------------------
  560|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  561|      0|        return 0;
  562|      0|    }
  563|  22.4k|    return group->meth->group_set_curve(group, p, a, b, ctx);
  564|  22.4k|}
EC_GROUP_get_degree:
  605|  17.4k|{
  606|  17.4k|    if (group->meth->group_get_degree == 0) {
  ------------------
  |  Branch (606:9): [True: 0, False: 17.4k]
  ------------------
  607|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  608|      0|        return 0;
  609|      0|    }
  610|  17.4k|    return group->meth->group_get_degree(group);
  611|  17.4k|}
EC_POINT_new:
  717|   118k|{
  718|   118k|    EC_POINT *ret;
  719|       |
  720|   118k|    if (group == NULL) {
  ------------------
  |  Branch (720:9): [True: 0, False: 118k]
  ------------------
  721|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  722|      0|        return NULL;
  723|      0|    }
  724|   118k|    if (group->meth->point_init == NULL) {
  ------------------
  |  Branch (724:9): [True: 0, False: 118k]
  ------------------
  725|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  726|      0|        return NULL;
  727|      0|    }
  728|       |
  729|   118k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   99|   118k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   118k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   118k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  730|   118k|    if (ret == NULL)
  ------------------
  |  Branch (730:9): [True: 0, False: 118k]
  ------------------
  731|      0|        return NULL;
  732|       |
  733|   118k|    ret->meth = group->meth;
  734|   118k|    ret->curve_name = group->curve_name;
  735|       |
  736|   118k|    if (!ret->meth->point_init(ret)) {
  ------------------
  |  Branch (736:9): [True: 0, False: 118k]
  ------------------
  737|      0|        OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  738|      0|        return NULL;
  739|      0|    }
  740|       |
  741|   118k|    return ret;
  742|   118k|}
EC_POINT_free:
  745|   123k|{
  746|   123k|    if (point == NULL)
  ------------------
  |  Branch (746:9): [True: 4.66k, False: 118k]
  ------------------
  747|  4.66k|        return;
  748|       |
  749|   118k|    if (point->meth->point_finish != 0)
  ------------------
  |  Branch (749:9): [True: 118k, False: 0]
  ------------------
  750|   118k|        point->meth->point_finish(point);
  751|   118k|    OPENSSL_free(point);
  ------------------
  |  |  107|   118k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   118k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   118k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  752|   118k|}
EC_POINT_copy:
  767|  59.4k|{
  768|  59.4k|    if (dest->meth->point_copy == 0) {
  ------------------
  |  Branch (768:9): [True: 0, False: 59.4k]
  ------------------
  769|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  770|      0|        return 0;
  771|      0|    }
  772|  59.4k|    if (dest->meth != src->meth
  ------------------
  |  Branch (772:9): [True: 0, False: 59.4k]
  ------------------
  773|  59.4k|            || (dest->curve_name != src->curve_name
  ------------------
  |  Branch (773:17): [True: 0, False: 59.4k]
  ------------------
  774|  59.4k|                 && dest->curve_name != 0
  ------------------
  |  Branch (774:21): [True: 0, False: 0]
  ------------------
  775|  59.4k|                 && src->curve_name != 0)) {
  ------------------
  |  Branch (775:21): [True: 0, False: 0]
  ------------------
  776|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  777|      0|        return 0;
  778|      0|    }
  779|  59.4k|    if (dest == src)
  ------------------
  |  Branch (779:9): [True: 0, False: 59.4k]
  ------------------
  780|      0|        return 1;
  781|  59.4k|    return dest->meth->point_copy(dest, src);
  782|  59.4k|}
EC_POINT_set_to_infinity:
  811|  2.77k|{
  812|  2.77k|    if (group->meth->point_set_to_infinity == 0) {
  ------------------
  |  Branch (812:9): [True: 0, False: 2.77k]
  ------------------
  813|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  814|      0|        return 0;
  815|      0|    }
  816|  2.77k|    if (group->meth != point->meth) {
  ------------------
  |  Branch (816:9): [True: 0, False: 2.77k]
  ------------------
  817|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  818|      0|        return 0;
  819|      0|    }
  820|  2.77k|    return group->meth->point_set_to_infinity(group, point);
  821|  2.77k|}
EC_POINT_set_Jprojective_coordinates_GFp:
  828|  27.2k|{
  829|  27.2k|    if (group->meth->field_type != NID_X9_62_prime_field) {
  ------------------
  |  |  152|  27.2k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (829:9): [True: 0, False: 27.2k]
  ------------------
  830|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  831|      0|        return 0;
  832|      0|    }
  833|  27.2k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (833:9): [True: 0, False: 27.2k]
  ------------------
  834|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  835|      0|        return 0;
  836|      0|    }
  837|  27.2k|    return ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group, point,
  838|  27.2k|                                                              x, y, z, ctx);
  839|  27.2k|}
EC_POINT_set_affine_coordinates:
  862|  46.3k|{
  863|  46.3k|    if (group->meth->point_set_affine_coordinates == NULL) {
  ------------------
  |  Branch (863:9): [True: 0, False: 46.3k]
  ------------------
  864|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  865|      0|        return 0;
  866|      0|    }
  867|  46.3k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (867:9): [True: 0, False: 46.3k]
  ------------------
  868|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  869|      0|        return 0;
  870|      0|    }
  871|  46.3k|    if (!group->meth->point_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (871:9): [True: 0, False: 46.3k]
  ------------------
  872|      0|        return 0;
  873|       |
  874|  46.3k|    if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
  ------------------
  |  Branch (874:9): [True: 926, False: 45.4k]
  ------------------
  875|    926|        ERR_raise(ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE);
  ------------------
  |  |  401|    926|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    926|    (ERR_new(),                                                 \
  |  |  |  |  404|    926|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    926|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    926|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    926|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    926|     ERR_set_error)
  |  |  ------------------
  ------------------
  876|    926|        return 0;
  877|    926|    }
  878|  45.4k|    return 1;
  879|  46.3k|}
EC_POINT_is_at_infinity:
  979|  46.3k|{
  980|  46.3k|    if (group->meth->is_at_infinity == 0) {
  ------------------
  |  Branch (980:9): [True: 0, False: 46.3k]
  ------------------
  981|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  982|      0|        return 0;
  983|      0|    }
  984|  46.3k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (984:9): [True: 0, False: 46.3k]
  ------------------
  985|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  986|      0|        return 0;
  987|      0|    }
  988|  46.3k|    return group->meth->is_at_infinity(group, point);
  989|  46.3k|}
EC_POINT_is_on_curve:
 1000|  46.3k|{
 1001|  46.3k|    if (group->meth->is_on_curve == 0) {
  ------------------
  |  Branch (1001:9): [True: 0, False: 46.3k]
  ------------------
 1002|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1003|      0|        return 0;
 1004|      0|    }
 1005|  46.3k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (1005:9): [True: 0, False: 46.3k]
  ------------------
 1006|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1007|      0|        return 0;
 1008|      0|    }
 1009|  46.3k|    return group->meth->is_on_curve(group, point, ctx);
 1010|  46.3k|}
ossl_ec_group_simple_order_bits:
 1226|  36.9k|{
 1227|  36.9k|    if (group->order == NULL)
  ------------------
  |  Branch (1227:9): [True: 0, False: 36.9k]
  ------------------
 1228|      0|        return 0;
 1229|  36.9k|    return BN_num_bits(group->order);
 1230|  36.9k|}
EC_GROUP_get_basis_type:
 1322|  8.30k|{
 1323|  8.30k|    int i;
 1324|       |
 1325|  8.30k|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field)
  ------------------
  |  |  156|  8.30k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1325:9): [True: 0, False: 8.30k]
  ------------------
 1326|       |        /* everything else is currently not supported */
 1327|      0|        return 0;
 1328|       |
 1329|       |    /* Find the last non-zero element of group->poly[] */
 1330|  8.30k|    for (i = 0;
 1331|  34.0k|         i < (int)OSSL_NELEM(group->poly) && group->poly[i] != 0;
  ------------------
  |  |   14|  68.0k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1331:10): [True: 34.0k, False: 0]
  |  Branch (1331:46): [True: 25.6k, False: 8.30k]
  ------------------
 1332|  25.6k|         i++)
 1333|  25.6k|        continue;
 1334|       |
 1335|  8.30k|    if (i == 4)
  ------------------
  |  Branch (1335:9): [True: 4.53k, False: 3.77k]
  ------------------
 1336|  4.53k|        return NID_X9_62_ppBasis;
  ------------------
  |  |  172|  4.53k|#define NID_X9_62_ppBasis               683
  ------------------
 1337|  3.77k|    else if (i == 2)
  ------------------
  |  Branch (1337:14): [True: 3.77k, False: 0]
  ------------------
 1338|  3.77k|        return NID_X9_62_tpBasis;
  ------------------
  |  |  168|  3.77k|#define NID_X9_62_tpBasis               682
  ------------------
 1339|      0|    else
 1340|       |        /* everything else is currently not supported */
 1341|      0|        return 0;
 1342|  8.30k|}
EC_GROUP_get_trinomial_basis:
 1346|  3.77k|{
 1347|  3.77k|    if (group == NULL)
  ------------------
  |  Branch (1347:9): [True: 0, False: 3.77k]
  ------------------
 1348|      0|        return 0;
 1349|       |
 1350|  3.77k|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field
  ------------------
  |  |  156|  7.54k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1350:9): [True: 0, False: 3.77k]
  ------------------
 1351|  3.77k|        || !((group->poly[0] != 0) && (group->poly[1] != 0)
  ------------------
  |  Branch (1351:14): [True: 3.77k, False: 0]
  |  Branch (1351:39): [True: 3.77k, False: 0]
  ------------------
 1352|  3.77k|             && (group->poly[2] == 0))) {
  ------------------
  |  Branch (1352:17): [True: 3.77k, False: 0]
  ------------------
 1353|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1354|      0|        return 0;
 1355|      0|    }
 1356|       |
 1357|  3.77k|    if (k)
  ------------------
  |  Branch (1357:9): [True: 3.77k, False: 0]
  ------------------
 1358|  3.77k|        *k = group->poly[1];
 1359|       |
 1360|  3.77k|    return 1;
 1361|  3.77k|}
EC_GROUP_get_pentanomial_basis:
 1365|  4.53k|{
 1366|  4.53k|    if (group == NULL)
  ------------------
  |  Branch (1366:9): [True: 0, False: 4.53k]
  ------------------
 1367|      0|        return 0;
 1368|       |
 1369|  4.53k|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field
  ------------------
  |  |  156|  9.07k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1369:9): [True: 0, False: 4.53k]
  ------------------
 1370|  4.53k|        || !((group->poly[0] != 0) && (group->poly[1] != 0)
  ------------------
  |  Branch (1370:14): [True: 4.53k, False: 0]
  |  Branch (1370:39): [True: 4.53k, False: 0]
  ------------------
 1371|  4.53k|             && (group->poly[2] != 0) && (group->poly[3] != 0)
  ------------------
  |  Branch (1371:17): [True: 4.53k, False: 0]
  |  Branch (1371:42): [True: 4.53k, False: 0]
  ------------------
 1372|  4.53k|             && (group->poly[4] == 0))) {
  ------------------
  |  Branch (1372:17): [True: 4.53k, False: 0]
  ------------------
 1373|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1374|      0|        return 0;
 1375|      0|    }
 1376|       |
 1377|  4.53k|    if (k1)
  ------------------
  |  Branch (1377:9): [True: 4.53k, False: 0]
  ------------------
 1378|  4.53k|        *k1 = group->poly[3];
 1379|  4.53k|    if (k2)
  ------------------
  |  Branch (1379:9): [True: 4.53k, False: 0]
  ------------------
 1380|  4.53k|        *k2 = group->poly[2];
 1381|  4.53k|    if (k3)
  ------------------
  |  Branch (1381:9): [True: 4.53k, False: 0]
  ------------------
 1382|  4.53k|        *k3 = group->poly[1];
 1383|       |
 1384|  4.53k|    return 1;
 1385|  4.53k|}
ec_lib.c:ec_precompute_mont_data:
 1185|  29.7k|{
 1186|  29.7k|    BN_CTX *ctx = BN_CTX_new_ex(group->libctx);
 1187|  29.7k|    int ret = 0;
 1188|       |
 1189|  29.7k|    BN_MONT_CTX_free(group->mont_data);
 1190|  29.7k|    group->mont_data = NULL;
 1191|       |
 1192|  29.7k|    if (ctx == NULL)
  ------------------
  |  Branch (1192:9): [True: 0, False: 29.7k]
  ------------------
 1193|      0|        goto err;
 1194|       |
 1195|  29.7k|    group->mont_data = BN_MONT_CTX_new();
 1196|  29.7k|    if (group->mont_data == NULL)
  ------------------
  |  Branch (1196:9): [True: 0, False: 29.7k]
  ------------------
 1197|      0|        goto err;
 1198|       |
 1199|  29.7k|    if (!BN_MONT_CTX_set(group->mont_data, group->order, ctx)) {
  ------------------
  |  Branch (1199:9): [True: 0, False: 29.7k]
  ------------------
 1200|      0|        BN_MONT_CTX_free(group->mont_data);
 1201|      0|        group->mont_data = NULL;
 1202|      0|        goto err;
 1203|      0|    }
 1204|       |
 1205|  29.7k|    ret = 1;
 1206|       |
 1207|  29.7k| err:
 1208|       |
 1209|  29.7k|    BN_CTX_free(ctx);
 1210|  29.7k|    return ret;
 1211|  29.7k|}

ec_lib.c:ec_point_is_compat:
  328|   166k|{
  329|   166k|    return group->meth == point->meth
  ------------------
  |  Branch (329:12): [True: 166k, False: 0]
  ------------------
  330|   166k|           && (group->curve_name == 0
  ------------------
  |  Branch (330:16): [True: 0, False: 166k]
  ------------------
  331|   166k|               || point->curve_name == 0
  ------------------
  |  Branch (331:19): [True: 0, False: 166k]
  ------------------
  332|   166k|               || group->curve_name == point->curve_name);
  ------------------
  |  Branch (332:19): [True: 166k, False: 0]
  ------------------
  333|   166k|}
ec_oct.c:ec_point_is_compat:
  328|  52.1k|{
  329|  52.1k|    return group->meth == point->meth
  ------------------
  |  Branch (329:12): [True: 52.1k, False: 0]
  ------------------
  330|  52.1k|           && (group->curve_name == 0
  ------------------
  |  Branch (330:16): [True: 0, False: 52.1k]
  ------------------
  331|  52.1k|               || point->curve_name == 0
  ------------------
  |  Branch (331:19): [True: 0, False: 52.1k]
  ------------------
  332|  52.1k|               || group->curve_name == point->curve_name);
  ------------------
  |  Branch (332:19): [True: 52.1k, False: 0]
  ------------------
  333|  52.1k|}

EC_POINT_set_compressed_coordinates:
   26|  22.4k|{
   27|  22.4k|    if (group->meth->point_set_compressed_coordinates == NULL
  ------------------
  |  Branch (27:9): [True: 22.4k, False: 0]
  ------------------
   28|  22.4k|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|  22.4k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (28:12): [True: 0, False: 22.4k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   30|      0|        return 0;
   31|      0|    }
   32|  22.4k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (32:9): [True: 0, False: 22.4k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   34|      0|        return 0;
   35|      0|    }
   36|  22.4k|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|  22.4k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (36:9): [True: 22.4k, False: 0]
  ------------------
   37|  22.4k|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|  22.4k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (37:13): [True: 14.6k, False: 7.75k]
  ------------------
   38|  14.6k|            return ossl_ec_GFp_simple_set_compressed_coordinates(group, point, x,
   39|  14.6k|                                                                 y_bit, ctx);
   40|  7.75k|        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|  7.75k|            return ossl_ec_GF2m_simple_set_compressed_coordinates(group, point,
   48|  7.75k|                                                                  x, y_bit, ctx);
   49|  22.4k|#endif
   50|  22.4k|    }
   51|      0|    return group->meth->point_set_compressed_coordinates(group, point, x,
   52|      0|                                                         y_bit, ctx);
   53|  22.4k|}
EC_POINT_oct2point:
  107|  29.7k|{
  108|  29.7k|    if (group->meth->oct2point == 0
  ------------------
  |  Branch (108:9): [True: 29.7k, False: 0]
  ------------------
  109|  29.7k|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|  29.7k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (109:12): [True: 0, False: 29.7k]
  ------------------
  110|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  111|      0|        return 0;
  112|      0|    }
  113|  29.7k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (113:9): [True: 0, False: 29.7k]
  ------------------
  114|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  115|      0|        return 0;
  116|      0|    }
  117|  29.7k|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|  29.7k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (117:9): [True: 29.7k, False: 0]
  ------------------
  118|  29.7k|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|  29.7k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (118:13): [True: 17.4k, False: 12.2k]
  ------------------
  119|  17.4k|            return ossl_ec_GFp_simple_oct2point(group, point, buf, len, ctx);
  120|  12.2k|        else
  121|       |#ifdef OPENSSL_NO_EC2M
  122|       |        {
  123|       |            ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
  124|       |            return 0;
  125|       |        }
  126|       |#else
  127|  12.2k|            return ossl_ec_GF2m_simple_oct2point(group, point, buf, len, ctx);
  128|  29.7k|#endif
  129|  29.7k|    }
  130|      0|    return group->meth->oct2point(group, point, buf, len, ctx);
  131|  29.7k|}

EC_GFp_mont_method:
   22|  10.2k|{
   23|  10.2k|    static const EC_METHOD ret = {
   24|  10.2k|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|  10.2k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
   25|  10.2k|        NID_X9_62_prime_field,
  ------------------
  |  |  152|  10.2k|#define NID_X9_62_prime_field           406
  ------------------
   26|  10.2k|        ossl_ec_GFp_mont_group_init,
   27|  10.2k|        ossl_ec_GFp_mont_group_finish,
   28|  10.2k|        ossl_ec_GFp_mont_group_clear_finish,
   29|  10.2k|        ossl_ec_GFp_mont_group_copy,
   30|  10.2k|        ossl_ec_GFp_mont_group_set_curve,
   31|  10.2k|        ossl_ec_GFp_simple_group_get_curve,
   32|  10.2k|        ossl_ec_GFp_simple_group_get_degree,
   33|  10.2k|        ossl_ec_group_simple_order_bits,
   34|  10.2k|        ossl_ec_GFp_simple_group_check_discriminant,
   35|  10.2k|        ossl_ec_GFp_simple_point_init,
   36|  10.2k|        ossl_ec_GFp_simple_point_finish,
   37|  10.2k|        ossl_ec_GFp_simple_point_clear_finish,
   38|  10.2k|        ossl_ec_GFp_simple_point_copy,
   39|  10.2k|        ossl_ec_GFp_simple_point_set_to_infinity,
   40|  10.2k|        ossl_ec_GFp_simple_point_set_affine_coordinates,
   41|  10.2k|        ossl_ec_GFp_simple_point_get_affine_coordinates,
   42|  10.2k|        0, 0, 0,
   43|  10.2k|        ossl_ec_GFp_simple_add,
   44|  10.2k|        ossl_ec_GFp_simple_dbl,
   45|  10.2k|        ossl_ec_GFp_simple_invert,
   46|  10.2k|        ossl_ec_GFp_simple_is_at_infinity,
   47|  10.2k|        ossl_ec_GFp_simple_is_on_curve,
   48|  10.2k|        ossl_ec_GFp_simple_cmp,
   49|  10.2k|        ossl_ec_GFp_simple_make_affine,
   50|  10.2k|        ossl_ec_GFp_simple_points_make_affine,
   51|  10.2k|        0 /* mul */ ,
   52|  10.2k|        0 /* precompute_mult */ ,
   53|  10.2k|        0 /* have_precompute_mult */ ,
   54|  10.2k|        ossl_ec_GFp_mont_field_mul,
   55|  10.2k|        ossl_ec_GFp_mont_field_sqr,
   56|  10.2k|        0 /* field_div */ ,
   57|  10.2k|        ossl_ec_GFp_mont_field_inv,
   58|  10.2k|        ossl_ec_GFp_mont_field_encode,
   59|  10.2k|        ossl_ec_GFp_mont_field_decode,
   60|  10.2k|        ossl_ec_GFp_mont_field_set_to_one,
   61|  10.2k|        ossl_ec_key_simple_priv2oct,
   62|  10.2k|        ossl_ec_key_simple_oct2priv,
   63|  10.2k|        0, /* set private */
   64|  10.2k|        ossl_ec_key_simple_generate_key,
   65|  10.2k|        ossl_ec_key_simple_check_key,
   66|  10.2k|        ossl_ec_key_simple_generate_public_key,
   67|  10.2k|        0, /* keycopy */
   68|  10.2k|        0, /* keyfinish */
   69|  10.2k|        ossl_ecdh_simple_compute_key,
   70|  10.2k|        ossl_ecdsa_simple_sign_setup,
   71|  10.2k|        ossl_ecdsa_simple_sign_sig,
   72|  10.2k|        ossl_ecdsa_simple_verify_sig,
   73|  10.2k|        0, /* field_inverse_mod_ord */
   74|  10.2k|        ossl_ec_GFp_simple_blind_coordinates,
   75|  10.2k|        ossl_ec_GFp_simple_ladder_pre,
   76|  10.2k|        ossl_ec_GFp_simple_ladder_step,
   77|  10.2k|        ossl_ec_GFp_simple_ladder_post
   78|  10.2k|    };
   79|       |
   80|  10.2k|    return &ret;
   81|  10.2k|}
ossl_ec_GFp_mont_group_init:
   84|  20.4k|{
   85|  20.4k|    int ok;
   86|       |
   87|  20.4k|    ok = ossl_ec_GFp_simple_group_init(group);
   88|  20.4k|    group->field_data1 = NULL;
   89|  20.4k|    group->field_data2 = NULL;
   90|  20.4k|    return ok;
   91|  20.4k|}
ossl_ec_GFp_mont_group_finish:
   94|  20.4k|{
   95|  20.4k|    BN_MONT_CTX_free(group->field_data1);
   96|  20.4k|    group->field_data1 = NULL;
   97|  20.4k|    BN_free(group->field_data2);
   98|  20.4k|    group->field_data2 = NULL;
   99|  20.4k|    ossl_ec_GFp_simple_group_finish(group);
  100|  20.4k|}
ossl_ec_GFp_mont_group_copy:
  112|  10.2k|{
  113|  10.2k|    BN_MONT_CTX_free(dest->field_data1);
  114|  10.2k|    dest->field_data1 = NULL;
  115|  10.2k|    BN_clear_free(dest->field_data2);
  116|  10.2k|    dest->field_data2 = NULL;
  117|       |
  118|  10.2k|    if (!ossl_ec_GFp_simple_group_copy(dest, src))
  ------------------
  |  Branch (118:9): [True: 0, False: 10.2k]
  ------------------
  119|      0|        return 0;
  120|       |
  121|  10.2k|    if (src->field_data1 != NULL) {
  ------------------
  |  Branch (121:9): [True: 10.2k, False: 0]
  ------------------
  122|  10.2k|        dest->field_data1 = BN_MONT_CTX_new();
  123|  10.2k|        if (dest->field_data1 == NULL)
  ------------------
  |  Branch (123:13): [True: 0, False: 10.2k]
  ------------------
  124|      0|            return 0;
  125|  10.2k|        if (!BN_MONT_CTX_copy(dest->field_data1, src->field_data1))
  ------------------
  |  Branch (125:13): [True: 0, False: 10.2k]
  ------------------
  126|      0|            goto err;
  127|  10.2k|    }
  128|  10.2k|    if (src->field_data2 != NULL) {
  ------------------
  |  Branch (128:9): [True: 10.2k, False: 0]
  ------------------
  129|  10.2k|        dest->field_data2 = BN_dup(src->field_data2);
  130|  10.2k|        if (dest->field_data2 == NULL)
  ------------------
  |  Branch (130:13): [True: 0, False: 10.2k]
  ------------------
  131|      0|            goto err;
  132|  10.2k|    }
  133|       |
  134|  10.2k|    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|  10.2k|}
ossl_ec_GFp_mont_group_set_curve:
  145|  10.2k|{
  146|  10.2k|    BN_CTX *new_ctx = NULL;
  147|  10.2k|    BN_MONT_CTX *mont = NULL;
  148|  10.2k|    BIGNUM *one = NULL;
  149|  10.2k|    int ret = 0;
  150|       |
  151|  10.2k|    BN_MONT_CTX_free(group->field_data1);
  152|  10.2k|    group->field_data1 = NULL;
  153|  10.2k|    BN_free(group->field_data2);
  154|  10.2k|    group->field_data2 = NULL;
  155|       |
  156|  10.2k|    if (ctx == NULL) {
  ------------------
  |  Branch (156:9): [True: 0, False: 10.2k]
  ------------------
  157|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  158|      0|        if (ctx == NULL)
  ------------------
  |  Branch (158:13): [True: 0, False: 0]
  ------------------
  159|      0|            return 0;
  160|      0|    }
  161|       |
  162|  10.2k|    mont = BN_MONT_CTX_new();
  163|  10.2k|    if (mont == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 10.2k]
  ------------------
  164|      0|        goto err;
  165|  10.2k|    if (!BN_MONT_CTX_set(mont, p, ctx)) {
  ------------------
  |  Branch (165:9): [True: 0, False: 10.2k]
  ------------------
  166|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  167|      0|        goto err;
  168|      0|    }
  169|  10.2k|    one = BN_new();
  170|  10.2k|    if (one == NULL)
  ------------------
  |  Branch (170:9): [True: 0, False: 10.2k]
  ------------------
  171|      0|        goto err;
  172|  10.2k|    if (!BN_to_montgomery(one, BN_value_one(), mont, ctx))
  ------------------
  |  Branch (172:9): [True: 0, False: 10.2k]
  ------------------
  173|      0|        goto err;
  174|       |
  175|  10.2k|    group->field_data1 = mont;
  176|  10.2k|    mont = NULL;
  177|  10.2k|    group->field_data2 = one;
  178|  10.2k|    one = NULL;
  179|       |
  180|  10.2k|    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
  181|       |
  182|  10.2k|    if (!ret) {
  ------------------
  |  Branch (182:9): [True: 0, False: 10.2k]
  ------------------
  183|      0|        BN_MONT_CTX_free(group->field_data1);
  184|      0|        group->field_data1 = NULL;
  185|      0|        BN_free(group->field_data2);
  186|      0|        group->field_data2 = NULL;
  187|      0|    }
  188|       |
  189|  10.2k| err:
  190|  10.2k|    BN_free(one);
  191|  10.2k|    BN_CTX_free(new_ctx);
  192|  10.2k|    BN_MONT_CTX_free(mont);
  193|  10.2k|    return ret;
  194|  10.2k|}
ossl_ec_GFp_mont_field_mul:
  198|  14.0k|{
  199|  14.0k|    if (group->field_data1 == NULL) {
  ------------------
  |  Branch (199:9): [True: 0, False: 14.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  201|      0|        return 0;
  202|      0|    }
  203|       |
  204|  14.0k|    return BN_mod_mul_montgomery(r, a, b, group->field_data1, ctx);
  205|  14.0k|}
ossl_ec_GFp_mont_field_sqr:
  209|  28.1k|{
  210|  28.1k|    if (group->field_data1 == NULL) {
  ------------------
  |  Branch (210:9): [True: 0, False: 28.1k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  212|      0|        return 0;
  213|      0|    }
  214|       |
  215|  28.1k|    return BN_mod_mul_montgomery(r, a, a, group->field_data1, ctx);
  216|  28.1k|}
ossl_ec_GFp_mont_field_encode:
  269|  48.6k|{
  270|  48.6k|    if (group->field_data1 == NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 48.6k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        return 0;
  273|      0|    }
  274|       |
  275|  48.6k|    return BN_to_montgomery(r, a, (BN_MONT_CTX *)group->field_data1, ctx);
  276|  48.6k|}
ossl_ec_GFp_mont_field_decode:
  280|  13.0k|{
  281|  13.0k|    if (group->field_data1 == NULL) {
  ------------------
  |  Branch (281:9): [True: 0, False: 13.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  283|      0|        return 0;
  284|      0|    }
  285|       |
  286|  13.0k|    return BN_from_montgomery(r, a, group->field_data1, ctx);
  287|  13.0k|}
ossl_ec_GFp_mont_field_set_to_one:
  291|  14.0k|{
  292|  14.0k|    if (group->field_data2 == NULL) {
  ------------------
  |  Branch (292:9): [True: 0, False: 14.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  294|      0|        return 0;
  295|      0|    }
  296|       |
  297|  14.0k|    if (!BN_copy(r, group->field_data2))
  ------------------
  |  Branch (297:9): [True: 0, False: 14.0k]
  ------------------
  298|      0|        return 0;
  299|  14.0k|    return 1;
  300|  14.0k|}

ossl_ec_GFp_nist_group_copy:
   86|  7.25k|{
   87|  7.25k|    dest->field_mod_func = src->field_mod_func;
   88|       |
   89|  7.25k|    return ossl_ec_GFp_simple_group_copy(dest, src);
   90|  7.25k|}
ossl_ec_GFp_nist_field_mul:
  130|  20.0k|{
  131|  20.0k|    int ret = 0;
  132|  20.0k|    BN_CTX *ctx_new = NULL;
  133|       |
  134|  20.0k|    if (!group || !r || !a || !b) {
  ------------------
  |  Branch (134:9): [True: 0, False: 20.0k]
  |  Branch (134:19): [True: 0, False: 20.0k]
  |  Branch (134:25): [True: 0, False: 20.0k]
  |  Branch (134:31): [True: 0, False: 20.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  136|      0|        goto err;
  137|      0|    }
  138|  20.0k|    if (!ctx)
  ------------------
  |  Branch (138:9): [True: 0, False: 20.0k]
  ------------------
  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|  20.0k|    if (!BN_mul(r, a, b, ctx))
  ------------------
  |  Branch (142:9): [True: 0, False: 20.0k]
  ------------------
  143|      0|        goto err;
  144|  20.0k|    if (!group->field_mod_func(r, r, group->field, ctx))
  ------------------
  |  Branch (144:9): [True: 0, False: 20.0k]
  ------------------
  145|      0|        goto err;
  146|       |
  147|  20.0k|    ret = 1;
  148|  20.0k| err:
  149|  20.0k|    BN_CTX_free(ctx_new);
  150|  20.0k|    return ret;
  151|  20.0k|}
ossl_ec_GFp_nist_field_sqr:
  155|  33.1k|{
  156|  33.1k|    int ret = 0;
  157|  33.1k|    BN_CTX *ctx_new = NULL;
  158|       |
  159|  33.1k|    if (!group || !r || !a) {
  ------------------
  |  Branch (159:9): [True: 0, False: 33.1k]
  |  Branch (159:19): [True: 0, False: 33.1k]
  |  Branch (159:25): [True: 0, False: 33.1k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  161|      0|        goto err;
  162|      0|    }
  163|  33.1k|    if (!ctx)
  ------------------
  |  Branch (163:9): [True: 0, False: 33.1k]
  ------------------
  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|  33.1k|    if (!BN_sqr(r, a, ctx))
  ------------------
  |  Branch (167:9): [True: 0, False: 33.1k]
  ------------------
  168|      0|        goto err;
  169|  33.1k|    if (!group->field_mod_func(r, r, group->field, ctx))
  ------------------
  |  Branch (169:9): [True: 0, False: 33.1k]
  ------------------
  170|      0|        goto err;
  171|       |
  172|  33.1k|    ret = 1;
  173|  33.1k| err:
  174|  33.1k|    BN_CTX_free(ctx_new);
  175|  33.1k|    return ret;
  176|  33.1k|}

EC_GFp_nistp224_method:
  244|  4.76k|{
  245|  4.76k|    static const EC_METHOD ret = {
  246|  4.76k|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|  4.76k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  247|  4.76k|        NID_X9_62_prime_field,
  ------------------
  |  |  152|  4.76k|#define NID_X9_62_prime_field           406
  ------------------
  248|  4.76k|        ossl_ec_GFp_nistp224_group_init,
  249|  4.76k|        ossl_ec_GFp_simple_group_finish,
  250|  4.76k|        ossl_ec_GFp_simple_group_clear_finish,
  251|  4.76k|        ossl_ec_GFp_nist_group_copy,
  252|  4.76k|        ossl_ec_GFp_nistp224_group_set_curve,
  253|  4.76k|        ossl_ec_GFp_simple_group_get_curve,
  254|  4.76k|        ossl_ec_GFp_simple_group_get_degree,
  255|  4.76k|        ossl_ec_group_simple_order_bits,
  256|  4.76k|        ossl_ec_GFp_simple_group_check_discriminant,
  257|  4.76k|        ossl_ec_GFp_simple_point_init,
  258|  4.76k|        ossl_ec_GFp_simple_point_finish,
  259|  4.76k|        ossl_ec_GFp_simple_point_clear_finish,
  260|  4.76k|        ossl_ec_GFp_simple_point_copy,
  261|  4.76k|        ossl_ec_GFp_simple_point_set_to_infinity,
  262|  4.76k|        ossl_ec_GFp_simple_point_set_affine_coordinates,
  263|  4.76k|        ossl_ec_GFp_nistp224_point_get_affine_coordinates,
  264|  4.76k|        0 /* point_set_compressed_coordinates */ ,
  265|  4.76k|        0 /* point2oct */ ,
  266|  4.76k|        0 /* oct2point */ ,
  267|  4.76k|        ossl_ec_GFp_simple_add,
  268|  4.76k|        ossl_ec_GFp_simple_dbl,
  269|  4.76k|        ossl_ec_GFp_simple_invert,
  270|  4.76k|        ossl_ec_GFp_simple_is_at_infinity,
  271|  4.76k|        ossl_ec_GFp_simple_is_on_curve,
  272|  4.76k|        ossl_ec_GFp_simple_cmp,
  273|  4.76k|        ossl_ec_GFp_simple_make_affine,
  274|  4.76k|        ossl_ec_GFp_simple_points_make_affine,
  275|  4.76k|        ossl_ec_GFp_nistp224_points_mul,
  276|  4.76k|        ossl_ec_GFp_nistp224_precompute_mult,
  277|  4.76k|        ossl_ec_GFp_nistp224_have_precompute_mult,
  278|  4.76k|        ossl_ec_GFp_nist_field_mul,
  279|  4.76k|        ossl_ec_GFp_nist_field_sqr,
  280|  4.76k|        0 /* field_div */ ,
  281|  4.76k|        ossl_ec_GFp_simple_field_inv,
  282|  4.76k|        0 /* field_encode */ ,
  283|  4.76k|        0 /* field_decode */ ,
  284|  4.76k|        0,                      /* field_set_to_one */
  285|  4.76k|        ossl_ec_key_simple_priv2oct,
  286|  4.76k|        ossl_ec_key_simple_oct2priv,
  287|  4.76k|        0, /* set private */
  288|  4.76k|        ossl_ec_key_simple_generate_key,
  289|  4.76k|        ossl_ec_key_simple_check_key,
  290|  4.76k|        ossl_ec_key_simple_generate_public_key,
  291|  4.76k|        0, /* keycopy */
  292|  4.76k|        0, /* keyfinish */
  293|  4.76k|        ossl_ecdh_simple_compute_key,
  294|  4.76k|        ossl_ecdsa_simple_sign_setup,
  295|  4.76k|        ossl_ecdsa_simple_sign_sig,
  296|  4.76k|        ossl_ecdsa_simple_verify_sig,
  297|  4.76k|        0, /* field_inverse_mod_ord */
  298|  4.76k|        0, /* blind_coordinates */
  299|  4.76k|        0, /* ladder_pre */
  300|  4.76k|        0, /* ladder_step */
  301|  4.76k|        0  /* ladder_post */
  302|  4.76k|    };
  303|       |
  304|  4.76k|    return &ret;
  305|  4.76k|}
ossl_ec_GFp_nistp224_group_init:
 1282|  9.53k|{
 1283|  9.53k|    int ret;
 1284|  9.53k|    ret = ossl_ec_GFp_simple_group_init(group);
 1285|  9.53k|    group->a_is_minus3 = 1;
 1286|  9.53k|    return ret;
 1287|  9.53k|}
ossl_ec_GFp_nistp224_group_set_curve:
 1292|  4.76k|{
 1293|  4.76k|    int ret = 0;
 1294|  4.76k|    BIGNUM *curve_p, *curve_a, *curve_b;
 1295|  4.76k|#ifndef FIPS_MODULE
 1296|  4.76k|    BN_CTX *new_ctx = NULL;
 1297|       |
 1298|  4.76k|    if (ctx == NULL)
  ------------------
  |  Branch (1298:9): [True: 0, False: 4.76k]
  ------------------
 1299|      0|        ctx = new_ctx = BN_CTX_new();
 1300|  4.76k|#endif
 1301|  4.76k|    if (ctx == NULL)
  ------------------
  |  Branch (1301:9): [True: 0, False: 4.76k]
  ------------------
 1302|      0|        return 0;
 1303|       |
 1304|  4.76k|    BN_CTX_start(ctx);
 1305|  4.76k|    curve_p = BN_CTX_get(ctx);
 1306|  4.76k|    curve_a = BN_CTX_get(ctx);
 1307|  4.76k|    curve_b = BN_CTX_get(ctx);
 1308|  4.76k|    if (curve_b == NULL)
  ------------------
  |  Branch (1308:9): [True: 0, False: 4.76k]
  ------------------
 1309|      0|        goto err;
 1310|  4.76k|    BN_bin2bn(nistp224_curve_params[0], sizeof(felem_bytearray), curve_p);
 1311|  4.76k|    BN_bin2bn(nistp224_curve_params[1], sizeof(felem_bytearray), curve_a);
 1312|  4.76k|    BN_bin2bn(nistp224_curve_params[2], sizeof(felem_bytearray), curve_b);
 1313|  4.76k|    if ((BN_cmp(curve_p, p)) || (BN_cmp(curve_a, a)) || (BN_cmp(curve_b, b))) {
  ------------------
  |  Branch (1313:9): [True: 0, False: 4.76k]
  |  Branch (1313:33): [True: 0, False: 4.76k]
  |  Branch (1313:57): [True: 0, False: 4.76k]
  ------------------
 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1315|      0|        goto err;
 1316|      0|    }
 1317|  4.76k|    group->field_mod_func = BN_nist_mod_224;
 1318|  4.76k|    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
 1319|  4.76k| err:
 1320|  4.76k|    BN_CTX_end(ctx);
 1321|  4.76k|#ifndef FIPS_MODULE
 1322|  4.76k|    BN_CTX_free(new_ctx);
 1323|  4.76k|#endif
 1324|  4.76k|    return ret;
 1325|  4.76k|}

ossl_ec_GFp_nistp384_method:
 1464|  1.03k|{
 1465|  1.03k|    static const EC_METHOD ret = {
 1466|  1.03k|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|  1.03k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
 1467|  1.03k|        NID_X9_62_prime_field,
  ------------------
  |  |  152|  1.03k|#define NID_X9_62_prime_field           406
  ------------------
 1468|  1.03k|        ossl_ec_GFp_nistp384_group_init,
 1469|  1.03k|        ossl_ec_GFp_simple_group_finish,
 1470|  1.03k|        ossl_ec_GFp_simple_group_clear_finish,
 1471|  1.03k|        ossl_ec_GFp_nist_group_copy,
 1472|  1.03k|        ossl_ec_GFp_nistp384_group_set_curve,
 1473|  1.03k|        ossl_ec_GFp_simple_group_get_curve,
 1474|  1.03k|        ossl_ec_GFp_simple_group_get_degree,
 1475|  1.03k|        ossl_ec_group_simple_order_bits,
 1476|  1.03k|        ossl_ec_GFp_simple_group_check_discriminant,
 1477|  1.03k|        ossl_ec_GFp_simple_point_init,
 1478|  1.03k|        ossl_ec_GFp_simple_point_finish,
 1479|  1.03k|        ossl_ec_GFp_simple_point_clear_finish,
 1480|  1.03k|        ossl_ec_GFp_simple_point_copy,
 1481|  1.03k|        ossl_ec_GFp_simple_point_set_to_infinity,
 1482|  1.03k|        ossl_ec_GFp_simple_point_set_affine_coordinates,
 1483|  1.03k|        ossl_ec_GFp_nistp384_point_get_affine_coordinates,
 1484|  1.03k|        0, /* point_set_compressed_coordinates */
 1485|  1.03k|        0, /* point2oct */
 1486|  1.03k|        0, /* oct2point */
 1487|  1.03k|        ossl_ec_GFp_simple_add,
 1488|  1.03k|        ossl_ec_GFp_simple_dbl,
 1489|  1.03k|        ossl_ec_GFp_simple_invert,
 1490|  1.03k|        ossl_ec_GFp_simple_is_at_infinity,
 1491|  1.03k|        ossl_ec_GFp_simple_is_on_curve,
 1492|  1.03k|        ossl_ec_GFp_simple_cmp,
 1493|  1.03k|        ossl_ec_GFp_simple_make_affine,
 1494|  1.03k|        ossl_ec_GFp_simple_points_make_affine,
 1495|  1.03k|        ossl_ec_GFp_nistp384_points_mul,
 1496|  1.03k|        ossl_ec_GFp_nistp384_precompute_mult,
 1497|  1.03k|        ossl_ec_GFp_nistp384_have_precompute_mult,
 1498|  1.03k|        ossl_ec_GFp_nist_field_mul,
 1499|  1.03k|        ossl_ec_GFp_nist_field_sqr,
 1500|  1.03k|        0, /* field_div */
 1501|  1.03k|        ossl_ec_GFp_simple_field_inv,
 1502|  1.03k|        0, /* field_encode */
 1503|  1.03k|        0, /* field_decode */
 1504|  1.03k|        0, /* field_set_to_one */
 1505|  1.03k|        ossl_ec_key_simple_priv2oct,
 1506|  1.03k|        ossl_ec_key_simple_oct2priv,
 1507|  1.03k|        0, /* set private */
 1508|  1.03k|        ossl_ec_key_simple_generate_key,
 1509|  1.03k|        ossl_ec_key_simple_check_key,
 1510|  1.03k|        ossl_ec_key_simple_generate_public_key,
 1511|  1.03k|        0, /* keycopy */
 1512|  1.03k|        0, /* keyfinish */
 1513|  1.03k|        ossl_ecdh_simple_compute_key,
 1514|  1.03k|        ossl_ecdsa_simple_sign_setup,
 1515|  1.03k|        ossl_ecdsa_simple_sign_sig,
 1516|  1.03k|        ossl_ecdsa_simple_verify_sig,
 1517|  1.03k|        0, /* field_inverse_mod_ord */
 1518|  1.03k|        0, /* blind_coordinates */
 1519|  1.03k|        0, /* ladder_pre */
 1520|  1.03k|        0, /* ladder_step */
 1521|  1.03k|        0  /* ladder_post */
 1522|  1.03k|    };
 1523|       |
 1524|  1.03k|    return &ret;
 1525|  1.03k|}
ossl_ec_GFp_nistp384_group_init:
 1578|  2.07k|{
 1579|  2.07k|    int ret;
 1580|       |
 1581|  2.07k|    ret = ossl_ec_GFp_simple_group_init(group);
 1582|  2.07k|    group->a_is_minus3 = 1;
 1583|  2.07k|    return ret;
 1584|  2.07k|}
ossl_ec_GFp_nistp384_group_set_curve:
 1589|  1.03k|{
 1590|  1.03k|    int ret = 0;
 1591|  1.03k|    BIGNUM *curve_p, *curve_a, *curve_b;
 1592|  1.03k|#ifndef FIPS_MODULE
 1593|  1.03k|    BN_CTX *new_ctx = NULL;
 1594|       |
 1595|  1.03k|    if (ctx == NULL)
  ------------------
  |  Branch (1595:9): [True: 0, False: 1.03k]
  ------------------
 1596|      0|        ctx = new_ctx = BN_CTX_new();
 1597|  1.03k|#endif
 1598|  1.03k|    if (ctx == NULL)
  ------------------
  |  Branch (1598:9): [True: 0, False: 1.03k]
  ------------------
 1599|      0|        return 0;
 1600|       |
 1601|  1.03k|    BN_CTX_start(ctx);
 1602|  1.03k|    curve_p = BN_CTX_get(ctx);
 1603|  1.03k|    curve_a = BN_CTX_get(ctx);
 1604|  1.03k|    curve_b = BN_CTX_get(ctx);
 1605|  1.03k|    if (curve_b == NULL)
  ------------------
  |  Branch (1605:9): [True: 0, False: 1.03k]
  ------------------
 1606|      0|        goto err;
 1607|  1.03k|    BN_bin2bn(nistp384_curve_params[0], sizeof(felem_bytearray), curve_p);
 1608|  1.03k|    BN_bin2bn(nistp384_curve_params[1], sizeof(felem_bytearray), curve_a);
 1609|  1.03k|    BN_bin2bn(nistp384_curve_params[2], sizeof(felem_bytearray), curve_b);
 1610|  1.03k|    if ((BN_cmp(curve_p, p)) || (BN_cmp(curve_a, a)) || (BN_cmp(curve_b, b))) {
  ------------------
  |  Branch (1610:9): [True: 0, False: 1.03k]
  |  Branch (1610:33): [True: 0, False: 1.03k]
  |  Branch (1610:57): [True: 0, False: 1.03k]
  ------------------
 1611|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1612|      0|        goto err;
 1613|      0|    }
 1614|  1.03k|    group->field_mod_func = BN_nist_mod_384;
 1615|  1.03k|    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
 1616|  1.03k| err:
 1617|  1.03k|    BN_CTX_end(ctx);
 1618|  1.03k|#ifndef FIPS_MODULE
 1619|  1.03k|    BN_CTX_free(new_ctx);
 1620|  1.03k|#endif
 1621|  1.03k|    return ret;
 1622|  1.03k|}

EC_GFp_nistp521_method:
 1671|  1.44k|{
 1672|  1.44k|    static const EC_METHOD ret = {
 1673|  1.44k|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|  1.44k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
 1674|  1.44k|        NID_X9_62_prime_field,
  ------------------
  |  |  152|  1.44k|#define NID_X9_62_prime_field           406
  ------------------
 1675|  1.44k|        ossl_ec_GFp_nistp521_group_init,
 1676|  1.44k|        ossl_ec_GFp_simple_group_finish,
 1677|  1.44k|        ossl_ec_GFp_simple_group_clear_finish,
 1678|  1.44k|        ossl_ec_GFp_nist_group_copy,
 1679|  1.44k|        ossl_ec_GFp_nistp521_group_set_curve,
 1680|  1.44k|        ossl_ec_GFp_simple_group_get_curve,
 1681|  1.44k|        ossl_ec_GFp_simple_group_get_degree,
 1682|  1.44k|        ossl_ec_group_simple_order_bits,
 1683|  1.44k|        ossl_ec_GFp_simple_group_check_discriminant,
 1684|  1.44k|        ossl_ec_GFp_simple_point_init,
 1685|  1.44k|        ossl_ec_GFp_simple_point_finish,
 1686|  1.44k|        ossl_ec_GFp_simple_point_clear_finish,
 1687|  1.44k|        ossl_ec_GFp_simple_point_copy,
 1688|  1.44k|        ossl_ec_GFp_simple_point_set_to_infinity,
 1689|  1.44k|        ossl_ec_GFp_simple_point_set_affine_coordinates,
 1690|  1.44k|        ossl_ec_GFp_nistp521_point_get_affine_coordinates,
 1691|  1.44k|        0 /* point_set_compressed_coordinates */ ,
 1692|  1.44k|        0 /* point2oct */ ,
 1693|  1.44k|        0 /* oct2point */ ,
 1694|  1.44k|        ossl_ec_GFp_simple_add,
 1695|  1.44k|        ossl_ec_GFp_simple_dbl,
 1696|  1.44k|        ossl_ec_GFp_simple_invert,
 1697|  1.44k|        ossl_ec_GFp_simple_is_at_infinity,
 1698|  1.44k|        ossl_ec_GFp_simple_is_on_curve,
 1699|  1.44k|        ossl_ec_GFp_simple_cmp,
 1700|  1.44k|        ossl_ec_GFp_simple_make_affine,
 1701|  1.44k|        ossl_ec_GFp_simple_points_make_affine,
 1702|  1.44k|        ossl_ec_GFp_nistp521_points_mul,
 1703|  1.44k|        ossl_ec_GFp_nistp521_precompute_mult,
 1704|  1.44k|        ossl_ec_GFp_nistp521_have_precompute_mult,
 1705|  1.44k|        ossl_ec_GFp_nist_field_mul,
 1706|  1.44k|        ossl_ec_GFp_nist_field_sqr,
 1707|  1.44k|        0 /* field_div */ ,
 1708|  1.44k|        ossl_ec_GFp_simple_field_inv,
 1709|  1.44k|        0 /* field_encode */ ,
 1710|  1.44k|        0 /* field_decode */ ,
 1711|  1.44k|        0,                      /* field_set_to_one */
 1712|  1.44k|        ossl_ec_key_simple_priv2oct,
 1713|  1.44k|        ossl_ec_key_simple_oct2priv,
 1714|  1.44k|        0, /* set private */
 1715|  1.44k|        ossl_ec_key_simple_generate_key,
 1716|  1.44k|        ossl_ec_key_simple_check_key,
 1717|  1.44k|        ossl_ec_key_simple_generate_public_key,
 1718|  1.44k|        0, /* keycopy */
 1719|  1.44k|        0, /* keyfinish */
 1720|  1.44k|        ossl_ecdh_simple_compute_key,
 1721|  1.44k|        ossl_ecdsa_simple_sign_setup,
 1722|  1.44k|        ossl_ecdsa_simple_sign_sig,
 1723|  1.44k|        ossl_ecdsa_simple_verify_sig,
 1724|  1.44k|        0, /* field_inverse_mod_ord */
 1725|  1.44k|        0, /* blind_coordinates */
 1726|  1.44k|        0, /* ladder_pre */
 1727|  1.44k|        0, /* ladder_step */
 1728|  1.44k|        0  /* ladder_post */
 1729|  1.44k|    };
 1730|       |
 1731|  1.44k|    return &ret;
 1732|  1.44k|}
ossl_ec_GFp_nistp521_group_init:
 1784|  2.89k|{
 1785|  2.89k|    int ret;
 1786|  2.89k|    ret = ossl_ec_GFp_simple_group_init(group);
 1787|  2.89k|    group->a_is_minus3 = 1;
 1788|  2.89k|    return ret;
 1789|  2.89k|}
ossl_ec_GFp_nistp521_group_set_curve:
 1794|  1.44k|{
 1795|  1.44k|    int ret = 0;
 1796|  1.44k|    BIGNUM *curve_p, *curve_a, *curve_b;
 1797|  1.44k|#ifndef FIPS_MODULE
 1798|  1.44k|    BN_CTX *new_ctx = NULL;
 1799|       |
 1800|  1.44k|    if (ctx == NULL)
  ------------------
  |  Branch (1800:9): [True: 0, False: 1.44k]
  ------------------
 1801|      0|        ctx = new_ctx = BN_CTX_new();
 1802|  1.44k|#endif
 1803|  1.44k|    if (ctx == NULL)
  ------------------
  |  Branch (1803:9): [True: 0, False: 1.44k]
  ------------------
 1804|      0|        return 0;
 1805|       |
 1806|  1.44k|    BN_CTX_start(ctx);
 1807|  1.44k|    curve_p = BN_CTX_get(ctx);
 1808|  1.44k|    curve_a = BN_CTX_get(ctx);
 1809|  1.44k|    curve_b = BN_CTX_get(ctx);
 1810|  1.44k|    if (curve_b == NULL)
  ------------------
  |  Branch (1810:9): [True: 0, False: 1.44k]
  ------------------
 1811|      0|        goto err;
 1812|  1.44k|    BN_bin2bn(nistp521_curve_params[0], sizeof(felem_bytearray), curve_p);
 1813|  1.44k|    BN_bin2bn(nistp521_curve_params[1], sizeof(felem_bytearray), curve_a);
 1814|  1.44k|    BN_bin2bn(nistp521_curve_params[2], sizeof(felem_bytearray), curve_b);
 1815|  1.44k|    if ((BN_cmp(curve_p, p)) || (BN_cmp(curve_a, a)) || (BN_cmp(curve_b, b))) {
  ------------------
  |  Branch (1815:9): [True: 0, False: 1.44k]
  |  Branch (1815:33): [True: 0, False: 1.44k]
  |  Branch (1815:57): [True: 0, False: 1.44k]
  ------------------
 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1817|      0|        goto err;
 1818|      0|    }
 1819|  1.44k|    group->field_mod_func = BN_nist_mod_521;
 1820|  1.44k|    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
 1821|  1.44k| err:
 1822|  1.44k|    BN_CTX_end(ctx);
 1823|  1.44k|#ifndef FIPS_MODULE
 1824|  1.44k|    BN_CTX_free(new_ctx);
 1825|  1.44k|#endif
 1826|  1.44k|    return ret;
 1827|  1.44k|}

EC_GFp_nistz256_method:
 1449|      8|{
 1450|      8|    static const EC_METHOD ret = {
 1451|      8|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|      8|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
 1452|      8|        NID_X9_62_prime_field,
  ------------------
  |  |  152|      8|#define NID_X9_62_prime_field           406
  ------------------
 1453|      8|        ossl_ec_GFp_mont_group_init,
 1454|      8|        ossl_ec_GFp_mont_group_finish,
 1455|      8|        ossl_ec_GFp_mont_group_clear_finish,
 1456|      8|        ossl_ec_GFp_mont_group_copy,
 1457|      8|        ossl_ec_GFp_mont_group_set_curve,
 1458|      8|        ossl_ec_GFp_simple_group_get_curve,
 1459|      8|        ossl_ec_GFp_simple_group_get_degree,
 1460|      8|        ossl_ec_group_simple_order_bits,
 1461|      8|        ossl_ec_GFp_simple_group_check_discriminant,
 1462|      8|        ossl_ec_GFp_simple_point_init,
 1463|      8|        ossl_ec_GFp_simple_point_finish,
 1464|      8|        ossl_ec_GFp_simple_point_clear_finish,
 1465|      8|        ossl_ec_GFp_simple_point_copy,
 1466|      8|        ossl_ec_GFp_simple_point_set_to_infinity,
 1467|      8|        ossl_ec_GFp_simple_point_set_affine_coordinates,
 1468|      8|        ecp_nistz256_get_affine,
 1469|      8|        0, 0, 0,
 1470|      8|        ossl_ec_GFp_simple_add,
 1471|      8|        ossl_ec_GFp_simple_dbl,
 1472|      8|        ossl_ec_GFp_simple_invert,
 1473|      8|        ossl_ec_GFp_simple_is_at_infinity,
 1474|      8|        ossl_ec_GFp_simple_is_on_curve,
 1475|      8|        ossl_ec_GFp_simple_cmp,
 1476|      8|        ossl_ec_GFp_simple_make_affine,
 1477|      8|        ossl_ec_GFp_simple_points_make_affine,
 1478|      8|        ecp_nistz256_points_mul,                    /* mul */
 1479|      8|        ecp_nistz256_mult_precompute,               /* precompute_mult */
 1480|      8|        ecp_nistz256_window_have_precompute_mult,   /* have_precompute_mult */
 1481|      8|        ossl_ec_GFp_mont_field_mul,
 1482|      8|        ossl_ec_GFp_mont_field_sqr,
 1483|      8|        0,                                          /* field_div */
 1484|      8|        ossl_ec_GFp_mont_field_inv,
 1485|      8|        ossl_ec_GFp_mont_field_encode,
 1486|      8|        ossl_ec_GFp_mont_field_decode,
 1487|      8|        ossl_ec_GFp_mont_field_set_to_one,
 1488|      8|        ossl_ec_key_simple_priv2oct,
 1489|      8|        ossl_ec_key_simple_oct2priv,
 1490|      8|        0, /* set private */
 1491|      8|        ossl_ec_key_simple_generate_key,
 1492|      8|        ossl_ec_key_simple_check_key,
 1493|      8|        ossl_ec_key_simple_generate_public_key,
 1494|      8|        0, /* keycopy */
 1495|      8|        0, /* keyfinish */
 1496|      8|        ossl_ecdh_simple_compute_key,
 1497|      8|        ossl_ecdsa_simple_sign_setup,
 1498|      8|        ossl_ecdsa_simple_sign_sig,
 1499|      8|        ossl_ecdsa_simple_verify_sig,
 1500|      8|        ecp_nistz256_inv_mod_ord,                   /* can be #define-d NULL */
 1501|      8|        0,                                          /* blind_coordinates */
 1502|      8|        0,                                          /* ladder_pre */
 1503|      8|        0,                                          /* ladder_step */
 1504|      8|        0                                           /* ladder_post */
 1505|      8|    };
 1506|       |
 1507|      8|    return &ret;
 1508|      8|}

ossl_ec_GFp_simple_set_compressed_coordinates:
   26|  14.6k|{
   27|  14.6k|    BN_CTX *new_ctx = NULL;
   28|  14.6k|    BIGNUM *tmp1, *tmp2, *x, *y;
   29|  14.6k|    int ret = 0;
   30|       |
   31|  14.6k|    if (ctx == NULL) {
  ------------------
  |  Branch (31:9): [True: 0, False: 14.6k]
  ------------------
   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|  14.6k|    y_bit = (y_bit != 0);
   38|       |
   39|  14.6k|    BN_CTX_start(ctx);
   40|  14.6k|    tmp1 = BN_CTX_get(ctx);
   41|  14.6k|    tmp2 = BN_CTX_get(ctx);
   42|  14.6k|    x = BN_CTX_get(ctx);
   43|  14.6k|    y = BN_CTX_get(ctx);
   44|  14.6k|    if (y == NULL)
  ------------------
  |  Branch (44:9): [True: 0, False: 14.6k]
  ------------------
   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|  14.6k|    if (!BN_nnmod(x, x_, group->field, ctx))
  ------------------
  |  Branch (54:9): [True: 0, False: 14.6k]
  ------------------
   55|      0|        goto err;
   56|  14.6k|    if (group->meth->field_decode == 0) {
  ------------------
  |  Branch (56:9): [True: 6.82k, False: 7.84k]
  ------------------
   57|       |        /* field_{sqr,mul} work on standard representation */
   58|  6.82k|        if (!group->meth->field_sqr(group, tmp2, x_, ctx))
  ------------------
  |  Branch (58:13): [True: 0, False: 6.82k]
  ------------------
   59|      0|            goto err;
   60|  6.82k|        if (!group->meth->field_mul(group, tmp1, tmp2, x_, ctx))
  ------------------
  |  Branch (60:13): [True: 0, False: 6.82k]
  ------------------
   61|      0|            goto err;
   62|  7.84k|    } else {
   63|  7.84k|        if (!BN_mod_sqr(tmp2, x_, group->field, ctx))
  ------------------
  |  Branch (63:13): [True: 0, False: 7.84k]
  ------------------
   64|      0|            goto err;
   65|  7.84k|        if (!BN_mod_mul(tmp1, tmp2, x_, group->field, ctx))
  ------------------
  |  Branch (65:13): [True: 0, False: 7.84k]
  ------------------
   66|      0|            goto err;
   67|  7.84k|    }
   68|       |
   69|       |    /* tmp1 := tmp1 + a*x */
   70|  14.6k|    if (group->a_is_minus3) {
  ------------------
  |  Branch (70:9): [True: 9.47k, False: 5.19k]
  ------------------
   71|  9.47k|        if (!BN_mod_lshift1_quick(tmp2, x, group->field))
  ------------------
  |  Branch (71:13): [True: 0, False: 9.47k]
  ------------------
   72|      0|            goto err;
   73|  9.47k|        if (!BN_mod_add_quick(tmp2, tmp2, x, group->field))
  ------------------
  |  Branch (73:13): [True: 0, False: 9.47k]
  ------------------
   74|      0|            goto err;
   75|  9.47k|        if (!BN_mod_sub_quick(tmp1, tmp1, tmp2, group->field))
  ------------------
  |  Branch (75:13): [True: 0, False: 9.47k]
  ------------------
   76|      0|            goto err;
   77|  9.47k|    } else {
   78|  5.19k|        if (group->meth->field_decode) {
  ------------------
  |  Branch (78:13): [True: 5.19k, False: 0]
  ------------------
   79|  5.19k|            if (!group->meth->field_decode(group, tmp2, group->a, ctx))
  ------------------
  |  Branch (79:17): [True: 0, False: 5.19k]
  ------------------
   80|      0|                goto err;
   81|  5.19k|            if (!BN_mod_mul(tmp2, tmp2, x, group->field, ctx))
  ------------------
  |  Branch (81:17): [True: 0, False: 5.19k]
  ------------------
   82|      0|                goto err;
   83|  5.19k|        } 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|  5.19k|        if (!BN_mod_add_quick(tmp1, tmp1, tmp2, group->field))
  ------------------
  |  Branch (89:13): [True: 0, False: 5.19k]
  ------------------
   90|      0|            goto err;
   91|  5.19k|    }
   92|       |
   93|       |    /* tmp1 := tmp1 + b */
   94|  14.6k|    if (group->meth->field_decode) {
  ------------------
  |  Branch (94:9): [True: 7.84k, False: 6.82k]
  ------------------
   95|  7.84k|        if (!group->meth->field_decode(group, tmp2, group->b, ctx))
  ------------------
  |  Branch (95:13): [True: 0, False: 7.84k]
  ------------------
   96|      0|            goto err;
   97|  7.84k|        if (!BN_mod_add_quick(tmp1, tmp1, tmp2, group->field))
  ------------------
  |  Branch (97:13): [True: 0, False: 7.84k]
  ------------------
   98|      0|            goto err;
   99|  7.84k|    } else {
  100|  6.82k|        if (!BN_mod_add_quick(tmp1, tmp1, group->b, group->field))
  ------------------
  |  Branch (100:13): [True: 0, False: 6.82k]
  ------------------
  101|      0|            goto err;
  102|  6.82k|    }
  103|       |
  104|  14.6k|    ERR_set_mark();
  105|  14.6k|    if (!BN_mod_sqrt(y, tmp1, group->field, ctx)) {
  ------------------
  |  Branch (105:9): [True: 4.92k, False: 9.74k]
  ------------------
  106|  4.92k|#ifndef FIPS_MODULE
  107|  4.92k|        unsigned long err = ERR_peek_last_error();
  108|       |
  109|  4.92k|        if (ERR_GET_LIB(err) == ERR_LIB_BN
  ------------------
  |  |   73|  9.85k|# define ERR_LIB_BN              3
  ------------------
  |  Branch (109:13): [True: 4.92k, False: 0]
  ------------------
  110|  4.92k|            && ERR_GET_REASON(err) == BN_R_NOT_A_SQUARE) {
  ------------------
  |  |   36|  4.92k|# define BN_R_NOT_A_SQUARE                                111
  ------------------
  |  Branch (110:16): [True: 4.92k, False: 0]
  ------------------
  111|  4.92k|            ERR_pop_to_mark();
  112|  4.92k|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT);
  ------------------
  |  |  401|  4.92k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  4.92k|    (ERR_new(),                                                 \
  |  |  |  |  404|  4.92k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  4.92k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  4.92k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  4.92k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  4.92k|     ERR_set_error)
  |  |  ------------------
  ------------------
  113|  4.92k|        } else
  114|      0|#endif
  115|      0|        {
  116|      0|            ERR_clear_last_mark();
  117|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  118|      0|        }
  119|  4.92k|        goto err;
  120|  4.92k|    }
  121|  9.74k|    ERR_clear_last_mark();
  122|       |
  123|  9.74k|    if (y_bit != BN_is_odd(y)) {
  ------------------
  |  Branch (123:9): [True: 4.88k, False: 4.86k]
  ------------------
  124|  4.88k|        if (BN_is_zero(y)) {
  ------------------
  |  Branch (124:13): [True: 0, False: 4.88k]
  ------------------
  125|      0|            int kron;
  126|       |
  127|      0|            kron = BN_kronecker(x, group->field, ctx);
  128|      0|            if (kron == -2)
  ------------------
  |  Branch (128:17): [True: 0, False: 0]
  ------------------
  129|      0|                goto err;
  130|       |
  131|      0|            if (kron == 1)
  ------------------
  |  Branch (131:17): [True: 0, False: 0]
  ------------------
  132|      0|                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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  133|      0|            else
  134|       |                /*
  135|       |                 * BN_mod_sqrt() should have caught this error (not a square)
  136|       |                 */
  137|      0|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  138|      0|            goto err;
  139|      0|        }
  140|  4.88k|        if (!BN_usub(y, group->field, y))
  ------------------
  |  Branch (140:13): [True: 0, False: 4.88k]
  ------------------
  141|      0|            goto err;
  142|  4.88k|    }
  143|  9.74k|    if (y_bit != BN_is_odd(y)) {
  ------------------
  |  Branch (143:9): [True: 0, False: 9.74k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  145|      0|        goto err;
  146|      0|    }
  147|       |
  148|  9.74k|    if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (148:9): [True: 0, False: 9.74k]
  ------------------
  149|      0|        goto err;
  150|       |
  151|  9.74k|    ret = 1;
  152|       |
  153|  14.6k| err:
  154|  14.6k|    BN_CTX_end(ctx);
  155|  14.6k|    BN_CTX_free(new_ctx);
  156|  14.6k|    return ret;
  157|  9.74k|}
ossl_ec_GFp_simple_oct2point:
  277|  17.4k|{
  278|  17.4k|    point_conversion_form_t form;
  279|  17.4k|    int y_bit;
  280|  17.4k|    BN_CTX *new_ctx = NULL;
  281|  17.4k|    BIGNUM *x, *y;
  282|  17.4k|    size_t field_len, enc_len;
  283|  17.4k|    int ret = 0;
  284|       |
  285|  17.4k|    if (len == 0) {
  ------------------
  |  Branch (285:9): [True: 127, False: 17.3k]
  ------------------
  286|    127|        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|    127|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    127|    (ERR_new(),                                                 \
  |  |  |  |  404|    127|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    127|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    127|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    127|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    127|     ERR_set_error)
  |  |  ------------------
  ------------------
  287|    127|        return 0;
  288|    127|    }
  289|  17.3k|    form = buf[0];
  290|  17.3k|    y_bit = form & 1;
  291|  17.3k|    form = form & ~1U;
  292|  17.3k|    if ((form != 0) && (form != POINT_CONVERSION_COMPRESSED)
  ------------------
  |  Branch (292:9): [True: 16.5k, False: 836]
  |  Branch (292:24): [True: 278, False: 16.2k]
  ------------------
  293|  17.3k|        && (form != POINT_CONVERSION_UNCOMPRESSED)
  ------------------
  |  Branch (293:12): [True: 240, False: 38]
  ------------------
  294|  17.3k|        && (form != POINT_CONVERSION_HYBRID)) {
  ------------------
  |  Branch (294:12): [True: 161, False: 79]
  ------------------
  295|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    161|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    161|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    161|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    161|     ERR_set_error)
  |  |  ------------------
  ------------------
  296|    161|        return 0;
  297|    161|    }
  298|  17.1k|    if ((form == 0 || form == POINT_CONVERSION_UNCOMPRESSED) && y_bit) {
  ------------------
  |  Branch (298:10): [True: 836, False: 16.3k]
  |  Branch (298:23): [True: 38, False: 16.3k]
  |  Branch (298:65): [True: 328, False: 546]
  ------------------
  299|    328|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|    328|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    328|    (ERR_new(),                                                 \
  |  |  |  |  404|    328|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    328|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    328|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    328|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    328|     ERR_set_error)
  |  |  ------------------
  ------------------
  300|    328|        return 0;
  301|    328|    }
  302|       |
  303|  16.8k|    if (form == 0) {
  ------------------
  |  Branch (303:9): [True: 508, False: 16.3k]
  ------------------
  304|    508|        if (len != 1) {
  ------------------
  |  Branch (304:13): [True: 89, False: 419]
  ------------------
  305|     89|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     89|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     89|    (ERR_new(),                                                 \
  |  |  |  |  404|     89|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     89|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     89|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     89|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     89|     ERR_set_error)
  |  |  ------------------
  ------------------
  306|     89|            return 0;
  307|     89|        }
  308|       |
  309|    419|        return EC_POINT_set_to_infinity(group, point);
  310|    508|    }
  311|       |
  312|  16.3k|    field_len = BN_num_bytes(group->field);
  ------------------
  |  |  189|  16.3k|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  313|  16.3k|    enc_len =
  314|  16.3k|        (form ==
  ------------------
  |  Branch (314:9): [True: 16.2k, False: 117]
  ------------------
  315|  16.3k|         POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;
  316|       |
  317|  16.3k|    if (len != enc_len) {
  ------------------
  |  Branch (317:9): [True: 1.50k, False: 14.8k]
  ------------------
  318|  1.50k|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|  1.50k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.50k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.50k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  1.50k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  1.50k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  1.50k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.50k|     ERR_set_error)
  |  |  ------------------
  ------------------
  319|  1.50k|        return 0;
  320|  1.50k|    }
  321|       |
  322|  14.8k|    if (ctx == NULL) {
  ------------------
  |  Branch (322:9): [True: 14.8k, False: 0]
  ------------------
  323|  14.8k|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  324|  14.8k|        if (ctx == NULL)
  ------------------
  |  Branch (324:13): [True: 0, False: 14.8k]
  ------------------
  325|      0|            return 0;
  326|  14.8k|    }
  327|       |
  328|  14.8k|    BN_CTX_start(ctx);
  329|  14.8k|    x = BN_CTX_get(ctx);
  330|  14.8k|    y = BN_CTX_get(ctx);
  331|  14.8k|    if (y == NULL)
  ------------------
  |  Branch (331:9): [True: 0, False: 14.8k]
  ------------------
  332|      0|        goto err;
  333|       |
  334|  14.8k|    if (!BN_bin2bn(buf + 1, field_len, x))
  ------------------
  |  Branch (334:9): [True: 0, False: 14.8k]
  ------------------
  335|      0|        goto err;
  336|  14.8k|    if (BN_ucmp(x, group->field) >= 0) {
  ------------------
  |  Branch (336:9): [True: 82, False: 14.7k]
  ------------------
  337|     82|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     82|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     82|    (ERR_new(),                                                 \
  |  |  |  |  404|     82|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     82|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     82|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     82|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     82|     ERR_set_error)
  |  |  ------------------
  ------------------
  338|     82|        goto err;
  339|     82|    }
  340|       |
  341|  14.7k|    if (form == POINT_CONVERSION_COMPRESSED) {
  ------------------
  |  Branch (341:9): [True: 14.6k, False: 94]
  ------------------
  342|  14.6k|        if (!EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx))
  ------------------
  |  Branch (342:13): [True: 4.92k, False: 9.74k]
  ------------------
  343|  4.92k|            goto err;
  344|  14.6k|    } else {
  345|     94|        if (!BN_bin2bn(buf + 1 + field_len, field_len, y))
  ------------------
  |  Branch (345:13): [True: 0, False: 94]
  ------------------
  346|      0|            goto err;
  347|     94|        if (BN_ucmp(y, group->field) >= 0) {
  ------------------
  |  Branch (347:13): [True: 10, False: 84]
  ------------------
  348|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     10|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     10|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     10|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     10|     ERR_set_error)
  |  |  ------------------
  ------------------
  349|     10|            goto err;
  350|     10|        }
  351|     84|        if (form == POINT_CONVERSION_HYBRID) {
  ------------------
  |  Branch (351:13): [True: 64, False: 20]
  ------------------
  352|     64|            if (y_bit != BN_is_odd(y)) {
  ------------------
  |  Branch (352:17): [True: 51, False: 13]
  ------------------
  353|     51|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     51|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     51|    (ERR_new(),                                                 \
  |  |  |  |  404|     51|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     51|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     51|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     51|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     51|     ERR_set_error)
  |  |  ------------------
  ------------------
  354|     51|                goto err;
  355|     51|            }
  356|     64|        }
  357|       |
  358|       |        /*
  359|       |         * EC_POINT_set_affine_coordinates is responsible for checking that
  360|       |         * the point is on the curve.
  361|       |         */
  362|     33|        if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (362:13): [True: 32, False: 1]
  ------------------
  363|     32|            goto err;
  364|     33|    }
  365|       |
  366|  9.74k|    ret = 1;
  367|       |
  368|  14.8k| err:
  369|  14.8k|    BN_CTX_end(ctx);
  370|  14.8k|    BN_CTX_free(new_ctx);
  371|  14.8k|    return ret;
  372|  9.74k|}

ossl_ec_GFp_simple_group_init:
   99|  34.9k|{
  100|  34.9k|    group->field = BN_new();
  101|  34.9k|    group->a = BN_new();
  102|  34.9k|    group->b = BN_new();
  103|  34.9k|    if (group->field == NULL || group->a == NULL || group->b == NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 34.9k]
  |  Branch (103:33): [True: 0, False: 34.9k]
  |  Branch (103:53): [True: 0, False: 34.9k]
  ------------------
  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|  34.9k|    group->a_is_minus3 = 0;
  110|  34.9k|    return 1;
  111|  34.9k|}
ossl_ec_GFp_simple_group_finish:
  114|  34.9k|{
  115|  34.9k|    BN_free(group->field);
  116|  34.9k|    BN_free(group->a);
  117|  34.9k|    BN_free(group->b);
  118|  34.9k|}
ossl_ec_GFp_simple_group_copy:
  128|  17.4k|{
  129|  17.4k|    if (!BN_copy(dest->field, src->field))
  ------------------
  |  Branch (129:9): [True: 0, False: 17.4k]
  ------------------
  130|      0|        return 0;
  131|  17.4k|    if (!BN_copy(dest->a, src->a))
  ------------------
  |  Branch (131:9): [True: 0, False: 17.4k]
  ------------------
  132|      0|        return 0;
  133|  17.4k|    if (!BN_copy(dest->b, src->b))
  ------------------
  |  Branch (133:9): [True: 0, False: 17.4k]
  ------------------
  134|      0|        return 0;
  135|       |
  136|  17.4k|    dest->a_is_minus3 = src->a_is_minus3;
  137|       |
  138|  17.4k|    return 1;
  139|  17.4k|}
ossl_ec_GFp_simple_group_set_curve:
  144|  17.4k|{
  145|  17.4k|    int ret = 0;
  146|  17.4k|    BN_CTX *new_ctx = NULL;
  147|  17.4k|    BIGNUM *tmp_a;
  148|       |
  149|       |    /* p must be a prime > 3 */
  150|  17.4k|    if (BN_num_bits(p) <= 2 || !BN_is_odd(p)) {
  ------------------
  |  Branch (150:9): [True: 0, False: 17.4k]
  |  Branch (150:32): [True: 0, False: 17.4k]
  ------------------
  151|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  152|      0|        return 0;
  153|      0|    }
  154|       |
  155|  17.4k|    if (ctx == NULL) {
  ------------------
  |  Branch (155:9): [True: 0, False: 17.4k]
  ------------------
  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|  17.4k|    BN_CTX_start(ctx);
  162|  17.4k|    tmp_a = BN_CTX_get(ctx);
  163|  17.4k|    if (tmp_a == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 17.4k]
  ------------------
  164|      0|        goto err;
  165|       |
  166|       |    /* group->field */
  167|  17.4k|    if (!BN_copy(group->field, p))
  ------------------
  |  Branch (167:9): [True: 0, False: 17.4k]
  ------------------
  168|      0|        goto err;
  169|  17.4k|    BN_set_negative(group->field, 0);
  170|       |
  171|       |    /* group->a */
  172|  17.4k|    if (!BN_nnmod(tmp_a, a, p, ctx))
  ------------------
  |  Branch (172:9): [True: 0, False: 17.4k]
  ------------------
  173|      0|        goto err;
  174|  17.4k|    if (group->meth->field_encode != NULL) {
  ------------------
  |  Branch (174:9): [True: 10.2k, False: 7.25k]
  ------------------
  175|  10.2k|        if (!group->meth->field_encode(group, group->a, tmp_a, ctx))
  ------------------
  |  Branch (175:13): [True: 0, False: 10.2k]
  ------------------
  176|      0|            goto err;
  177|  10.2k|    } else if (!BN_copy(group->a, tmp_a))
  ------------------
  |  Branch (177:16): [True: 0, False: 7.25k]
  ------------------
  178|      0|        goto err;
  179|       |
  180|       |    /* group->b */
  181|  17.4k|    if (!BN_nnmod(group->b, b, p, ctx))
  ------------------
  |  Branch (181:9): [True: 0, False: 17.4k]
  ------------------
  182|      0|        goto err;
  183|  17.4k|    if (group->meth->field_encode != NULL)
  ------------------
  |  Branch (183:9): [True: 10.2k, False: 7.25k]
  ------------------
  184|  10.2k|        if (!group->meth->field_encode(group, group->b, group->b, ctx))
  ------------------
  |  Branch (184:13): [True: 0, False: 10.2k]
  ------------------
  185|      0|            goto err;
  186|       |
  187|       |    /* group->a_is_minus3 */
  188|  17.4k|    if (!BN_add_word(tmp_a, 3))
  ------------------
  |  Branch (188:9): [True: 0, False: 17.4k]
  ------------------
  189|      0|        goto err;
  190|  17.4k|    group->a_is_minus3 = (0 == BN_cmp(tmp_a, group->field));
  191|       |
  192|  17.4k|    ret = 1;
  193|       |
  194|  17.4k| err:
  195|  17.4k|    BN_CTX_end(ctx);
  196|  17.4k|    BN_CTX_free(new_ctx);
  197|  17.4k|    return ret;
  198|  17.4k|}
ossl_ec_GFp_simple_point_init:
  323|  69.9k|{
  324|  69.9k|    point->X = BN_new();
  325|  69.9k|    point->Y = BN_new();
  326|  69.9k|    point->Z = BN_new();
  327|  69.9k|    point->Z_is_one = 0;
  328|       |
  329|  69.9k|    if (point->X == NULL || point->Y == NULL || point->Z == NULL) {
  ------------------
  |  Branch (329:9): [True: 0, False: 69.9k]
  |  Branch (329:29): [True: 0, False: 69.9k]
  |  Branch (329:49): [True: 0, False: 69.9k]
  ------------------
  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|  69.9k|    return 1;
  336|  69.9k|}
ossl_ec_GFp_simple_point_finish:
  339|  69.9k|{
  340|  69.9k|    BN_free(point->X);
  341|  69.9k|    BN_free(point->Y);
  342|  69.9k|    BN_free(point->Z);
  343|  69.9k|}
ossl_ec_GFp_simple_point_copy:
  354|  34.9k|{
  355|  34.9k|    if (!BN_copy(dest->X, src->X))
  ------------------
  |  Branch (355:9): [True: 0, False: 34.9k]
  ------------------
  356|      0|        return 0;
  357|  34.9k|    if (!BN_copy(dest->Y, src->Y))
  ------------------
  |  Branch (357:9): [True: 0, False: 34.9k]
  ------------------
  358|      0|        return 0;
  359|  34.9k|    if (!BN_copy(dest->Z, src->Z))
  ------------------
  |  Branch (359:9): [True: 0, False: 34.9k]
  ------------------
  360|      0|        return 0;
  361|  34.9k|    dest->Z_is_one = src->Z_is_one;
  362|  34.9k|    dest->curve_name = src->curve_name;
  363|       |
  364|  34.9k|    return 1;
  365|  34.9k|}
ossl_ec_GFp_simple_point_set_to_infinity:
  369|    419|{
  370|    419|    point->Z_is_one = 0;
  371|    419|    BN_zero(point->Z);
  ------------------
  |  |  202|    419|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  372|    419|    return 1;
  373|    419|}
ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp:
  381|  27.2k|{
  382|  27.2k|    BN_CTX *new_ctx = NULL;
  383|  27.2k|    int ret = 0;
  384|       |
  385|  27.2k|    if (ctx == NULL) {
  ------------------
  |  Branch (385:9): [True: 0, False: 27.2k]
  ------------------
  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|  27.2k|    if (x != NULL) {
  ------------------
  |  Branch (391:9): [True: 27.2k, False: 0]
  ------------------
  392|  27.2k|        if (!BN_nnmod(point->X, x, group->field, ctx))
  ------------------
  |  Branch (392:13): [True: 0, False: 27.2k]
  ------------------
  393|      0|            goto err;
  394|  27.2k|        if (group->meth->field_encode) {
  ------------------
  |  Branch (394:13): [True: 14.0k, False: 13.1k]
  ------------------
  395|  14.0k|            if (!group->meth->field_encode(group, point->X, point->X, ctx))
  ------------------
  |  Branch (395:17): [True: 0, False: 14.0k]
  ------------------
  396|      0|                goto err;
  397|  14.0k|        }
  398|  27.2k|    }
  399|       |
  400|  27.2k|    if (y != NULL) {
  ------------------
  |  Branch (400:9): [True: 27.2k, False: 0]
  ------------------
  401|  27.2k|        if (!BN_nnmod(point->Y, y, group->field, ctx))
  ------------------
  |  Branch (401:13): [True: 0, False: 27.2k]
  ------------------
  402|      0|            goto err;
  403|  27.2k|        if (group->meth->field_encode) {
  ------------------
  |  Branch (403:13): [True: 14.0k, False: 13.1k]
  ------------------
  404|  14.0k|            if (!group->meth->field_encode(group, point->Y, point->Y, ctx))
  ------------------
  |  Branch (404:17): [True: 0, False: 14.0k]
  ------------------
  405|      0|                goto err;
  406|  14.0k|        }
  407|  27.2k|    }
  408|       |
  409|  27.2k|    if (z != NULL) {
  ------------------
  |  Branch (409:9): [True: 27.2k, False: 0]
  ------------------
  410|  27.2k|        int Z_is_one;
  411|       |
  412|  27.2k|        if (!BN_nnmod(point->Z, z, group->field, ctx))
  ------------------
  |  Branch (412:13): [True: 0, False: 27.2k]
  ------------------
  413|      0|            goto err;
  414|  27.2k|        Z_is_one = BN_is_one(point->Z);
  415|  27.2k|        if (group->meth->field_encode) {
  ------------------
  |  Branch (415:13): [True: 14.0k, False: 13.1k]
  ------------------
  416|  14.0k|            if (Z_is_one && (group->meth->field_set_to_one != 0)) {
  ------------------
  |  Branch (416:17): [True: 14.0k, False: 0]
  |  Branch (416:29): [True: 14.0k, False: 0]
  ------------------
  417|  14.0k|                if (!group->meth->field_set_to_one(group, point->Z, ctx))
  ------------------
  |  Branch (417:21): [True: 0, False: 14.0k]
  ------------------
  418|      0|                    goto err;
  419|  14.0k|            } 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|  14.0k|        }
  425|  27.2k|        point->Z_is_one = Z_is_one;
  426|  27.2k|    }
  427|       |
  428|  27.2k|    ret = 1;
  429|       |
  430|  27.2k| err:
  431|  27.2k|    BN_CTX_free(new_ctx);
  432|  27.2k|    return ret;
  433|  27.2k|}
ossl_ec_GFp_simple_point_set_affine_coordinates:
  488|  27.2k|{
  489|  27.2k|    if (x == NULL || y == NULL) {
  ------------------
  |  Branch (489:9): [True: 0, False: 27.2k]
  |  Branch (489:22): [True: 0, False: 27.2k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  494|      0|        return 0;
  495|      0|    }
  496|       |
  497|  27.2k|    return EC_POINT_set_Jprojective_coordinates_GFp(group, point, x, y,
  498|  27.2k|                                                    BN_value_one(), ctx);
  499|  27.2k|}
ossl_ec_GFp_simple_is_at_infinity:
  952|  27.2k|{
  953|  27.2k|    return BN_is_zero(point->Z);
  954|  27.2k|}
ossl_ec_GFp_simple_is_on_curve:
  958|  27.2k|{
  959|  27.2k|    int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *,
  960|  27.2k|                      const BIGNUM *, BN_CTX *);
  961|  27.2k|    int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
  962|  27.2k|    const BIGNUM *p;
  963|  27.2k|    BN_CTX *new_ctx = NULL;
  964|  27.2k|    BIGNUM *rh, *tmp, *Z4, *Z6;
  965|  27.2k|    int ret = -1;
  966|       |
  967|  27.2k|    if (EC_POINT_is_at_infinity(group, point))
  ------------------
  |  Branch (967:9): [True: 0, False: 27.2k]
  ------------------
  968|      0|        return 1;
  969|       |
  970|  27.2k|    field_mul = group->meth->field_mul;
  971|  27.2k|    field_sqr = group->meth->field_sqr;
  972|  27.2k|    p = group->field;
  973|       |
  974|  27.2k|    if (ctx == NULL) {
  ------------------
  |  Branch (974:9): [True: 0, False: 27.2k]
  ------------------
  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|  27.2k|    BN_CTX_start(ctx);
  981|  27.2k|    rh = BN_CTX_get(ctx);
  982|  27.2k|    tmp = BN_CTX_get(ctx);
  983|  27.2k|    Z4 = BN_CTX_get(ctx);
  984|  27.2k|    Z6 = BN_CTX_get(ctx);
  985|  27.2k|    if (Z6 == NULL)
  ------------------
  |  Branch (985:9): [True: 0, False: 27.2k]
  ------------------
  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|  27.2k|    if (!field_sqr(group, rh, point->X, ctx))
  ------------------
  |  Branch (999:9): [True: 0, False: 27.2k]
  ------------------
 1000|      0|        goto err;
 1001|       |
 1002|  27.2k|    if (!point->Z_is_one) {
  ------------------
  |  Branch (1002:9): [True: 0, False: 27.2k]
  ------------------
 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|  27.2k|    } else {
 1035|       |        /* point->Z_is_one */
 1036|       |
 1037|       |        /* rh := (rh + a)*X */
 1038|  27.2k|        if (!BN_mod_add_quick(rh, rh, group->a, p))
  ------------------
  |  Branch (1038:13): [True: 0, False: 27.2k]
  ------------------
 1039|      0|            goto err;
 1040|  27.2k|        if (!field_mul(group, rh, rh, point->X, ctx))
  ------------------
  |  Branch (1040:13): [True: 0, False: 27.2k]
  ------------------
 1041|      0|            goto err;
 1042|       |        /* rh := rh + b */
 1043|  27.2k|        if (!BN_mod_add_quick(rh, rh, group->b, p))
  ------------------
  |  Branch (1043:13): [True: 0, False: 27.2k]
  ------------------
 1044|      0|            goto err;
 1045|  27.2k|    }
 1046|       |
 1047|       |    /* 'lh' := Y^2 */
 1048|  27.2k|    if (!field_sqr(group, tmp, point->Y, ctx))
  ------------------
  |  Branch (1048:9): [True: 0, False: 27.2k]
  ------------------
 1049|      0|        goto err;
 1050|       |
 1051|  27.2k|    ret = (0 == BN_ucmp(tmp, rh));
 1052|       |
 1053|  27.2k| err:
 1054|  27.2k|    BN_CTX_end(ctx);
 1055|  27.2k|    BN_CTX_free(new_ctx);
 1056|  27.2k|    return ret;
 1057|  27.2k|}

ossl_ecx_key_op:
  155|  2.65k|{
  156|  2.65k|    ECX_KEY *key = NULL;
  157|  2.65k|    unsigned char *privkey, *pubkey;
  158|       |
  159|  2.65k|    if (op != KEY_OP_KEYGEN) {
  ------------------
  |  Branch (159:9): [True: 2.65k, False: 0]
  ------------------
  160|  2.65k|        if (palg != NULL) {
  ------------------
  |  Branch (160:13): [True: 2.65k, False: 0]
  ------------------
  161|  2.65k|            int ptype;
  162|       |
  163|       |            /* Algorithm parameters must be absent */
  164|  2.65k|            X509_ALGOR_get0(NULL, &ptype, NULL, palg);
  165|  2.65k|            if (ptype != V_ASN1_UNDEF) {
  ------------------
  |  |   60|  2.65k|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (165:17): [True: 43, False: 2.61k]
  ------------------
  166|     43|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     43|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     43|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     43|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     43|     ERR_set_error)
  |  |  ------------------
  ------------------
  167|     43|                return 0;
  168|     43|            }
  169|  2.61k|            if (id == EVP_PKEY_NONE)
  ------------------
  |  |   58|  2.61k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  2.61k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (169:17): [True: 0, False: 2.61k]
  ------------------
  170|      0|                id = OBJ_obj2nid(palg->algorithm);
  171|  2.61k|            else if (id != OBJ_obj2nid(palg->algorithm)) {
  ------------------
  |  Branch (171:22): [True: 0, False: 2.61k]
  ------------------
  172|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  173|      0|                return 0;
  174|      0|            }
  175|  2.61k|        }
  176|       |
  177|  2.61k|        if (p == NULL || id == EVP_PKEY_NONE || plen != KEYLENID(id)) {
  ------------------
  |  |   58|    618|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  3.23k|#define NID_undef                       0
  |  |  ------------------
  ------------------
                      if (p == NULL || id == EVP_PKEY_NONE || plen != KEYLENID(id)) {
  ------------------
  |  |   12|    618|#define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   11|    618|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|    618|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5492|  1.23k|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|    594|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5500|    594|#define NID_ED25519             1087
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (11:26): [True: 24, False: 594]
  |  |  |  |  |  Branch (11:53): [True: 76, False: 518]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   26|    100|#  define X25519_KEYLEN         32
  |  |  ------------------
  |  |   13|    618|                                     : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   80|    518|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5496|    518|#define NID_X448                1035
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                                                    : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   27|     83|#  define X448_KEYLEN           56
  |  |  ------------------
  |  |  |  Branch (13:41): [True: 83, False: 435]
  |  |  ------------------
  |  |   14|    518|                                                              : ED448_KEYLEN))
  |  |  ------------------
  |  |  |  |   29|    435|#  define ED448_KEYLEN          57
  |  |  ------------------
  ------------------
  |  Branch (177:13): [True: 1.99k, False: 618]
  |  Branch (177:26): [True: 0, False: 618]
  |  Branch (177:49): [True: 231, False: 387]
  ------------------
  178|  2.22k|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|  2.22k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.22k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.22k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  2.22k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  2.22k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  2.22k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.22k|     ERR_set_error)
  |  |  ------------------
  ------------------
  179|  2.22k|            return 0;
  180|  2.22k|        }
  181|  2.61k|    }
  182|       |
  183|    387|    key = ossl_ecx_key_new(libctx, KEYNID2TYPE(id), 1, propq);
  ------------------
  |  |   16|    387|    (IS25519(id) ? ((id) == EVP_PKEY_X25519 ? ECX_KEY_TYPE_X25519 \
  |  |  ------------------
  |  |  |  |   11|    387|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|    387|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5492|    774|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|    381|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5500|    381|#define NID_ED25519             1087
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (11:26): [True: 6, False: 381]
  |  |  |  |  |  Branch (11:53): [True: 6, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (IS25519(id) ? ((id) == EVP_PKEY_X25519 ? ECX_KEY_TYPE_X25519 \
  |  |  ------------------
  |  |  |  |   78|     12|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  ------------------
  |  |  |  |  |  | 5492|     12|#define NID_X25519              1034
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (16:21): [True: 6, False: 6]
  |  |  ------------------
  |  |   17|     12|                                            : ECX_KEY_TYPE_ED25519) \
  |  |   18|    387|                 : ((id) == EVP_PKEY_X448 ? ECX_KEY_TYPE_X448 \
  |  |  ------------------
  |  |  |  |   80|    375|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5496|    375|#define NID_X448                1035
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (18:21): [True: 70, False: 305]
  |  |  ------------------
  |  |   19|    375|                                          : ECX_KEY_TYPE_ED448))
  ------------------
  184|    387|    if (key == NULL) {
  ------------------
  |  Branch (184:9): [True: 0, False: 387]
  ------------------
  185|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  186|      0|        return 0;
  187|      0|    }
  188|    387|    pubkey = key->pubkey;
  189|       |
  190|    387|    if (op == KEY_OP_PUBLIC) {
  ------------------
  |  Branch (190:9): [True: 387, False: 0]
  ------------------
  191|    387|        memcpy(pubkey, p, plen);
  192|    387|    } else {
  193|      0|        privkey = ossl_ecx_key_allocate_privkey(key);
  194|      0|        if (privkey == NULL) {
  ------------------
  |  Branch (194:13): [True: 0, False: 0]
  ------------------
  195|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  196|      0|            goto err;
  197|      0|        }
  198|      0|        if (op == KEY_OP_KEYGEN) {
  ------------------
  |  Branch (198:13): [True: 0, False: 0]
  ------------------
  199|      0|            if (id != EVP_PKEY_NONE) {
  ------------------
  |  |   58|      0|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|      0|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (199:17): [True: 0, False: 0]
  ------------------
  200|      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)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      0|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5492|      0|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|      0|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5500|      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 \
  |  |  ------------------
  |  |  |  |   80|      0|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5496|      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 (200:21): [True: 0, False: 0]
  ------------------
  201|      0|                    goto err;
  202|      0|                if (id == EVP_PKEY_X25519) {
  ------------------
  |  |   78|      0|# define EVP_PKEY_X25519 NID_X25519
  |  |  ------------------
  |  |  |  | 5492|      0|#define NID_X25519              1034
  |  |  ------------------
  ------------------
  |  Branch (202:21): [True: 0, False: 0]
  ------------------
  203|      0|                    privkey[0] &= 248;
  204|      0|                    privkey[X25519_KEYLEN - 1] &= 127;
  ------------------
  |  |   26|      0|#  define X25519_KEYLEN         32
  ------------------
  205|      0|                    privkey[X25519_KEYLEN - 1] |= 64;
  ------------------
  |  |   26|      0|#  define X25519_KEYLEN         32
  ------------------
  206|      0|                } else if (id == EVP_PKEY_X448) {
  ------------------
  |  |   80|      0|# define EVP_PKEY_X448 NID_X448
  |  |  ------------------
  |  |  |  | 5496|      0|#define NID_X448                1035
  |  |  ------------------
  ------------------
  |  Branch (206:28): [True: 0, False: 0]
  ------------------
  207|      0|                    privkey[0] &= 252;
  208|      0|                    privkey[X448_KEYLEN - 1] |= 128;
  ------------------
  |  |   27|      0|#  define X448_KEYLEN           56
  ------------------
  209|      0|                }
  210|      0|            }
  211|      0|        } else {
  212|      0|            memcpy(privkey, p, KEYLENID(id));
  ------------------
  |  |   12|      0|#define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   11|      0|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   78|      0|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5492|      0|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|      0|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5500|      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 \
  |  |  ------------------
  |  |  |  |   80|      0|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5496|      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
  |  |  ------------------
  ------------------
  213|      0|        }
  214|      0|        if (!ossl_ecx_public_from_private(key)) {
  ------------------
  |  Branch (214:13): [True: 0, False: 0]
  ------------------
  215|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  216|      0|            goto err;
  217|      0|        }
  218|      0|    }
  219|       |
  220|    387|    return key;
  221|      0| err:
  222|      0|    ossl_ecx_key_free(key);
  223|      0|    return NULL;
  224|    387|}

ossl_ecx_key_new:
   22|    387|{
   23|    387|    ECX_KEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   99|    387|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    387|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    387|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   24|       |
   25|    387|    if (ret == NULL)
  ------------------
  |  Branch (25:9): [True: 0, False: 387]
  ------------------
   26|      0|        return NULL;
   27|       |
   28|    387|    ret->libctx = libctx;
   29|    387|    ret->haspubkey = haspubkey;
   30|    387|    switch (type) {
  ------------------
  |  Branch (30:13): [True: 0, False: 387]
  ------------------
   31|      6|    case ECX_KEY_TYPE_X25519:
  ------------------
  |  Branch (31:5): [True: 6, False: 381]
  ------------------
   32|      6|        ret->keylen = X25519_KEYLEN;
  ------------------
  |  |   26|      6|#  define X25519_KEYLEN         32
  ------------------
   33|      6|        break;
   34|     70|    case ECX_KEY_TYPE_X448:
  ------------------
  |  Branch (34:5): [True: 70, False: 317]
  ------------------
   35|     70|        ret->keylen = X448_KEYLEN;
  ------------------
  |  |   27|     70|#  define X448_KEYLEN           56
  ------------------
   36|     70|        break;
   37|      6|    case ECX_KEY_TYPE_ED25519:
  ------------------
  |  Branch (37:5): [True: 6, False: 381]
  ------------------
   38|      6|        ret->keylen = ED25519_KEYLEN;
  ------------------
  |  |   28|      6|#  define ED25519_KEYLEN        32
  ------------------
   39|      6|        break;
   40|    305|    case ECX_KEY_TYPE_ED448:
  ------------------
  |  Branch (40:5): [True: 305, False: 82]
  ------------------
   41|    305|        ret->keylen = ED448_KEYLEN;
  ------------------
  |  |   29|    305|#  define ED448_KEYLEN          57
  ------------------
   42|    305|        break;
   43|    387|    }
   44|    387|    ret->type = type;
   45|       |
   46|    387|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (46:9): [True: 0, False: 387]
  ------------------
   47|      0|        goto err;
   48|       |
   49|    387|    if (propq != NULL) {
  ------------------
  |  Branch (49:9): [True: 0, False: 387]
  ------------------
   50|      0|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  111|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   51|      0|        if (ret->propq == NULL)
  ------------------
  |  Branch (51:13): [True: 0, False: 0]
  ------------------
   52|      0|            goto err;
   53|      0|    }
   54|    387|    return ret;
   55|      0|err:
   56|      0|    if (ret != NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  ------------------
   57|      0|        OPENSSL_free(ret->propq);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   58|      0|        CRYPTO_FREE_REF(&ret->references);
   59|      0|    }
   60|      0|    OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|      0|    return NULL;
   62|    387|}
ossl_ecx_key_free:
   65|  5.70k|{
   66|  5.70k|    int i;
   67|       |
   68|  5.70k|    if (key == NULL)
  ------------------
  |  Branch (68:9): [True: 4.92k, False: 774]
  ------------------
   69|  4.92k|        return;
   70|       |
   71|    774|    CRYPTO_DOWN_REF(&key->references, &i);
   72|    774|    REF_PRINT_COUNT("ECX_KEY", key);
  ------------------
  |  |  289|    774|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|    774|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|    774|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|    774|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   73|    774|    if (i > 0)
  ------------------
  |  Branch (73:9): [True: 387, False: 387]
  ------------------
   74|    387|        return;
   75|    387|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|    387|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 387]
  |  |  ------------------
  ------------------
   76|       |
   77|    387|    OPENSSL_free(key->propq);
  ------------------
  |  |  107|    387|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    387|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    387|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   78|    387|    OPENSSL_secure_clear_free(key->privkey, key->keylen);
  ------------------
  |  |  121|    387|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    387|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    387|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|    387|    CRYPTO_FREE_REF(&key->references);
   80|    387|    OPENSSL_free(key);
  ------------------
  |  |  107|    387|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    387|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    387|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   81|    387|}
ossl_ecx_key_set0_libctx:
   84|    387|{
   85|    387|    key->libctx = libctx;
   86|    387|}
ossl_ecx_key_up_ref:
   89|    387|{
   90|    387|    int i;
   91|       |
   92|    387|    if (CRYPTO_UP_REF(&key->references, &i) <= 0)
  ------------------
  |  Branch (92:9): [True: 0, False: 387]
  ------------------
   93|      0|        return 0;
   94|       |
   95|    387|    REF_PRINT_COUNT("ECX_KEY", key);
  ------------------
  |  |  289|    387|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|    387|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|    387|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|    387|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   96|    387|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|    387|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 387]
  |  |  ------------------
  ------------------
   97|    387|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (97:13): [True: 387, False: 0]
  ------------------
   98|    387|}

ecx_meth.c:ecx_pub_decode:
   55|  2.65k|{
   56|  2.65k|    const unsigned char *p;
   57|  2.65k|    int pklen;
   58|  2.65k|    X509_ALGOR *palg;
   59|  2.65k|    ECX_KEY *ecx;
   60|  2.65k|    int ret = 0;
   61|       |
   62|  2.65k|    if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
  ------------------
  |  Branch (62:9): [True: 0, False: 2.65k]
  ------------------
   63|      0|        return 0;
   64|  2.65k|    ecx = ossl_ecx_key_op(palg, p, pklen, pkey->ameth->pkey_id,
   65|  2.65k|                          KEY_OP_PUBLIC, NULL, NULL);
   66|  2.65k|    if (ecx != NULL) {
  ------------------
  |  Branch (66:9): [True: 387, False: 2.26k]
  ------------------
   67|    387|        ret = 1;
   68|    387|        EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, ecx);
   69|    387|    }
   70|  2.65k|    return ret;
   71|  2.65k|}
ecx_meth.c:ecx_free:
  156|  2.65k|{
  157|  2.65k|    ossl_ecx_key_free(pkey->pkey.ecx);
  158|  2.65k|}

OSSL_DECODER_from_bio:
   48|  58.8k|{
   49|  58.8k|    struct decoder_process_data_st data;
   50|  58.8k|    int ok = 0;
   51|  58.8k|    BIO *new_bio = NULL;
   52|  58.8k|    unsigned long lasterr;
   53|       |
   54|  58.8k|    if (in == NULL) {
  ------------------
  |  Branch (54:9): [True: 0, False: 58.8k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   56|      0|        return 0;
   57|      0|    }
   58|       |
   59|  58.8k|    if (OSSL_DECODER_CTX_get_num_decoders(ctx) == 0) {
  ------------------
  |  Branch (59:9): [True: 4.24k, False: 54.6k]
  ------------------
   60|  4.24k|        ERR_raise_data(ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND,
  ------------------
  |  |  403|  4.24k|    (ERR_new(),                                                 \
  |  |  404|  4.24k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  279|  4.24k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|  4.24k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|  4.24k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|  4.24k|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND,
  ------------------
  |  |  121|  4.24k|# define ERR_LIB_OSSL_DECODER    60
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND,
  ------------------
  |  |   25|  4.24k|# define OSSL_DECODER_R_DECODER_NOT_FOUND                 102
  ------------------
   61|  4.24k|                       "No decoders were found. For standard decoders you need "
   62|  4.24k|                       "at least one of the default or base providers "
   63|  4.24k|                       "available. Did you forget to load them?");
   64|  4.24k|        return 0;
   65|  4.24k|    }
   66|       |
   67|  54.6k|    lasterr = ERR_peek_last_error();
   68|       |
   69|  54.6k|    if (BIO_tell(in) < 0) {
  ------------------
  |  |  564|  54.6k|# define BIO_tell(b)     (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
  |  |  ------------------
  |  |  |  |  459|  54.6k|# define BIO_C_FILE_TELL                         133
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 54.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|  54.6k|    memset(&data, 0, sizeof(data));
   76|  54.6k|    data.ctx = ctx;
   77|  54.6k|    data.bio = in;
   78|       |
   79|       |    /* Enable passphrase caching */
   80|  54.6k|    (void)ossl_pw_enable_passphrase_caching(&ctx->pwdata);
   81|       |
   82|  54.6k|    ok = decoder_process(NULL, &data);
   83|       |
   84|  54.6k|    if (!data.flag_construct_called) {
  ------------------
  |  Branch (84:9): [True: 24.9k, False: 29.6k]
  ------------------
   85|  24.9k|        const char *spaces
   86|  24.9k|            = ctx->start_input_type != NULL && ctx->input_structure != NULL
  ------------------
  |  Branch (86:15): [True: 24.9k, False: 0]
  |  Branch (86:48): [True: 24.9k, False: 0]
  ------------------
   87|  24.9k|            ? " " : "";
   88|  24.9k|        const char *input_type_label
   89|  24.9k|            = ctx->start_input_type != NULL ? "Input type: " : "";
  ------------------
  |  Branch (89:15): [True: 24.9k, False: 0]
  ------------------
   90|  24.9k|        const char *input_structure_label
   91|  24.9k|            = ctx->input_structure != NULL ? "Input structure: " : "";
  ------------------
  |  Branch (91:15): [True: 24.9k, False: 0]
  ------------------
   92|  24.9k|        const char *comma
   93|  24.9k|            = ctx->start_input_type != NULL && ctx->input_structure != NULL
  ------------------
  |  Branch (93:15): [True: 24.9k, False: 0]
  |  Branch (93:48): [True: 24.9k, False: 0]
  ------------------
   94|  24.9k|            ? ", " : "";
   95|  24.9k|        const char *input_type
   96|  24.9k|            = ctx->start_input_type != NULL ? ctx->start_input_type : "";
  ------------------
  |  Branch (96:15): [True: 24.9k, False: 0]
  ------------------
   97|  24.9k|        const char *input_structure
   98|  24.9k|            = ctx->input_structure != NULL ? ctx->input_structure : "";
  ------------------
  |  Branch (98:15): [True: 24.9k, False: 0]
  ------------------
   99|       |
  100|  24.9k|        if (ERR_peek_last_error() == lasterr || ERR_peek_error() == 0)
  ------------------
  |  Branch (100:13): [True: 24.9k, False: 0]
  |  Branch (100:49): [True: 0, False: 0]
  ------------------
  101|       |            /* Prevent spurious decoding error but add at least something */
  102|  24.9k|            ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_UNSUPPORTED,
  ------------------
  |  |  403|  24.9k|    (ERR_new(),                                                 \
  |  |  404|  24.9k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  279|  24.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|  24.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|  24.9k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|  24.9k|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_UNSUPPORTED,
  ------------------
  |  |  121|  24.9k|# define ERR_LIB_OSSL_DECODER    60
  ------------------
                          ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_UNSUPPORTED,
  ------------------
  |  |  363|  24.9k|# define ERR_R_UNSUPPORTED                       (268|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|  24.9k|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|  24.9k|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  103|  24.9k|                           "No supported data to decode. %s%s%s%s%s%s",
  104|  24.9k|                           spaces, input_type_label, input_type, comma,
  105|  24.9k|                           input_structure_label, input_structure);
  106|  24.9k|        ok = 0;
  107|  24.9k|    }
  108|       |
  109|       |    /* Clear any internally cached passphrase */
  110|  54.6k|    (void)ossl_pw_clear_passphrase_cache(&ctx->pwdata);
  111|       |
  112|  54.6k|    if (new_bio != NULL) {
  ------------------
  |  Branch (112:9): [True: 0, False: 54.6k]
  ------------------
  113|      0|        BIO_pop(new_bio);
  114|      0|        BIO_free(new_bio);
  115|      0|    }
  116|  54.6k|    return ok;
  117|  54.6k|}
OSSL_DECODER_from_data:
  147|  58.8k|{
  148|  58.8k|    BIO *membio;
  149|  58.8k|    int ret = 0;
  150|       |
  151|  58.8k|    if (pdata == NULL || *pdata == NULL || pdata_len == NULL) {
  ------------------
  |  Branch (151:9): [True: 0, False: 58.8k]
  |  Branch (151:26): [True: 0, False: 58.8k]
  |  Branch (151:44): [True: 0, False: 58.8k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  153|      0|        return 0;
  154|      0|    }
  155|       |
  156|  58.8k|    membio = BIO_new_mem_buf(*pdata, (int)*pdata_len);
  157|  58.8k|    if (OSSL_DECODER_from_bio(ctx, membio)) {
  ------------------
  |  Branch (157:9): [True: 29.6k, False: 29.1k]
  ------------------
  158|  29.6k|        *pdata_len = (size_t)BIO_get_mem_data(membio, pdata);
  ------------------
  |  |  606|  29.6k|# define BIO_get_mem_data(b,pp)  BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)(pp))
  |  |  ------------------
  |  |  |  |   87|  29.6k|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  |  |  ------------------
  ------------------
  159|  29.6k|        ret = 1;
  160|  29.6k|    }
  161|  58.8k|    BIO_free(membio);
  162|       |
  163|  58.8k|    return ret;
  164|  58.8k|}
OSSL_DECODER_CTX_set_selection:
  167|    868|{
  168|    868|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|    868|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    868|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (168:9): [True: 0, False: 868]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|    868|    ctx->selection = selection;
  178|    868|    return 1;
  179|    868|}
OSSL_DECODER_CTX_set_input_type:
  183|  59.7k|{
  184|  59.7k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  59.7k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  59.7k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (184:9): [True: 0, False: 59.7k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|  59.7k|    ctx->start_input_type = input_type;
  194|  59.7k|    return 1;
  195|  59.7k|}
OSSL_DECODER_CTX_set_input_structure:
  199|  59.7k|{
  200|  59.7k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  59.7k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  59.7k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (200:9): [True: 0, False: 59.7k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|  59.7k|    ctx->input_structure = input_structure;
  210|  59.7k|    return 1;
  211|  59.7k|}
ossl_decoder_instance_new:
  215|    102|{
  216|    102|    OSSL_DECODER_INSTANCE *decoder_inst = NULL;
  217|    102|    const OSSL_PROVIDER *prov;
  218|    102|    OSSL_LIB_CTX *libctx;
  219|    102|    const OSSL_PROPERTY_LIST *props;
  220|    102|    const OSSL_PROPERTY_DEFINITION *prop;
  221|       |
  222|    102|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|    102|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    102|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (222:9): [True: 0, False: 102]
  ------------------
  223|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  224|      0|        return 0;
  225|      0|    }
  226|       |
  227|    102|    if ((decoder_inst = OPENSSL_zalloc(sizeof(*decoder_inst))) == NULL)
  ------------------
  |  |   99|    102|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    102|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    102|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (227:9): [True: 0, False: 102]
  ------------------
  228|      0|        return 0;
  229|       |
  230|    102|    prov = OSSL_DECODER_get0_provider(decoder);
  231|    102|    libctx = ossl_provider_libctx(prov);
  232|    102|    props = ossl_decoder_parsed_properties(decoder);
  233|    102|    if (props == NULL) {
  ------------------
  |  Branch (233:9): [True: 0, False: 102]
  ------------------
  234|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|      0|                       "there are no property definitions with decoder %s",
  236|      0|                       OSSL_DECODER_get0_name(decoder));
  237|      0|        goto err;
  238|      0|    }
  239|       |
  240|       |    /* The "input" property is mandatory */
  241|    102|    prop = ossl_property_find_property(props, libctx, "input");
  242|    102|    decoder_inst->input_type = ossl_property_get_string_value(libctx, prop);
  243|    102|    decoder_inst->input_type_id = 0;
  244|    102|    if (decoder_inst->input_type == NULL) {
  ------------------
  |  Branch (244:9): [True: 0, False: 102]
  ------------------
  245|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  246|      0|                       "the mandatory 'input' property is missing "
  247|      0|                       "for decoder %s (properties: %s)",
  248|      0|                       OSSL_DECODER_get0_name(decoder),
  249|      0|                       OSSL_DECODER_get0_properties(decoder));
  250|      0|        goto err;
  251|      0|    }
  252|       |
  253|       |    /* The "structure" property is optional */
  254|    102|    prop = ossl_property_find_property(props, libctx, "structure");
  255|    102|    if (prop != NULL) {
  ------------------
  |  Branch (255:9): [True: 55, False: 47]
  ------------------
  256|     55|        decoder_inst->input_structure
  257|     55|            = ossl_property_get_string_value(libctx, prop);
  258|     55|    }
  259|       |
  260|    102|    if (!OSSL_DECODER_up_ref(decoder)) {
  ------------------
  |  Branch (260:9): [True: 0, False: 102]
  ------------------
  261|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  262|      0|        goto err;
  263|      0|    }
  264|    102|    decoder_inst->decoder = decoder;
  265|    102|    decoder_inst->decoderctx = decoderctx;
  266|    102|    return decoder_inst;
  267|      0| err:
  268|      0|    ossl_decoder_instance_free(decoder_inst);
  269|      0|    return NULL;
  270|    102|}
ossl_decoder_instance_free:
  273|   271k|{
  274|   271k|    if (decoder_inst != NULL) {
  ------------------
  |  Branch (274:9): [True: 271k, False: 0]
  ------------------
  275|   271k|        if (decoder_inst->decoder != NULL)
  ------------------
  |  Branch (275:13): [True: 271k, False: 0]
  ------------------
  276|   271k|            decoder_inst->decoder->freectx(decoder_inst->decoderctx);
  277|   271k|        decoder_inst->decoderctx = NULL;
  278|   271k|        OSSL_DECODER_free(decoder_inst->decoder);
  279|   271k|        decoder_inst->decoder = NULL;
  280|   271k|        OPENSSL_free(decoder_inst);
  ------------------
  |  |  107|   271k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   271k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   271k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|   271k|    }
  282|   271k|}
ossl_decoder_instance_dup:
  285|   271k|{
  286|   271k|    OSSL_DECODER_INSTANCE *dest;
  287|   271k|    const OSSL_PROVIDER *prov;
  288|   271k|    void *provctx;
  289|       |
  290|   271k|    if ((dest = OPENSSL_zalloc(sizeof(*dest))) == NULL)
  ------------------
  |  |   99|   271k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   271k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   271k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (290:9): [True: 0, False: 271k]
  ------------------
  291|      0|        return NULL;
  292|       |
  293|   271k|    *dest = *src;
  294|   271k|    if (!OSSL_DECODER_up_ref(dest->decoder)) {
  ------------------
  |  Branch (294:9): [True: 0, False: 271k]
  ------------------
  295|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  296|      0|        goto err;
  297|      0|    }
  298|   271k|    prov = OSSL_DECODER_get0_provider(dest->decoder);
  299|   271k|    provctx = OSSL_PROVIDER_get0_provider_ctx(prov);
  300|       |
  301|   271k|    dest->decoderctx = dest->decoder->newctx(provctx);
  302|   271k|    if (dest->decoderctx == NULL) {
  ------------------
  |  Branch (302:9): [True: 0, False: 271k]
  ------------------
  303|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  304|      0|        OSSL_DECODER_free(dest->decoder);
  305|      0|        goto err;
  306|      0|    }
  307|       |
  308|   271k|    return dest;
  309|       |
  310|      0| err:
  311|      0|    OPENSSL_free(dest);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  312|      0|    return NULL;
  313|   271k|}
ossl_decoder_ctx_add_decoder_inst:
  317|     75|{
  318|     75|    int ok;
  319|       |
  320|     75|    if (ctx->decoder_insts == NULL
  ------------------
  |  Branch (320:9): [True: 14, False: 61]
  ------------------
  321|     75|        && (ctx->decoder_insts =
  ------------------
  |  Branch (321:12): [True: 0, False: 14]
  ------------------
  322|     14|            sk_OSSL_DECODER_INSTANCE_new_null()) == NULL) {
  323|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  324|      0|        return 0;
  325|      0|    }
  326|       |
  327|     75|    ok = (sk_OSSL_DECODER_INSTANCE_push(ctx->decoder_insts, di) > 0);
  328|     75|    if (ok) {
  ------------------
  |  Branch (328:9): [True: 75, False: 0]
  ------------------
  329|     75|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|     75|    do {                                        \
  |  |  220|     75|        BIO *trc_out = NULL;                    \
  |  |  221|     75|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  330|      0|            BIO_printf(trc_out,
  331|      0|                       "(ctx %p) Added decoder instance %p for decoder %p\n"
  332|      0|                       "    %s with %s\n",
  333|      0|                       (void *)ctx, (void *)di, (void *)di->decoder,
  334|      0|                       OSSL_DECODER_get0_name(di->decoder),
  335|      0|                       OSSL_DECODER_get0_properties(di->decoder));
  336|     75|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|     75|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  337|     75|    }
  338|     75|    return ok;
  339|     75|}
OSSL_DECODER_CTX_add_extra:
  490|    868|{
  491|       |    /*
  492|       |     * This function goes through existing decoder methods in
  493|       |     * |ctx->decoder_insts|, and tries to fetch new decoders that produce
  494|       |     * what the existing ones want as input, and push those newly fetched
  495|       |     * decoders on top of the same stack.
  496|       |     * Then it does the same again, but looping over the newly fetched
  497|       |     * decoders, until there are no more decoders to be fetched, or
  498|       |     * when we have done this 10 times.
  499|       |     *
  500|       |     * we do this with sliding windows on the stack by keeping track of indexes
  501|       |     * and of the end.
  502|       |     *
  503|       |     * +----------------+
  504|       |     * |   DER to RSA   | <--- w_prev_start
  505|       |     * +----------------+
  506|       |     * |   DER to DSA   |
  507|       |     * +----------------+
  508|       |     * |   DER to DH    |
  509|       |     * +----------------+
  510|       |     * |   PEM to DER   | <--- w_prev_end, w_new_start
  511|       |     * +----------------+
  512|       |     *                    <--- w_new_end
  513|       |     */
  514|    868|    struct collect_extra_decoder_data_st data;
  515|    868|    size_t depth = 0; /* Counts the number of iterations */
  516|    868|    size_t count; /* Calculates how many were added in each iteration */
  517|    868|    size_t numdecoders;
  518|    868|    STACK_OF(OSSL_DECODER) *skdecoders;
  ------------------
  |  |   31|    868|# define STACK_OF(type) struct stack_st_##type
  ------------------
  519|       |
  520|    868|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|    868|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    868|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (520:9): [True: 0, False: 868]
  ------------------
  521|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  522|      0|        return 0;
  523|      0|    }
  524|       |
  525|       |    /*
  526|       |     * If there is no stack of OSSL_DECODER_INSTANCE, we have nothing
  527|       |     * more to add.  That's fine.
  528|       |     */
  529|    868|    if (ctx->decoder_insts == NULL)
  ------------------
  |  Branch (529:9): [True: 854, False: 14]
  ------------------
  530|    854|        return 1;
  531|       |
  532|     14|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|     14|    do {                                        \
  |  |  220|     14|        BIO *trc_out = NULL;                    \
  |  |  221|     14|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  533|      0|        BIO_printf(trc_out, "(ctx %p) Looking for extra decoders\n",
  534|      0|                   (void *)ctx);
  535|     14|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|     14|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  536|       |
  537|       |
  538|     14|    skdecoders = sk_OSSL_DECODER_new_null();
  539|     14|    if (skdecoders == NULL) {
  ------------------
  |  Branch (539:9): [True: 0, False: 14]
  ------------------
  540|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  541|      0|        return 0;
  542|      0|    }
  543|     14|    OSSL_DECODER_do_all_provided(libctx, collect_all_decoders, skdecoders);
  544|     14|    numdecoders = sk_OSSL_DECODER_num(skdecoders);
  545|       |
  546|     14|    memset(&data, 0, sizeof(data));
  547|     14|    data.ctx = ctx;
  548|     14|    data.w_prev_start = 0;
  549|     14|    data.w_prev_end = sk_OSSL_DECODER_INSTANCE_num(ctx->decoder_insts);
  550|     28|    do {
  551|     28|        size_t i, j;
  552|       |
  553|     28|        data.w_new_start = data.w_new_end = data.w_prev_end;
  554|       |
  555|       |        /*
  556|       |         * Two iterations:
  557|       |         * 0.  All decoders that have the same name as their input type.
  558|       |         *     This allows for decoders that unwrap some data in a specific
  559|       |         *     encoding, and pass the result on with the same encoding.
  560|       |         * 1.  All decoders that a different name than their input type.
  561|       |         */
  562|     28|        for (data.type_check = IS_SAME;
  563|     84|             data.type_check <= IS_DIFFERENT;
  ------------------
  |  Branch (563:14): [True: 56, False: 28]
  ------------------
  564|     56|             data.type_check++) {
  565|    206|            for (i = data.w_prev_start; i < data.w_prev_end; i++) {
  ------------------
  |  Branch (565:41): [True: 150, False: 56]
  ------------------
  566|    150|                OSSL_DECODER_INSTANCE *decoder_inst =
  567|    150|                    sk_OSSL_DECODER_INSTANCE_value(ctx->decoder_insts, i);
  568|       |
  569|    150|                data.output_type
  570|    150|                    = OSSL_DECODER_INSTANCE_get_input_type(decoder_inst);
  571|       |
  572|    150|                data.output_type_id = 0;
  573|       |
  574|  6.15k|                for (j = 0; j < numdecoders; j++)
  ------------------
  |  Branch (574:29): [True: 6.00k, False: 150]
  ------------------
  575|  6.00k|                    collect_extra_decoder(sk_OSSL_DECODER_value(skdecoders, j),
  576|  6.00k|                                          &data);
  577|    150|            }
  578|     56|        }
  579|       |        /* How many were added in this iteration */
  580|     28|        count = data.w_new_end - data.w_new_start;
  581|       |
  582|       |        /* Slide the "previous decoder" windows */
  583|     28|        data.w_prev_start = data.w_new_start;
  584|     28|        data.w_prev_end = data.w_new_end;
  585|       |
  586|     28|        depth++;
  587|     28|    } while (count != 0 && depth <= 10);
  ------------------
  |  Branch (587:14): [True: 14, False: 14]
  |  Branch (587:28): [True: 14, False: 0]
  ------------------
  588|       |
  589|     14|    sk_OSSL_DECODER_pop_free(skdecoders, OSSL_DECODER_free);
  590|     14|    return 1;
  591|     14|}
OSSL_DECODER_CTX_get_num_decoders:
  594|   114k|{
  595|   114k|    if (ctx == NULL || ctx->decoder_insts == NULL)
  ------------------
  |  Branch (595:9): [True: 0, False: 114k]
  |  Branch (595:24): [True: 5.09k, False: 109k]
  ------------------
  596|  5.09k|        return 0;
  597|   109k|    return sk_OSSL_DECODER_INSTANCE_num(ctx->decoder_insts);
  598|   114k|}
OSSL_DECODER_CTX_set_construct:
  602|  58.8k|{
  603|  58.8k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  58.8k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  58.8k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (603:9): [True: 0, False: 58.8k]
  ------------------
  604|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  605|      0|        return 0;
  606|      0|    }
  607|  58.8k|    ctx->construct = construct;
  608|  58.8k|    return 1;
  609|  58.8k|}
OSSL_DECODER_CTX_set_construct_data:
  613|  54.6k|{
  614|  54.6k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  54.6k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  54.6k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (614:9): [True: 0, False: 54.6k]
  ------------------
  615|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  616|      0|        return 0;
  617|      0|    }
  618|  54.6k|    ctx->construct_data = construct_data;
  619|  54.6k|    return 1;
  620|  54.6k|}
OSSL_DECODER_CTX_set_cleanup:
  624|  58.8k|{
  625|  58.8k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  58.8k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  58.8k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (625:9): [True: 0, False: 58.8k]
  ------------------
  626|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  627|      0|        return 0;
  628|      0|    }
  629|  58.8k|    ctx->cleanup = cleanup;
  630|  58.8k|    return 1;
  631|  58.8k|}
OSSL_DECODER_CTX_get_construct:
  635|  58.8k|{
  636|  58.8k|    if (ctx == NULL)
  ------------------
  |  Branch (636:9): [True: 0, False: 58.8k]
  ------------------
  637|      0|        return NULL;
  638|  58.8k|    return ctx->construct;
  639|  58.8k|}
OSSL_DECODER_CTX_get_construct_data:
  642|  58.8k|{
  643|  58.8k|    if (ctx == NULL)
  ------------------
  |  Branch (643:9): [True: 0, False: 58.8k]
  ------------------
  644|      0|        return NULL;
  645|  58.8k|    return ctx->construct_data;
  646|  58.8k|}
OSSL_DECODER_CTX_get_cleanup:
  650|  58.8k|{
  651|  58.8k|    if (ctx == NULL)
  ------------------
  |  Branch (651:9): [True: 0, False: 58.8k]
  ------------------
  652|      0|        return NULL;
  653|  58.8k|    return ctx->cleanup;
  654|  58.8k|}
OSSL_DECODER_INSTANCE_get_decoder:
  679|   439k|{
  680|   439k|    if (decoder_inst == NULL)
  ------------------
  |  Branch (680:9): [True: 0, False: 439k]
  ------------------
  681|      0|        return NULL;
  682|   439k|    return decoder_inst->decoder;
  683|   439k|}
OSSL_DECODER_INSTANCE_get_decoder_ctx:
  687|   355k|{
  688|   355k|    if (decoder_inst == NULL)
  ------------------
  |  Branch (688:9): [True: 0, False: 355k]
  ------------------
  689|      0|        return NULL;
  690|   355k|    return decoder_inst->decoderctx;
  691|   355k|}
OSSL_DECODER_INSTANCE_get_input_type:
  695|   271k|{
  696|   271k|    if (decoder_inst == NULL)
  ------------------
  |  Branch (696:9): [True: 0, False: 271k]
  ------------------
  697|      0|        return NULL;
  698|   271k|    return decoder_inst->input_type;
  699|   271k|}
OSSL_DECODER_INSTANCE_get_input_structure:
  704|   271k|{
  705|   271k|    if (decoder_inst == NULL)
  ------------------
  |  Branch (705:9): [True: 0, False: 271k]
  ------------------
  706|      0|        return NULL;
  707|   271k|    *was_set = decoder_inst->flag_input_structure_was_set;
  708|   271k|    return decoder_inst->input_structure;
  709|   271k|}
decoder_lib.c:collect_all_decoders:
  391|    560|{
  392|    560|    STACK_OF(OSSL_DECODER) *skdecoders = arg;
  ------------------
  |  |   31|    560|# define STACK_OF(type) struct stack_st_##type
  ------------------
  393|       |
  394|    560|    if (OSSL_DECODER_up_ref(decoder)
  ------------------
  |  Branch (394:9): [True: 560, False: 0]
  ------------------
  395|    560|            && !sk_OSSL_DECODER_push(skdecoders, decoder))
  ------------------
  |  Branch (395:16): [True: 0, False: 560]
  ------------------
  396|      0|        OSSL_DECODER_free(decoder);
  397|    560|}
decoder_lib.c:collect_extra_decoder:
  400|  6.00k|{
  401|  6.00k|    struct collect_extra_decoder_data_st *data = arg;
  402|  6.00k|    size_t j;
  403|  6.00k|    const OSSL_PROVIDER *prov = OSSL_DECODER_get0_provider(decoder);
  404|  6.00k|    void *provctx = OSSL_PROVIDER_get0_provider_ctx(prov);
  405|       |
  406|  6.00k|    if (ossl_decoder_fast_is_a(decoder, data->output_type, &data->output_type_id)) {
  ------------------
  |  Branch (406:9): [True: 330, False: 5.67k]
  ------------------
  407|    330|        void *decoderctx = NULL;
  408|    330|        OSSL_DECODER_INSTANCE *di = NULL;
  409|       |
  410|    330|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|    330|    do {                                        \
  |  |  220|    330|        BIO *trc_out = NULL;                    \
  |  |  221|    330|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  411|      0|            BIO_printf(trc_out,
  412|      0|                       "(ctx %p) [%d] Checking out decoder %p:\n"
  413|      0|                       "    %s with %s\n",
  414|      0|                       (void *)data->ctx, data->type_check, (void *)decoder,
  415|      0|                       OSSL_DECODER_get0_name(decoder),
  416|      0|                       OSSL_DECODER_get0_properties(decoder));
  417|    330|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|    330|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  418|       |
  419|       |        /*
  420|       |         * Check that we don't already have this decoder in our stack,
  421|       |         * starting with the previous windows but also looking at what
  422|       |         * we have added in the current window.
  423|       |         */
  424|  1.14k|        for (j = data->w_prev_start; j < data->w_new_end; j++) {
  ------------------
  |  Branch (424:38): [True: 1.07k, False: 69]
  ------------------
  425|  1.07k|            OSSL_DECODER_INSTANCE *check_inst =
  426|  1.07k|                sk_OSSL_DECODER_INSTANCE_value(data->ctx->decoder_insts, j);
  427|       |
  428|  1.07k|            if (decoder->base.algodef == check_inst->decoder->base.algodef) {
  ------------------
  |  Branch (428:17): [True: 261, False: 814]
  ------------------
  429|       |                /* We found it, so don't do anything more */
  430|    261|                OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|    261|    do {                                        \
  |  |  220|    261|        BIO *trc_out = NULL;                    \
  |  |  221|    261|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  431|      0|                    BIO_printf(trc_out,
  432|      0|                               "    REJECTED: already exists in the chain\n");
  433|    261|                } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|    261|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  434|    261|                return;
  435|    261|            }
  436|  1.07k|        }
  437|       |
  438|     69|        if ((decoderctx = decoder->newctx(provctx)) == NULL)
  ------------------
  |  Branch (438:13): [True: 0, False: 69]
  ------------------
  439|      0|            return;
  440|       |
  441|     69|        if ((di = ossl_decoder_instance_new(decoder, decoderctx)) == NULL) {
  ------------------
  |  Branch (441:13): [True: 0, False: 69]
  ------------------
  442|      0|            decoder->freectx(decoderctx);
  443|      0|            return;
  444|      0|        }
  445|       |
  446|     69|        switch (data->type_check) {
  ------------------
  |  Branch (446:17): [True: 0, False: 69]
  ------------------
  447|     55|        case IS_SAME:
  ------------------
  |  Branch (447:9): [True: 55, False: 14]
  ------------------
  448|       |            /* If it differs, this is not a decoder to add for now. */
  449|     55|            if (!ossl_decoder_fast_is_a(decoder,
  ------------------
  |  Branch (449:17): [True: 27, False: 28]
  ------------------
  450|     55|                                        OSSL_DECODER_INSTANCE_get_input_type(di),
  451|     55|                                        &di->input_type_id)) {
  452|     27|                ossl_decoder_instance_free(di);
  453|     27|                OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|     27|    do {                                        \
  |  |  220|     27|        BIO *trc_out = NULL;                    \
  |  |  221|     27|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  454|      0|                    BIO_printf(trc_out,
  455|      0|                               "    REJECTED: input type doesn't match output type\n");
  456|     27|                } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|     27|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  457|     27|                return;
  458|     27|            }
  459|     28|            break;
  460|     28|        case IS_DIFFERENT:
  ------------------
  |  Branch (460:9): [True: 14, False: 55]
  ------------------
  461|       |            /* If it's the same, this is not a decoder to add for now. */
  462|     14|            if (ossl_decoder_fast_is_a(decoder,
  ------------------
  |  Branch (462:17): [True: 0, False: 14]
  ------------------
  463|     14|                                       OSSL_DECODER_INSTANCE_get_input_type(di),
  464|     14|                                       &di->input_type_id)) {
  465|      0|                ossl_decoder_instance_free(di);
  466|      0|                OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|      0|    do {                                        \
  |  |  220|      0|        BIO *trc_out = NULL;                    \
  |  |  221|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  467|      0|                    BIO_printf(trc_out,
  468|      0|                               "    REJECTED: input type matches output type\n");
  469|      0|                } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  470|      0|                return;
  471|      0|            }
  472|     14|            break;
  473|     69|        }
  474|       |
  475|       |        /*
  476|       |         * Apart from keeping w_new_end up to date, We don't care about
  477|       |         * errors here.  If it doesn't collect, then it doesn't...
  478|       |         */
  479|     42|        if (!ossl_decoder_ctx_add_decoder_inst(data->ctx, di)) {
  ------------------
  |  Branch (479:13): [True: 0, False: 42]
  ------------------
  480|      0|            ossl_decoder_instance_free(di);
  481|      0|            return;
  482|      0|        }
  483|       |
  484|     42|        data->w_new_end++;
  485|     42|    }
  486|  6.00k|}
decoder_lib.c:decoder_process:
  712|   138k|{
  713|   138k|    struct decoder_process_data_st *data = arg;
  714|   138k|    OSSL_DECODER_CTX *ctx = data->ctx;
  715|   138k|    OSSL_DECODER_INSTANCE *decoder_inst = NULL;
  716|   138k|    OSSL_DECODER *decoder = NULL;
  717|   138k|    OSSL_CORE_BIO *cbio = NULL;
  718|   138k|    BIO *bio = data->bio;
  719|   138k|    long loc;
  720|   138k|    size_t i;
  721|   138k|    int ok = 0;
  722|       |    /* For recursions */
  723|   138k|    struct decoder_process_data_st new_data;
  724|   138k|    const char *data_type = NULL;
  725|   138k|    const char *data_structure = NULL;
  726|       |
  727|       |    /*
  728|       |     * This is an indicator up the call stack that something was indeed
  729|       |     * decoded, leading to a recursive call of this function.
  730|       |     */
  731|   138k|    data->flag_next_level_called = 1;
  732|       |
  733|   138k|    memset(&new_data, 0, sizeof(new_data));
  734|   138k|    new_data.ctx = data->ctx;
  735|   138k|    new_data.recursion = data->recursion + 1;
  736|       |
  737|   138k|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  738|   138k|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  739|   138k|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  740|   138k|               : LEVEL_STR "...")
  741|       |
  742|   138k|    if (params == NULL) {
  ------------------
  |  Branch (742:9): [True: 54.6k, False: 84.0k]
  ------------------
  743|       |        /* First iteration, where we prepare for what is to come */
  744|       |
  745|  54.6k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  54.6k|    do {                                        \
  |  |  220|  54.6k|        BIO *trc_out = NULL;                    \
  |  |  221|  54.6k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  746|      0|            BIO_printf(trc_out,
  747|      0|                       "(ctx %p) starting to walk the decoder chain\n",
  748|      0|                       (void *)new_data.ctx);
  749|  54.6k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  54.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  750|       |
  751|  54.6k|        data->current_decoder_inst_index =
  752|  54.6k|            OSSL_DECODER_CTX_get_num_decoders(ctx);
  753|       |
  754|  54.6k|        bio = data->bio;
  755|  84.0k|    } else {
  756|  84.0k|        const OSSL_PARAM *p;
  757|  84.0k|        const char *trace_data_structure;
  758|       |
  759|  84.0k|        decoder_inst =
  760|  84.0k|            sk_OSSL_DECODER_INSTANCE_value(ctx->decoder_insts,
  761|  84.0k|                                           data->current_decoder_inst_index);
  762|  84.0k|        decoder = OSSL_DECODER_INSTANCE_get_decoder(decoder_inst);
  763|       |
  764|  84.0k|        data->flag_construct_called = 0;
  765|  84.0k|        if (ctx->construct != NULL) {
  ------------------
  |  Branch (765:13): [True: 84.0k, False: 0]
  ------------------
  766|  84.0k|            int rv;
  767|       |
  768|  84.0k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  84.0k|    do {                                        \
  |  |  220|  84.0k|        BIO *trc_out = NULL;                    \
  |  |  221|  84.0k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  769|      0|                BIO_printf(trc_out,
  770|      0|                           "(ctx %p) %s Running constructor\n",
  771|      0|                           (void *)new_data.ctx, LEVEL);
  ------------------
  |  |  738|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (738:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  739|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  740|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  772|  84.0k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  84.0k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  773|       |
  774|  84.0k|            rv = ctx->construct(decoder_inst, params, ctx->construct_data);
  775|       |
  776|  84.0k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  84.0k|    do {                                        \
  |  |  220|  84.0k|        BIO *trc_out = NULL;                    \
  |  |  221|  84.0k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  777|      0|                BIO_printf(trc_out,
  778|      0|                           "(ctx %p) %s Running constructor => %d\n",
  779|      0|                           (void *)new_data.ctx, LEVEL, rv);
  ------------------
  |  |  738|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (738:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  739|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  740|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  780|  84.0k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  84.0k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  781|       |
  782|  84.0k|            ok = (rv > 0);
  783|  84.0k|            if (ok) {
  ------------------
  |  Branch (783:17): [True: 29.6k, False: 54.4k]
  ------------------
  784|  29.6k|                data->flag_construct_called = 1;
  785|  29.6k|                goto end;
  786|  29.6k|            }
  787|  84.0k|        }
  788|       |
  789|       |        /* The constructor didn't return success */
  790|       |
  791|       |        /*
  792|       |         * so we try to use the object we got and feed it to any next
  793|       |         * decoder that will take it.  Object references are not
  794|       |         * allowed for this.
  795|       |         * If this data isn't present, decoding has failed.
  796|       |         */
  797|       |
  798|  54.4k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA);
  ------------------
  |  |  309|  54.4k|# define OSSL_OBJECT_PARAM_DATA "data"
  ------------------
  799|  54.4k|        if (p == NULL || p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|  54.4k|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (799:13): [True: 0, False: 54.4k]
  |  Branch (799:26): [True: 0, False: 54.4k]
  ------------------
  800|      0|            goto end;
  801|  54.4k|        new_data.bio = BIO_new_mem_buf(p->data, (int)p->data_size);
  802|  54.4k|        if (new_data.bio == NULL)
  ------------------
  |  Branch (802:13): [True: 0, False: 54.4k]
  ------------------
  803|      0|            goto end;
  804|  54.4k|        bio = new_data.bio;
  805|       |
  806|       |        /* Get the data type if there is one */
  807|  54.4k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_TYPE);
  ------------------
  |  |  311|  54.4k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  808|  54.4k|        if (p != NULL && !OSSL_PARAM_get_utf8_string_ptr(p, &data_type))
  ------------------
  |  Branch (808:13): [True: 54.4k, False: 0]
  |  Branch (808:26): [True: 0, False: 54.4k]
  ------------------
  809|      0|            goto end;
  810|       |
  811|       |        /* Get the data structure if there is one */
  812|  54.4k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_STRUCTURE);
  ------------------
  |  |  310|  54.4k|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  813|  54.4k|        if (p != NULL && !OSSL_PARAM_get_utf8_string_ptr(p, &data_structure))
  ------------------
  |  Branch (813:13): [True: 54.4k, False: 0]
  |  Branch (813:26): [True: 0, False: 54.4k]
  ------------------
  814|      0|            goto end;
  815|       |
  816|       |        /*
  817|       |         * If the data structure is "type-specific" and the data type is
  818|       |         * given, we drop the data structure.  The reasoning is that the
  819|       |         * data type is already enough to find the applicable next decoder,
  820|       |         * so an additional "type-specific" data structure is extraneous.
  821|       |         *
  822|       |         * Furthermore, if the OSSL_DECODER caller asked for a type specific
  823|       |         * structure under another name, such as "DH", we get a mismatch
  824|       |         * if the data structure we just received is "type-specific".
  825|       |         * There's only so much you can do without infusing this code with
  826|       |         * too special knowledge.
  827|       |         */
  828|  54.4k|        trace_data_structure = data_structure;
  829|  54.4k|        if (data_type != NULL && data_structure != NULL
  ------------------
  |  Branch (829:13): [True: 54.4k, False: 0]
  |  Branch (829:34): [True: 54.4k, False: 0]
  ------------------
  830|  54.4k|            && OPENSSL_strcasecmp(data_structure, "type-specific") == 0)
  ------------------
  |  Branch (830:16): [True: 0, False: 54.4k]
  ------------------
  831|      0|            data_structure = NULL;
  832|       |
  833|  54.4k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  54.4k|    do {                                        \
  |  |  220|  54.4k|        BIO *trc_out = NULL;                    \
  |  |  221|  54.4k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  834|      0|            BIO_printf(trc_out,
  835|      0|                       "(ctx %p) %s incoming from previous decoder (%p):\n"
  836|      0|                       "    data type: %s, data structure: %s%s\n",
  837|      0|                       (void *)new_data.ctx, LEVEL, (void *)decoder,
  ------------------
  |  |  738|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (738:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  739|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  740|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  838|      0|                       data_type, trace_data_structure,
  839|      0|                       (trace_data_structure == data_structure
  ------------------
  |  Branch (839:25): [True: 0, False: 0]
  ------------------
  840|      0|                        ? "" : " (dropped)"));
  841|  54.4k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  54.4k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  842|  54.4k|    }
  843|       |
  844|       |    /*
  845|       |     * If we have no more decoders to look through at this point,
  846|       |     * we failed
  847|       |     */
  848|   109k|    if (data->current_decoder_inst_index == 0)
  ------------------
  |  Branch (848:9): [True: 0, False: 109k]
  ------------------
  849|      0|        goto end;
  850|       |
  851|   109k|    if ((loc = BIO_tell(bio)) < 0) {
  ------------------
  |  |  564|   109k|# define BIO_tell(b)     (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
  |  |  ------------------
  |  |  |  |  459|   109k|# define BIO_C_FILE_TELL                         133
  |  |  ------------------
  ------------------
  |  Branch (851:9): [True: 0, False: 109k]
  ------------------
  852|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  853|      0|        goto end;
  854|      0|    }
  855|       |
  856|   109k|    if ((cbio = ossl_core_bio_new_from_bio(bio)) == NULL) {
  ------------------
  |  Branch (856:9): [True: 0, False: 109k]
  ------------------
  857|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  858|      0|        goto end;
  859|      0|    }
  860|       |
  861|   295k|    for (i = data->current_decoder_inst_index; i-- > 0;) {
  ------------------
  |  Branch (861:48): [True: 271k, False: 24.9k]
  ------------------
  862|   271k|        OSSL_DECODER_INSTANCE *new_decoder_inst =
  863|   271k|            sk_OSSL_DECODER_INSTANCE_value(ctx->decoder_insts, i);
  864|   271k|        OSSL_DECODER *new_decoder =
  865|   271k|            OSSL_DECODER_INSTANCE_get_decoder(new_decoder_inst);
  866|   271k|        void *new_decoderctx =
  867|   271k|            OSSL_DECODER_INSTANCE_get_decoder_ctx(new_decoder_inst);
  868|   271k|        const char *new_input_type =
  869|   271k|            OSSL_DECODER_INSTANCE_get_input_type(new_decoder_inst);
  870|   271k|        int n_i_s_was_set = 0;   /* We don't care here */
  871|   271k|        const char *new_input_structure =
  872|   271k|            OSSL_DECODER_INSTANCE_get_input_structure(new_decoder_inst,
  873|   271k|                                                      &n_i_s_was_set);
  874|       |
  875|   271k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|   271k|    do {                                        \
  |  |  220|   271k|        BIO *trc_out = NULL;                    \
  |  |  221|   271k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  876|      0|            BIO_printf(trc_out,
  877|      0|                       "(ctx %p) %s [%u] Considering decoder instance %p (decoder %p):\n"
  878|      0|                       "    %s with %s\n",
  879|      0|                       (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  738|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (738:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  739|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  740|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  880|      0|                       (void *)new_decoder_inst, (void *)new_decoder,
  881|      0|                       OSSL_DECODER_get0_name(new_decoder),
  882|      0|                       OSSL_DECODER_get0_properties(new_decoder));
  883|   271k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|   271k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  884|       |
  885|       |        /*
  886|       |         * If |decoder| is NULL, it means we've just started, and the caller
  887|       |         * may have specified what it expects the initial input to be.  If
  888|       |         * that's the case, we do this extra check.
  889|       |         */
  890|   271k|        if (decoder == NULL && ctx->start_input_type != NULL
  ------------------
  |  Branch (890:13): [True: 164k, False: 106k]
  |  Branch (890:32): [True: 164k, False: 0]
  ------------------
  891|   271k|            && OPENSSL_strcasecmp(ctx->start_input_type, new_input_type) != 0) {
  ------------------
  |  Branch (891:16): [True: 54.6k, False: 109k]
  ------------------
  892|  54.6k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  54.6k|    do {                                        \
  |  |  220|  54.6k|        BIO *trc_out = NULL;                    \
  |  |  221|  54.6k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  893|      0|                BIO_printf(trc_out,
  894|      0|                           "(ctx %p) %s [%u] the start input type '%s' doesn't match the input type of the considered decoder, skipping...\n",
  895|      0|                           (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  738|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (738:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  739|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  740|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  896|      0|                           ctx->start_input_type);
  897|  54.6k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  54.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  898|  54.6k|            continue;
  899|  54.6k|        }
  900|       |
  901|       |        /*
  902|       |         * If we have a previous decoder, we check that the input type
  903|       |         * of the next to be used matches the type of this previous one.
  904|       |         * |new_input_type| holds the value of the "input-type" parameter
  905|       |         * for the decoder we're currently considering.
  906|       |         */
  907|   216k|        if (decoder != NULL && !ossl_decoder_fast_is_a(decoder, new_input_type,
  ------------------
  |  Branch (907:13): [True: 106k, False: 109k]
  |  Branch (907:32): [True: 5.95k, False: 100k]
  ------------------
  908|   106k|                                                       &new_decoder_inst->input_type_id)) {
  909|  5.95k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  5.95k|    do {                                        \
  |  |  220|  5.95k|        BIO *trc_out = NULL;                    \
  |  |  221|  5.95k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  910|      0|                BIO_printf(trc_out,
  911|      0|                           "(ctx %p) %s [%u] the input type doesn't match the name of the previous decoder (%p), skipping...\n",
  912|      0|                           (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  738|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (738:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  739|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  740|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  913|      0|                           (void *)decoder);
  914|  5.95k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  5.95k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  915|  5.95k|            continue;
  916|  5.95k|        }
  917|       |
  918|       |        /*
  919|       |         * If the previous decoder gave us a data type, we check to see
  920|       |         * if that matches the decoder we're currently considering.
  921|       |         */
  922|   210k|        if (data_type != NULL && !OSSL_DECODER_is_a(new_decoder, data_type)) {
  ------------------
  |  Branch (922:13): [True: 100k, False: 109k]
  |  Branch (922:34): [True: 34.3k, False: 66.3k]
  ------------------
  923|  34.3k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  34.3k|    do {                                        \
  |  |  220|  34.3k|        BIO *trc_out = NULL;                    \
  |  |  221|  34.3k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  924|      0|                BIO_printf(trc_out,
  925|      0|                           "(ctx %p) %s [%u] the previous decoder's data type doesn't match the name of the considered decoder, skipping...\n",
  926|      0|                           (void *)new_data.ctx, LEVEL, (unsigned int)i);
  ------------------
  |  |  738|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (738:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  739|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  740|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  927|  34.3k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  34.3k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  928|  34.3k|            continue;
  929|  34.3k|        }
  930|       |
  931|       |        /*
  932|       |         * If the previous decoder gave us a data structure name, we check
  933|       |         * to see that it matches the input data structure of the decoder
  934|       |         * we're currently considering.
  935|       |         */
  936|   175k|        if (data_structure != NULL
  ------------------
  |  Branch (936:13): [True: 66.3k, False: 109k]
  ------------------
  937|   175k|            && (new_input_structure == NULL
  ------------------
  |  Branch (937:17): [True: 0, False: 66.3k]
  ------------------
  938|  66.3k|                || OPENSSL_strcasecmp(data_structure,
  ------------------
  |  Branch (938:20): [True: 11.9k, False: 54.4k]
  ------------------
  939|  66.3k|                                      new_input_structure) != 0)) {
  940|  11.9k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  11.9k|    do {                                        \
  |  |  220|  11.9k|        BIO *trc_out = NULL;                    \
  |  |  221|  11.9k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  941|      0|                BIO_printf(trc_out,
  942|      0|                           "(ctx %p) %s [%u] the previous decoder's data structure doesn't match the input structure of the considered decoder, skipping...\n",
  943|      0|                           (void *)new_data.ctx, LEVEL, (unsigned int)i);
  ------------------
  |  |  738|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (738:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  739|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  740|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  944|  11.9k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  11.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  945|  11.9k|            continue;
  946|  11.9k|        }
  947|       |
  948|       |        /*
  949|       |         * If the decoder we're currently considering specifies a structure,
  950|       |         * and this check hasn't already been done earlier in this chain of
  951|       |         * decoder_process() calls, check that it matches the user provided
  952|       |         * input structure, if one is given.
  953|       |         */
  954|   164k|        if (!data->flag_input_structure_checked
  ------------------
  |  Branch (954:13): [True: 54.6k, False: 109k]
  ------------------
  955|   164k|            && ctx->input_structure != NULL
  ------------------
  |  Branch (955:16): [True: 54.6k, False: 0]
  ------------------
  956|   164k|            && new_input_structure != NULL) {
  ------------------
  |  Branch (956:16): [True: 54.6k, False: 0]
  ------------------
  957|  54.6k|            data->flag_input_structure_checked = 1;
  958|  54.6k|            if (OPENSSL_strcasecmp(new_input_structure,
  ------------------
  |  Branch (958:17): [True: 54.6k, False: 0]
  ------------------
  959|  54.6k|                                   ctx->input_structure) != 0) {
  960|  54.6k|                OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  54.6k|    do {                                        \
  |  |  220|  54.6k|        BIO *trc_out = NULL;                    \
  |  |  221|  54.6k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  961|      0|                    BIO_printf(trc_out,
  962|      0|                               "(ctx %p) %s [%u] the previous decoder's data structure doesn't match the input structure given by the user, skipping...\n",
  963|      0|                               (void *)new_data.ctx, LEVEL, (unsigned int)i);
  ------------------
  |  |  738|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (738:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  739|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  740|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  964|  54.6k|                } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  54.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  965|  54.6k|                continue;
  966|  54.6k|            }
  967|  54.6k|        }
  968|       |
  969|       |        /*
  970|       |         * Checking the return value of BIO_reset() or BIO_seek() is unsafe.
  971|       |         * Furthermore, BIO_reset() is unsafe to use if the source BIO happens
  972|       |         * to be a BIO_s_mem(), because the earlier BIO_tell() gives us zero
  973|       |         * no matter where we are in the underlying buffer we're reading from.
  974|       |         *
  975|       |         * So, we simply do a BIO_seek(), and use BIO_tell() that we're back
  976|       |         * at the same position.  This is a best effort attempt, but BIO_seek()
  977|       |         * and BIO_tell() should come as a pair...
  978|       |         */
  979|   109k|        (void)BIO_seek(bio, loc);
  ------------------
  |  |  563|   109k|# define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)
  |  |  ------------------
  |  |  |  |  453|   109k|# define BIO_C_FILE_SEEK                         128
  |  |  ------------------
  ------------------
  980|   109k|        if (BIO_tell(bio) != loc)
  ------------------
  |  |  564|   109k|# define BIO_tell(b)     (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
  |  |  ------------------
  |  |  |  |  459|   109k|# define BIO_C_FILE_TELL                         133
  |  |  ------------------
  ------------------
  |  Branch (980:13): [True: 0, False: 109k]
  ------------------
  981|      0|            goto end;
  982|       |
  983|       |        /* Recurse */
  984|   109k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|   109k|    do {                                        \
  |  |  220|   109k|        BIO *trc_out = NULL;                    \
  |  |  221|   109k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  985|      0|            BIO_printf(trc_out,
  986|      0|                       "(ctx %p) %s [%u] Running decoder instance %p\n",
  987|      0|                       (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  738|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (738:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  739|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  740|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  988|      0|                       (void *)new_decoder_inst);
  989|   109k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|   109k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  990|       |
  991|       |        /*
  992|       |         * We only care about errors reported from decoder implementations
  993|       |         * if it returns false (i.e. there was a fatal error).
  994|       |         */
  995|   109k|        ERR_set_mark();
  996|       |
  997|   109k|        new_data.current_decoder_inst_index = i;
  998|   109k|        new_data.flag_input_structure_checked
  999|   109k|            = data->flag_input_structure_checked;
 1000|   109k|        ok = new_decoder->decode(new_decoderctx, cbio,
 1001|   109k|                                 new_data.ctx->selection,
 1002|   109k|                                 decoder_process, &new_data,
 1003|   109k|                                 ossl_pw_passphrase_callback_dec,
 1004|   109k|                                 &new_data.ctx->pwdata);
 1005|       |
 1006|   109k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|   109k|    do {                                        \
  |  |  220|   109k|        BIO *trc_out = NULL;                    \
  |  |  221|   109k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1007|      0|            BIO_printf(trc_out,
 1008|      0|                       "(ctx %p) %s [%u] Running decoder instance %p => %d"
 1009|      0|                       " (recursed further: %s, construct called: %s)\n",
 1010|      0|                       (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  738|      0|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (738:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  739|      0|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                              ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  740|      0|               : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  737|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
 1011|      0|                       (void *)new_decoder_inst, ok,
 1012|      0|                       new_data.flag_next_level_called ? "yes" : "no",
  ------------------
  |  Branch (1012:24): [True: 0, False: 0]
  ------------------
 1013|      0|                       new_data.flag_construct_called ? "yes" : "no");
  ------------------
  |  Branch (1013:24): [True: 0, False: 0]
  ------------------
 1014|   109k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|   109k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1015|       |
 1016|   109k|        data->flag_construct_called = new_data.flag_construct_called;
 1017|       |
 1018|       |        /* Break on error or if we tried to construct an object already */
 1019|   109k|        if (!ok || data->flag_construct_called) {
  ------------------
  |  Branch (1019:13): [True: 0, False: 109k]
  |  Branch (1019:20): [True: 59.3k, False: 50.1k]
  ------------------
 1020|  59.3k|            ERR_clear_last_mark();
 1021|  59.3k|            break;
 1022|  59.3k|        }
 1023|  50.1k|        ERR_pop_to_mark();
 1024|       |
 1025|       |        /*
 1026|       |         * Break if the decoder implementation that we called recursed, since
 1027|       |         * that indicates that it successfully decoded something.
 1028|       |         */
 1029|  50.1k|        if (new_data.flag_next_level_called)
  ------------------
  |  Branch (1029:13): [True: 24.7k, False: 25.3k]
  ------------------
 1030|  24.7k|            break;
 1031|  50.1k|    }
 1032|       |
 1033|   138k| end:
 1034|   138k|    ossl_core_bio_free(cbio);
 1035|   138k|    BIO_free(new_data.bio);
 1036|   138k|    return ok;
 1037|   109k|}

OSSL_DECODER_up_ref:
   43|   271k|{
   44|   271k|    int ref = 0;
   45|       |
   46|   271k|    CRYPTO_UP_REF(&decoder->base.refcnt, &ref);
   47|   271k|    return 1;
   48|   271k|}
OSSL_DECODER_free:
   51|   271k|{
   52|   271k|    int ref = 0;
   53|       |
   54|   271k|    if (decoder == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 271k]
  ------------------
   55|      0|        return;
   56|       |
   57|   271k|    CRYPTO_DOWN_REF(&decoder->base.refcnt, &ref);
   58|   271k|    if (ref > 0)
  ------------------
  |  Branch (58:9): [True: 271k, False: 40]
  ------------------
   59|   271k|        return;
   60|     40|    OPENSSL_free(decoder->base.name);
  ------------------
  |  |  107|     40|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|     40|    ossl_property_free(decoder->base.parsed_propdef);
   62|     40|    ossl_provider_free(decoder->base.prov);
   63|     40|    CRYPTO_FREE_REF(&decoder->base.refcnt);
   64|     40|    OPENSSL_free(decoder);
  ------------------
  |  |  107|     40|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   65|     40|}
ossl_decoder_from_algorithm:
  201|     40|{
  202|     40|    OSSL_DECODER *decoder = NULL;
  203|     40|    const OSSL_DISPATCH *fns = algodef->implementation;
  204|     40|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  205|       |
  206|     40|    if ((decoder = ossl_decoder_new()) == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 40]
  ------------------
  207|      0|        return NULL;
  208|     40|    decoder->base.id = id;
  209|     40|    if ((decoder->base.name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (209:9): [True: 0, False: 40]
  ------------------
  210|      0|        OSSL_DECODER_free(decoder);
  211|      0|        return NULL;
  212|      0|    }
  213|     40|    decoder->base.algodef = algodef;
  214|     40|    if ((decoder->base.parsed_propdef
  ------------------
  |  Branch (214:9): [True: 0, False: 40]
  ------------------
  215|     40|         = ossl_parse_property(libctx, algodef->property_definition)) == NULL) {
  216|      0|        OSSL_DECODER_free(decoder);
  217|      0|        return NULL;
  218|      0|    }
  219|       |
  220|    308|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (220:12): [True: 268, False: 40]
  ------------------
  221|    268|        switch (fns->function_id) {
  ------------------
  |  Branch (221:17): [True: 0, False: 268]
  ------------------
  222|     40|        case OSSL_FUNC_DECODER_NEWCTX:
  ------------------
  |  |  890|     40|# define OSSL_FUNC_DECODER_NEWCTX                      1
  ------------------
  |  Branch (222:9): [True: 40, False: 228]
  ------------------
  223|     40|            if (decoder->newctx == NULL)
  ------------------
  |  Branch (223:17): [True: 40, False: 0]
  ------------------
  224|     40|                decoder->newctx = OSSL_FUNC_decoder_newctx(fns);
  225|     40|            break;
  226|     40|        case OSSL_FUNC_DECODER_FREECTX:
  ------------------
  |  |  891|     40|# define OSSL_FUNC_DECODER_FREECTX                     2
  ------------------
  |  Branch (226:9): [True: 40, False: 228]
  ------------------
  227|     40|            if (decoder->freectx == NULL)
  ------------------
  |  Branch (227:17): [True: 40, False: 0]
  ------------------
  228|     40|                decoder->freectx = OSSL_FUNC_decoder_freectx(fns);
  229|     40|            break;
  230|      0|        case OSSL_FUNC_DECODER_GET_PARAMS:
  ------------------
  |  |  892|      0|# define OSSL_FUNC_DECODER_GET_PARAMS                  3
  ------------------
  |  Branch (230:9): [True: 0, False: 268]
  ------------------
  231|      0|            if (decoder->get_params == NULL)
  ------------------
  |  Branch (231:17): [True: 0, False: 0]
  ------------------
  232|      0|                decoder->get_params =
  233|      0|                    OSSL_FUNC_decoder_get_params(fns);
  234|      0|            break;
  235|      0|        case OSSL_FUNC_DECODER_GETTABLE_PARAMS:
  ------------------
  |  |  893|      0|# define OSSL_FUNC_DECODER_GETTABLE_PARAMS             4
  ------------------
  |  Branch (235:9): [True: 0, False: 268]
  ------------------
  236|      0|            if (decoder->gettable_params == NULL)
  ------------------
  |  Branch (236:17): [True: 0, False: 0]
  ------------------
  237|      0|                decoder->gettable_params =
  238|      0|                    OSSL_FUNC_decoder_gettable_params(fns);
  239|      0|            break;
  240|     37|        case OSSL_FUNC_DECODER_SET_CTX_PARAMS:
  ------------------
  |  |  894|     37|# define OSSL_FUNC_DECODER_SET_CTX_PARAMS              5
  ------------------
  |  Branch (240:9): [True: 37, False: 231]
  ------------------
  241|     37|            if (decoder->set_ctx_params == NULL)
  ------------------
  |  Branch (241:17): [True: 37, False: 0]
  ------------------
  242|     37|                decoder->set_ctx_params =
  243|     37|                    OSSL_FUNC_decoder_set_ctx_params(fns);
  244|     37|            break;
  245|     37|        case OSSL_FUNC_DECODER_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  895|     37|# define OSSL_FUNC_DECODER_SETTABLE_CTX_PARAMS         6
  ------------------
  |  Branch (245:9): [True: 37, False: 231]
  ------------------
  246|     37|            if (decoder->settable_ctx_params == NULL)
  ------------------
  |  Branch (246:17): [True: 37, False: 0]
  ------------------
  247|     37|                decoder->settable_ctx_params =
  248|     37|                    OSSL_FUNC_decoder_settable_ctx_params(fns);
  249|     37|            break;
  250|     37|        case OSSL_FUNC_DECODER_DOES_SELECTION:
  ------------------
  |  |  896|     37|# define OSSL_FUNC_DECODER_DOES_SELECTION             10
  ------------------
  |  Branch (250:9): [True: 37, False: 231]
  ------------------
  251|     37|            if (decoder->does_selection == NULL)
  ------------------
  |  Branch (251:17): [True: 37, False: 0]
  ------------------
  252|     37|                decoder->does_selection =
  253|     37|                    OSSL_FUNC_decoder_does_selection(fns);
  254|     37|            break;
  255|     40|        case OSSL_FUNC_DECODER_DECODE:
  ------------------
  |  |  897|     40|# define OSSL_FUNC_DECODER_DECODE                     11
  ------------------
  |  Branch (255:9): [True: 40, False: 228]
  ------------------
  256|     40|            if (decoder->decode == NULL)
  ------------------
  |  Branch (256:17): [True: 40, False: 0]
  ------------------
  257|     40|                decoder->decode = OSSL_FUNC_decoder_decode(fns);
  258|     40|            break;
  259|     37|        case OSSL_FUNC_DECODER_EXPORT_OBJECT:
  ------------------
  |  |  898|     37|# define OSSL_FUNC_DECODER_EXPORT_OBJECT              20
  ------------------
  |  Branch (259:9): [True: 37, False: 231]
  ------------------
  260|     37|            if (decoder->export_object == NULL)
  ------------------
  |  Branch (260:17): [True: 37, False: 0]
  ------------------
  261|     37|                decoder->export_object = OSSL_FUNC_decoder_export_object(fns);
  262|     37|            break;
  263|    268|        }
  264|    268|    }
  265|       |    /*
  266|       |     * Try to check that the method is sensible.
  267|       |     * If you have a constructor, you must have a destructor and vice versa.
  268|       |     * You must have at least one of the encoding driver functions.
  269|       |     */
  270|     40|    if (!((decoder->newctx == NULL && decoder->freectx == NULL)
  ------------------
  |  Branch (270:12): [True: 0, False: 40]
  |  Branch (270:39): [True: 0, False: 0]
  ------------------
  271|     40|          || (decoder->newctx != NULL && decoder->freectx != NULL))
  ------------------
  |  Branch (271:15): [True: 40, False: 0]
  |  Branch (271:42): [True: 40, False: 0]
  ------------------
  272|     40|        || decoder->decode == NULL) {
  ------------------
  |  Branch (272:12): [True: 0, False: 40]
  ------------------
  273|      0|        OSSL_DECODER_free(decoder);
  274|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  275|      0|        return NULL;
  276|      0|    }
  277|       |
  278|     40|    if (prov != NULL && !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (278:9): [True: 40, False: 0]
  |  Branch (278:25): [True: 0, False: 40]
  ------------------
  279|      0|        OSSL_DECODER_free(decoder);
  280|      0|        return NULL;
  281|      0|    }
  282|       |
  283|     40|    decoder->base.prov = prov;
  284|     40|    return decoder;
  285|     40|}
OSSL_DECODER_get0_provider:
  455|   395k|{
  456|   395k|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|   395k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   395k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (456:9): [True: 0, False: 395k]
  ------------------
  457|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  458|      0|        return 0;
  459|      0|    }
  460|       |
  461|   395k|    return decoder->base.prov;
  462|   395k|}
ossl_decoder_parsed_properties:
  476|    102|{
  477|    102|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|    102|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    102|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (477:9): [True: 0, False: 102]
  ------------------
  478|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  479|      0|        return 0;
  480|      0|    }
  481|       |
  482|    102|    return decoder->base.parsed_propdef;
  483|    102|}
ossl_decoder_get_number:
  486|   105k|{
  487|   105k|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|   105k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   105k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (487:9): [True: 0, False: 105k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  489|      0|        return 0;
  490|      0|    }
  491|       |
  492|   105k|    return decoder->base.id;
  493|   105k|}
OSSL_DECODER_is_a:
  506|   100k|{
  507|   100k|    if (decoder->base.prov != NULL) {
  ------------------
  |  Branch (507:9): [True: 100k, False: 0]
  ------------------
  508|   100k|        OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov);
  509|   100k|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  510|       |
  511|   100k|        return ossl_namemap_name2num(namemap, name) == decoder->base.id;
  512|   100k|    }
  513|      0|    return 0;
  514|   100k|}
ossl_decoder_fast_is_a:
  525|   112k|{
  526|   112k|    int id = *id_cache;
  527|       |
  528|   112k|    if (id <= 0)
  ------------------
  |  Branch (528:9): [True: 108k, False: 4.29k]
  ------------------
  529|   108k|        *id_cache = id = resolve_name(decoder, name);
  530|       |
  531|   112k|    return id > 0 && ossl_decoder_get_number(decoder) == id;
  ------------------
  |  Branch (531:12): [True: 105k, False: 7.59k]
  |  Branch (531:22): [True: 101k, False: 4.07k]
  ------------------
  532|   112k|}
OSSL_DECODER_do_all_provided:
  550|    882|{
  551|    882|    struct decoder_data_st methdata;
  552|    882|    struct do_one_data_st data;
  553|       |
  554|    882|    methdata.libctx = libctx;
  555|    882|    methdata.tmp_store = NULL;
  556|    882|    (void)inner_ossl_decoder_fetch(&methdata, NULL, NULL /* properties */);
  557|       |
  558|    882|    data.user_fn = user_fn;
  559|    882|    data.user_arg = user_arg;
  560|    882|    if (methdata.tmp_store != NULL)
  ------------------
  |  Branch (560:9): [True: 0, False: 882]
  ------------------
  561|      0|        ossl_method_store_do_all(methdata.tmp_store, &do_one, &data);
  562|    882|    ossl_method_store_do_all(get_decoder_store(libctx), &do_one, &data);
  563|    882|    dealloc_tmp_decoder_store(methdata.tmp_store);
  564|    882|}
OSSL_DECODER_CTX_new:
  623|  59.7k|{
  624|  59.7k|    OSSL_DECODER_CTX *ctx;
  625|       |
  626|  59.7k|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |   99|  59.7k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  59.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  59.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  627|  59.7k|    return ctx;
  628|  59.7k|}
OSSL_DECODER_CTX_free:
  663|   114k|{
  664|   114k|    if (ctx != NULL) {
  ------------------
  |  Branch (664:9): [True: 59.7k, False: 54.4k]
  ------------------
  665|  59.7k|        if (ctx->cleanup != NULL)
  ------------------
  |  Branch (665:13): [True: 54.6k, False: 5.09k]
  ------------------
  666|  54.6k|            ctx->cleanup(ctx->construct_data);
  667|  59.7k|        sk_OSSL_DECODER_INSTANCE_pop_free(ctx->decoder_insts,
  668|  59.7k|                                          ossl_decoder_instance_free);
  669|  59.7k|        ossl_pw_clear_passphrase_data(&ctx->pwdata);
  670|  59.7k|        OPENSSL_free(ctx);
  ------------------
  |  |  107|  59.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  59.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  59.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  671|  59.7k|    }
  672|   114k|}
decoder_meth.c:ossl_decoder_new:
   29|     40|{
   30|     40|    OSSL_DECODER *decoder = NULL;
   31|       |
   32|     40|    if ((decoder = OPENSSL_zalloc(sizeof(*decoder))) == NULL)
  ------------------
  |  |   99|     40|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (32:9): [True: 0, False: 40]
  ------------------
   33|      0|        return NULL;
   34|     40|    if (!CRYPTO_NEW_REF(&decoder->base.refcnt, 1)) {
  ------------------
  |  Branch (34:9): [True: 0, False: 40]
  ------------------
   35|      0|        OSSL_DECODER_free(decoder);
   36|      0|        return NULL;
   37|      0|    }
   38|       |
   39|     40|    return decoder;
   40|     40|}
decoder_meth.c:inner_ossl_decoder_fetch:
  343|    882|{
  344|    882|    OSSL_METHOD_STORE *store = get_decoder_store(methdata->libctx);
  345|    882|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  346|    882|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (346:31): [True: 0, False: 882]
  ------------------
  347|    882|    void *method = NULL;
  348|    882|    int unsupported, id;
  349|       |
  350|    882|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (350:9): [True: 0, False: 882]
  |  Branch (350:26): [True: 0, False: 882]
  ------------------
  351|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  352|      0|        return NULL;
  353|      0|    }
  354|       |
  355|    882|    id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (355:10): [True: 0, False: 882]
  ------------------
  356|       |
  357|       |    /*
  358|       |     * If we haven't found the name yet, chances are that the algorithm to
  359|       |     * be fetched is unsupported.
  360|       |     */
  361|    882|    unsupported = id == 0;
  362|       |
  363|    882|    if (id == 0
  ------------------
  |  Branch (363:9): [True: 882, False: 0]
  ------------------
  364|    882|        || !ossl_method_store_cache_get(store, NULL, id, propq, &method)) {
  ------------------
  |  Branch (364:12): [True: 0, False: 0]
  ------------------
  365|    882|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  366|    882|            get_tmp_decoder_store,
  367|    882|            reserve_decoder_store,
  368|    882|            unreserve_decoder_store,
  369|    882|            get_decoder_from_store,
  370|    882|            put_decoder_in_store,
  371|    882|            construct_decoder,
  372|    882|            destruct_decoder
  373|    882|        };
  374|    882|        OSSL_PROVIDER *prov = NULL;
  375|       |
  376|    882|        methdata->id = id;
  377|    882|        methdata->names = name;
  378|    882|        methdata->propquery = propq;
  379|    882|        methdata->flag_construct_error_occurred = 0;
  380|    882|        if ((method = ossl_method_construct(methdata->libctx, OSSL_OP_DECODER,
  ------------------
  |  |  266|    882|# define OSSL_OP_DECODER                            21
  ------------------
  |  Branch (380:13): [True: 0, False: 882]
  ------------------
  381|    882|                                            &prov, 0 /* !force_cache */,
  382|    882|                                            &mcm, methdata)) != NULL) {
  383|       |            /*
  384|       |             * If construction did create a method for us, we know that
  385|       |             * there is a correct name_id and meth_id, since those have
  386|       |             * already been calculated in get_decoder_from_store() and
  387|       |             * put_decoder_in_store() above.
  388|       |             */
  389|      0|            if (id == 0 && name != NULL)
  ------------------
  |  Branch (389:17): [True: 0, False: 0]
  |  Branch (389:28): [True: 0, False: 0]
  ------------------
  390|      0|                id = ossl_namemap_name2num(namemap, name);
  391|      0|            if (id != 0)
  ------------------
  |  Branch (391:17): [True: 0, False: 0]
  ------------------
  392|      0|                ossl_method_store_cache_set(store, prov, id, propq, method,
  393|      0|                                            up_ref_decoder, free_decoder);
  394|      0|        }
  395|       |
  396|       |        /*
  397|       |         * If we never were in the constructor, the algorithm to be fetched
  398|       |         * is unsupported.
  399|       |         */
  400|    882|        unsupported = !methdata->flag_construct_error_occurred;
  401|    882|    }
  402|       |
  403|    882|    if ((id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (403:10): [True: 0, False: 882]
  |  Branch (403:21): [True: 0, False: 882]
  |  Branch (403:38): [True: 0, False: 0]
  ------------------
  404|      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 (404:20): [True: 0, False: 0]
  ------------------
  405|       |
  406|      0|        if (name == NULL)
  ------------------
  |  Branch (406:13): [True: 0, False: 0]
  ------------------
  407|      0|            name = ossl_namemap_num2name(namemap, id, 0);
  408|      0|        ERR_raise_data(ERR_LIB_OSSL_DECODER, code,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  ------------------
  409|      0|                       "%s, Name (%s : %d), Properties (%s)",
  410|      0|                       ossl_lib_ctx_get_descriptor(methdata->libctx),
  411|      0|                       name == NULL ? "<null>" : name, id,
  ------------------
  |  Branch (411:24): [True: 0, False: 0]
  ------------------
  412|      0|                       properties == NULL ? "<null>" : properties);
  ------------------
  |  Branch (412:24): [True: 0, False: 0]
  ------------------
  413|      0|    }
  414|       |
  415|    882|    return method;
  416|    882|}
decoder_meth.c:reserve_decoder_store:
  107|    882|{
  108|    882|    struct decoder_data_st *methdata = data;
  109|       |
  110|    882|    if (store == NULL
  ------------------
  |  Branch (110:9): [True: 882, False: 0]
  ------------------
  111|    882|        && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (111:12): [True: 0, False: 882]
  ------------------
  112|      0|        return 0;
  113|       |
  114|    882|    return ossl_method_lock_store(store);
  115|    882|}
decoder_meth.c:unreserve_decoder_store:
  118|    882|{
  119|    882|    struct decoder_data_st *methdata = data;
  120|       |
  121|    882|    if (store == NULL
  ------------------
  |  Branch (121:9): [True: 882, False: 0]
  ------------------
  122|    882|        && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (122:12): [True: 0, False: 882]
  ------------------
  123|      0|        return 0;
  124|       |
  125|    882|    return ossl_method_unlock_store(store);
  126|    882|}
decoder_meth.c:get_decoder_from_store:
  131|    882|{
  132|    882|    struct decoder_data_st *methdata = data;
  133|    882|    void *method = NULL;
  134|    882|    int id;
  135|       |
  136|       |    /*
  137|       |     * get_decoder_from_store() is only called to try and get the method
  138|       |     * that OSSL_DECODER_fetch() is asking for, and the name or name id are
  139|       |     * passed via methdata.
  140|       |     */
  141|    882|    if ((id = methdata->id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (141:9): [True: 882, False: 0]
  |  Branch (141:37): [True: 0, False: 882]
  ------------------
  142|      0|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  143|      0|        const char *names = methdata->names;
  144|      0|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   25|      0|#define NAME_SEPARATOR ':'
  ------------------
  145|      0|        size_t l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (145:21): [True: 0, False: 0]
  ------------------
  146|       |
  147|      0|        if (namemap == 0)
  ------------------
  |  Branch (147:13): [True: 0, False: 0]
  ------------------
  148|      0|            return NULL;
  149|      0|        id = ossl_namemap_name2num_n(namemap, names, l);
  150|      0|    }
  151|       |
  152|    882|    if (id == 0)
  ------------------
  |  Branch (152:9): [True: 882, False: 0]
  ------------------
  153|    882|        return NULL;
  154|       |
  155|      0|    if (store == NULL
  ------------------
  |  Branch (155:9): [True: 0, False: 0]
  ------------------
  156|      0|        && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (156:12): [True: 0, False: 0]
  ------------------
  157|      0|        return NULL;
  158|       |
  159|      0|    if (!ossl_method_store_fetch(store, id, methdata->propquery, prov, &method))
  ------------------
  |  Branch (159:9): [True: 0, False: 0]
  ------------------
  160|      0|        return NULL;
  161|      0|    return method;
  162|      0|}
decoder_meth.c:put_decoder_in_store:
  168|     40|{
  169|     40|    struct decoder_data_st *methdata = data;
  170|     40|    OSSL_NAMEMAP *namemap;
  171|     40|    int id;
  172|     40|    size_t l = 0;
  173|       |
  174|       |    /*
  175|       |     * put_decoder_in_store() is only called with an OSSL_DECODER method that
  176|       |     * was successfully created by construct_decoder() below, which means that
  177|       |     * all the names should already be stored in the namemap with the same
  178|       |     * numeric identity, so just use the first to get that identity.
  179|       |     */
  180|     40|    if (names != NULL) {
  ------------------
  |  Branch (180:9): [True: 40, False: 0]
  ------------------
  181|     40|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   25|     40|#define NAME_SEPARATOR ':'
  ------------------
  182|       |
  183|     40|        l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (183:14): [True: 40, False: 0]
  ------------------
  184|     40|    }
  185|       |
  186|     40|    if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
  ------------------
  |  Branch (186:9): [True: 0, False: 40]
  ------------------
  187|     40|        || (id = ossl_namemap_name2num_n(namemap, names, l)) == 0)
  ------------------
  |  Branch (187:12): [True: 0, False: 40]
  ------------------
  188|      0|        return 0;
  189|       |
  190|     40|    if (store == NULL && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (190:9): [True: 40, False: 0]
  |  Branch (190:26): [True: 0, False: 40]
  ------------------
  191|      0|        return 0;
  192|       |
  193|     40|    return ossl_method_store_add(store, prov, id, propdef, method,
  194|     40|                                 (int (*)(void *))OSSL_DECODER_up_ref,
  195|     40|                                 (void (*)(void *))OSSL_DECODER_free);
  196|     40|}
decoder_meth.c:construct_decoder:
  295|     40|{
  296|       |    /*
  297|       |     * This function is only called if get_decoder_from_store() returned
  298|       |     * NULL, so it's safe to say that of all the spots to create a new
  299|       |     * namemap entry, this is it.  Should the name already exist there, we
  300|       |     * know that ossl_namemap_add() will return its corresponding number.
  301|       |     */
  302|     40|    struct decoder_data_st *methdata = data;
  303|     40|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  304|     40|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  305|     40|    const char *names = algodef->algorithm_names;
  306|     40|    int id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
  ------------------
  |  |   25|     40|#define NAME_SEPARATOR ':'
  ------------------
  307|     40|    void *method = NULL;
  308|       |
  309|     40|    if (id != 0)
  ------------------
  |  Branch (309:9): [True: 40, False: 0]
  ------------------
  310|     40|        method = ossl_decoder_from_algorithm(id, algodef, prov);
  311|       |
  312|       |    /*
  313|       |     * Flag to indicate that there was actual construction errors.  This
  314|       |     * helps inner_evp_generic_fetch() determine what error it should
  315|       |     * record on inaccessible algorithms.
  316|       |     */
  317|     40|    if (method == NULL)
  ------------------
  |  Branch (317:9): [True: 0, False: 40]
  ------------------
  318|      0|        methdata->flag_construct_error_occurred = 1;
  319|       |
  320|     40|    return method;
  321|     40|}
decoder_meth.c:destruct_decoder:
  325|     40|{
  326|     40|    OSSL_DECODER_free(method);
  327|     40|}
decoder_meth.c:dealloc_tmp_decoder_store:
   95|    882|{
   96|    882|    if (store != NULL)
  ------------------
  |  Branch (96:9): [True: 0, False: 882]
  ------------------
   97|      0|        ossl_method_store_free(store);
   98|    882|}
decoder_meth.c:get_decoder_store:
  102|  3.56k|{
  103|  3.56k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_STORE_INDEX);
  ------------------
  |  |  111|  3.56k|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  104|  3.56k|}
decoder_meth.c:resolve_name:
  517|   108k|{
  518|   108k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov);
  519|   108k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  520|       |
  521|   108k|    return ossl_namemap_name2num(namemap, name);
  522|   108k|}
decoder_meth.c:do_one:
  540|  35.2k|{
  541|  35.2k|    struct do_one_data_st *data = arg;
  542|       |
  543|  35.2k|    data->user_fn(method, data->user_arg);
  544|  35.2k|}

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

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

ENGINE_get_pkey_asn1_meth_engine:
   78|   105k|{
   79|   105k|    return ossl_engine_table_select(&pkey_asn1_meth_table, nid,
   80|   105k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  279|   105k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  280|   105k|#   define OPENSSL_LINE __LINE__
  ------------------
   81|   105k|}
ENGINE_pkey_asn1_find_str:
  191|   150k|{
  192|   150k|    ENGINE_FIND_STR fstr;
  193|   150k|    fstr.e = NULL;
  194|   150k|    fstr.ameth = NULL;
  195|   150k|    fstr.str = str;
  196|   150k|    fstr.len = len;
  197|       |
  198|   150k|    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
  ------------------
  |  |  130|   150k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 150k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (198:9): [True: 0, False: 150k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  201|      0|        return NULL;
  202|      0|    }
  203|       |
  204|   150k|    if (!CRYPTO_THREAD_read_lock(global_engine_lock))
  ------------------
  |  Branch (204:9): [True: 0, False: 150k]
  ------------------
  205|      0|        return NULL;
  206|   150k|    engine_table_doall(pkey_asn1_meth_table, look_str_cb, &fstr);
  207|       |    /* If found obtain a structural reference to engine */
  208|   150k|    if (fstr.e != NULL) {
  ------------------
  |  Branch (208:9): [True: 0, False: 150k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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,                                       \
  |  |  ------------------
  |  |  |  |  300|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6))
  |  |  |  |  ------------------
  |  |  |  |  |  |  282|      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|   150k|    *pe = fstr.e;
  219|   150k|    CRYPTO_THREAD_unlock(global_engine_lock);
  220|   150k|    return fstr.ameth;
  221|   150k|}

ENGINE_get_cipher_engine:
   67|      5|{
   68|      5|    return ossl_engine_table_select(&cipher_table, nid,
   69|      5|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  279|      5|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  280|      5|#   define OPENSSL_LINE __LINE__
  ------------------
   70|      5|}

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

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

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

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

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

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

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

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);
  ------------------
  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  ------------------
                  CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  280|      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|     70|{
  273|     70|#ifndef OPENSSL_NO_ERR
  274|     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 (274:9): [True: 0, False: 70]
  ------------------
  275|      0|        return 0;
  276|       |
  277|     70|    err_load_strings(ERR_str_libraries);
  278|     70|    err_load_strings(ERR_str_reasons);
  279|     70|#endif
  280|     70|    return 1;
  281|     70|}
ERR_load_strings_const:
  297|     68|{
  298|     68|#ifndef OPENSSL_NO_ERR
  299|     68|    if (ossl_err_load_ERR_strings() == 0)
  ------------------
  |  Branch (299:9): [True: 0, False: 68]
  ------------------
  300|      0|        return 0;
  301|     68|    err_load_strings(str);
  302|     68|#endif
  303|       |
  304|     68|    return 1;
  305|     68|}
ERR_clear_error:
  335|  8.56k|{
  336|  8.56k|    int i;
  337|  8.56k|    ERR_STATE *es;
  338|       |
  339|  8.56k|    es = ossl_err_get_state_int();
  340|  8.56k|    if (es == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 8.56k]
  ------------------
  341|      0|        return;
  342|       |
  343|   145k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|   145k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (343:17): [True: 137k, False: 8.56k]
  ------------------
  344|   137k|        err_clear(es, i, 0);
  345|   137k|    }
  346|  8.56k|    es->top = es->bottom = 0;
  347|  8.56k|}
ERR_peek_last_error:
  410|   661k|{
  411|   661k|    return get_error_values(EV_PEEK_LAST, NULL, NULL, NULL, NULL, NULL);
  412|   661k|}
ERR_reason_error_string:
  613|     68|{
  614|     68|#ifndef OPENSSL_NO_ERR
  615|     68|    ERR_STRING_DATA d, *p = NULL;
  616|     68|    unsigned long l, r;
  617|       |
  618|     68|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|     68|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 68, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (618:9): [True: 0, False: 68]
  ------------------
  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|     68|    if (ERR_SYSTEM_ERROR(e))
  ------------------
  |  |  239|     68|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|     68|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 68]
  |  |  ------------------
  ------------------
  628|      0|        return NULL;
  629|       |
  630|     68|    l = ERR_GET_LIB(e);
  631|     68|    r = ERR_GET_REASON(e);
  632|     68|    d.error = ERR_PACK(l, 0, r);
  ------------------
  |  |  279|     68|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     68|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     68|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     68|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     68|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  633|     68|    p = int_err_get_item(&d);
  634|     68|    if (p == NULL) {
  ------------------
  |  Branch (634:9): [True: 68, False: 0]
  ------------------
  635|     68|        d.error = ERR_PACK(0, 0, r);
  ------------------
  |  |  279|     68|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     68|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     68|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     68|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     68|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  636|     68|        p = int_err_get_item(&d);
  637|     68|    }
  638|     68|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (638:13): [True: 68, False: 0]
  ------------------
  639|       |#else
  640|       |    return NULL;
  641|       |#endif
  642|     68|}
ossl_err_get_state_int:
  673|  5.68M|{
  674|  5.68M|    ERR_STATE *state;
  675|  5.68M|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  5.68M|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|  5.68M|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  5.68M|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 3, False: 5.68M]
  ------------------
  678|      3|        return NULL;
  679|       |
  680|  5.68M|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|  5.68M|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 5.68M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 5.68M]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|  5.68M|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|  5.68M|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 5.68M]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|  5.68M|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 2, False: 5.68M]
  ------------------
  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);
  ------------------
  |  |  450|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  706|      2|    }
  707|       |
  708|  5.68M|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  5.68M|# define set_sys_error(e)        errno=(e)
  ------------------
  709|  5.68M|    return state;
  710|  5.68M|}
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|      1|{
  766|      1|    int ret;
  767|       |
  768|      1|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (768:9): [True: 0, False: 1]
  ------------------
  769|      0|        return 0;
  770|       |
  771|      1|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (771:9): [True: 0, False: 1]
  ------------------
  772|      0|        return 0;
  773|      1|    ret = int_err_library_number++;
  774|      1|    CRYPTO_THREAD_unlock(err_string_lock);
  775|      1|    return ret;
  776|      1|}
ERR_add_error_data:
  813|  75.3k|{
  814|  75.3k|    va_list args;
  815|  75.3k|    va_start(args, num);
  816|  75.3k|    ERR_add_error_vdata(num, args);
  817|  75.3k|    va_end(args);
  818|  75.3k|}
ERR_add_error_vdata:
  821|  75.3k|{
  822|  75.3k|    int i, len, size;
  823|  75.3k|    int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   48|  75.3k|# define ERR_TXT_MALLOCED        0x01
  ------------------
                  int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   49|  75.3k|# define ERR_TXT_STRING          0x02
  ------------------
  824|  75.3k|    char *str, *arg;
  825|  75.3k|    ERR_STATE *es;
  826|       |
  827|       |    /* Get the current error data; if an allocated string get it. */
  828|  75.3k|    es = ossl_err_get_state_int();
  829|  75.3k|    if (es == NULL)
  ------------------
  |  Branch (829:9): [True: 0, False: 75.3k]
  ------------------
  830|      0|        return;
  831|  75.3k|    i = es->top;
  832|       |
  833|       |    /*
  834|       |     * If err_data is allocated already, reuse the space.
  835|       |     * Otherwise, allocate a small new buffer.
  836|       |     */
  837|  75.3k|    if ((es->err_data_flags[i] & flags) == flags) {
  ------------------
  |  Branch (837:9): [True: 0, False: 75.3k]
  ------------------
  838|      0|        str = es->err_data[i];
  839|      0|        size = es->err_data_size[i];
  840|       |
  841|       |        /*
  842|       |         * To protect the string we just grabbed from tampering by other
  843|       |         * functions we may call, or to protect them from freeing a pointer
  844|       |         * that may no longer be valid at that point, we clear away the
  845|       |         * data pointer and the flags.  We will set them again at the end
  846|       |         * of this function.
  847|       |         */
  848|      0|        es->err_data[i] = NULL;
  849|      0|        es->err_data_flags[i] = 0;
  850|  75.3k|    } else if ((str = OPENSSL_malloc(size = 81)) == NULL) {
  ------------------
  |  |   97|  75.3k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  75.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  75.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (850:16): [True: 0, False: 75.3k]
  ------------------
  851|      0|        return;
  852|  75.3k|    } else {
  853|  75.3k|        str[0] = '\0';
  854|  75.3k|    }
  855|  75.3k|    len = strlen(str);
  856|       |
  857|   363k|    while (--num >= 0) {
  ------------------
  |  Branch (857:12): [True: 288k, False: 75.3k]
  ------------------
  858|   288k|        arg = va_arg(args, char *);
  859|   288k|        if (arg == NULL)
  ------------------
  |  Branch (859:13): [True: 0, False: 288k]
  ------------------
  860|      0|            arg = "<NULL>";
  861|   288k|        len += strlen(arg);
  862|   288k|        if (len >= size) {
  ------------------
  |  Branch (862:13): [True: 0, False: 288k]
  ------------------
  863|      0|            char *p;
  864|       |
  865|      0|            size = len + 20;
  866|      0|            p = OPENSSL_realloc(str, size);
  ------------------
  |  |  101|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  867|      0|            if (p == NULL) {
  ------------------
  |  Branch (867:17): [True: 0, False: 0]
  ------------------
  868|      0|                OPENSSL_free(str);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  869|      0|                return;
  870|      0|            }
  871|      0|            str = p;
  872|      0|        }
  873|   288k|        OPENSSL_strlcat(str, arg, (size_t)size);
  874|   288k|    }
  875|  75.3k|    if (!err_set_error_data_int(str, size, flags, 0))
  ------------------
  |  Branch (875:9): [True: 0, False: 75.3k]
  ------------------
  876|      0|        OPENSSL_free(str);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  877|  75.3k|}
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_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)))
  ------------------
  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|  8.63k|{
  173|  8.63k|    unsigned long ret, l;
  174|       |
  175|  8.63k|    l = a->error;
  176|  8.63k|    ret = l ^ ERR_GET_LIB(l);
  177|  8.63k|    return (ret ^ ret % 19 * 13);
  178|  8.63k|}
err.c:err_string_data_cmp:
  182|  5.87k|{
  183|  5.87k|    if (a->error == b->error)
  ------------------
  |  Branch (183:9): [True: 5.57k, False: 292]
  ------------------
  184|  5.57k|        return 0;
  185|    292|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (185:12): [True: 160, False: 132]
  ------------------
  186|  5.87k|}
err.c:err_load_strings:
  260|    208|{
  261|    208|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (261:9): [True: 0, False: 208]
  ------------------
  262|      0|        return 0;
  263|  8.70k|    for (; str->error; str++)
  ------------------
  |  Branch (263:12): [True: 8.49k, False: 208]
  ------------------
  264|  8.49k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  378|  8.70k|#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|    208|                                       (ERR_STRING_DATA *)str);
  266|    208|    CRYPTO_THREAD_unlock(err_string_lock);
  267|    208|    return 1;
  268|    208|}
err.c:get_error_values:
  448|   661k|{
  449|   661k|    int i = 0;
  450|   661k|    ERR_STATE *es;
  451|   661k|    unsigned long ret;
  452|       |
  453|   661k|    es = ossl_err_get_state_int();
  454|   661k|    if (es == NULL)
  ------------------
  |  Branch (454:9): [True: 0, False: 661k]
  ------------------
  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|   661k|    while (es->bottom != es->top) {
  ------------------
  |  Branch (461:12): [True: 581k, False: 79.5k]
  ------------------
  462|   581k|        if (es->err_flags[es->top] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|   581k|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (462:13): [True: 0, False: 581k]
  ------------------
  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|   581k|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|   581k|#  define ERR_NUM_ERRORS  16
  ------------------
  468|   581k|        if (es->err_flags[i] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|   581k|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (468:13): [True: 0, False: 581k]
  ------------------
  469|      0|            es->bottom = i;
  470|      0|            err_clear(es, es->bottom, 0);
  471|      0|            continue;
  472|      0|        }
  473|   581k|        break;
  474|   581k|    }
  475|       |
  476|       |    /* If everything has been cleared, the stack is empty. */
  477|   661k|    if (es->bottom == es->top)
  ------------------
  |  Branch (477:9): [True: 79.5k, False: 581k]
  ------------------
  478|  79.5k|        return 0;
  479|       |
  480|       |    /* Which error, the top of stack (latest one) or the first one? */
  481|   581k|    if (g == EV_PEEK_LAST)
  ------------------
  |  Branch (481:9): [True: 581k, False: 0]
  ------------------
  482|   581k|        i = es->top;
  483|      0|    else
  484|      0|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
  485|       |
  486|   581k|    ret = es->err_buffer[i];
  487|   581k|    if (g == EV_POP) {
  ------------------
  |  Branch (487:9): [True: 0, False: 581k]
  ------------------
  488|      0|        es->bottom = i;
  489|      0|        es->err_buffer[i] = 0;
  490|      0|    }
  491|       |
  492|   581k|    if (file != NULL) {
  ------------------
  |  Branch (492:9): [True: 0, False: 581k]
  ------------------
  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|   581k|    if (line != NULL)
  ------------------
  |  Branch (497:9): [True: 0, False: 581k]
  ------------------
  498|      0|        *line = es->err_line[i];
  499|   581k|    if (func != NULL) {
  ------------------
  |  Branch (499:9): [True: 0, False: 581k]
  ------------------
  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|   581k|    if (flags != NULL)
  ------------------
  |  Branch (504:9): [True: 0, False: 581k]
  ------------------
  505|      0|        *flags = es->err_data_flags[i];
  506|   581k|    if (data == NULL) {
  ------------------
  |  Branch (506:9): [True: 581k, False: 0]
  ------------------
  507|   581k|        if (g == EV_POP) {
  ------------------
  |  Branch (507:13): [True: 0, False: 581k]
  ------------------
  508|      0|            err_clear_data(es, i, 0);
  509|      0|        }
  510|   581k|    } 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|   581k|    return ret;
  519|   661k|}
err.c:int_err_get_item:
  189|    136|{
  190|    136|    ERR_STRING_DATA *p = NULL;
  191|       |
  192|    136|    if (!CRYPTO_THREAD_read_lock(err_string_lock))
  ------------------
  |  Branch (192:9): [True: 0, False: 136]
  ------------------
  193|      0|        return NULL;
  194|    136|    p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
  ------------------
  |  |  380|    136|#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|    136|    CRYPTO_THREAD_unlock(err_string_lock);
  196|       |
  197|    136|    return p;
  198|    136|}
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|  75.3k|{
  781|  75.3k|    ERR_STATE *es;
  782|       |
  783|  75.3k|    es = ossl_err_get_state_int();
  784|  75.3k|    if (es == NULL)
  ------------------
  |  Branch (784:9): [True: 0, False: 75.3k]
  ------------------
  785|      0|        return 0;
  786|       |
  787|  75.3k|    err_clear_data(es, es->top, deallocate);
  788|  75.3k|    err_set_data(es, es->top, data, size, flags);
  789|       |
  790|  75.3k|    return 1;
  791|  75.3k|}

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|  1.03M|{
   18|  1.03M|    ERR_STATE *es;
   19|       |
   20|  1.03M|    es = ossl_err_get_state_int();
   21|  1.03M|    if (es == NULL)
  ------------------
  |  Branch (21:9): [True: 1, False: 1.03M]
  ------------------
   22|      1|        return;
   23|       |
   24|       |    /* Allocate a slot */
   25|  1.03M|    err_get_slot(es);
   26|  1.03M|    err_clear(es, es->top, 0);
   27|  1.03M|}
ERR_set_debug:
   30|  1.03M|{
   31|  1.03M|    ERR_STATE *es;
   32|       |
   33|  1.03M|    es = ossl_err_get_state_int();
   34|  1.03M|    if (es == NULL)
  ------------------
  |  Branch (34:9): [True: 1, False: 1.03M]
  ------------------
   35|      1|        return;
   36|       |
   37|  1.03M|    err_set_debug(es, es->top, file, line, func);
   38|  1.03M|}
ERR_set_error:
   41|  1.03M|{
   42|  1.03M|    va_list args;
   43|       |
   44|  1.03M|    va_start(args, fmt);
   45|  1.03M|    ERR_vset_error(lib, reason, fmt, args);
   46|  1.03M|    va_end(args);
   47|  1.03M|}
ERR_vset_error:
   50|  1.03M|{
   51|  1.03M|    ERR_STATE *es;
   52|  1.03M|    char *buf = NULL;
   53|  1.03M|    size_t buf_size = 0;
   54|  1.03M|    unsigned long flags = 0;
   55|  1.03M|    size_t i;
   56|       |
   57|  1.03M|    es = ossl_err_get_state_int();
   58|  1.03M|    if (es == NULL)
  ------------------
  |  Branch (58:9): [True: 1, False: 1.03M]
  ------------------
   59|      1|        return;
   60|  1.03M|    i = es->top;
   61|       |
   62|  1.03M|    if (fmt != NULL) {
  ------------------
  |  Branch (62:9): [True: 30.5k, False: 1.00M]
  ------------------
   63|  30.5k|        int printed_len = 0;
   64|  30.5k|        char *rbuf = NULL;
   65|       |
   66|  30.5k|        buf = es->err_data[i];
   67|  30.5k|        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|  30.5k|        es->err_data[i] = NULL;
   77|  30.5k|        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|  30.5k|        if (buf_size < ERR_MAX_DATA_SIZE
  ------------------
  |  |  392|  61.1k|#define ERR_MAX_DATA_SIZE       1024
  ------------------
  |  Branch (83:13): [True: 30.5k, False: 0]
  ------------------
   84|  30.5k|            && (rbuf = OPENSSL_realloc(buf, ERR_MAX_DATA_SIZE)) != NULL) {
  ------------------
  |  |  101|  30.5k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  30.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  30.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (84:16): [True: 30.5k, False: 0]
  ------------------
   85|  30.5k|            buf = rbuf;
   86|  30.5k|            buf_size = ERR_MAX_DATA_SIZE;
  ------------------
  |  |  392|  30.5k|#define ERR_MAX_DATA_SIZE       1024
  ------------------
   87|  30.5k|        }
   88|       |
   89|  30.5k|        if (buf != NULL) {
  ------------------
  |  Branch (89:13): [True: 30.5k, False: 0]
  ------------------
   90|  30.5k|            printed_len = BIO_vsnprintf(buf, buf_size, fmt, args);
   91|  30.5k|        }
   92|  30.5k|        if (printed_len < 0)
  ------------------
  |  Branch (92:13): [True: 0, False: 30.5k]
  ------------------
   93|      0|            printed_len = 0;
   94|  30.5k|        if (buf != NULL)
  ------------------
  |  Branch (94:13): [True: 30.5k, False: 0]
  ------------------
   95|  30.5k|            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|  30.5k|        if ((rbuf = OPENSSL_realloc(buf, printed_len + 1)) != NULL) {
  ------------------
  |  |  101|  30.5k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  30.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  30.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (103:13): [True: 30.5k, False: 0]
  ------------------
  104|  30.5k|            buf = rbuf;
  105|  30.5k|            buf_size = printed_len + 1;
  106|  30.5k|            buf[printed_len] = '\0';
  107|  30.5k|        }
  108|       |
  109|  30.5k|        if (buf != NULL)
  ------------------
  |  Branch (109:13): [True: 30.5k, False: 0]
  ------------------
  110|  30.5k|            flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   48|  30.5k|# define ERR_TXT_MALLOCED        0x01
  ------------------
                          flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   49|  30.5k|# define ERR_TXT_STRING          0x02
  ------------------
  111|  30.5k|    }
  112|       |
  113|  1.03M|    err_clear_data(es, es->top, 0);
  114|  1.03M|    err_set_error(es, es->top, lib, reason);
  115|  1.03M|    if (fmt != NULL)
  ------------------
  |  Branch (115:9): [True: 30.5k, False: 1.00M]
  ------------------
  116|  30.5k|        err_set_data(es, es->top, buf, buf_size, flags);
  117|  1.03M|}

err.c:err_clear:
   85|   137k|{
   86|   137k|    err_clear_data(es, i, (deall));
   87|   137k|    es->err_marks[i] = 0;
   88|   137k|    es->err_flags[i] = 0;
   89|   137k|    es->err_buffer[i] = 0;
   90|   137k|    es->err_line[i] = -1;
   91|   137k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  107|   137k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   137k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   137k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|   137k|    es->err_file[i] = NULL;
   93|   137k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  107|   137k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   137k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   137k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|   137k|    es->err_func[i] = NULL;
   95|   137k|}
err.c:err_clear_data:
   22|   212k|{
   23|   212k|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|   212k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 198k, False: 13.9k]
  ------------------
   24|   198k|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 16, False: 198k]
  ------------------
   25|     16|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  107|     16|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|     16|            es->err_data[i] = NULL;
   27|     16|            es->err_data_size[i] = 0;
   28|     16|            es->err_data_flags[i] = 0;
   29|   198k|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 198k, False: 0]
  ------------------
   30|   198k|            es->err_data[i][0] = '\0';
   31|   198k|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   48|   198k|# define ERR_TXT_MALLOCED        0x01
  ------------------
   32|   198k|        }
   33|   198k|    } else {
   34|  13.9k|        es->err_data[i] = NULL;
   35|  13.9k|        es->err_data_size[i] = 0;
   36|  13.9k|        es->err_data_flags[i] = 0;
   37|  13.9k|    }
   38|   212k|}
err.c:err_set_data:
   76|  75.3k|{
   77|  75.3k|    if ((es->err_data_flags[i] & ERR_TXT_MALLOCED) != 0)
  ------------------
  |  |   48|  75.3k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (77:9): [True: 75.3k, False: 16]
  ------------------
   78|  75.3k|        OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  107|  75.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  75.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  75.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|  75.3k|    es->err_data[i] = data;
   80|  75.3k|    es->err_data_size[i] = datasz;
   81|  75.3k|    es->err_data_flags[i] = flags;
   82|  75.3k|}
err_blocks.c:err_get_slot:
   15|  1.03M|{
   16|  1.03M|    es->top = (es->top + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|  1.03M|#  define ERR_NUM_ERRORS  16
  ------------------
   17|  1.03M|    if (es->top == es->bottom)
  ------------------
  |  Branch (17:9): [True: 45.1k, False: 991k]
  ------------------
   18|  45.1k|        es->bottom = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|  45.1k|#  define ERR_NUM_ERRORS  16
  ------------------
   19|  1.03M|}
err_blocks.c:err_clear:
   85|  1.03M|{
   86|  1.03M|    err_clear_data(es, i, (deall));
   87|  1.03M|    es->err_marks[i] = 0;
   88|  1.03M|    es->err_flags[i] = 0;
   89|  1.03M|    es->err_buffer[i] = 0;
   90|  1.03M|    es->err_line[i] = -1;
   91|  1.03M|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  107|  1.03M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.03M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.03M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  1.03M|    es->err_file[i] = NULL;
   93|  1.03M|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  107|  1.03M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.03M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.03M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|  1.03M|    es->err_func[i] = NULL;
   95|  1.03M|}
err_blocks.c:err_set_debug:
   52|  1.03M|{
   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|  1.03M|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  107|  1.03M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.03M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.03M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   58|  1.03M|    if (file == NULL || file[0] == '\0')
  ------------------
  |  Branch (58:9): [True: 0, False: 1.03M]
  |  Branch (58:25): [True: 0, False: 1.03M]
  ------------------
   59|      0|        es->err_file[i] = NULL;
   60|  1.03M|    else if ((es->err_file[i] = CRYPTO_malloc(strlen(file) + 1,
  ------------------
  |  Branch (60:14): [True: 1.03M, False: 0]
  ------------------
   61|  1.03M|                                              NULL, 0)) != NULL)
   62|       |        /* We cannot use OPENSSL_strdup due to possible recursion */
   63|  1.03M|        strcpy(es->err_file[i], file);
   64|       |
   65|  1.03M|    es->err_line[i] = line;
   66|  1.03M|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  107|  1.03M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.03M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.03M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|  1.03M|    if (fn == NULL || fn[0] == '\0')
  ------------------
  |  Branch (67:9): [True: 0, False: 1.03M]
  |  Branch (67:23): [True: 0, False: 1.03M]
  ------------------
   68|      0|        es->err_func[i] = NULL;
   69|  1.03M|    else if ((es->err_func[i] = CRYPTO_malloc(strlen(fn) + 1,
  ------------------
  |  Branch (69:14): [True: 1.03M, False: 0]
  ------------------
   70|  1.03M|                                              NULL, 0)) != NULL)
   71|  1.03M|        strcpy(es->err_func[i], fn);
   72|  1.03M|}
err_blocks.c:err_clear_data:
   22|  2.07M|{
   23|  2.07M|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  2.07M|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 2.04M, False: 30.6k]
  ------------------
   24|  2.04M|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 0, False: 2.04M]
  ------------------
   25|      0|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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|  2.04M|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 2.04M, False: 0]
  ------------------
   30|  2.04M|            es->err_data[i][0] = '\0';
   31|  2.04M|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   48|  2.04M|# define ERR_TXT_MALLOCED        0x01
  ------------------
   32|  2.04M|        }
   33|  2.04M|    } else {
   34|  30.6k|        es->err_data[i] = NULL;
   35|  30.6k|        es->err_data_size[i] = 0;
   36|  30.6k|        es->err_data_flags[i] = 0;
   37|  30.6k|    }
   38|  2.07M|}
err_blocks.c:err_set_error:
   42|  1.03M|{
   43|  1.03M|    es->err_buffer[i] =
   44|  1.03M|        lib == ERR_LIB_SYS
  ------------------
  |  |   72|  1.03M|# define ERR_LIB_SYS             2
  ------------------
  |  Branch (44:9): [True: 1, False: 1.03M]
  ------------------
   45|  1.03M|        ? (unsigned int)(ERR_SYSTEM_FLAG |  reason)
  ------------------
  |  |  218|      1|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  ------------------
   46|  1.03M|        : ERR_PACK(lib, 0, reason);
  ------------------
  |  |  279|  2.07M|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|  1.03M|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|  1.03M|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|  2.07M|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|  1.03M|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
   47|  1.03M|}
err_blocks.c:err_set_data:
   76|  30.5k|{
   77|  30.5k|    if ((es->err_data_flags[i] & ERR_TXT_MALLOCED) != 0)
  ------------------
  |  |   48|  30.5k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (77:9): [True: 0, False: 30.5k]
  ------------------
   78|      0|        OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|  30.5k|    es->err_data[i] = data;
   80|  30.5k|    es->err_data_size[i] = datasz;
   81|  30.5k|    es->err_data_flags[i] = flags;
   82|  30.5k|}
err_mark.c:err_clear:
   85|   935k|{
   86|   935k|    err_clear_data(es, i, (deall));
   87|   935k|    es->err_marks[i] = 0;
   88|   935k|    es->err_flags[i] = 0;
   89|   935k|    es->err_buffer[i] = 0;
   90|   935k|    es->err_line[i] = -1;
   91|   935k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  107|   935k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   935k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   935k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|   935k|    es->err_file[i] = NULL;
   93|   935k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  107|   935k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   935k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   935k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|   935k|    es->err_func[i] = NULL;
   95|   935k|}
err_mark.c:err_clear_data:
   22|   935k|{
   23|   935k|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|   935k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 935k, False: 6]
  ------------------
   24|   935k|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 0, False: 935k]
  ------------------
   25|      0|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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|   935k|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 935k, False: 0]
  ------------------
   30|   935k|            es->err_data[i][0] = '\0';
   31|   935k|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   48|   935k|# define ERR_TXT_MALLOCED        0x01
  ------------------
   32|   935k|        }
   33|   935k|    } else {
   34|      6|        es->err_data[i] = NULL;
   35|      6|        es->err_data_size[i] = 0;
   36|      6|        es->err_data_flags[i] = 0;
   37|      6|    }
   38|   935k|}

ERR_set_mark:
   16|   648k|{
   17|   648k|    ERR_STATE *es;
   18|       |
   19|   648k|    es = ossl_err_get_state_int();
   20|   648k|    if (es == NULL)
  ------------------
  |  Branch (20:9): [True: 0, False: 648k]
  ------------------
   21|      0|        return 0;
   22|       |
   23|   648k|    if (es->bottom == es->top)
  ------------------
  |  Branch (23:9): [True: 635k, False: 13.3k]
  ------------------
   24|   635k|        return 0;
   25|  13.3k|    es->err_marks[es->top]++;
   26|  13.3k|    return 1;
   27|   648k|}
ERR_pop_to_mark:
   30|  1.00M|{
   31|  1.00M|    ERR_STATE *es;
   32|       |
   33|  1.00M|    es = ossl_err_get_state_int();
   34|  1.00M|    if (es == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 1.00M]
  ------------------
   35|      0|        return 0;
   36|       |
   37|  1.94M|    while (es->bottom != es->top
  ------------------
  |  Branch (37:12): [True: 948k, False: 994k]
  ------------------
   38|  1.94M|           && es->err_marks[es->top] == 0) {
  ------------------
  |  Branch (38:15): [True: 935k, False: 12.2k]
  ------------------
   39|   935k|        err_clear(es, es->top, 0);
   40|   935k|        es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|    919|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (40:19): [True: 935k, False: 919]
  ------------------
   41|   935k|    }
   42|       |
   43|  1.00M|    if (es->bottom == es->top)
  ------------------
  |  Branch (43:9): [True: 994k, False: 12.2k]
  ------------------
   44|   994k|        return 0;
   45|  12.2k|    es->err_marks[es->top]--;
   46|  12.2k|    return 1;
   47|  1.00M|}
ERR_clear_last_mark:
   69|  99.5k|{
   70|  99.5k|    ERR_STATE *es;
   71|  99.5k|    int top;
   72|       |
   73|  99.5k|    es = ossl_err_get_state_int();
   74|  99.5k|    if (es == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 99.5k]
  ------------------
   75|      0|        return 0;
   76|       |
   77|  99.5k|    top = es->top;
   78|   125k|    while (es->bottom != top
  ------------------
  |  Branch (78:12): [True: 27.1k, False: 98.4k]
  ------------------
   79|   125k|           && es->err_marks[top] == 0) {
  ------------------
  |  Branch (79:15): [True: 26.0k, False: 1.09k]
  ------------------
   80|  26.0k|        top = top > 0 ? top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|    125|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (80:15): [True: 25.9k, False: 125]
  ------------------
   81|  26.0k|    }
   82|       |
   83|  99.5k|    if (es->bottom == top)
  ------------------
  |  Branch (83:9): [True: 98.4k, False: 1.09k]
  ------------------
   84|  98.4k|        return 0;
   85|  1.09k|    es->err_marks[top]--;
   86|  1.09k|    return 1;
   87|  99.5k|}

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

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

evp_md_ctx_clear_digest:
   44|  20.3k|{
   45|  20.3k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (45:9): [True: 20.3k, False: 0]
  ------------------
   46|  20.3k|        if (ctx->digest != NULL && ctx->digest->freectx != NULL)
  ------------------
  |  Branch (46:13): [True: 20.3k, False: 0]
  |  Branch (46:36): [True: 20.3k, False: 0]
  ------------------
   47|  20.3k|            ctx->digest->freectx(ctx->algctx);
   48|  20.3k|        ctx->algctx = NULL;
   49|  20.3k|        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  199|  20.3k|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
   50|  20.3k|    }
   51|       |
   52|       |    /* Code below to be removed when legacy support is dropped. */
   53|       |
   54|       |    /*
   55|       |     * Don't assume ctx->md_data was cleaned in EVP_Digest_Final, because
   56|       |     * sometimes only copies of the context are ever finalised.
   57|       |     */
   58|  20.3k|    cleanup_old_md_data(ctx, force);
   59|  20.3k|    if (force)
  ------------------
  |  Branch (59:9): [True: 0, False: 20.3k]
  ------------------
   60|      0|        ctx->digest = NULL;
   61|       |
   62|  20.3k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   63|  20.3k|    ENGINE_finish(ctx->engine);
   64|  20.3k|    ctx->engine = NULL;
   65|  20.3k|#endif
   66|       |
   67|       |    /* Non legacy code, this has to be later than the ctx->digest cleaning */
   68|  20.3k|    if (!keep_fetched) {
  ------------------
  |  Branch (68:9): [True: 20.3k, False: 0]
  ------------------
   69|  20.3k|        EVP_MD_free(ctx->fetched_digest);
   70|  20.3k|        ctx->fetched_digest = NULL;
   71|  20.3k|        ctx->reqdigest = NULL;
   72|  20.3k|    }
   73|  20.3k|}
EVP_MD_CTX_reset:
  100|  20.3k|{
  101|  20.3k|    return evp_md_ctx_reset_ex(ctx, 0);
  102|  20.3k|}
EVP_MD_CTX_new:
  131|  20.3k|{
  132|  20.3k|    return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  ------------------
  |  |   99|  20.3k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  20.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  20.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  133|  20.3k|}
EVP_MD_CTX_free:
  136|  22.1k|{
  137|  22.1k|    if (ctx == NULL)
  ------------------
  |  Branch (137:9): [True: 1.83k, False: 20.3k]
  ------------------
  138|  1.83k|        return;
  139|       |
  140|  20.3k|    EVP_MD_CTX_reset(ctx);
  141|  20.3k|    OPENSSL_free(ctx);
  ------------------
  |  |  107|  20.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  20.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  20.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  142|  20.3k|}
evp_md_ctx_free_algctx:
  145|  20.3k|{
  146|  20.3k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (146:9): [True: 0, False: 20.3k]
  ------------------
  147|      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 (147:13): [True: 0, False: 0]
  ------------------
  148|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  149|      0|            return 0;
  150|      0|        }
  151|      0|        if (ctx->digest->freectx != NULL)
  ------------------
  |  Branch (151:13): [True: 0, False: 0]
  ------------------
  152|      0|            ctx->digest->freectx(ctx->algctx);
  153|      0|        ctx->algctx = NULL;
  154|      0|    }
  155|  20.3k|    return 1;
  156|  20.3k|}
EVP_DigestInit_ex:
  382|  20.3k|{
  383|  20.3k|    return evp_md_init_internal(ctx, type, NULL, impl);
  384|  20.3k|}
EVP_DigestUpdate:
  387|  20.3k|{
  388|  20.3k|    if (count == 0)
  ------------------
  |  Branch (388:9): [True: 0, False: 20.3k]
  ------------------
  389|      0|        return 1;
  390|       |
  391|  20.3k|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|  20.3k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (391:9): [True: 0, False: 20.3k]
  ------------------
  392|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  393|      0|        return 0;
  394|      0|    }
  395|       |
  396|  20.3k|    if (ctx->pctx != NULL
  ------------------
  |  Branch (396:9): [True: 0, False: 20.3k]
  ------------------
  397|  20.3k|            && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  731|  20.3k|    ((ctx)->operation == EVP_PKEY_OP_SIGN \
  |  |  ------------------
  |  |  |  | 1691|      0|# define EVP_PKEY_OP_SIGN                (1<<4)
  |  |  ------------------
  |  |  |  Branch (731:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  732|      0|     || (ctx)->operation == EVP_PKEY_OP_SIGNCTX \
  |  |  ------------------
  |  |  |  | 1694|      0|# define EVP_PKEY_OP_SIGNCTX             (1<<7)
  |  |  ------------------
  |  |  |  Branch (732:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  733|      0|     || (ctx)->operation == EVP_PKEY_OP_VERIFY \
  |  |  ------------------
  |  |  |  | 1692|      0|# define EVP_PKEY_OP_VERIFY              (1<<5)
  |  |  ------------------
  |  |  |  Branch (733:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  734|      0|     || (ctx)->operation == EVP_PKEY_OP_VERIFYCTX \
  |  |  ------------------
  |  |  |  | 1695|      0|# define EVP_PKEY_OP_VERIFYCTX           (1<<8)
  |  |  ------------------
  |  |  |  Branch (734:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  735|  20.3k|     || (ctx)->operation == EVP_PKEY_OP_VERIFYRECOVER)
  |  |  ------------------
  |  |  |  | 1693|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1<<6)
  |  |  ------------------
  |  |  |  Branch (735:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  398|  20.3k|            && ctx->pctx->op.sig.algctx != NULL) {
  ------------------
  |  Branch (398:16): [True: 0, False: 0]
  ------------------
  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)
  ------------------
  |  | 1694|      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)
  ------------------
  |  | 1695|      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|        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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  412|      0|        return 0;
  413|      0|    }
  414|       |
  415|  20.3k|    if (ctx->digest == NULL
  ------------------
  |  Branch (415:9): [True: 0, False: 20.3k]
  ------------------
  416|  20.3k|            || ctx->digest->prov == NULL
  ------------------
  |  Branch (416:16): [True: 0, False: 20.3k]
  ------------------
  417|  20.3k|            || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0)
  ------------------
  |  |  221|  20.3k|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (417:16): [True: 0, False: 20.3k]
  ------------------
  418|      0|        goto legacy;
  419|       |
  420|  20.3k|    if (ctx->digest->dupdate == NULL) {
  ------------------
  |  Branch (420:9): [True: 0, False: 20.3k]
  ------------------
  421|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  422|      0|        return 0;
  423|      0|    }
  424|  20.3k|    return ctx->digest->dupdate(ctx->algctx, data, count);
  425|       |
  426|       |    /* Code below to be removed when legacy support is dropped. */
  427|      0| legacy:
  428|      0|    return ctx->update(ctx, data, count);
  429|  20.3k|}
EVP_DigestFinal_ex:
  442|  20.3k|{
  443|  20.3k|    int ret, sz;
  444|  20.3k|    size_t size = 0;
  445|  20.3k|    size_t mdsize = 0;
  446|       |
  447|  20.3k|    if (ctx->digest == NULL)
  ------------------
  |  Branch (447:9): [True: 0, False: 20.3k]
  ------------------
  448|      0|        return 0;
  449|       |
  450|  20.3k|    sz = EVP_MD_get_size(ctx->digest);
  451|  20.3k|    if (sz < 0)
  ------------------
  |  Branch (451:9): [True: 0, False: 20.3k]
  ------------------
  452|      0|        return 0;
  453|  20.3k|    mdsize = sz;
  454|  20.3k|    if (ctx->digest->prov == NULL)
  ------------------
  |  Branch (454:9): [True: 0, False: 20.3k]
  ------------------
  455|      0|        goto legacy;
  456|       |
  457|  20.3k|    if (ctx->digest->dfinal == NULL) {
  ------------------
  |  Branch (457:9): [True: 0, False: 20.3k]
  ------------------
  458|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  459|      0|        return 0;
  460|      0|    }
  461|       |
  462|  20.3k|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|  20.3k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (462:9): [True: 0, False: 20.3k]
  ------------------
  463|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  464|      0|        return 0;
  465|      0|    }
  466|       |
  467|  20.3k|    ret = ctx->digest->dfinal(ctx->algctx, md, &size, mdsize);
  468|       |
  469|  20.3k|    ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|  20.3k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  470|       |
  471|  20.3k|    if (isize != NULL) {
  ------------------
  |  Branch (471:9): [True: 0, False: 20.3k]
  ------------------
  472|      0|        if (size <= UINT_MAX) {
  ------------------
  |  Branch (472:13): [True: 0, False: 0]
  ------------------
  473|      0|            *isize = (unsigned int)size;
  474|      0|        } else {
  475|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  476|      0|            ret = 0;
  477|      0|        }
  478|      0|    }
  479|       |
  480|  20.3k|    return ret;
  481|       |
  482|       |    /* Code below to be removed when legacy support is dropped. */
  483|      0| legacy:
  484|      0|    OPENSSL_assert(mdsize <= EVP_MAX_MD_SIZE);
  ------------------
  |  |  421|      0|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (421:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  485|      0|    ret = ctx->digest->final(ctx, md);
  486|      0|    if (isize != NULL)
  ------------------
  |  Branch (486:9): [True: 0, False: 0]
  ------------------
  487|      0|        *isize = mdsize;
  488|      0|    if (ctx->digest->cleanup) {
  ------------------
  |  Branch (488:9): [True: 0, False: 0]
  ------------------
  489|      0|        ctx->digest->cleanup(ctx);
  490|      0|        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  199|      0|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  491|      0|    }
  492|      0|    OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
  493|      0|    return ret;
  494|  20.3k|}
EVP_Digest:
  688|  20.3k|{
  689|  20.3k|    EVP_MD_CTX *ctx = EVP_MD_CTX_new();
  690|  20.3k|    int ret;
  691|       |
  692|  20.3k|    if (ctx == NULL)
  ------------------
  |  Branch (692:9): [True: 0, False: 20.3k]
  ------------------
  693|      0|        return 0;
  694|  20.3k|    EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT);
  ------------------
  |  |  197|  20.3k|# define EVP_MD_CTX_FLAG_ONESHOT         0x0001/* digest update will be
  ------------------
  695|  20.3k|    ret = EVP_DigestInit_ex(ctx, type, impl)
  ------------------
  |  Branch (695:11): [True: 20.3k, False: 0]
  ------------------
  696|  20.3k|        && EVP_DigestUpdate(ctx, data, count)
  ------------------
  |  Branch (696:12): [True: 20.3k, False: 0]
  ------------------
  697|  20.3k|        && EVP_DigestFinal_ex(ctx, md, size);
  ------------------
  |  Branch (697:12): [True: 20.3k, False: 0]
  ------------------
  698|  20.3k|    EVP_MD_CTX_free(ctx);
  699|       |
  700|  20.3k|    return ret;
  701|  20.3k|}
evp_md_new:
  901|     27|{
  902|     27|    EVP_MD *md = OPENSSL_zalloc(sizeof(*md));
  ------------------
  |  |   99|     27|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  903|       |
  904|     27|    if (md != NULL && !CRYPTO_NEW_REF(&md->refcnt, 1)) {
  ------------------
  |  Branch (904:9): [True: 27, False: 0]
  |  Branch (904:23): [True: 0, False: 27]
  ------------------
  905|      0|        OPENSSL_free(md);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  906|      0|        return NULL;
  907|      0|    }
  908|     27|    return md;
  909|     27|}
EVP_MD_fetch:
 1106|  20.3k|{
 1107|  20.3k|    EVP_MD *md =
 1108|  20.3k|        evp_generic_fetch(ctx, OSSL_OP_DIGEST, algorithm, properties,
  ------------------
  |  |  254|  20.3k|# define OSSL_OP_DIGEST                              1
  ------------------
 1109|  20.3k|                          evp_md_from_algorithm, evp_md_up_ref, evp_md_free);
 1110|       |
 1111|  20.3k|    return md;
 1112|  20.3k|}
EVP_MD_up_ref:
 1115|  40.6k|{
 1116|  40.6k|    int ref = 0;
 1117|       |
 1118|  40.6k|    if (md->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  251|  40.6k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1118:9): [True: 40.6k, False: 0]
  ------------------
 1119|  40.6k|        CRYPTO_UP_REF(&md->refcnt, &ref);
 1120|  40.6k|    return 1;
 1121|  40.6k|}
EVP_MD_free:
 1124|  60.9k|{
 1125|  60.9k|    int i;
 1126|       |
 1127|  60.9k|    if (md == NULL || md->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  251|  40.6k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1127:9): [True: 20.3k, False: 40.6k]
  |  Branch (1127:23): [True: 0, False: 40.6k]
  ------------------
 1128|  20.3k|        return;
 1129|       |
 1130|  40.6k|    CRYPTO_DOWN_REF(&md->refcnt, &i);
 1131|  40.6k|    if (i > 0)
  ------------------
  |  Branch (1131:9): [True: 40.6k, False: 27]
  ------------------
 1132|  40.6k|        return;
 1133|     27|    evp_md_free_int(md);
 1134|     27|}
digest.c:cleanup_old_md_data:
   29|  40.6k|{
   30|  40.6k|    if (ctx->digest != NULL) {
  ------------------
  |  Branch (30:9): [True: 20.3k, False: 20.3k]
  ------------------
   31|  20.3k|        if (ctx->digest->cleanup != NULL
  ------------------
  |  Branch (31:13): [True: 0, False: 20.3k]
  ------------------
   32|  20.3k|                && !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_CLEANED))
  ------------------
  |  |  199|      0|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  |  Branch (32:20): [True: 0, False: 0]
  ------------------
   33|      0|            ctx->digest->cleanup(ctx);
   34|  20.3k|        if (ctx->md_data != NULL && ctx->digest->ctx_size > 0
  ------------------
  |  Branch (34:13): [True: 0, False: 20.3k]
  |  Branch (34:37): [True: 0, False: 0]
  ------------------
   35|  20.3k|                && (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE)
  ------------------
  |  |  201|      0|# define EVP_MD_CTX_FLAG_REUSE           0x0004/* Don't free up ctx->md_data
  ------------------
  |  Branch (35:21): [True: 0, False: 0]
  ------------------
   36|      0|                    || force)) {
  ------------------
  |  Branch (36:24): [True: 0, False: 0]
  ------------------
   37|      0|            OPENSSL_clear_free(ctx->md_data, ctx->digest->ctx_size);
  ------------------
  |  |  105|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   38|      0|            ctx->md_data = NULL;
   39|      0|        }
   40|  20.3k|    }
   41|  40.6k|}
digest.c:evp_md_ctx_reset_ex:
   76|  20.3k|{
   77|  20.3k|    if (ctx == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 20.3k]
  ------------------
   78|      0|        return 1;
   79|       |
   80|  20.3k|#ifndef FIPS_MODULE
   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|  20.3k|    if (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX)) {
  ------------------
  |  |   32|  20.3k|#define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX   0x0400
  ------------------
  |  Branch (85:9): [True: 20.3k, False: 0]
  ------------------
   86|  20.3k|        EVP_PKEY_CTX_free(ctx->pctx);
   87|  20.3k|        ctx->pctx = NULL;
   88|  20.3k|    }
   89|  20.3k|#endif
   90|       |
   91|  20.3k|    evp_md_ctx_clear_digest(ctx, 0, keep_fetched);
   92|  20.3k|    if (!keep_fetched)
  ------------------
  |  Branch (92:9): [True: 20.3k, False: 0]
  ------------------
   93|  20.3k|        OPENSSL_cleanse(ctx, sizeof(*ctx));
   94|       |
   95|  20.3k|    return 1;
   96|  20.3k|}
digest.c:evp_md_init_internal:
  160|  20.3k|{
  161|  20.3k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  162|  20.3k|    ENGINE *tmpimpl = NULL;
  163|  20.3k|#endif
  164|       |
  165|  20.3k|#if !defined(FIPS_MODULE)
  166|  20.3k|    if (ctx->pctx != NULL
  ------------------
  |  Branch (166:9): [True: 0, False: 20.3k]
  ------------------
  167|  20.3k|            && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  731|  20.3k|    ((ctx)->operation == EVP_PKEY_OP_SIGN \
  |  |  ------------------
  |  |  |  | 1691|      0|# define EVP_PKEY_OP_SIGN                (1<<4)
  |  |  ------------------
  |  |  |  Branch (731:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  732|      0|     || (ctx)->operation == EVP_PKEY_OP_SIGNCTX \
  |  |  ------------------
  |  |  |  | 1694|      0|# define EVP_PKEY_OP_SIGNCTX             (1<<7)
  |  |  ------------------
  |  |  |  Branch (732:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  733|      0|     || (ctx)->operation == EVP_PKEY_OP_VERIFY \
  |  |  ------------------
  |  |  |  | 1692|      0|# define EVP_PKEY_OP_VERIFY              (1<<5)
  |  |  ------------------
  |  |  |  Branch (733:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  734|      0|     || (ctx)->operation == EVP_PKEY_OP_VERIFYCTX \
  |  |  ------------------
  |  |  |  | 1695|      0|# define EVP_PKEY_OP_VERIFYCTX           (1<<8)
  |  |  ------------------
  |  |  |  Branch (734:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  735|  20.3k|     || (ctx)->operation == EVP_PKEY_OP_VERIFYRECOVER)
  |  |  ------------------
  |  |  |  | 1693|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1<<6)
  |  |  ------------------
  |  |  |  Branch (735:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  168|  20.3k|            && ctx->pctx->op.sig.algctx != NULL) {
  ------------------
  |  Branch (168:16): [True: 0, False: 0]
  ------------------
  169|       |        /*
  170|       |         * Prior to OpenSSL 3.0 calling EVP_DigestInit_ex() on an mdctx
  171|       |         * previously initialised with EVP_DigestSignInit() would retain
  172|       |         * information about the key, and re-initialise for another sign
  173|       |         * operation. So in that case we redirect to EVP_DigestSignInit()
  174|       |         */
  175|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1694|      0|# define EVP_PKEY_OP_SIGNCTX             (1<<7)
  ------------------
  |  Branch (175:13): [True: 0, False: 0]
  ------------------
  176|      0|            return EVP_DigestSignInit(ctx, NULL, type, impl, NULL);
  177|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_VERIFYCTX)
  ------------------
  |  | 1695|      0|# define EVP_PKEY_OP_VERIFYCTX           (1<<8)
  ------------------
  |  Branch (177:13): [True: 0, False: 0]
  ------------------
  178|      0|            return EVP_DigestVerifyInit(ctx, NULL, type, impl, NULL);
  179|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  180|      0|        return 0;
  181|      0|    }
  182|  20.3k|#endif
  183|       |
  184|  20.3k|    EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED
  ------------------
  |  |  199|  20.3k|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  185|  20.3k|                                | EVP_MD_CTX_FLAG_FINALISED);
  ------------------
  |  |   33|  20.3k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  186|       |
  187|  20.3k|    if (type != NULL) {
  ------------------
  |  Branch (187:9): [True: 20.3k, False: 0]
  ------------------
  188|  20.3k|        ctx->reqdigest = type;
  189|  20.3k|    } else {
  190|      0|        if (ctx->digest == NULL) {
  ------------------
  |  Branch (190:13): [True: 0, False: 0]
  ------------------
  191|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  192|      0|            return 0;
  193|      0|        }
  194|      0|        type = ctx->digest;
  195|      0|    }
  196|       |
  197|       |    /* Code below to be removed when legacy support is dropped. */
  198|  20.3k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  199|       |    /*
  200|       |     * Whether it's nice or not, "Inits" can be used on "Final"'d contexts so
  201|       |     * this context may already have an ENGINE! Try to avoid releasing the
  202|       |     * previous handle, re-querying for an ENGINE, and having a
  203|       |     * reinitialisation, when it may all be unnecessary.
  204|       |     */
  205|  20.3k|    if (ctx->engine != NULL
  ------------------
  |  Branch (205:9): [True: 0, False: 20.3k]
  ------------------
  206|  20.3k|            && ctx->digest != NULL
  ------------------
  |  Branch (206:16): [True: 0, False: 0]
  ------------------
  207|  20.3k|            && type->type == ctx->digest->type)
  ------------------
  |  Branch (207:16): [True: 0, False: 0]
  ------------------
  208|      0|        goto skip_to_init;
  209|       |
  210|       |    /*
  211|       |     * Ensure an ENGINE left lying around from last time is cleared (the
  212|       |     * previous check attempted to avoid this if the same ENGINE and
  213|       |     * EVP_MD could be used).
  214|       |     */
  215|  20.3k|    ENGINE_finish(ctx->engine);
  216|  20.3k|    ctx->engine = NULL;
  217|       |
  218|  20.3k|    if (impl == NULL)
  ------------------
  |  Branch (218:9): [True: 20.3k, False: 0]
  ------------------
  219|  20.3k|        tmpimpl = ENGINE_get_digest_engine(type->type);
  220|  20.3k|#endif
  221|       |
  222|       |    /*
  223|       |     * If there are engines involved or EVP_MD_CTX_FLAG_NO_INIT is set then we
  224|       |     * should use legacy handling for now.
  225|       |     */
  226|  20.3k|    if (impl != NULL
  ------------------
  |  Branch (226:9): [True: 0, False: 20.3k]
  ------------------
  227|  20.3k|#if !defined(OPENSSL_NO_ENGINE)
  228|  20.3k|            || ctx->engine != NULL
  ------------------
  |  Branch (228:16): [True: 0, False: 20.3k]
  ------------------
  229|  20.3k|# if !defined(FIPS_MODULE)
  230|  20.3k|            || tmpimpl != NULL
  ------------------
  |  Branch (230:16): [True: 0, False: 20.3k]
  ------------------
  231|  20.3k|# endif
  232|  20.3k|#endif
  233|  20.3k|            || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0
  ------------------
  |  |  221|  20.3k|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (233:16): [True: 0, False: 20.3k]
  ------------------
  234|  20.3k|            || (type != NULL && type->origin == EVP_ORIG_METH)
  ------------------
  |  |  253|  20.3k|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (234:17): [True: 20.3k, False: 0]
  |  Branch (234:33): [True: 0, False: 20.3k]
  ------------------
  235|  20.3k|            || (type == NULL && ctx->digest != NULL
  ------------------
  |  Branch (235:17): [True: 0, False: 20.3k]
  |  Branch (235:33): [True: 0, False: 0]
  ------------------
  236|  20.3k|                             && ctx->digest->origin == EVP_ORIG_METH)) {
  ------------------
  |  |  253|      0|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (236:33): [True: 0, False: 0]
  ------------------
  237|       |        /* If we were using provided hash before, cleanup algctx */
  238|      0|        if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (238:13): [True: 0, False: 0]
  ------------------
  239|      0|            return 0;
  240|      0|        if (ctx->digest == ctx->fetched_digest)
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|            ctx->digest = NULL;
  242|      0|        EVP_MD_free(ctx->fetched_digest);
  243|      0|        ctx->fetched_digest = NULL;
  244|      0|        goto legacy;
  245|      0|    }
  246|       |
  247|  20.3k|    cleanup_old_md_data(ctx, 1);
  248|       |
  249|       |    /* Start of non-legacy code below */
  250|  20.3k|    if (ctx->digest == type) {
  ------------------
  |  Branch (250:9): [True: 0, False: 20.3k]
  ------------------
  251|      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 (251:13): [True: 0, False: 0]
  ------------------
  252|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  253|      0|            return 0;
  254|      0|        }
  255|  20.3k|    } else {
  256|  20.3k|        if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (256:13): [True: 0, False: 20.3k]
  ------------------
  257|      0|            return 0;
  258|  20.3k|    }
  259|       |
  260|  20.3k|    if (type->prov == NULL) {
  ------------------
  |  Branch (260:9): [True: 0, False: 20.3k]
  ------------------
  261|       |#ifdef FIPS_MODULE
  262|       |        /* We only do explicit fetches inside the FIPS module */
  263|       |        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  264|       |        return 0;
  265|       |#else
  266|       |        /* The NULL digest is a special case */
  267|      0|        EVP_MD *provmd = EVP_MD_fetch(NULL,
  268|      0|                                      type->type != NID_undef ? OBJ_nid2sn(type->type)
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (268:39): [True: 0, False: 0]
  ------------------
  269|      0|                                                              : "NULL", "");
  270|       |
  271|      0|        if (provmd == NULL) {
  ------------------
  |  Branch (271:13): [True: 0, False: 0]
  ------------------
  272|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  273|      0|            return 0;
  274|      0|        }
  275|      0|        type = provmd;
  276|      0|        EVP_MD_free(ctx->fetched_digest);
  277|      0|        ctx->fetched_digest = provmd;
  278|      0|#endif
  279|      0|    }
  280|       |
  281|  20.3k|    if (type->prov != NULL && ctx->fetched_digest != type) {
  ------------------
  |  Branch (281:9): [True: 20.3k, False: 0]
  |  Branch (281:31): [True: 20.3k, False: 0]
  ------------------
  282|  20.3k|        if (!EVP_MD_up_ref((EVP_MD *)type)) {
  ------------------
  |  Branch (282:13): [True: 0, False: 20.3k]
  ------------------
  283|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  284|      0|            return 0;
  285|      0|        }
  286|  20.3k|        EVP_MD_free(ctx->fetched_digest);
  287|  20.3k|        ctx->fetched_digest = (EVP_MD *)type;
  288|  20.3k|    }
  289|  20.3k|    ctx->digest = type;
  290|  20.3k|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (290:9): [True: 20.3k, False: 0]
  ------------------
  291|  20.3k|        ctx->algctx = ctx->digest->newctx(ossl_provider_ctx(type->prov));
  292|  20.3k|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (292:13): [True: 0, False: 20.3k]
  ------------------
  293|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  294|      0|            return 0;
  295|      0|        }
  296|  20.3k|    }
  297|       |
  298|  20.3k|    if (ctx->digest->dinit == NULL) {
  ------------------
  |  Branch (298:9): [True: 0, False: 20.3k]
  ------------------
  299|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  300|      0|        return 0;
  301|      0|    }
  302|       |
  303|  20.3k|    return ctx->digest->dinit(ctx->algctx, params);
  304|       |
  305|       |    /* Code below to be removed when legacy support is dropped. */
  306|      0| legacy:
  307|       |
  308|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  309|      0|    if (type) {
  ------------------
  |  Branch (309:9): [True: 0, False: 0]
  ------------------
  310|      0|        if (impl != NULL) {
  ------------------
  |  Branch (310:13): [True: 0, False: 0]
  ------------------
  311|      0|            if (!ENGINE_init(impl)) {
  ------------------
  |  Branch (311:17): [True: 0, False: 0]
  ------------------
  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  313|      0|                return 0;
  314|      0|            }
  315|      0|        } else {
  316|       |            /* Ask if an ENGINE is reserved for this job */
  317|      0|            impl = tmpimpl;
  318|      0|        }
  319|      0|        if (impl != NULL) {
  ------------------
  |  Branch (319:13): [True: 0, False: 0]
  ------------------
  320|       |            /* There's an ENGINE for this job ... (apparently) */
  321|      0|            const EVP_MD *d = ENGINE_get_digest(impl, type->type);
  322|       |
  323|      0|            if (d == NULL) {
  ------------------
  |  Branch (323:17): [True: 0, False: 0]
  ------------------
  324|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  325|      0|                ENGINE_finish(impl);
  326|      0|                return 0;
  327|      0|            }
  328|       |            /* We'll use the ENGINE's private digest definition */
  329|      0|            type = d;
  330|       |            /*
  331|       |             * Store the ENGINE functional reference so we know 'type' came
  332|       |             * from an ENGINE and we need to release it when done.
  333|       |             */
  334|      0|            ctx->engine = impl;
  335|      0|        } else
  336|      0|            ctx->engine = NULL;
  337|      0|    }
  338|      0|#endif
  339|      0|    if (ctx->digest != type) {
  ------------------
  |  Branch (339:9): [True: 0, False: 0]
  ------------------
  340|      0|        cleanup_old_md_data(ctx, 1);
  341|       |
  342|      0|        ctx->digest = type;
  343|      0|        if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) {
  ------------------
  |  |  221|      0|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (343:13): [True: 0, False: 0]
  |  Branch (343:56): [True: 0, False: 0]
  ------------------
  344|      0|            ctx->update = type->update;
  345|      0|            ctx->md_data = OPENSSL_zalloc(type->ctx_size);
  ------------------
  |  |   99|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  346|      0|            if (ctx->md_data == NULL)
  ------------------
  |  Branch (346:17): [True: 0, False: 0]
  ------------------
  347|      0|                return 0;
  348|      0|        }
  349|      0|    }
  350|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  351|      0| skip_to_init:
  352|      0|#endif
  353|      0|#ifndef FIPS_MODULE
  354|      0|    if (ctx->pctx != NULL
  ------------------
  |  Branch (354:9): [True: 0, False: 0]
  ------------------
  355|      0|            && (!EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  731|      0|    ((ctx)->operation == EVP_PKEY_OP_SIGN \
  |  |  ------------------
  |  |  |  | 1691|      0|# define EVP_PKEY_OP_SIGN                (1<<4)
  |  |  ------------------
  |  |  |  Branch (731:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  732|      0|     || (ctx)->operation == EVP_PKEY_OP_SIGNCTX \
  |  |  ------------------
  |  |  |  | 1694|      0|# define EVP_PKEY_OP_SIGNCTX             (1<<7)
  |  |  ------------------
  |  |  |  Branch (732:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  733|      0|     || (ctx)->operation == EVP_PKEY_OP_VERIFY \
  |  |  ------------------
  |  |  |  | 1692|      0|# define EVP_PKEY_OP_VERIFY              (1<<5)
  |  |  ------------------
  |  |  |  Branch (733:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  734|      0|     || (ctx)->operation == EVP_PKEY_OP_VERIFYCTX \
  |  |  ------------------
  |  |  |  | 1695|      0|# define EVP_PKEY_OP_VERIFYCTX           (1<<8)
  |  |  ------------------
  |  |  |  Branch (734:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  735|      0|     || (ctx)->operation == EVP_PKEY_OP_VERIFYRECOVER)
  |  |  ------------------
  |  |  |  | 1693|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1<<6)
  |  |  ------------------
  |  |  |  Branch (735:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  356|      0|                 || ctx->pctx->op.sig.signature == NULL)) {
  ------------------
  |  Branch (356:21): [True: 0, False: 0]
  ------------------
  357|      0|        int r;
  358|      0|        r = EVP_PKEY_CTX_ctrl(ctx->pctx, -1, EVP_PKEY_OP_TYPE_SIG,
  ------------------
  |  | 1703|      0|        (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER \
  |  |  ------------------
  |  |  |  | 1691|      0|# define EVP_PKEY_OP_SIGN                (1<<4)
  |  |  ------------------
  |  |                       (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER \
  |  |  ------------------
  |  |  |  | 1692|      0|# define EVP_PKEY_OP_VERIFY              (1<<5)
  |  |  ------------------
  |  |                       (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER \
  |  |  ------------------
  |  |  |  | 1693|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1<<6)
  |  |  ------------------
  |  | 1704|      0|                | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1694|      0|# define EVP_PKEY_OP_SIGNCTX             (1<<7)
  |  |  ------------------
  |  |                               | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1695|      0|# define EVP_PKEY_OP_VERIFYCTX           (1<<8)
  |  |  ------------------
  ------------------
  359|      0|                              EVP_PKEY_CTRL_DIGESTINIT, 0, ctx);
  ------------------
  |  | 1722|      0|# define EVP_PKEY_CTRL_DIGESTINIT        7
  ------------------
  360|      0|        if (r <= 0 && (r != -2))
  ------------------
  |  Branch (360:13): [True: 0, False: 0]
  |  Branch (360:23): [True: 0, False: 0]
  ------------------
  361|      0|            return 0;
  362|      0|    }
  363|      0|#endif
  364|      0|    if (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT)
  ------------------
  |  |  221|      0|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (364:9): [True: 0, False: 0]
  ------------------
  365|      0|        return 1;
  366|      0|    return ctx->digest->init(ctx);
  367|      0|}
digest.c:evp_md_from_algorithm:
  972|     27|{
  973|     27|    const OSSL_DISPATCH *fns = algodef->implementation;
  974|     27|    EVP_MD *md = NULL;
  975|     27|    int fncnt = 0;
  976|       |
  977|       |    /* EVP_MD_fetch() will set the legacy NID if available */
  978|     27|    if ((md = evp_md_new()) == NULL) {
  ------------------
  |  Branch (978:9): [True: 0, False: 27]
  ------------------
  979|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  980|      0|        return NULL;
  981|      0|    }
  982|       |
  983|     27|#ifndef FIPS_MODULE
  984|     27|    md->type = NID_undef;
  ------------------
  |  |   18|     27|#define NID_undef                       0
  ------------------
  985|     27|    if (!evp_names_do_all(prov, name_id, set_legacy_nid, &md->type)
  ------------------
  |  Branch (985:9): [True: 0, False: 27]
  ------------------
  986|     27|            || md->type == -1) {
  ------------------
  |  Branch (986:16): [True: 0, False: 27]
  ------------------
  987|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  988|      0|        EVP_MD_free(md);
  989|      0|        return NULL;
  990|      0|    }
  991|     27|#endif
  992|       |
  993|     27|    md->name_id = name_id;
  994|     27|    if ((md->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (994:9): [True: 0, False: 27]
  ------------------
  995|      0|        EVP_MD_free(md);
  996|      0|        return NULL;
  997|      0|    }
  998|     27|    md->description = algodef->algorithm_description;
  999|       |
 1000|    257|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (1000:12): [True: 230, False: 27]
  ------------------
 1001|    230|        switch (fns->function_id) {
  ------------------
  |  Branch (1001:17): [True: 0, False: 230]
  ------------------
 1002|     27|        case OSSL_FUNC_DIGEST_NEWCTX:
  ------------------
  |  |  273|     27|# define OSSL_FUNC_DIGEST_NEWCTX                     1
  ------------------
  |  Branch (1002:9): [True: 27, False: 203]
  ------------------
 1003|     27|            if (md->newctx == NULL) {
  ------------------
  |  Branch (1003:17): [True: 27, False: 0]
  ------------------
 1004|     27|                md->newctx = OSSL_FUNC_digest_newctx(fns);
 1005|     27|                fncnt++;
 1006|     27|            }
 1007|     27|            break;
 1008|     27|        case OSSL_FUNC_DIGEST_INIT:
  ------------------
  |  |  274|     27|# define OSSL_FUNC_DIGEST_INIT                       2
  ------------------
  |  Branch (1008:9): [True: 27, False: 203]
  ------------------
 1009|     27|            if (md->dinit == NULL) {
  ------------------
  |  Branch (1009:17): [True: 27, False: 0]
  ------------------
 1010|     27|                md->dinit = OSSL_FUNC_digest_init(fns);
 1011|     27|                fncnt++;
 1012|     27|            }
 1013|     27|            break;
 1014|     27|        case OSSL_FUNC_DIGEST_UPDATE:
  ------------------
  |  |  275|     27|# define OSSL_FUNC_DIGEST_UPDATE                     3
  ------------------
  |  Branch (1014:9): [True: 27, False: 203]
  ------------------
 1015|     27|            if (md->dupdate == NULL) {
  ------------------
  |  Branch (1015:17): [True: 27, False: 0]
  ------------------
 1016|     27|                md->dupdate = OSSL_FUNC_digest_update(fns);
 1017|     27|                fncnt++;
 1018|     27|            }
 1019|     27|            break;
 1020|     27|        case OSSL_FUNC_DIGEST_FINAL:
  ------------------
  |  |  276|     27|# define OSSL_FUNC_DIGEST_FINAL                      4
  ------------------
  |  Branch (1020:9): [True: 27, False: 203]
  ------------------
 1021|     27|            if (md->dfinal == NULL) {
  ------------------
  |  Branch (1021:17): [True: 27, False: 0]
  ------------------
 1022|     27|                md->dfinal = OSSL_FUNC_digest_final(fns);
 1023|     27|                fncnt++;
 1024|     27|            }
 1025|     27|            break;
 1026|      0|        case OSSL_FUNC_DIGEST_DIGEST:
  ------------------
  |  |  277|      0|# define OSSL_FUNC_DIGEST_DIGEST                     5
  ------------------
  |  Branch (1026:9): [True: 0, False: 230]
  ------------------
 1027|      0|            if (md->digest == NULL)
  ------------------
  |  Branch (1027:17): [True: 0, False: 0]
  ------------------
 1028|      0|                md->digest = OSSL_FUNC_digest_digest(fns);
 1029|       |            /* We don't increment fnct for this as it is stand alone */
 1030|      0|            break;
 1031|     27|        case OSSL_FUNC_DIGEST_FREECTX:
  ------------------
  |  |  278|     27|# define OSSL_FUNC_DIGEST_FREECTX                    6
  ------------------
  |  Branch (1031:9): [True: 27, False: 203]
  ------------------
 1032|     27|            if (md->freectx == NULL) {
  ------------------
  |  Branch (1032:17): [True: 27, False: 0]
  ------------------
 1033|     27|                md->freectx = OSSL_FUNC_digest_freectx(fns);
 1034|     27|                fncnt++;
 1035|     27|            }
 1036|     27|            break;
 1037|     27|        case OSSL_FUNC_DIGEST_DUPCTX:
  ------------------
  |  |  279|     27|# define OSSL_FUNC_DIGEST_DUPCTX                     7
  ------------------
  |  Branch (1037:9): [True: 27, False: 203]
  ------------------
 1038|     27|            if (md->dupctx == NULL)
  ------------------
  |  Branch (1038:17): [True: 27, False: 0]
  ------------------
 1039|     27|                md->dupctx = OSSL_FUNC_digest_dupctx(fns);
 1040|     27|            break;
 1041|     27|        case OSSL_FUNC_DIGEST_GET_PARAMS:
  ------------------
  |  |  280|     27|# define OSSL_FUNC_DIGEST_GET_PARAMS                 8
  ------------------
  |  Branch (1041:9): [True: 27, False: 203]
  ------------------
 1042|     27|            if (md->get_params == NULL)
  ------------------
  |  Branch (1042:17): [True: 27, False: 0]
  ------------------
 1043|     27|                md->get_params = OSSL_FUNC_digest_get_params(fns);
 1044|     27|            break;
 1045|      7|        case OSSL_FUNC_DIGEST_SET_CTX_PARAMS:
  ------------------
  |  |  281|      7|# define OSSL_FUNC_DIGEST_SET_CTX_PARAMS             9
  ------------------
  |  Branch (1045:9): [True: 7, False: 223]
  ------------------
 1046|      7|            if (md->set_ctx_params == NULL)
  ------------------
  |  Branch (1046:17): [True: 7, False: 0]
  ------------------
 1047|      7|                md->set_ctx_params = OSSL_FUNC_digest_set_ctx_params(fns);
 1048|      7|            break;
 1049|      0|        case OSSL_FUNC_DIGEST_GET_CTX_PARAMS:
  ------------------
  |  |  282|      0|# define OSSL_FUNC_DIGEST_GET_CTX_PARAMS            10
  ------------------
  |  Branch (1049:9): [True: 0, False: 230]
  ------------------
 1050|      0|            if (md->get_ctx_params == NULL)
  ------------------
  |  Branch (1050:17): [True: 0, False: 0]
  ------------------
 1051|      0|                md->get_ctx_params = OSSL_FUNC_digest_get_ctx_params(fns);
 1052|      0|            break;
 1053|     27|        case OSSL_FUNC_DIGEST_GETTABLE_PARAMS:
  ------------------
  |  |  283|     27|# define OSSL_FUNC_DIGEST_GETTABLE_PARAMS           11
  ------------------
  |  Branch (1053:9): [True: 27, False: 203]
  ------------------
 1054|     27|            if (md->gettable_params == NULL)
  ------------------
  |  Branch (1054:17): [True: 27, False: 0]
  ------------------
 1055|     27|                md->gettable_params = OSSL_FUNC_digest_gettable_params(fns);
 1056|     27|            break;
 1057|      7|        case OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  284|      7|# define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS       12
  ------------------
  |  Branch (1057:9): [True: 7, False: 223]
  ------------------
 1058|      7|            if (md->settable_ctx_params == NULL)
  ------------------
  |  Branch (1058:17): [True: 7, False: 0]
  ------------------
 1059|      7|                md->settable_ctx_params =
 1060|      7|                    OSSL_FUNC_digest_settable_ctx_params(fns);
 1061|      7|            break;
 1062|      0|        case OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  285|      0|# define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS       13
  ------------------
  |  Branch (1062:9): [True: 0, False: 230]
  ------------------
 1063|      0|            if (md->gettable_ctx_params == NULL)
  ------------------
  |  Branch (1063:17): [True: 0, False: 0]
  ------------------
 1064|      0|                md->gettable_ctx_params =
 1065|      0|                    OSSL_FUNC_digest_gettable_ctx_params(fns);
 1066|      0|            break;
 1067|    230|        }
 1068|    230|    }
 1069|     27|    if ((fncnt != 0 && fncnt != 5)
  ------------------
  |  Branch (1069:10): [True: 27, False: 0]
  |  Branch (1069:24): [True: 0, False: 27]
  ------------------
 1070|     27|        || (fncnt == 0 && md->digest == NULL)) {
  ------------------
  |  Branch (1070:13): [True: 0, False: 27]
  |  Branch (1070:27): [True: 0, False: 0]
  ------------------
 1071|       |        /*
 1072|       |         * In order to be a consistent set of functions we either need the
 1073|       |         * whole set of init/update/final etc functions or none of them.
 1074|       |         * The "digest" function can standalone. We at least need one way to
 1075|       |         * generate digests.
 1076|       |         */
 1077|      0|        EVP_MD_free(md);
 1078|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1079|      0|        return NULL;
 1080|      0|    }
 1081|     27|    md->prov = prov;
 1082|     27|    if (prov != NULL)
  ------------------
  |  Branch (1082:9): [True: 27, False: 0]
  ------------------
 1083|     27|        ossl_provider_up_ref(prov);
 1084|       |
 1085|     27|    if (!evp_md_cache_constants(md)) {
  ------------------
  |  Branch (1085:9): [True: 0, False: 27]
  ------------------
 1086|      0|        EVP_MD_free(md);
 1087|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1088|      0|        md = NULL;
 1089|      0|    }
 1090|       |
 1091|     27|    return md;
 1092|     27|}
digest.c:set_legacy_nid:
  918|     71|{
  919|     71|    int nid;
  920|     71|    int *legacy_nid = vlegacy_nid;
  921|       |    /*
  922|       |     * We use lowest level function to get the associated method, because
  923|       |     * higher level functions such as EVP_get_digestbyname() have changed
  924|       |     * to look at providers too.
  925|       |     */
  926|     71|    const void *legacy_method = OBJ_NAME_get(name, OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|     71|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  927|       |
  928|     71|    if (*legacy_nid == -1)       /* We found a clash already */
  ------------------
  |  Branch (928:9): [True: 0, False: 71]
  ------------------
  929|      0|        return;
  930|       |
  931|     71|    if (legacy_method == NULL)
  ------------------
  |  Branch (931:9): [True: 48, False: 23]
  ------------------
  932|     48|        return;
  933|     23|    nid = EVP_MD_nid(legacy_method);
  ------------------
  |  |  535|     23|# define EVP_MD_nid EVP_MD_get_type
  ------------------
  934|     23|    if (*legacy_nid != NID_undef && *legacy_nid != nid) {
  ------------------
  |  |   18|     46|#define NID_undef                       0
  ------------------
  |  Branch (934:9): [True: 4, False: 19]
  |  Branch (934:37): [True: 0, False: 4]
  ------------------
  935|      0|        *legacy_nid = -1;
  936|      0|        return;
  937|      0|    }
  938|     23|    *legacy_nid = nid;
  939|     23|}
digest.c:evp_md_cache_constants:
  943|     27|{
  944|     27|    int ok, xof = 0, algid_absent = 0;
  945|     27|    size_t blksz = 0;
  946|     27|    size_t mdsize = 0;
  947|     27|    OSSL_PARAM params[5];
  948|       |
  949|     27|    params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, &blksz);
  ------------------
  |  |  195|     27|# define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  950|     27|    params[1] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_SIZE, &mdsize);
  ------------------
  |  |  198|     27|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
  951|     27|    params[2] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_XOF, &xof);
  ------------------
  |  |  200|     27|# define OSSL_DIGEST_PARAM_XOF "xof"
  ------------------
  952|     27|    params[3] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_ALGID_ABSENT,
  ------------------
  |  |  194|     27|# define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent"
  ------------------
  953|     27|                                         &algid_absent);
  954|     27|    params[4] = OSSL_PARAM_construct_end();
  955|     27|    ok = evp_do_md_getparams(md, params) > 0;
  956|     27|    if (mdsize > INT_MAX || blksz > INT_MAX)
  ------------------
  |  Branch (956:9): [True: 0, False: 27]
  |  Branch (956:29): [True: 0, False: 27]
  ------------------
  957|      0|        ok = 0;
  958|     27|    if (ok) {
  ------------------
  |  Branch (958:9): [True: 27, False: 0]
  ------------------
  959|     27|        md->block_size = (int)blksz;
  960|     27|        md->md_size = (int)mdsize;
  961|     27|        if (xof)
  ------------------
  |  Branch (961:13): [True: 4, False: 23]
  ------------------
  962|      4|            md->flags |= EVP_MD_FLAG_XOF;
  ------------------
  |  |  161|      4|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
  963|     27|        if (algid_absent)
  ------------------
  |  Branch (963:13): [True: 16, False: 11]
  ------------------
  964|     16|            md->flags |= EVP_MD_FLAG_DIGALGID_ABSENT;
  ------------------
  |  |  173|     16|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  965|     27|    }
  966|     27|    return ok;
  967|     27|}
digest.c:evp_md_up_ref:
 1095|  20.3k|{
 1096|  20.3k|    return EVP_MD_up_ref(md);
 1097|  20.3k|}
digest.c:evp_md_free:
 1100|     55|{
 1101|     55|    EVP_MD_free(md);
 1102|     55|}

EVP_aes_128_cbc:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_ecb:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_ofb:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_cfb128:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_cfb1:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_cfb8:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_ctr:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_cbc:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ecb:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ofb:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_cfb128:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_cfb1:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_cfb8:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ctr:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_cbc:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ecb:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ofb:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_cfb128:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_cfb1:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_cfb8:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ctr:
  442|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  443|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_gcm:
  468|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_gcm:
  468|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_gcm:
  468|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_xts:
  468|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_xts:
  468|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_ccm:
  468|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ccm:
  468|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ccm:
  468|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_wrap:
 3778|      1|{
 3779|      1|    return &aes_128_wrap;
 3780|      1|}
EVP_aes_192_wrap:
 3792|      1|{
 3793|      1|    return &aes_192_wrap;
 3794|      1|}
EVP_aes_256_wrap:
 3806|      1|{
 3807|      1|    return &aes_256_wrap;
 3808|      1|}
EVP_aes_128_wrap_pad:
 3820|      1|{
 3821|      1|    return &aes_128_wrap_pad;
 3822|      1|}
EVP_aes_192_wrap_pad:
 3834|      1|{
 3835|      1|    return &aes_192_wrap_pad;
 3836|      1|}
EVP_aes_256_wrap_pad:
 3848|      1|{
 3849|      1|    return &aes_256_wrap_pad;
 3850|      1|}
EVP_aes_128_ocb:
  468|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_192_ocb:
  468|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_256_ocb:
  468|      1|const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
  469|      1|{ return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
  ------------------
  |  |  180|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (180:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------

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

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

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

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

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

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

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

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

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

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

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

OSSL_EC_curve_nid2name:
  119|  18.4k|{
  120|  18.4k|    size_t i;
  121|       |
  122|  18.4k|    if (nid <= 0)
  ------------------
  |  Branch (122:9): [True: 0, False: 18.4k]
  ------------------
  123|      0|        return NULL;
  124|       |
  125|   490k|    for (i = 0; i < OSSL_NELEM(curve_list); i++) {
  ------------------
  |  |   14|   490k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (125:17): [True: 490k, False: 0]
  ------------------
  126|   490k|        if (curve_list[i].nid == nid)
  ------------------
  |  Branch (126:13): [True: 18.4k, False: 471k]
  ------------------
  127|  18.4k|            return curve_list[i].name;
  128|   490k|    }
  129|      0|    return NULL;
  130|  18.4k|}

EVP_CIPHER_CTX_reset:
   34|  1.99k|{
   35|  1.99k|    if (ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 1.99k]
  ------------------
   36|      0|        return 1;
   37|       |
   38|  1.99k|    if (ctx->cipher == NULL || ctx->cipher->prov == NULL)
  ------------------
  |  Branch (38:9): [True: 1.99k, False: 5]
  |  Branch (38:32): [True: 0, False: 5]
  ------------------
   39|  1.99k|        goto legacy;
   40|       |
   41|      5|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (41:9): [True: 5, False: 0]
  ------------------
   42|      5|        if (ctx->cipher->freectx != NULL)
  ------------------
  |  Branch (42:13): [True: 5, False: 0]
  ------------------
   43|      5|            ctx->cipher->freectx(ctx->algctx);
   44|      5|        ctx->algctx = NULL;
   45|      5|    }
   46|      5|    if (ctx->fetched_cipher != NULL)
  ------------------
  |  Branch (46:9): [True: 5, False: 0]
  ------------------
   47|      5|        EVP_CIPHER_free(ctx->fetched_cipher);
   48|      5|    memset(ctx, 0, sizeof(*ctx));
   49|      5|    ctx->iv_len = -1;
   50|       |
   51|      5|    return 1;
   52|       |
   53|       |    /* Remove legacy code below when legacy support is removed. */
   54|  1.99k| legacy:
   55|       |
   56|  1.99k|    if (ctx->cipher != NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 1.99k]
  ------------------
   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|  1.99k|    OPENSSL_free(ctx->cipher_data);
  ------------------
  |  |  107|  1.99k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.99k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.99k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|  1.99k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   65|  1.99k|    ENGINE_finish(ctx->engine);
   66|  1.99k|#endif
   67|  1.99k|    memset(ctx, 0, sizeof(*ctx));
   68|  1.99k|    ctx->iv_len = -1;
   69|  1.99k|    return 1;
   70|  1.99k|}
EVP_CIPHER_CTX_new:
   73|  1.99k|{
   74|  1.99k|    EVP_CIPHER_CTX *ctx;
   75|       |
   76|  1.99k|    ctx = OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
  ------------------
  |  |   99|  1.99k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.99k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.99k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|  1.99k|    if (ctx == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 1.99k]
  ------------------
   78|      0|        return NULL;
   79|       |
   80|  1.99k|    ctx->iv_len = -1;
   81|  1.99k|    return ctx;
   82|  1.99k|}
EVP_CIPHER_CTX_free:
   85|  1.99k|{
   86|  1.99k|    if (ctx == NULL)
  ------------------
  |  Branch (86:9): [True: 1, False: 1.99k]
  ------------------
   87|      1|        return;
   88|  1.99k|    EVP_CIPHER_CTX_reset(ctx);
   89|  1.99k|    OPENSSL_free(ctx);
  ------------------
  |  |  107|  1.99k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.99k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.99k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   90|  1.99k|}
EVP_CipherInit_ex:
  420|  22.8k|{
  421|  22.8k|    return evp_cipher_init_internal(ctx, cipher, impl, key, iv, enc, NULL);
  422|  22.8k|}
EVP_CipherUpdate:
  426|  15.2k|{
  427|  15.2k|    if (ctx->encrypt)
  ------------------
  |  Branch (427:9): [True: 15.2k, False: 0]
  ------------------
  428|  15.2k|        return EVP_EncryptUpdate(ctx, out, outl, in, inl);
  429|      0|    else
  430|      0|        return EVP_DecryptUpdate(ctx, out, outl, in, inl);
  431|  15.2k|}
EVP_EncryptUpdate:
  619|  15.2k|{
  620|  15.2k|    int ret;
  621|  15.2k|    size_t soutl, inl_ = (size_t)inl;
  622|  15.2k|    int blocksize;
  623|       |
  624|  15.2k|    if (likely(outl != NULL)) {
  ------------------
  |  |   22|  15.2k|#  define likely(x)     __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:25): [True: 15.2k, False: 0]
  |  |  ------------------
  ------------------
  625|  15.2k|        *outl = 0;
  626|  15.2k|    } else {
  627|      0|        ERR_raise(ERR_LIB_EVP, 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  628|      0|        return 0;
  629|      0|    }
  630|       |
  631|       |    /* Prevent accidental use of decryption context when encrypting */
  632|  15.2k|    if (unlikely(!ctx->encrypt)) {
  ------------------
  |  |   23|  15.2k|#  define unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:25): [True: 0, False: 15.2k]
  |  |  ------------------
  ------------------
  633|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  634|      0|        return 0;
  635|      0|    }
  636|       |
  637|  15.2k|    if (unlikely(ctx->cipher == NULL)) {
  ------------------
  |  |   23|  15.2k|#  define unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:25): [True: 0, False: 15.2k]
  |  |  ------------------
  ------------------
  638|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  639|      0|        return 0;
  640|      0|    }
  641|       |
  642|  15.2k|    if (unlikely(ctx->cipher->prov == NULL))
  ------------------
  |  |   23|  15.2k|#  define unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:25): [True: 0, False: 15.2k]
  |  |  ------------------
  ------------------
  643|      0|        goto legacy;
  644|       |
  645|  15.2k|    blocksize = ctx->cipher->block_size;
  646|       |
  647|  15.2k|    if (unlikely(ctx->cipher->cupdate == NULL || blocksize < 1)) {
  ------------------
  |  |   23|  30.5k|#  define unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:25): [True: 0, False: 15.2k]
  |  |  |  Branch (23:45): [True: 0, False: 15.2k]
  |  |  |  Branch (23:45): [True: 0, False: 15.2k]
  |  |  ------------------
  ------------------
  648|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  649|      0|        return 0;
  650|      0|    }
  651|       |
  652|  15.2k|    ret = ctx->cipher->cupdate(ctx->algctx, out, &soutl,
  653|  15.2k|                               inl_ + (size_t)(blocksize == 1 ? 0 : blocksize),
  ------------------
  |  Branch (653:48): [True: 7.62k, False: 7.64k]
  ------------------
  654|  15.2k|                               in, inl_);
  655|       |
  656|  15.2k|    if (likely(ret)) {
  ------------------
  |  |   22|  15.2k|#  define likely(x)     __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:25): [True: 15.2k, False: 0]
  |  |  ------------------
  ------------------
  657|  15.2k|        if (soutl > INT_MAX) {
  ------------------
  |  Branch (657:13): [True: 0, False: 15.2k]
  ------------------
  658|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  659|      0|            return 0;
  660|      0|        }
  661|  15.2k|        *outl = soutl;
  662|  15.2k|    }
  663|       |
  664|  15.2k|    return ret;
  665|       |
  666|       |    /* Code below to be removed when legacy support is dropped. */
  667|      0| legacy:
  668|       |
  669|      0|    return evp_EncryptDecryptUpdate(ctx, out, outl, in, inl);
  670|  15.2k|}
EVP_CIPHER_gettable_ctx_params:
 1340|    130|{
 1341|    130|    void *provctx;
 1342|       |
 1343|    130|    if (cipher != NULL && cipher->gettable_ctx_params != NULL) {
  ------------------
  |  Branch (1343:9): [True: 130, False: 0]
  |  Branch (1343:27): [True: 130, False: 0]
  ------------------
 1344|    130|        provctx = ossl_provider_ctx(EVP_CIPHER_get0_provider(cipher));
 1345|    130|        return cipher->gettable_ctx_params(NULL, provctx);
 1346|    130|    }
 1347|      0|    return NULL;
 1348|    130|}
evp_cipher_new:
 1483|    130|{
 1484|    130|    EVP_CIPHER *cipher = OPENSSL_zalloc(sizeof(EVP_CIPHER));
  ------------------
  |  |   99|    130|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    130|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    130|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1485|       |
 1486|    130|    if (cipher != NULL && !CRYPTO_NEW_REF(&cipher->refcnt, 1)) {
  ------------------
  |  Branch (1486:9): [True: 130, False: 0]
  |  Branch (1486:27): [True: 0, False: 130]
  ------------------
 1487|      0|        OPENSSL_free(cipher);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1488|      0|        return NULL;
 1489|      0|    }
 1490|    130|    return cipher;
 1491|    130|}
EVP_CIPHER_fetch:
 1674|      4|{
 1675|      4|    EVP_CIPHER *cipher =
 1676|      4|        evp_generic_fetch(ctx, OSSL_OP_CIPHER, algorithm, properties,
  ------------------
  |  |  255|      4|# define OSSL_OP_CIPHER                              2   /* Symmetric Ciphers */
  ------------------
 1677|      4|                          evp_cipher_from_algorithm, evp_cipher_up_ref,
 1678|      4|                          evp_cipher_free);
 1679|       |
 1680|      4|    return cipher;
 1681|      4|}
EVP_CIPHER_up_ref:
 1684|  23.0k|{
 1685|  23.0k|    int ref = 0;
 1686|       |
 1687|  23.0k|    if (cipher->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  251|  23.0k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1687:9): [True: 23.0k, False: 0]
  ------------------
 1688|  23.0k|        CRYPTO_UP_REF(&cipher->refcnt, &ref);
 1689|  23.0k|    return 1;
 1690|  23.0k|}
evp_cipher_free_int:
 1693|    130|{
 1694|    130|    OPENSSL_free(cipher->type_name);
  ------------------
  |  |  107|    130|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    130|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    130|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1695|    130|    ossl_provider_free(cipher->prov);
 1696|    130|    CRYPTO_FREE_REF(&cipher->refcnt);
 1697|    130|    OPENSSL_free(cipher);
  ------------------
  |  |  107|    130|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    130|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    130|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1698|    130|}
EVP_CIPHER_free:
 1701|  23.1k|{
 1702|  23.1k|    int i;
 1703|       |
 1704|  23.1k|    if (cipher == NULL || cipher->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  251|  23.1k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1704:9): [True: 9, False: 23.1k]
  |  Branch (1704:27): [True: 0, False: 23.1k]
  ------------------
 1705|      9|        return;
 1706|       |
 1707|  23.1k|    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
 1708|  23.1k|    if (i > 0)
  ------------------
  |  Branch (1708:9): [True: 23.0k, False: 130]
  ------------------
 1709|  23.0k|        return;
 1710|    130|    evp_cipher_free_int(cipher);
 1711|    130|}
evp_enc.c:evp_cipher_init_internal:
   97|  22.8k|{
   98|  22.8k|    int n;
   99|  22.8k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  100|  22.8k|    ENGINE *tmpimpl = NULL;
  101|  22.8k|#endif
  102|       |
  103|       |    /*
  104|       |     * enc == 1 means we are encrypting.
  105|       |     * enc == 0 means we are decrypting.
  106|       |     * enc == -1 means, use the previously initialised value for encrypt/decrypt
  107|       |     */
  108|  22.8k|    if (enc == -1) {
  ------------------
  |  Branch (108:9): [True: 22.8k, False: 5]
  ------------------
  109|  22.8k|        enc = ctx->encrypt;
  110|  22.8k|    } else {
  111|      5|        if (enc)
  ------------------
  |  Branch (111:13): [True: 5, False: 0]
  ------------------
  112|      5|            enc = 1;
  113|      5|        ctx->encrypt = enc;
  114|      5|    }
  115|       |
  116|  22.8k|    if (cipher == NULL && ctx->cipher == NULL) {
  ------------------
  |  Branch (116:9): [True: 22.8k, False: 5]
  |  Branch (116:27): [True: 0, False: 22.8k]
  ------------------
  117|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  118|      0|        return 0;
  119|      0|    }
  120|       |
  121|       |    /* Code below to be removed when legacy support is dropped. */
  122|       |
  123|  22.8k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  124|       |    /*
  125|       |     * Whether it's nice or not, "Inits" can be used on "Final"'d contexts so
  126|       |     * this context may already have an ENGINE! Try to avoid releasing the
  127|       |     * previous handle, re-querying for an ENGINE, and having a
  128|       |     * reinitialisation, when it may all be unnecessary.
  129|       |     */
  130|  22.8k|    if (ctx->engine && ctx->cipher
  ------------------
  |  Branch (130:9): [True: 0, False: 22.8k]
  |  Branch (130:24): [True: 0, False: 0]
  ------------------
  131|  22.8k|        && (cipher == NULL || cipher->nid == ctx->cipher->nid))
  ------------------
  |  Branch (131:13): [True: 0, False: 0]
  |  Branch (131:31): [True: 0, False: 0]
  ------------------
  132|      0|        goto skip_to_init;
  133|       |
  134|  22.8k|    if (cipher != NULL && impl == NULL) {
  ------------------
  |  Branch (134:9): [True: 5, False: 22.8k]
  |  Branch (134:27): [True: 5, False: 0]
  ------------------
  135|       |         /* Ask if an ENGINE is reserved for this job */
  136|      5|        tmpimpl = ENGINE_get_cipher_engine(cipher->nid);
  137|      5|    }
  138|  22.8k|#endif
  139|       |
  140|       |    /*
  141|       |     * If there are engines involved then we should use legacy handling for now.
  142|       |     */
  143|  22.8k|    if (ctx->engine != NULL
  ------------------
  |  Branch (143:9): [True: 0, False: 22.8k]
  ------------------
  144|  22.8k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  145|  22.8k|            || tmpimpl != NULL
  ------------------
  |  Branch (145:16): [True: 0, False: 22.8k]
  ------------------
  146|  22.8k|#endif
  147|  22.8k|            || impl != NULL
  ------------------
  |  Branch (147:16): [True: 0, False: 22.8k]
  ------------------
  148|  22.8k|            || (cipher != NULL && cipher->origin == EVP_ORIG_METH)
  ------------------
  |  |  253|      5|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (148:17): [True: 5, False: 22.8k]
  |  Branch (148:35): [True: 0, False: 5]
  ------------------
  149|  22.8k|            || (cipher == NULL && ctx->cipher != NULL
  ------------------
  |  Branch (149:17): [True: 22.8k, False: 5]
  |  Branch (149:35): [True: 22.8k, False: 0]
  ------------------
  150|  22.8k|                               && ctx->cipher->origin == EVP_ORIG_METH)) {
  ------------------
  |  |  253|  22.8k|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (150:35): [True: 0, False: 22.8k]
  ------------------
  151|      0|        if (ctx->cipher == ctx->fetched_cipher)
  ------------------
  |  Branch (151:13): [True: 0, False: 0]
  ------------------
  152|      0|            ctx->cipher = NULL;
  153|      0|        EVP_CIPHER_free(ctx->fetched_cipher);
  154|      0|        ctx->fetched_cipher = NULL;
  155|      0|        goto legacy;
  156|      0|    }
  157|       |    /*
  158|       |     * Ensure a context left lying around from last time is cleared
  159|       |     * (legacy code)
  160|       |     */
  161|  22.8k|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (161:9): [True: 5, False: 22.8k]
  |  Branch (161:27): [True: 0, False: 5]
  ------------------
  162|      0|        if (ctx->cipher->cleanup != NULL && !ctx->cipher->cleanup(ctx))
  ------------------
  |  Branch (162:13): [True: 0, False: 0]
  |  Branch (162:45): [True: 0, False: 0]
  ------------------
  163|      0|            return 0;
  164|      0|        OPENSSL_clear_free(ctx->cipher_data, ctx->cipher->ctx_size);
  ------------------
  |  |  105|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  165|      0|        ctx->cipher_data = NULL;
  166|      0|    }
  167|       |
  168|       |    /* Start of non-legacy code below */
  169|       |
  170|       |    /* Ensure a context left lying around from last time is cleared */
  171|  22.8k|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (171:9): [True: 5, False: 22.8k]
  |  Branch (171:27): [True: 0, False: 5]
  ------------------
  172|      0|        unsigned long flags = ctx->flags;
  173|       |
  174|      0|        EVP_CIPHER_CTX_reset(ctx);
  175|       |        /* Restore encrypt and flags */
  176|      0|        ctx->encrypt = enc;
  177|      0|        ctx->flags = flags;
  178|      0|    }
  179|       |
  180|  22.8k|    if (cipher == NULL)
  ------------------
  |  Branch (180:9): [True: 22.8k, False: 5]
  ------------------
  181|  22.8k|        cipher = ctx->cipher;
  182|       |
  183|  22.8k|    if (cipher->prov == NULL) {
  ------------------
  |  Branch (183:9): [True: 0, False: 22.8k]
  ------------------
  184|       |#ifdef FIPS_MODULE
  185|       |        /* We only do explicit fetches inside the FIPS module */
  186|       |        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  187|       |        return 0;
  188|       |#else
  189|      0|        EVP_CIPHER *provciph =
  190|      0|            EVP_CIPHER_fetch(NULL,
  191|      0|                             cipher->nid == NID_undef ? "NULL"
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (191:30): [True: 0, False: 0]
  ------------------
  192|      0|                                                      : OBJ_nid2sn(cipher->nid),
  193|      0|                             "");
  194|       |
  195|      0|        if (provciph == NULL)
  ------------------
  |  Branch (195:13): [True: 0, False: 0]
  ------------------
  196|      0|            return 0;
  197|      0|        cipher = provciph;
  198|      0|        EVP_CIPHER_free(ctx->fetched_cipher);
  199|      0|        ctx->fetched_cipher = provciph;
  200|      0|#endif
  201|      0|    }
  202|       |
  203|  22.8k|    if (cipher->prov != NULL) {
  ------------------
  |  Branch (203:9): [True: 22.8k, False: 0]
  ------------------
  204|  22.8k|        if (!EVP_CIPHER_up_ref((EVP_CIPHER *)cipher)) {
  ------------------
  |  Branch (204:13): [True: 0, False: 22.8k]
  ------------------
  205|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  206|      0|            return 0;
  207|      0|        }
  208|  22.8k|        EVP_CIPHER_free(ctx->fetched_cipher);
  209|       |        /* Coverity false positive, the reference counting is confusing it */
  210|       |        /* coverity[use_after_free] */
  211|  22.8k|        ctx->fetched_cipher = (EVP_CIPHER *)cipher;
  212|  22.8k|    }
  213|  22.8k|    ctx->cipher = cipher;
  214|  22.8k|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (214:9): [True: 5, False: 22.8k]
  ------------------
  215|      5|        ctx->algctx = ctx->cipher->newctx(ossl_provider_ctx(cipher->prov));
  216|      5|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (216:13): [True: 0, False: 5]
  ------------------
  217|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  218|      0|            return 0;
  219|      0|        }
  220|      5|    }
  221|       |
  222|  22.8k|    if ((ctx->flags & EVP_CIPH_NO_PADDING) != 0) {
  ------------------
  |  |  323|  22.8k|# define         EVP_CIPH_NO_PADDING             0x100
  ------------------
  |  Branch (222:9): [True: 0, False: 22.8k]
  ------------------
  223|       |        /*
  224|       |         * If this ctx was already set up for no padding then we need to tell
  225|       |         * the new cipher about it.
  226|       |         */
  227|      0|        if (!EVP_CIPHER_CTX_set_padding(ctx, 0))
  ------------------
  |  Branch (227:13): [True: 0, False: 0]
  ------------------
  228|      0|            return 0;
  229|      0|    }
  230|       |
  231|  22.8k|    if (enc) {
  ------------------
  |  Branch (231:9): [True: 22.8k, False: 0]
  ------------------
  232|  22.8k|        if (ctx->cipher->einit == NULL) {
  ------------------
  |  Branch (232:13): [True: 0, False: 22.8k]
  ------------------
  233|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  234|      0|            return 0;
  235|      0|        }
  236|       |
  237|  22.8k|        return ctx->cipher->einit(ctx->algctx,
  238|  22.8k|                                  key,
  239|  22.8k|                                  key == NULL ? 0
  ------------------
  |  Branch (239:35): [True: 7.62k, False: 15.2k]
  ------------------
  240|  22.8k|                                              : EVP_CIPHER_CTX_get_key_length(ctx),
  241|  22.8k|                                  iv,
  242|  22.8k|                                  iv == NULL ? 0
  ------------------
  |  Branch (242:35): [True: 15.2k, False: 7.62k]
  ------------------
  243|  22.8k|                                             : EVP_CIPHER_CTX_get_iv_length(ctx),
  244|  22.8k|                                  params);
  245|  22.8k|    }
  246|       |
  247|      0|    if (ctx->cipher->dinit == NULL) {
  ------------------
  |  Branch (247:9): [True: 0, False: 0]
  ------------------
  248|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  249|      0|        return 0;
  250|      0|    }
  251|       |
  252|      0|    return ctx->cipher->dinit(ctx->algctx,
  253|      0|                              key,
  254|      0|                              key == NULL ? 0
  ------------------
  |  Branch (254:31): [True: 0, False: 0]
  ------------------
  255|      0|                                          : EVP_CIPHER_CTX_get_key_length(ctx),
  256|      0|                              iv,
  257|      0|                              iv == NULL ? 0
  ------------------
  |  Branch (257:31): [True: 0, False: 0]
  ------------------
  258|      0|                                         : EVP_CIPHER_CTX_get_iv_length(ctx),
  259|      0|                                  params);
  260|       |
  261|       |    /* Code below to be removed when legacy support is dropped. */
  262|      0| legacy:
  263|       |
  264|      0|    if (cipher != NULL) {
  ------------------
  |  Branch (264:9): [True: 0, False: 0]
  ------------------
  265|       |        /*
  266|       |         * Ensure a context left lying around from last time is cleared (we
  267|       |         * previously attempted to avoid this if the same ENGINE and
  268|       |         * EVP_CIPHER could be used).
  269|       |         */
  270|      0|        if (ctx->cipher) {
  ------------------
  |  Branch (270:13): [True: 0, False: 0]
  ------------------
  271|      0|            unsigned long flags = ctx->flags;
  272|      0|            EVP_CIPHER_CTX_reset(ctx);
  273|       |            /* Restore encrypt and flags */
  274|      0|            ctx->encrypt = enc;
  275|      0|            ctx->flags = flags;
  276|      0|        }
  277|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  278|      0|        if (impl != NULL) {
  ------------------
  |  Branch (278:13): [True: 0, False: 0]
  ------------------
  279|      0|            if (!ENGINE_init(impl)) {
  ------------------
  |  Branch (279:17): [True: 0, False: 0]
  ------------------
  280|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  281|      0|                return 0;
  282|      0|            }
  283|      0|        } else {
  284|      0|            impl = tmpimpl;
  285|      0|        }
  286|      0|        if (impl != NULL) {
  ------------------
  |  Branch (286:13): [True: 0, False: 0]
  ------------------
  287|       |            /* There's an ENGINE for this job ... (apparently) */
  288|      0|            const EVP_CIPHER *c = ENGINE_get_cipher(impl, cipher->nid);
  289|       |
  290|      0|            if (c == NULL) {
  ------------------
  |  Branch (290:17): [True: 0, False: 0]
  ------------------
  291|       |                /*
  292|       |                 * One positive side-effect of US's export control history,
  293|       |                 * is that we should at least be able to avoid using US
  294|       |                 * misspellings of "initialisation"?
  295|       |                 */
  296|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  297|      0|                return 0;
  298|      0|            }
  299|       |            /* We'll use the ENGINE's private cipher definition */
  300|      0|            cipher = c;
  301|       |            /*
  302|       |             * Store the ENGINE functional reference so we know 'cipher' came
  303|       |             * from an ENGINE and we need to release it when done.
  304|       |             */
  305|      0|            ctx->engine = impl;
  306|      0|        } else {
  307|      0|            ctx->engine = NULL;
  308|      0|        }
  309|      0|#endif
  310|       |
  311|      0|        ctx->cipher = cipher;
  312|      0|        if (ctx->cipher->ctx_size) {
  ------------------
  |  Branch (312:13): [True: 0, False: 0]
  ------------------
  313|      0|            ctx->cipher_data = OPENSSL_zalloc(ctx->cipher->ctx_size);
  ------------------
  |  |   99|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  314|      0|            if (ctx->cipher_data == NULL) {
  ------------------
  |  Branch (314:17): [True: 0, False: 0]
  ------------------
  315|      0|                ctx->cipher = NULL;
  316|      0|                return 0;
  317|      0|            }
  318|      0|        } else {
  319|      0|            ctx->cipher_data = NULL;
  320|      0|        }
  321|      0|        ctx->key_len = cipher->key_len;
  322|       |        /* Preserve wrap enable flag, zero everything else */
  323|      0|        ctx->flags &= EVP_CIPHER_CTX_FLAG_WRAP_ALLOW;
  ------------------
  |  |  362|      0|# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1
  ------------------
  324|      0|        if (ctx->cipher->flags & EVP_CIPH_CTRL_INIT) {
  ------------------
  |  |  319|      0|# define         EVP_CIPH_CTRL_INIT              0x40
  ------------------
  |  Branch (324:13): [True: 0, False: 0]
  ------------------
  325|      0|            if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL) <= 0) {
  ------------------
  |  |  366|      0|# define         EVP_CTRL_INIT                   0x0
  ------------------
  |  Branch (325:17): [True: 0, False: 0]
  ------------------
  326|      0|                ctx->cipher = NULL;
  327|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  328|      0|                return 0;
  329|      0|            }
  330|      0|        }
  331|      0|    }
  332|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  333|      0| skip_to_init:
  334|      0|#endif
  335|      0|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (335:9): [True: 0, False: 0]
  ------------------
  336|      0|        return 0;
  337|       |
  338|       |    /* we assume block size is a power of 2 in *cryptUpdate */
  339|      0|    OPENSSL_assert(ctx->cipher->block_size == 1
  ------------------
  |  |  421|      0|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (421:13): [True: 0, False: 0]
  |  |  |  Branch (421:13): [True: 0, False: 0]
  |  |  |  Branch (421:13): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  340|      0|                   || ctx->cipher->block_size == 8
  341|      0|                   || ctx->cipher->block_size == 16);
  342|       |
  343|      0|    if (!(ctx->flags & EVP_CIPHER_CTX_FLAG_WRAP_ALLOW)
  ------------------
  |  |  362|      0|# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1
  ------------------
  |  Branch (343:9): [True: 0, False: 0]
  ------------------
  344|      0|        && EVP_CIPHER_CTX_get_mode(ctx) == EVP_CIPH_WRAP_MODE) {
  ------------------
  |  |  651|      0|# define EVP_CIPHER_CTX_get_mode(c)  EVP_CIPHER_get_mode(EVP_CIPHER_CTX_get0_cipher(c))
  ------------------
                      && EVP_CIPHER_CTX_get_mode(ctx) == EVP_CIPH_WRAP_MODE) {
  ------------------
  |  |  307|      0|# define         EVP_CIPH_WRAP_MODE              0x10002
  ------------------
  |  Branch (344:12): [True: 0, False: 0]
  ------------------
  345|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  346|      0|        return 0;
  347|      0|    }
  348|       |
  349|      0|    if ((EVP_CIPHER_get_flags(EVP_CIPHER_CTX_get0_cipher(ctx))
  ------------------
  |  Branch (349:9): [True: 0, False: 0]
  ------------------
  350|      0|                & EVP_CIPH_CUSTOM_IV) == 0) {
  ------------------
  |  |  315|      0|# define         EVP_CIPH_CUSTOM_IV              0x10
  ------------------
  351|      0|        switch (EVP_CIPHER_CTX_get_mode(ctx)) {
  ------------------
  |  |  651|      0|# define EVP_CIPHER_CTX_get_mode(c)  EVP_CIPHER_get_mode(EVP_CIPHER_CTX_get0_cipher(c))
  ------------------
  352|       |
  353|      0|        case EVP_CIPH_STREAM_CIPHER:
  ------------------
  |  |  298|      0|# define         EVP_CIPH_STREAM_CIPHER          0x0
  ------------------
  |  Branch (353:9): [True: 0, False: 0]
  ------------------
  354|      0|        case EVP_CIPH_ECB_MODE:
  ------------------
  |  |  299|      0|# define         EVP_CIPH_ECB_MODE               0x1
  ------------------
  |  Branch (354:9): [True: 0, False: 0]
  ------------------
  355|      0|            break;
  356|       |
  357|      0|        case EVP_CIPH_CFB_MODE:
  ------------------
  |  |  301|      0|# define         EVP_CIPH_CFB_MODE               0x3
  ------------------
  |  Branch (357:9): [True: 0, False: 0]
  ------------------
  358|      0|        case EVP_CIPH_OFB_MODE:
  ------------------
  |  |  302|      0|# define         EVP_CIPH_OFB_MODE               0x4
  ------------------
  |  Branch (358:9): [True: 0, False: 0]
  ------------------
  359|       |
  360|      0|            ctx->num = 0;
  361|       |            /* fall-through */
  362|       |
  363|      0|        case EVP_CIPH_CBC_MODE:
  ------------------
  |  |  300|      0|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (363:9): [True: 0, False: 0]
  ------------------
  364|      0|            n = EVP_CIPHER_CTX_get_iv_length(ctx);
  365|      0|            if (n < 0 || n > (int)sizeof(ctx->iv)) {
  ------------------
  |  Branch (365:17): [True: 0, False: 0]
  |  Branch (365:26): [True: 0, False: 0]
  ------------------
  366|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  367|      0|                return 0;
  368|      0|            }
  369|      0|            if (iv != NULL)
  ------------------
  |  Branch (369:17): [True: 0, False: 0]
  ------------------
  370|      0|                memcpy(ctx->oiv, iv, n);
  371|      0|            memcpy(ctx->iv, ctx->oiv, n);
  372|      0|            break;
  373|       |
  374|      0|        case EVP_CIPH_CTR_MODE:
  ------------------
  |  |  303|      0|# define         EVP_CIPH_CTR_MODE               0x5
  ------------------
  |  Branch (374:9): [True: 0, False: 0]
  ------------------
  375|      0|            ctx->num = 0;
  376|       |            /* Don't reuse IV for CTR mode */
  377|      0|            if (iv != NULL) {
  ------------------
  |  Branch (377:17): [True: 0, False: 0]
  ------------------
  378|      0|                n = EVP_CIPHER_CTX_get_iv_length(ctx);
  379|      0|                if (n <= 0 || n > (int)sizeof(ctx->iv)) {
  ------------------
  |  Branch (379:21): [True: 0, False: 0]
  |  Branch (379:31): [True: 0, False: 0]
  ------------------
  380|      0|                    ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  381|      0|                    return 0;
  382|      0|                }
  383|      0|                memcpy(ctx->iv, iv, n);
  384|      0|            }
  385|      0|            break;
  386|       |
  387|      0|        default:
  ------------------
  |  Branch (387:9): [True: 0, False: 0]
  ------------------
  388|      0|            return 0;
  389|      0|        }
  390|      0|    }
  391|       |
  392|      0|    if (key != NULL || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) {
  ------------------
  |  |  317|      0|# define         EVP_CIPH_ALWAYS_CALL_INIT       0x20
  ------------------
  |  Branch (392:9): [True: 0, False: 0]
  |  Branch (392:24): [True: 0, False: 0]
  ------------------
  393|      0|        if (!ctx->cipher->init(ctx, key, iv, enc))
  ------------------
  |  Branch (393:13): [True: 0, False: 0]
  ------------------
  394|      0|            return 0;
  395|      0|    }
  396|      0|    ctx->buf_len = 0;
  397|      0|    ctx->final_used = 0;
  398|      0|    ctx->block_mask = ctx->cipher->block_size - 1;
  399|      0|    return 1;
  400|      0|}
evp_enc.c:evp_cipher_from_algorithm:
 1527|    130|{
 1528|    130|    const OSSL_DISPATCH *fns = algodef->implementation;
 1529|    130|    EVP_CIPHER *cipher = NULL;
 1530|    130|    int fnciphcnt = 0, fnctxcnt = 0;
 1531|       |
 1532|    130|    if ((cipher = evp_cipher_new()) == NULL) {
  ------------------
  |  Branch (1532:9): [True: 0, False: 130]
  ------------------
 1533|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1534|      0|        return NULL;
 1535|      0|    }
 1536|       |
 1537|    130|#ifndef FIPS_MODULE
 1538|    130|    cipher->nid = NID_undef;
  ------------------
  |  |   18|    130|#define NID_undef                       0
  ------------------
 1539|    130|    if (!evp_names_do_all(prov, name_id, set_legacy_nid, &cipher->nid)
  ------------------
  |  Branch (1539:9): [True: 0, False: 130]
  ------------------
 1540|    130|            || cipher->nid == -1) {
  ------------------
  |  Branch (1540:16): [True: 0, False: 130]
  ------------------
 1541|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1542|      0|        EVP_CIPHER_free(cipher);
 1543|      0|        return NULL;
 1544|      0|    }
 1545|    130|#endif
 1546|       |
 1547|    130|    cipher->name_id = name_id;
 1548|    130|    if ((cipher->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (1548:9): [True: 0, False: 130]
  ------------------
 1549|      0|        EVP_CIPHER_free(cipher);
 1550|      0|        return NULL;
 1551|      0|    }
 1552|    130|    cipher->description = algodef->algorithm_description;
 1553|       |
 1554|  1.93k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (1554:12): [True: 1.80k, False: 130]
  ------------------
 1555|  1.80k|        switch (fns->function_id) {
  ------------------
  |  Branch (1555:17): [True: 0, False: 1.80k]
  ------------------
 1556|    130|        case OSSL_FUNC_CIPHER_NEWCTX:
  ------------------
  |  |  315|    130|# define OSSL_FUNC_CIPHER_NEWCTX                     1
  ------------------
  |  Branch (1556:9): [True: 130, False: 1.67k]
  ------------------
 1557|    130|            if (cipher->newctx != NULL)
  ------------------
  |  Branch (1557:17): [True: 0, False: 130]
  ------------------
 1558|      0|                break;
 1559|    130|            cipher->newctx = OSSL_FUNC_cipher_newctx(fns);
 1560|    130|            fnctxcnt++;
 1561|    130|            break;
 1562|    130|        case OSSL_FUNC_CIPHER_ENCRYPT_INIT:
  ------------------
  |  |  316|    130|# define OSSL_FUNC_CIPHER_ENCRYPT_INIT               2
  ------------------
  |  Branch (1562:9): [True: 130, False: 1.67k]
  ------------------
 1563|    130|            if (cipher->einit != NULL)
  ------------------
  |  Branch (1563:17): [True: 0, False: 130]
  ------------------
 1564|      0|                break;
 1565|    130|            cipher->einit = OSSL_FUNC_cipher_encrypt_init(fns);
 1566|    130|            fnciphcnt++;
 1567|    130|            break;
 1568|    130|        case OSSL_FUNC_CIPHER_DECRYPT_INIT:
  ------------------
  |  |  317|    130|# define OSSL_FUNC_CIPHER_DECRYPT_INIT               3
  ------------------
  |  Branch (1568:9): [True: 130, False: 1.67k]
  ------------------
 1569|    130|            if (cipher->dinit != NULL)
  ------------------
  |  Branch (1569:17): [True: 0, False: 130]
  ------------------
 1570|      0|                break;
 1571|    130|            cipher->dinit = OSSL_FUNC_cipher_decrypt_init(fns);
 1572|    130|            fnciphcnt++;
 1573|    130|            break;
 1574|    130|        case OSSL_FUNC_CIPHER_UPDATE:
  ------------------
  |  |  318|    130|# define OSSL_FUNC_CIPHER_UPDATE                     4
  ------------------
  |  Branch (1574:9): [True: 130, False: 1.67k]
  ------------------
 1575|    130|            if (cipher->cupdate != NULL)
  ------------------
  |  Branch (1575:17): [True: 0, False: 130]
  ------------------
 1576|      0|                break;
 1577|    130|            cipher->cupdate = OSSL_FUNC_cipher_update(fns);
 1578|    130|            fnciphcnt++;
 1579|    130|            break;
 1580|    130|        case OSSL_FUNC_CIPHER_FINAL:
  ------------------
  |  |  319|    130|# define OSSL_FUNC_CIPHER_FINAL                      5
  ------------------
  |  Branch (1580:9): [True: 130, False: 1.67k]
  ------------------
 1581|    130|            if (cipher->cfinal != NULL)
  ------------------
  |  Branch (1581:17): [True: 0, False: 130]
  ------------------
 1582|      0|                break;
 1583|    130|            cipher->cfinal = OSSL_FUNC_cipher_final(fns);
 1584|    130|            fnciphcnt++;
 1585|    130|            break;
 1586|    118|        case OSSL_FUNC_CIPHER_CIPHER:
  ------------------
  |  |  320|    118|# define OSSL_FUNC_CIPHER_CIPHER                     6
  ------------------
  |  Branch (1586:9): [True: 118, False: 1.68k]
  ------------------
 1587|    118|            if (cipher->ccipher != NULL)
  ------------------
  |  Branch (1587:17): [True: 0, False: 118]
  ------------------
 1588|      0|                break;
 1589|    118|            cipher->ccipher = OSSL_FUNC_cipher_cipher(fns);
 1590|    118|            break;
 1591|    130|        case OSSL_FUNC_CIPHER_FREECTX:
  ------------------
  |  |  321|    130|# define OSSL_FUNC_CIPHER_FREECTX                    7
  ------------------
  |  Branch (1591:9): [True: 130, False: 1.67k]
  ------------------
 1592|    130|            if (cipher->freectx != NULL)
  ------------------
  |  Branch (1592:17): [True: 0, False: 130]
  ------------------
 1593|      0|                break;
 1594|    130|            cipher->freectx = OSSL_FUNC_cipher_freectx(fns);
 1595|    130|            fnctxcnt++;
 1596|    130|            break;
 1597|    129|        case OSSL_FUNC_CIPHER_DUPCTX:
  ------------------
  |  |  322|    129|# define OSSL_FUNC_CIPHER_DUPCTX                     8
  ------------------
  |  Branch (1597:9): [True: 129, False: 1.67k]
  ------------------
 1598|    129|            if (cipher->dupctx != NULL)
  ------------------
  |  Branch (1598:17): [True: 0, False: 129]
  ------------------
 1599|      0|                break;
 1600|    129|            cipher->dupctx = OSSL_FUNC_cipher_dupctx(fns);
 1601|    129|            break;
 1602|    130|        case OSSL_FUNC_CIPHER_GET_PARAMS:
  ------------------
  |  |  323|    130|# define OSSL_FUNC_CIPHER_GET_PARAMS                 9
  ------------------
  |  Branch (1602:9): [True: 130, False: 1.67k]
  ------------------
 1603|    130|            if (cipher->get_params != NULL)
  ------------------
  |  Branch (1603:17): [True: 0, False: 130]
  ------------------
 1604|      0|                break;
 1605|    130|            cipher->get_params = OSSL_FUNC_cipher_get_params(fns);
 1606|    130|            break;
 1607|    130|        case OSSL_FUNC_CIPHER_GET_CTX_PARAMS:
  ------------------
  |  |  324|    130|# define OSSL_FUNC_CIPHER_GET_CTX_PARAMS            10
  ------------------
  |  Branch (1607:9): [True: 130, False: 1.67k]
  ------------------
 1608|    130|            if (cipher->get_ctx_params != NULL)
  ------------------
  |  Branch (1608:17): [True: 0, False: 130]
  ------------------
 1609|      0|                break;
 1610|    130|            cipher->get_ctx_params = OSSL_FUNC_cipher_get_ctx_params(fns);
 1611|    130|            break;
 1612|    130|        case OSSL_FUNC_CIPHER_SET_CTX_PARAMS:
  ------------------
  |  |  325|    130|# define OSSL_FUNC_CIPHER_SET_CTX_PARAMS            11
  ------------------
  |  Branch (1612:9): [True: 130, False: 1.67k]
  ------------------
 1613|    130|            if (cipher->set_ctx_params != NULL)
  ------------------
  |  Branch (1613:17): [True: 0, False: 130]
  ------------------
 1614|      0|                break;
 1615|    130|            cipher->set_ctx_params = OSSL_FUNC_cipher_set_ctx_params(fns);
 1616|    130|            break;
 1617|    130|        case OSSL_FUNC_CIPHER_GETTABLE_PARAMS:
  ------------------
  |  |  326|    130|# define OSSL_FUNC_CIPHER_GETTABLE_PARAMS           12
  ------------------
  |  Branch (1617:9): [True: 130, False: 1.67k]
  ------------------
 1618|    130|            if (cipher->gettable_params != NULL)
  ------------------
  |  Branch (1618:17): [True: 0, False: 130]
  ------------------
 1619|      0|                break;
 1620|    130|            cipher->gettable_params = OSSL_FUNC_cipher_gettable_params(fns);
 1621|    130|            break;
 1622|    130|        case OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  327|    130|# define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS       13
  ------------------
  |  Branch (1622:9): [True: 130, False: 1.67k]
  ------------------
 1623|    130|            if (cipher->gettable_ctx_params != NULL)
  ------------------
  |  Branch (1623:17): [True: 0, False: 130]
  ------------------
 1624|      0|                break;
 1625|    130|            cipher->gettable_ctx_params =
 1626|    130|                OSSL_FUNC_cipher_gettable_ctx_params(fns);
 1627|    130|            break;
 1628|    130|        case OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  328|    130|# define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS       14
  ------------------
  |  Branch (1628:9): [True: 130, False: 1.67k]
  ------------------
 1629|    130|            if (cipher->settable_ctx_params != NULL)
  ------------------
  |  Branch (1629:17): [True: 0, False: 130]
  ------------------
 1630|      0|                break;
 1631|    130|            cipher->settable_ctx_params =
 1632|    130|                OSSL_FUNC_cipher_settable_ctx_params(fns);
 1633|    130|            break;
 1634|  1.80k|        }
 1635|  1.80k|    }
 1636|    130|    if ((fnciphcnt != 0 && fnciphcnt != 3 && fnciphcnt != 4)
  ------------------
  |  Branch (1636:10): [True: 130, False: 0]
  |  Branch (1636:28): [True: 130, False: 0]
  |  Branch (1636:46): [True: 0, False: 130]
  ------------------
 1637|    130|            || (fnciphcnt == 0 && cipher->ccipher == NULL)
  ------------------
  |  Branch (1637:17): [True: 0, False: 130]
  |  Branch (1637:35): [True: 0, False: 0]
  ------------------
 1638|    130|            || fnctxcnt != 2) {
  ------------------
  |  Branch (1638:16): [True: 0, False: 130]
  ------------------
 1639|       |        /*
 1640|       |         * In order to be a consistent set of functions we must have at least
 1641|       |         * a complete set of "encrypt" functions, or a complete set of "decrypt"
 1642|       |         * functions, or a single "cipher" function. In all cases we need both
 1643|       |         * the "newctx" and "freectx" functions.
 1644|       |         */
 1645|      0|        EVP_CIPHER_free(cipher);
 1646|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1647|      0|        return NULL;
 1648|      0|    }
 1649|    130|    cipher->prov = prov;
 1650|    130|    if (prov != NULL)
  ------------------
  |  Branch (1650:9): [True: 130, False: 0]
  ------------------
 1651|    130|        ossl_provider_up_ref(prov);
 1652|       |
 1653|    130|    if (!evp_cipher_cache_constants(cipher)) {
  ------------------
  |  Branch (1653:9): [True: 0, False: 130]
  ------------------
 1654|      0|        EVP_CIPHER_free(cipher);
 1655|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1656|      0|        cipher = NULL;
 1657|      0|    }
 1658|       |
 1659|    130|    return cipher;
 1660|    130|}
evp_enc.c:set_legacy_nid:
 1501|    243|{
 1502|    243|    int nid;
 1503|    243|    int *legacy_nid = vlegacy_nid;
 1504|       |    /*
 1505|       |     * We use lowest level function to get the associated method, because
 1506|       |     * higher level functions such as EVP_get_cipherbyname() have changed
 1507|       |     * to look at providers too.
 1508|       |     */
 1509|    243|    const void *legacy_method = OBJ_NAME_get(name, OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|    243|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
 1510|       |
 1511|    243|    if (*legacy_nid == -1)       /* We found a clash already */
  ------------------
  |  Branch (1511:9): [True: 0, False: 243]
  ------------------
 1512|      0|        return;
 1513|    243|    if (legacy_method == NULL)
  ------------------
  |  Branch (1513:9): [True: 109, False: 134]
  ------------------
 1514|    109|        return;
 1515|    134|    nid = EVP_CIPHER_get_nid(legacy_method);
 1516|    134|    if (*legacy_nid != NID_undef && *legacy_nid != nid) {
  ------------------
  |  |   18|    268|#define NID_undef                       0
  ------------------
  |  Branch (1516:9): [True: 26, False: 108]
  |  Branch (1516:37): [True: 0, False: 26]
  ------------------
 1517|      0|        *legacy_nid = -1;
 1518|      0|        return;
 1519|      0|    }
 1520|    134|    *legacy_nid = nid;
 1521|    134|}
evp_enc.c:evp_cipher_up_ref:
 1663|    136|{
 1664|    136|    return EVP_CIPHER_up_ref(cipher);
 1665|    136|}
evp_enc.c:evp_cipher_free:
 1668|    262|{
 1669|    262|    EVP_CIPHER_free(cipher);
 1670|    262|}

ossl_err_load_EVP_strings:
  202|      2|{
  203|      2|#ifndef OPENSSL_NO_ERR
  204|      2|    if (ERR_reason_error_string(EVP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (204:9): [True: 2, False: 0]
  ------------------
  205|      2|        ERR_load_strings_const(EVP_str_reasons);
  206|      2|#endif
  207|      2|    return 1;
  208|      2|}

evp_generic_fetch:
  359|  20.3k|{
  360|  20.3k|    struct evp_method_data_st methdata;
  361|  20.3k|    void *method;
  362|       |
  363|  20.3k|    methdata.libctx = libctx;
  364|  20.3k|    methdata.tmp_store = NULL;
  365|  20.3k|    method = inner_evp_generic_fetch(&methdata, NULL, operation_id,
  366|  20.3k|                                     name, properties,
  367|  20.3k|                                     new_method, up_ref_method, free_method);
  368|  20.3k|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  369|  20.3k|    return method;
  370|  20.3k|}
evp_generic_do_all:
  593|    868|{
  594|    868|    struct evp_method_data_st methdata;
  595|    868|    struct filter_data_st data;
  596|       |
  597|    868|    methdata.libctx = libctx;
  598|    868|    methdata.tmp_store = NULL;
  599|    868|    (void)inner_evp_generic_fetch(&methdata, NULL, operation_id, NULL, NULL,
  600|    868|                                  new_method, up_ref_method, free_method);
  601|       |
  602|    868|    data.operation_id = operation_id;
  603|    868|    data.user_fn = user_fn;
  604|    868|    data.user_arg = user_arg;
  605|    868|    if (methdata.tmp_store != NULL)
  ------------------
  |  Branch (605:9): [True: 0, False: 868]
  ------------------
  606|      0|        ossl_method_store_do_all(methdata.tmp_store, &filter_on_operation_id,
  607|      0|                                 &data);
  608|    868|    ossl_method_store_do_all(get_evp_method_store(libctx),
  609|    868|                             &filter_on_operation_id, &data);
  610|    868|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  611|    868|}
evp_is_a:
  615|  49.9k|{
  616|       |    /*
  617|       |     * For a |prov| that is NULL, the library context will be NULL
  618|       |     */
  619|  49.9k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  620|  49.9k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  621|       |
  622|  49.9k|    if (prov == NULL)
  ------------------
  |  Branch (622:9): [True: 20.3k, False: 29.6k]
  ------------------
  623|  20.3k|        number = ossl_namemap_name2num(namemap, legacy_name);
  624|  49.9k|    return ossl_namemap_name2num(namemap, name) == number;
  625|  49.9k|}
evp_names_do_all:
  630|  29.8k|{
  631|  29.8k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  632|  29.8k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  633|       |
  634|  29.8k|    return ossl_namemap_doall_names(namemap, number, fn, data);
  635|  29.8k|}
evp_fetch.c:inner_evp_generic_fetch:
  249|  21.1k|{
  250|  21.1k|    OSSL_METHOD_STORE *store = get_evp_method_store(methdata->libctx);
  251|  21.1k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  252|  21.1k|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (252:31): [True: 0, False: 21.1k]
  ------------------
  253|  21.1k|    uint32_t meth_id = 0;
  254|  21.1k|    void *method = NULL;
  255|  21.1k|    int unsupported, name_id;
  256|       |
  257|  21.1k|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (257:9): [True: 0, False: 21.1k]
  |  Branch (257:26): [True: 0, False: 21.1k]
  ------------------
  258|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  259|      0|        return NULL;
  260|      0|    }
  261|       |
  262|       |    /*
  263|       |     * If there's ever an operation_id == 0 passed, we have an internal
  264|       |     * programming error.
  265|       |     */
  266|  21.1k|    if (!ossl_assert(operation_id > 0)) {
  ------------------
  |  |   52|  21.1k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  21.1k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (266:9): [True: 0, False: 21.1k]
  ------------------
  267|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  268|      0|        return NULL;
  269|      0|    }
  270|       |
  271|       |    /* If we haven't received a name id yet, try to get one for the name */
  272|  21.1k|    name_id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (272:15): [True: 20.3k, False: 868]
  ------------------
  273|       |
  274|       |    /*
  275|       |     * If we have a name id, calculate a method id with evp_method_id().
  276|       |     *
  277|       |     * evp_method_id returns 0 if we have too many operations (more than
  278|       |     * about 2^8) or too many names (more than about 2^24).  In that case,
  279|       |     * we can't create any new method.
  280|       |     * For all intents and purposes, this is an internal error.
  281|       |     */
  282|  21.1k|    if (name_id != 0 && (meth_id = evp_method_id(name_id, operation_id)) == 0) {
  ------------------
  |  Branch (282:9): [True: 20.3k, False: 870]
  |  Branch (282:25): [True: 0, False: 20.3k]
  ------------------
  283|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  284|      0|        return NULL;
  285|      0|    }
  286|       |
  287|       |    /*
  288|       |     * If we haven't found the name yet, chances are that the algorithm to
  289|       |     * be fetched is unsupported.
  290|       |     */
  291|  21.1k|    unsupported = name_id == 0;
  292|       |
  293|  21.1k|    if (meth_id == 0
  ------------------
  |  Branch (293:9): [True: 870, False: 20.3k]
  ------------------
  294|  21.1k|        || !ossl_method_store_cache_get(store, prov, meth_id, propq, &method)) {
  ------------------
  |  Branch (294:12): [True: 3, False: 20.3k]
  ------------------
  295|    873|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  296|    873|            get_tmp_evp_method_store,
  297|    873|            reserve_evp_method_store,
  298|    873|            unreserve_evp_method_store,
  299|    873|            get_evp_method_from_store,
  300|    873|            put_evp_method_in_store,
  301|    873|            construct_evp_method,
  302|    873|            destruct_evp_method
  303|    873|        };
  304|       |
  305|    873|        methdata->operation_id = operation_id;
  306|    873|        methdata->name_id = name_id;
  307|    873|        methdata->names = name;
  308|    873|        methdata->propquery = propq;
  309|    873|        methdata->method_from_algorithm = new_method;
  310|    873|        methdata->refcnt_up_method = up_ref_method;
  311|    873|        methdata->destruct_method = free_method;
  312|    873|        methdata->flag_construct_error_occurred = 0;
  313|    873|        if ((method = ossl_method_construct(methdata->libctx, operation_id,
  ------------------
  |  Branch (313:13): [True: 5, False: 868]
  ------------------
  314|    873|                                            &prov, 0 /* !force_cache */,
  315|    873|                                            &mcm, methdata)) != NULL) {
  316|       |            /*
  317|       |             * If construction did create a method for us, we know that
  318|       |             * there is a correct name_id and meth_id, since those have
  319|       |             * already been calculated in get_evp_method_from_store() and
  320|       |             * put_evp_method_in_store() above.
  321|       |             */
  322|      5|            if (name_id == 0)
  ------------------
  |  Branch (322:17): [True: 2, False: 3]
  ------------------
  323|      2|                name_id = ossl_namemap_name2num(namemap, name);
  324|      5|            meth_id = evp_method_id(name_id, operation_id);
  325|      5|            if (name_id != 0)
  ------------------
  |  Branch (325:17): [True: 5, False: 0]
  ------------------
  326|      5|                ossl_method_store_cache_set(store, prov, meth_id, propq,
  327|      5|                                            method, up_ref_method, free_method);
  328|      5|        }
  329|       |
  330|       |        /*
  331|       |         * If we never were in the constructor, the algorithm to be fetched
  332|       |         * is unsupported.
  333|       |         */
  334|    873|        unsupported = !methdata->flag_construct_error_occurred;
  335|    873|    }
  336|       |
  337|  21.1k|    if ((name_id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (337:10): [True: 20.3k, False: 868]
  |  Branch (337:26): [True: 0, False: 868]
  |  Branch (337:43): [True: 0, False: 20.3k]
  ------------------
  338|      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 (338:20): [True: 0, False: 0]
  ------------------
  339|       |
  340|      0|        if (name == NULL)
  ------------------
  |  Branch (340:13): [True: 0, False: 0]
  ------------------
  341|      0|            name = ossl_namemap_num2name(namemap, name_id, 0);
  342|      0|        ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
  343|      0|                       "%s, Algorithm (%s : %d), Properties (%s)",
  344|      0|                       ossl_lib_ctx_get_descriptor(methdata->libctx),
  345|      0|                       name == NULL ? "<null>" : name, name_id,
  ------------------
  |  Branch (345:24): [True: 0, False: 0]
  ------------------
  346|      0|                       properties == NULL ? "<null>" : properties);
  ------------------
  |  Branch (346:24): [True: 0, False: 0]
  ------------------
  347|      0|    }
  348|       |
  349|  21.1k|    return method;
  350|  21.1k|}
evp_fetch.c:evp_method_id:
  112|  20.4k|{
  113|  20.4k|    if (!ossl_assert(name_id > 0 && name_id <= METHOD_ID_NAME_MAX)
  ------------------
  |  |   52|  40.9k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 20.4k, False: 0]
  |  |  |  Branch (52:43): [True: 20.4k, False: 0]
  |  |  ------------------
  |  |   53|  40.9k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (113:9): [True: 0, False: 20.4k]
  ------------------
  114|  20.4k|        || !ossl_assert(operation_id > 0
  ------------------
  |  |   52|  40.9k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 20.4k, False: 0]
  |  |  |  Branch (52:43): [True: 20.4k, False: 0]
  |  |  ------------------
  |  |   53|  20.4k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (114:12): [True: 0, False: 20.4k]
  ------------------
  115|  20.4k|                        && operation_id <= METHOD_ID_OPERATION_MAX))
  116|      0|        return 0;
  117|  20.4k|    return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  109|  20.4k|#define METHOD_ID_NAME_OFFSET           8
  ------------------
                  return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  108|  20.4k|#define METHOD_ID_NAME_MASK             0x7FFFFF00
  ------------------
  118|  20.4k|            | (operation_id & METHOD_ID_OPERATION_MASK));
  ------------------
  |  |  106|  20.4k|#define METHOD_ID_OPERATION_MASK        0x000000FF
  ------------------
  119|  20.4k|}
evp_fetch.c:reserve_evp_method_store:
   68|    873|{
   69|    873|    struct evp_method_data_st *methdata = data;
   70|       |
   71|    873|    if (store == NULL
  ------------------
  |  Branch (71:9): [True: 873, False: 0]
  ------------------
   72|    873|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (72:12): [True: 0, False: 873]
  ------------------
   73|      0|        return 0;
   74|       |
   75|    873|    return ossl_method_lock_store(store);
   76|    873|}
evp_fetch.c:unreserve_evp_method_store:
   79|    873|{
   80|    873|    struct evp_method_data_st *methdata = data;
   81|       |
   82|    873|    if (store == NULL
  ------------------
  |  Branch (82:9): [True: 873, False: 0]
  ------------------
   83|    873|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (83:12): [True: 0, False: 873]
  ------------------
   84|      0|        return 0;
   85|       |
   86|    873|    return ossl_method_unlock_store(store);
   87|    873|}
evp_fetch.c:get_evp_method_from_store:
  123|    873|{
  124|    873|    struct evp_method_data_st *methdata = data;
  125|    873|    void *method = NULL;
  126|    873|    int name_id;
  127|    873|    uint32_t meth_id;
  128|       |
  129|       |    /*
  130|       |     * get_evp_method_from_store() is only called to try and get the method
  131|       |     * that evp_generic_fetch() is asking for, and the operation id as well
  132|       |     * as the name or name id are passed via methdata.
  133|       |     */
  134|    873|    if ((name_id = methdata->name_id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (134:9): [True: 870, False: 3]
  |  Branch (134:47): [True: 2, False: 868]
  ------------------
  135|      2|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  136|      2|        const char *names = methdata->names;
  137|      2|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|      2|#define NAME_SEPARATOR ':'
  ------------------
  138|      2|        size_t l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (138:21): [True: 2, False: 0]
  ------------------
  139|       |
  140|      2|        if (namemap == 0)
  ------------------
  |  Branch (140:13): [True: 0, False: 2]
  ------------------
  141|      0|            return NULL;
  142|      2|        name_id = ossl_namemap_name2num_n(namemap, names, l);
  143|      2|    }
  144|       |
  145|    873|    if (name_id == 0
  ------------------
  |  Branch (145:9): [True: 868, False: 5]
  ------------------
  146|    873|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (146:12): [True: 0, False: 5]
  ------------------
  147|    868|        return NULL;
  148|       |
  149|      5|    if (store == NULL
  ------------------
  |  Branch (149:9): [True: 5, False: 0]
  ------------------
  150|      5|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (150:12): [True: 0, False: 5]
  ------------------
  151|      0|        return NULL;
  152|       |
  153|      5|    if (!ossl_method_store_fetch(store, meth_id, methdata->propquery, prov,
  ------------------
  |  Branch (153:9): [True: 0, False: 5]
  ------------------
  154|      5|                                 &method))
  155|      0|        return NULL;
  156|      5|    return method;
  157|      5|}
evp_fetch.c:put_evp_method_in_store:
  163|    180|{
  164|    180|    struct evp_method_data_st *methdata = data;
  165|    180|    OSSL_NAMEMAP *namemap;
  166|    180|    int name_id;
  167|    180|    uint32_t meth_id;
  168|    180|    size_t l = 0;
  169|       |
  170|       |    /*
  171|       |     * put_evp_method_in_store() is only called with an EVP method that was
  172|       |     * successfully created by construct_method() below, which means that
  173|       |     * all the names should already be stored in the namemap with the same
  174|       |     * numeric identity, so just use the first to get that identity.
  175|       |     */
  176|    180|    if (names != NULL) {
  ------------------
  |  Branch (176:9): [True: 180, False: 0]
  ------------------
  177|    180|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|    180|#define NAME_SEPARATOR ':'
  ------------------
  178|       |
  179|    180|        l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (179:14): [True: 67, False: 113]
  ------------------
  180|    180|    }
  181|       |
  182|    180|    if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
  ------------------
  |  Branch (182:9): [True: 0, False: 180]
  ------------------
  183|    180|        || (name_id = ossl_namemap_name2num_n(namemap, names, l)) == 0
  ------------------
  |  Branch (183:12): [True: 0, False: 180]
  ------------------
  184|    180|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (184:12): [True: 0, False: 180]
  ------------------
  185|      0|        return 0;
  186|       |
  187|    180|    if (store == NULL
  ------------------
  |  Branch (187:9): [True: 180, False: 0]
  ------------------
  188|    180|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (188:12): [True: 0, False: 180]
  ------------------
  189|      0|        return 0;
  190|       |
  191|    180|    return ossl_method_store_add(store, prov, meth_id, propdef, method,
  192|    180|                                 methdata->refcnt_up_method,
  193|    180|                                 methdata->destruct_method);
  194|    180|}
evp_fetch.c:construct_evp_method:
  202|    180|{
  203|       |    /*
  204|       |     * This function is only called if get_evp_method_from_store() returned
  205|       |     * NULL, so it's safe to say that of all the spots to create a new
  206|       |     * namemap entry, this is it.  Should the name already exist there, we
  207|       |     * know that ossl_namemap_add_name() will return its corresponding
  208|       |     * number.
  209|       |     */
  210|    180|    struct evp_method_data_st *methdata = data;
  211|    180|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  212|    180|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  213|    180|    const char *names = algodef->algorithm_names;
  214|    180|    int name_id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
  ------------------
  |  |   24|    180|#define NAME_SEPARATOR ':'
  ------------------
  215|    180|    void *method;
  216|       |
  217|    180|    if (name_id == 0)
  ------------------
  |  Branch (217:9): [True: 0, False: 180]
  ------------------
  218|      0|        return NULL;
  219|       |
  220|    180|    method = methdata->method_from_algorithm(name_id, algodef, prov);
  221|       |
  222|       |    /*
  223|       |     * Flag to indicate that there was actual construction errors.  This
  224|       |     * helps inner_evp_generic_fetch() determine what error it should
  225|       |     * record on inaccessible algorithms.
  226|       |     */
  227|    180|    if (method == NULL)
  ------------------
  |  Branch (227:9): [True: 0, False: 180]
  ------------------
  228|      0|        methdata->flag_construct_error_occurred = 1;
  229|       |
  230|    180|    return method;
  231|    180|}
evp_fetch.c:destruct_evp_method:
  234|    180|{
  235|    180|    struct evp_method_data_st *methdata = data;
  236|       |
  237|    180|    methdata->destruct_method(method);
  238|    180|}
evp_fetch.c:dealloc_tmp_evp_method_store:
   57|  21.1k|{
   58|  21.1k|    if (store != NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 21.1k]
  ------------------
   59|      0|        ossl_method_store_free(store);
   60|  21.1k|}
evp_fetch.c:get_evp_method_store:
   63|  23.9k|{
   64|  23.9k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX);
  ------------------
  |  |   98|  23.9k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
   65|  23.9k|}
evp_fetch.c:filter_on_operation_id:
  578|   118k|{
  579|   118k|    struct filter_data_st *data = arg;
  580|       |
  581|   118k|    if ((id & METHOD_ID_OPERATION_MASK) == data->operation_id)
  ------------------
  |  |  106|   118k|#define METHOD_ID_OPERATION_MASK        0x000000FF
  ------------------
  |  Branch (581:9): [True: 15.6k, False: 103k]
  ------------------
  582|  15.6k|        data->user_fn(method, data->user_arg);
  583|   118k|}

EVP_CIPHER_get_type:
  277|    183|{
  278|    183|    int nid;
  279|    183|    nid = EVP_CIPHER_get_nid(cipher);
  280|       |
  281|    183|    switch (nid) {
  282|       |
  283|      3|    case NID_rc2_cbc:
  ------------------
  |  | 1276|      3|#define NID_rc2_cbc             37
  ------------------
  |  Branch (283:5): [True: 3, False: 180]
  ------------------
  284|      5|    case NID_rc2_64_cbc:
  ------------------
  |  | 1297|      5|#define NID_rc2_64_cbc          166
  ------------------
  |  Branch (284:5): [True: 2, False: 181]
  ------------------
  285|      7|    case NID_rc2_40_cbc:
  ------------------
  |  | 1293|      7|#define NID_rc2_40_cbc          98
  ------------------
  |  Branch (285:5): [True: 2, False: 181]
  ------------------
  286|       |
  287|      7|        return NID_rc2_cbc;
  ------------------
  |  | 1276|      7|#define NID_rc2_cbc             37
  ------------------
  288|       |
  289|      1|    case NID_rc4:
  ------------------
  |  | 1301|      1|#define NID_rc4         5
  ------------------
  |  Branch (289:5): [True: 1, False: 182]
  ------------------
  290|      2|    case NID_rc4_40:
  ------------------
  |  | 1306|      2|#define NID_rc4_40              97
  ------------------
  |  Branch (290:5): [True: 1, False: 182]
  ------------------
  291|       |
  292|      2|        return NID_rc4;
  ------------------
  |  | 1301|      2|#define NID_rc4         5
  ------------------
  293|       |
  294|      1|    case NID_aes_128_cfb128:
  ------------------
  |  | 3071|      1|#define NID_aes_128_cfb128              421
  ------------------
  |  Branch (294:5): [True: 1, False: 182]
  ------------------
  295|      2|    case NID_aes_128_cfb8:
  ------------------
  |  | 3192|      2|#define NID_aes_128_cfb8                653
  ------------------
  |  Branch (295:5): [True: 1, False: 182]
  ------------------
  296|      3|    case NID_aes_128_cfb1:
  ------------------
  |  | 3180|      3|#define NID_aes_128_cfb1                650
  ------------------
  |  Branch (296:5): [True: 1, False: 182]
  ------------------
  297|       |
  298|      3|        return NID_aes_128_cfb128;
  ------------------
  |  | 3071|      3|#define NID_aes_128_cfb128              421
  ------------------
  299|       |
  300|      1|    case NID_aes_192_cfb128:
  ------------------
  |  | 3109|      1|#define NID_aes_192_cfb128              425
  ------------------
  |  Branch (300:5): [True: 1, False: 182]
  ------------------
  301|      2|    case NID_aes_192_cfb8:
  ------------------
  |  | 3196|      2|#define NID_aes_192_cfb8                654
  ------------------
  |  Branch (301:5): [True: 1, False: 182]
  ------------------
  302|      3|    case NID_aes_192_cfb1:
  ------------------
  |  | 3184|      3|#define NID_aes_192_cfb1                651
  ------------------
  |  Branch (302:5): [True: 1, False: 182]
  ------------------
  303|       |
  304|      3|        return NID_aes_192_cfb128;
  ------------------
  |  | 3109|      3|#define NID_aes_192_cfb128              425
  ------------------
  305|       |
  306|      1|    case NID_aes_256_cfb128:
  ------------------
  |  | 3147|      1|#define NID_aes_256_cfb128              429
  ------------------
  |  Branch (306:5): [True: 1, False: 182]
  ------------------
  307|      2|    case NID_aes_256_cfb8:
  ------------------
  |  | 3200|      2|#define NID_aes_256_cfb8                655
  ------------------
  |  Branch (307:5): [True: 1, False: 182]
  ------------------
  308|      3|    case NID_aes_256_cfb1:
  ------------------
  |  | 3188|      3|#define NID_aes_256_cfb1                652
  ------------------
  |  Branch (308:5): [True: 1, False: 182]
  ------------------
  309|       |
  310|      3|        return NID_aes_256_cfb128;
  ------------------
  |  | 3147|      3|#define NID_aes_256_cfb128              429
  ------------------
  311|       |
  312|      1|    case NID_des_cfb64:
  ------------------
  |  | 2246|      1|#define NID_des_cfb64           30
  ------------------
  |  Branch (312:5): [True: 1, False: 182]
  ------------------
  313|      2|    case NID_des_cfb8:
  ------------------
  |  | 3232|      2|#define NID_des_cfb8            657
  ------------------
  |  Branch (313:5): [True: 1, False: 182]
  ------------------
  314|      3|    case NID_des_cfb1:
  ------------------
  |  | 3228|      3|#define NID_des_cfb1            656
  ------------------
  |  Branch (314:5): [True: 1, False: 182]
  ------------------
  315|       |
  316|      3|        return NID_des_cfb64;
  ------------------
  |  | 2246|      3|#define NID_des_cfb64           30
  ------------------
  317|       |
  318|      1|    case NID_des_ede3_cfb64:
  ------------------
  |  | 2287|      1|#define NID_des_ede3_cfb64              61
  ------------------
  |  Branch (318:5): [True: 1, False: 182]
  ------------------
  319|      2|    case NID_des_ede3_cfb8:
  ------------------
  |  | 3240|      2|#define NID_des_ede3_cfb8               659
  ------------------
  |  Branch (319:5): [True: 1, False: 182]
  ------------------
  320|      3|    case NID_des_ede3_cfb1:
  ------------------
  |  | 3236|      3|#define NID_des_ede3_cfb1               658
  ------------------
  |  Branch (320:5): [True: 1, False: 182]
  ------------------
  321|       |
  322|      3|        return NID_des_cfb64;
  ------------------
  |  | 2246|      3|#define NID_des_cfb64           30
  ------------------
  323|       |
  324|    159|    default:
  ------------------
  |  Branch (324:5): [True: 159, False: 24]
  ------------------
  325|       |#ifdef FIPS_MODULE
  326|       |        return NID_undef;
  327|       |#else
  328|    159|        {
  329|       |            /* Check it has an OID and it is valid */
  330|    159|            ASN1_OBJECT *otmp = OBJ_nid2obj(nid);
  331|       |
  332|    159|            if (OBJ_get0_data(otmp) == NULL)
  ------------------
  |  Branch (332:17): [True: 48, False: 111]
  ------------------
  333|     48|                nid = NID_undef;
  ------------------
  |  |   18|     48|#define NID_undef                       0
  ------------------
  334|    159|            ASN1_OBJECT_free(otmp);
  335|    159|            return nid;
  336|      2|        }
  337|    183|#endif
  338|    183|    }
  339|    183|}
evp_cipher_cache_constants:
  342|    130|{
  343|    130|    int ok, aead = 0, custom_iv = 0, cts = 0, multiblock = 0, randkey = 0;
  344|    130|    size_t ivlen = 0;
  345|    130|    size_t blksz = 0;
  346|    130|    size_t keylen = 0;
  347|    130|    unsigned int mode = 0;
  348|    130|    OSSL_PARAM params[10];
  349|       |
  350|    130|    params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_BLOCK_SIZE, &blksz);
  ------------------
  |  |  163|    130|# define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  351|    130|    params[1] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN, &ivlen);
  ------------------
  |  |  169|    130|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  352|    130|    params[2] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &keylen);
  ------------------
  |  |  170|    130|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  353|    130|    params[3] = OSSL_PARAM_construct_uint(OSSL_CIPHER_PARAM_MODE, &mode);
  ------------------
  |  |  171|    130|# define OSSL_CIPHER_PARAM_MODE "mode"
  ------------------
  354|    130|    params[4] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_AEAD, &aead);
  ------------------
  |  |  152|    130|# define OSSL_CIPHER_PARAM_AEAD "aead"
  ------------------
  355|    130|    params[5] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_CUSTOM_IV,
  ------------------
  |  |  166|    130|# define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv"
  ------------------
  356|    130|                                         &custom_iv);
  357|    130|    params[6] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_CTS, &cts);
  ------------------
  |  |  164|    130|# define OSSL_CIPHER_PARAM_CTS "cts"
  ------------------
  358|    130|    params[7] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK,
  ------------------
  |  |  178|    130|# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi"
  ------------------
  359|    130|                                         &multiblock);
  360|    130|    params[8] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_HAS_RAND_KEY,
  ------------------
  |  |  167|    130|# define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey"
  ------------------
  361|    130|                                         &randkey);
  362|    130|    params[9] = OSSL_PARAM_construct_end();
  363|    130|    ok = evp_do_ciph_getparams(cipher, params) > 0;
  364|    130|    if (ok) {
  ------------------
  |  Branch (364:9): [True: 130, False: 0]
  ------------------
  365|    130|        cipher->block_size = blksz;
  366|    130|        cipher->iv_len = ivlen;
  367|    130|        cipher->key_len = keylen;
  368|    130|        cipher->flags = mode;
  369|    130|        if (aead)
  ------------------
  |  Branch (369:13): [True: 28, False: 102]
  ------------------
  370|     28|            cipher->flags |= EVP_CIPH_FLAG_AEAD_CIPHER;
  ------------------
  |  |  345|     28|# define         EVP_CIPH_FLAG_AEAD_CIPHER       0x200000
  ------------------
  371|    130|        if (custom_iv)
  ------------------
  |  Branch (371:13): [True: 41, False: 89]
  ------------------
  372|     41|            cipher->flags |= EVP_CIPH_CUSTOM_IV;
  ------------------
  |  |  315|     41|# define         EVP_CIPH_CUSTOM_IV              0x10
  ------------------
  373|    130|        if (cts)
  ------------------
  |  Branch (373:13): [True: 6, False: 124]
  ------------------
  374|      6|            cipher->flags |= EVP_CIPH_FLAG_CTS;
  ------------------
  |  |  343|      6|# define         EVP_CIPH_FLAG_CTS               0x4000
  ------------------
  375|    130|        if (multiblock)
  ------------------
  |  Branch (375:13): [True: 4, False: 126]
  ------------------
  376|      4|            cipher->flags |= EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK;
  ------------------
  |  |  346|      4|# define         EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000
  ------------------
  377|    130|        if (cipher->ccipher != NULL)
  ------------------
  |  Branch (377:13): [True: 118, False: 12]
  ------------------
  378|    118|            cipher->flags |= EVP_CIPH_FLAG_CUSTOM_CIPHER;
  ------------------
  |  |  344|    118|# define         EVP_CIPH_FLAG_CUSTOM_CIPHER     0x100000
  ------------------
  379|    130|        if (randkey)
  ------------------
  |  Branch (379:13): [True: 11, False: 119]
  ------------------
  380|     11|            cipher->flags |= EVP_CIPH_RAND_KEY;
  ------------------
  |  |  325|     11|# define         EVP_CIPH_RAND_KEY               0x200
  ------------------
  381|    130|        if (OSSL_PARAM_locate_const(EVP_CIPHER_gettable_ctx_params(cipher),
  ------------------
  |  Branch (381:13): [True: 0, False: 130]
  ------------------
  382|    130|                                    OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS))
  ------------------
  |  |  162|    130|# define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS "alg_id_param"
  ------------------
  383|      0|            cipher->flags |= EVP_CIPH_FLAG_CUSTOM_ASN1;
  ------------------
  |  |  350|      0|# define         EVP_CIPH_FLAG_CUSTOM_ASN1       0x1000000
  ------------------
  384|    130|    }
  385|    130|    return ok;
  386|    130|}
EVP_CIPHER_get_iv_length:
  501|      2|{
  502|      2|    return cipher->iv_len;
  503|      2|}
EVP_CIPHER_CTX_get_iv_length:
  506|  7.62k|{
  507|  7.62k|    if (ctx->iv_len < 0) {
  ------------------
  |  Branch (507:9): [True: 2, False: 7.61k]
  ------------------
  508|      2|        int rv, len = EVP_CIPHER_get_iv_length(ctx->cipher);
  509|      2|        size_t v = len;
  510|      2|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      2|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      2|    { NULL, 0, NULL, 0, 0 }
  ------------------
  511|       |
  512|      2|        if (ctx->cipher->get_ctx_params != NULL) {
  ------------------
  |  Branch (512:13): [True: 2, False: 0]
  ------------------
  513|      2|            params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN,
  ------------------
  |  |  169|      2|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  514|      2|                                                    &v);
  515|      2|            rv = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  516|      2|            if (rv > 0) {
  ------------------
  |  Branch (516:17): [True: 2, False: 0]
  ------------------
  517|      2|                if (OSSL_PARAM_modified(params)
  ------------------
  |  Branch (517:21): [True: 2, False: 0]
  ------------------
  518|      2|                        && !OSSL_PARAM_get_int(params, &len))
  ------------------
  |  Branch (518:28): [True: 0, False: 2]
  ------------------
  519|      0|                    return -1;
  520|      2|            } else if (rv != EVP_CTRL_RET_UNSUPPORTED) {
  ------------------
  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  ------------------
  |  Branch (520:24): [True: 0, False: 0]
  ------------------
  521|      0|                return -1;
  522|      0|            }
  523|      2|        }
  524|       |        /* Code below to be removed when legacy support is dropped. */
  525|      0|        else if ((EVP_CIPHER_get_flags(ctx->cipher)
  ------------------
  |  Branch (525:18): [True: 0, False: 0]
  ------------------
  526|      0|                  & EVP_CIPH_CUSTOM_IV_LENGTH) != 0) {
  ------------------
  |  |  329|      0|# define         EVP_CIPH_CUSTOM_IV_LENGTH       0x800
  ------------------
  527|      0|            rv = EVP_CIPHER_CTX_ctrl((EVP_CIPHER_CTX *)ctx, EVP_CTRL_GET_IVLEN,
  ------------------
  |  |  429|      0|# define         EVP_CTRL_GET_IVLEN                      0x25
  ------------------
  528|      0|                                     0, &len);
  529|      0|            if (rv <= 0)
  ------------------
  |  Branch (529:17): [True: 0, False: 0]
  ------------------
  530|      0|                return -1;
  531|      0|        }
  532|       |        /*-
  533|       |         * Casting away the const is annoying but required here.  We need to
  534|       |         * cache the result for performance reasons.
  535|       |         */
  536|      2|        ((EVP_CIPHER_CTX *)ctx)->iv_len = len;
  537|      2|    }
  538|  7.62k|    return ctx->iv_len;
  539|  7.62k|}
EVP_CIPHER_get_key_length:
  649|      2|{
  650|      2|    return cipher->key_len;
  651|      2|}
EVP_CIPHER_CTX_get_key_length:
  654|  15.2k|{
  655|  15.2k|    if (ctx->key_len <= 0 && ctx->cipher->prov != NULL) {
  ------------------
  |  Branch (655:9): [True: 5, False: 15.2k]
  |  Branch (655:30): [True: 5, False: 0]
  ------------------
  656|      5|        int ok;
  657|      5|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      5|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      5|    { NULL, 0, NULL, 0, 0 }
  ------------------
  658|      5|        size_t len;
  659|       |
  660|      5|        params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &len);
  ------------------
  |  |  170|      5|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  661|      5|        ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  662|      5|        if (ok <= 0)
  ------------------
  |  Branch (662:13): [True: 0, False: 5]
  ------------------
  663|      0|            return EVP_CTRL_RET_UNSUPPORTED;
  ------------------
  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  ------------------
  664|       |
  665|       |        /*-
  666|       |         * The if branch should never be taken since EVP_MAX_KEY_LENGTH is
  667|       |         * less than INT_MAX but best to be safe.
  668|       |         *
  669|       |         * Casting away the const is annoying but required here.  We need to
  670|       |         * cache the result for performance reasons.
  671|       |         */
  672|      5|        if (!OSSL_PARAM_get_int(params, &((EVP_CIPHER_CTX *)ctx)->key_len))
  ------------------
  |  Branch (672:13): [True: 0, False: 5]
  ------------------
  673|      0|            return -1;
  674|      5|        ((EVP_CIPHER_CTX *)ctx)->key_len = (int)len;
  675|      5|    }
  676|  15.2k|    return ctx->key_len;
  677|  15.2k|}
EVP_CIPHER_get_nid:
  680|    317|{
  681|    317|    return cipher->nid;
  682|    317|}
EVP_CIPHER_get0_provider:
  736|    130|{
  737|    130|    return cipher->prov;
  738|    130|}
EVP_MD_is_a:
  746|  20.3k|{
  747|  20.3k|    if (md == NULL)
  ------------------
  |  Branch (747:9): [True: 0, False: 20.3k]
  ------------------
  748|      0|        return 0;
  749|  20.3k|    if (md->prov != NULL)
  ------------------
  |  Branch (749:9): [True: 0, False: 20.3k]
  ------------------
  750|      0|        return evp_is_a(md->prov, md->name_id, NULL, name);
  751|  20.3k|    return evp_is_a(NULL, 0, EVP_MD_get0_name(md), name);
  752|  20.3k|}
EVP_MD_get0_name:
  771|  40.6k|{
  772|  40.6k|    if (md == NULL)
  ------------------
  |  Branch (772:9): [True: 0, False: 40.6k]
  ------------------
  773|      0|        return NULL;
  774|  40.6k|    if (md->type_name != NULL)
  ------------------
  |  Branch (774:9): [True: 0, False: 40.6k]
  ------------------
  775|      0|        return md->type_name;
  776|  40.6k|#ifndef FIPS_MODULE
  777|  40.6k|    return OBJ_nid2sn(EVP_MD_nid(md));
  ------------------
  |  |  535|  40.6k|# define EVP_MD_nid EVP_MD_get_type
  ------------------
  778|       |#else
  779|       |    return NULL;
  780|       |#endif
  781|  40.6k|}
EVP_MD_get0_provider:
  794|  20.3k|{
  795|  20.3k|    return md->prov;
  796|  20.3k|}
EVP_MD_get_type:
  799|  62.6k|{
  800|  62.6k|    return md->type;
  801|  62.6k|}
EVP_MD_get_size:
  818|  20.3k|{
  819|  20.3k|    if (md == NULL) {
  ------------------
  |  Branch (819:9): [True: 0, False: 20.3k]
  ------------------
  820|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  821|      0|        return -1;
  822|      0|    }
  823|  20.3k|    return md->md_size;
  824|  20.3k|}
evp_md_free_int:
  865|     27|{
  866|     27|    OPENSSL_free(md->type_name);
  ------------------
  |  |  107|     27|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  867|     27|    ossl_provider_free(md->prov);
  868|     27|    CRYPTO_FREE_REF(&md->refcnt);
  869|     27|    OPENSSL_free(md);
  ------------------
  |  |  107|     27|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  870|     27|}
EVP_MD_CTX_set_flags:
 1085|  40.6k|{
 1086|  40.6k|    ctx->flags |= flags;
 1087|  40.6k|}
EVP_MD_CTX_clear_flags:
 1090|  20.3k|{
 1091|  20.3k|    ctx->flags &= ~flags;
 1092|  20.3k|}
EVP_MD_CTX_test_flags:
 1095|  20.3k|{
 1096|  20.3k|    return (ctx->flags & flags);
 1097|  20.3k|}
EVP_CIPHER_CTX_set_flags:
 1109|  1.99k|{
 1110|  1.99k|    int oldflags = ctx->flags;
 1111|       |
 1112|  1.99k|    ctx->flags |= flags;
 1113|  1.99k|    if (((oldflags ^ ctx->flags) & EVP_CIPH_FLAG_LENGTH_BITS) != 0)
  ------------------
  |  |  334|  1.99k|# define         EVP_CIPH_FLAG_LENGTH_BITS       0x2000
  ------------------
  |  Branch (1113:9): [True: 0, False: 1.99k]
  ------------------
 1114|      0|        evp_cipher_ctx_enable_use_bits(ctx, 1);
 1115|  1.99k|}

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

EVP_RAND_enable_locking:
   93|      1|{
   94|      1|    if (rand->meth->enable_locking != NULL)
  ------------------
  |  Branch (94:9): [True: 1, False: 0]
  ------------------
   95|      1|        return rand->meth->enable_locking(rand->algctx);
   96|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   97|      0|    return 0;
   98|      1|}
EVP_RAND_fetch:
  275|      3|{
  276|      3|    return evp_generic_fetch(libctx, OSSL_OP_RAND, algorithm, properties,
  ------------------
  |  |  258|      3|# define OSSL_OP_RAND                                5
  ------------------
  277|      3|                             evp_rand_from_algorithm, evp_rand_up_ref,
  278|      3|                             evp_rand_free);
  279|      3|}
EVP_RAND_up_ref:
  282|      3|{
  283|      3|    return evp_rand_up_ref(rand);
  284|      3|}
EVP_RAND_free:
  287|      6|{
  288|      6|    evp_rand_free(rand);
  289|      6|}
EVP_RAND_get0_provider:
  312|      2|{
  313|      2|    return rand->prov;
  314|      2|}
EVP_RAND_CTX_up_ref:
  324|      2|{
  325|      2|    int ref = 0;
  326|       |
  327|      2|    return CRYPTO_UP_REF(&ctx->refcnt, &ref);
  328|      2|}
EVP_RAND_CTX_new:
  331|      3|{
  332|      3|    EVP_RAND_CTX *ctx;
  333|      3|    void *parent_ctx = NULL;
  334|      3|    const OSSL_DISPATCH *parent_dispatch = NULL;
  335|       |
  336|      3|    if (rand == NULL) {
  ------------------
  |  Branch (336:9): [True: 0, False: 3]
  ------------------
  337|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  338|      0|        return NULL;
  339|      0|    }
  340|       |
  341|      3|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |   99|      3|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  342|      3|    if (ctx == NULL)
  ------------------
  |  Branch (342:9): [True: 0, False: 3]
  ------------------
  343|      0|        return NULL;
  344|      3|    if (!CRYPTO_NEW_REF(&ctx->refcnt, 1)) {
  ------------------
  |  Branch (344:9): [True: 0, False: 3]
  ------------------
  345|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  346|      0|        return NULL;
  347|      0|    }
  348|      3|    if (parent != NULL) {
  ------------------
  |  Branch (348:9): [True: 2, False: 1]
  ------------------
  349|      2|        if (!EVP_RAND_CTX_up_ref(parent)) {
  ------------------
  |  Branch (349:13): [True: 0, False: 2]
  ------------------
  350|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  351|      0|            CRYPTO_FREE_REF(&ctx->refcnt);
  352|      0|            OPENSSL_free(ctx);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  353|      0|            return NULL;
  354|      0|        }
  355|      2|        parent_ctx = parent->algctx;
  356|      2|        parent_dispatch = parent->meth->dispatch;
  357|      2|    }
  358|      3|    if ((ctx->algctx = rand->newctx(ossl_provider_ctx(rand->prov), parent_ctx,
  ------------------
  |  Branch (358:9): [True: 0, False: 3]
  ------------------
  359|      3|                                    parent_dispatch)) == NULL
  360|      3|            || !EVP_RAND_up_ref(rand)) {
  ------------------
  |  Branch (360:16): [True: 0, False: 3]
  ------------------
  361|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  362|      0|        rand->freectx(ctx->algctx);
  363|      0|        CRYPTO_FREE_REF(&ctx->refcnt);
  364|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  365|      0|        EVP_RAND_CTX_free(parent);
  366|      0|        return NULL;
  367|      0|    }
  368|      3|    ctx->meth = rand;
  369|      3|    ctx->parent = parent;
  370|      3|    return ctx;
  371|      3|}
EVP_RAND_CTX_free:
  374|      9|{
  375|      9|    int ref = 0;
  376|      9|    EVP_RAND_CTX *parent;
  377|       |
  378|      9|    if (ctx == NULL)
  ------------------
  |  Branch (378:9): [True: 4, False: 5]
  ------------------
  379|      4|        return;
  380|       |
  381|      5|    CRYPTO_DOWN_REF(&ctx->refcnt, &ref);
  382|      5|    if (ref > 0)
  ------------------
  |  Branch (382:9): [True: 2, False: 3]
  ------------------
  383|      2|        return;
  384|      3|    parent = ctx->parent;
  385|      3|    ctx->meth->freectx(ctx->algctx);
  386|      3|    ctx->algctx = NULL;
  387|      3|    EVP_RAND_free(ctx->meth);
  388|      3|    CRYPTO_FREE_REF(&ctx->refcnt);
  389|      3|    OPENSSL_free(ctx);
  ------------------
  |  |  107|      3|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  390|      3|    EVP_RAND_CTX_free(parent);
  391|      3|}
EVP_RAND_CTX_settable_params:
  472|      2|{
  473|      2|    void *provctx;
  474|       |
  475|      2|    if (ctx->meth->settable_ctx_params == NULL)
  ------------------
  |  Branch (475:9): [True: 0, False: 2]
  ------------------
  476|      0|        return NULL;
  477|      2|    provctx = ossl_provider_ctx(EVP_RAND_get0_provider(ctx->meth));
  478|      2|    return ctx->meth->settable_ctx_params(ctx->algctx, provctx);
  479|      2|}
EVP_RAND_instantiate:
  513|      3|{
  514|      3|    int res;
  515|       |
  516|      3|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (516:9): [True: 0, False: 3]
  ------------------
  517|      0|        return 0;
  518|      3|    res = evp_rand_instantiate_locked(ctx, strength, prediction_resistance,
  519|      3|                                      pstr, pstr_len, params);
  520|      3|    evp_rand_unlock(ctx);
  521|      3|    return res;
  522|      3|}
EVP_RAND_generate:
  575|  7.61k|{
  576|  7.61k|    int res;
  577|       |
  578|  7.61k|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (578:9): [True: 0, False: 7.61k]
  ------------------
  579|      0|        return 0;
  580|  7.61k|    res = evp_rand_generate_locked(ctx, out, outlen, strength,
  581|  7.61k|                                   prediction_resistance, addin, addin_len);
  582|  7.61k|    evp_rand_unlock(ctx);
  583|  7.61k|    return res;
  584|  7.61k|}
evp_rand.c:evp_rand_from_algorithm:
  118|      5|{
  119|      5|    const OSSL_DISPATCH *fns = algodef->implementation;
  120|      5|    EVP_RAND *rand = NULL;
  121|      5|    int fnrandcnt = 0, fnctxcnt = 0, fnlockcnt = 0, fnenablelockcnt = 0;
  122|       |#ifdef FIPS_MODULE
  123|       |    int fnzeroizecnt = 0;
  124|       |#endif
  125|       |
  126|      5|    if ((rand = evp_rand_new()) == NULL) {
  ------------------
  |  Branch (126:9): [True: 0, False: 5]
  ------------------
  127|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  128|      0|        return NULL;
  129|      0|    }
  130|      5|    rand->name_id = name_id;
  131|      5|    if ((rand->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (131:9): [True: 0, False: 5]
  ------------------
  132|      0|        evp_rand_free(rand);
  133|      0|        return NULL;
  134|      0|    }
  135|      5|    rand->description = algodef->algorithm_description;
  136|      5|    rand->dispatch = fns;
  137|     83|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (137:12): [True: 78, False: 5]
  ------------------
  138|     78|        switch (fns->function_id) {
  ------------------
  |  Branch (138:17): [True: 9, False: 69]
  ------------------
  139|      5|        case OSSL_FUNC_RAND_NEWCTX:
  ------------------
  |  |  437|      5|# define OSSL_FUNC_RAND_NEWCTX                        1
  ------------------
  |  Branch (139:9): [True: 5, False: 73]
  ------------------
  140|      5|            if (rand->newctx != NULL)
  ------------------
  |  Branch (140:17): [True: 0, False: 5]
  ------------------
  141|      0|                break;
  142|      5|            rand->newctx = OSSL_FUNC_rand_newctx(fns);
  143|      5|            fnctxcnt++;
  144|      5|            break;
  145|      5|        case OSSL_FUNC_RAND_FREECTX:
  ------------------
  |  |  438|      5|# define OSSL_FUNC_RAND_FREECTX                       2
  ------------------
  |  Branch (145:9): [True: 5, False: 73]
  ------------------
  146|      5|            if (rand->freectx != NULL)
  ------------------
  |  Branch (146:17): [True: 0, False: 5]
  ------------------
  147|      0|                break;
  148|      5|            rand->freectx = OSSL_FUNC_rand_freectx(fns);
  149|      5|            fnctxcnt++;
  150|      5|            break;
  151|      5|        case OSSL_FUNC_RAND_INSTANTIATE:
  ------------------
  |  |  439|      5|# define OSSL_FUNC_RAND_INSTANTIATE                   3
  ------------------
  |  Branch (151:9): [True: 5, False: 73]
  ------------------
  152|      5|            if (rand->instantiate != NULL)
  ------------------
  |  Branch (152:17): [True: 0, False: 5]
  ------------------
  153|      0|                break;
  154|      5|            rand->instantiate = OSSL_FUNC_rand_instantiate(fns);
  155|      5|            fnrandcnt++;
  156|      5|            break;
  157|      5|        case OSSL_FUNC_RAND_UNINSTANTIATE:
  ------------------
  |  |  440|      5|# define OSSL_FUNC_RAND_UNINSTANTIATE                 4
  ------------------
  |  Branch (157:9): [True: 5, False: 73]
  ------------------
  158|      5|             if (rand->uninstantiate != NULL)
  ------------------
  |  Branch (158:18): [True: 0, False: 5]
  ------------------
  159|      0|                break;
  160|      5|            rand->uninstantiate = OSSL_FUNC_rand_uninstantiate(fns);
  161|      5|            fnrandcnt++;
  162|      5|            break;
  163|      5|        case OSSL_FUNC_RAND_GENERATE:
  ------------------
  |  |  441|      5|# define OSSL_FUNC_RAND_GENERATE                      5
  ------------------
  |  Branch (163:9): [True: 5, False: 73]
  ------------------
  164|      5|            if (rand->generate != NULL)
  ------------------
  |  Branch (164:17): [True: 0, False: 5]
  ------------------
  165|      0|                break;
  166|      5|            rand->generate = OSSL_FUNC_rand_generate(fns);
  167|      5|            fnrandcnt++;
  168|      5|            break;
  169|      5|        case OSSL_FUNC_RAND_RESEED:
  ------------------
  |  |  442|      5|# define OSSL_FUNC_RAND_RESEED                        6
  ------------------
  |  Branch (169:9): [True: 5, False: 73]
  ------------------
  170|      5|            if (rand->reseed != NULL)
  ------------------
  |  Branch (170:17): [True: 0, False: 5]
  ------------------
  171|      0|                break;
  172|      5|            rand->reseed = OSSL_FUNC_rand_reseed(fns);
  173|      5|            break;
  174|      1|        case OSSL_FUNC_RAND_NONCE:
  ------------------
  |  |  443|      1|# define OSSL_FUNC_RAND_NONCE                         7
  ------------------
  |  Branch (174:9): [True: 1, False: 77]
  ------------------
  175|      1|            if (rand->nonce != NULL)
  ------------------
  |  Branch (175:17): [True: 0, False: 1]
  ------------------
  176|      0|                break;
  177|      1|            rand->nonce = OSSL_FUNC_rand_nonce(fns);
  178|      1|            break;
  179|      5|        case OSSL_FUNC_RAND_ENABLE_LOCKING:
  ------------------
  |  |  444|      5|# define OSSL_FUNC_RAND_ENABLE_LOCKING                8
  ------------------
  |  Branch (179:9): [True: 5, False: 73]
  ------------------
  180|      5|            if (rand->enable_locking != NULL)
  ------------------
  |  Branch (180:17): [True: 0, False: 5]
  ------------------
  181|      0|                break;
  182|      5|            rand->enable_locking = OSSL_FUNC_rand_enable_locking(fns);
  183|      5|            fnenablelockcnt++;
  184|      5|            break;
  185|      5|        case OSSL_FUNC_RAND_LOCK:
  ------------------
  |  |  445|      5|# define OSSL_FUNC_RAND_LOCK                          9
  ------------------
  |  Branch (185:9): [True: 5, False: 73]
  ------------------
  186|      5|            if (rand->lock != NULL)
  ------------------
  |  Branch (186:17): [True: 0, False: 5]
  ------------------
  187|      0|                break;
  188|      5|            rand->lock = OSSL_FUNC_rand_lock(fns);
  189|      5|            fnlockcnt++;
  190|      5|            break;
  191|      5|        case OSSL_FUNC_RAND_UNLOCK:
  ------------------
  |  |  446|      5|# define OSSL_FUNC_RAND_UNLOCK                       10
  ------------------
  |  Branch (191:9): [True: 5, False: 73]
  ------------------
  192|      5|            if (rand->unlock != NULL)
  ------------------
  |  Branch (192:17): [True: 0, False: 5]
  ------------------
  193|      0|                break;
  194|      5|            rand->unlock = OSSL_FUNC_rand_unlock(fns);
  195|      5|            fnlockcnt++;
  196|      5|            break;
  197|      0|        case OSSL_FUNC_RAND_GETTABLE_PARAMS:
  ------------------
  |  |  447|      0|# define OSSL_FUNC_RAND_GETTABLE_PARAMS              11
  ------------------
  |  Branch (197:9): [True: 0, False: 78]
  ------------------
  198|      0|            if (rand->gettable_params != NULL)
  ------------------
  |  Branch (198:17): [True: 0, False: 0]
  ------------------
  199|      0|                break;
  200|      0|            rand->gettable_params =
  201|      0|                OSSL_FUNC_rand_gettable_params(fns);
  202|      0|            break;
  203|      5|        case OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  448|      5|# define OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS          12
  ------------------
  |  Branch (203:9): [True: 5, False: 73]
  ------------------
  204|      5|            if (rand->gettable_ctx_params != NULL)
  ------------------
  |  Branch (204:17): [True: 0, False: 5]
  ------------------
  205|      0|                break;
  206|      5|            rand->gettable_ctx_params =
  207|      5|                OSSL_FUNC_rand_gettable_ctx_params(fns);
  208|      5|            break;
  209|      4|        case OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  449|      4|# define OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS          13
  ------------------
  |  Branch (209:9): [True: 4, False: 74]
  ------------------
  210|      4|            if (rand->settable_ctx_params != NULL)
  ------------------
  |  Branch (210:17): [True: 0, False: 4]
  ------------------
  211|      0|                break;
  212|      4|            rand->settable_ctx_params =
  213|      4|                OSSL_FUNC_rand_settable_ctx_params(fns);
  214|      4|            break;
  215|      0|        case OSSL_FUNC_RAND_GET_PARAMS:
  ------------------
  |  |  450|      0|# define OSSL_FUNC_RAND_GET_PARAMS                   14
  ------------------
  |  Branch (215:9): [True: 0, False: 78]
  ------------------
  216|      0|            if (rand->get_params != NULL)
  ------------------
  |  Branch (216:17): [True: 0, False: 0]
  ------------------
  217|      0|                break;
  218|      0|            rand->get_params = OSSL_FUNC_rand_get_params(fns);
  219|      0|            break;
  220|      5|        case OSSL_FUNC_RAND_GET_CTX_PARAMS:
  ------------------
  |  |  451|      5|# define OSSL_FUNC_RAND_GET_CTX_PARAMS               15
  ------------------
  |  Branch (220:9): [True: 5, False: 73]
  ------------------
  221|      5|            if (rand->get_ctx_params != NULL)
  ------------------
  |  Branch (221:17): [True: 0, False: 5]
  ------------------
  222|      0|                break;
  223|      5|            rand->get_ctx_params = OSSL_FUNC_rand_get_ctx_params(fns);
  224|      5|            fnctxcnt++;
  225|      5|            break;
  226|      4|        case OSSL_FUNC_RAND_SET_CTX_PARAMS:
  ------------------
  |  |  452|      4|# define OSSL_FUNC_RAND_SET_CTX_PARAMS               16
  ------------------
  |  Branch (226:9): [True: 4, False: 74]
  ------------------
  227|      4|            if (rand->set_ctx_params != NULL)
  ------------------
  |  Branch (227:17): [True: 0, False: 4]
  ------------------
  228|      0|                break;
  229|      4|            rand->set_ctx_params = OSSL_FUNC_rand_set_ctx_params(fns);
  230|      4|            break;
  231|      5|        case OSSL_FUNC_RAND_VERIFY_ZEROIZATION:
  ------------------
  |  |  453|      5|# define OSSL_FUNC_RAND_VERIFY_ZEROIZATION           17
  ------------------
  |  Branch (231:9): [True: 5, False: 73]
  ------------------
  232|      5|            if (rand->verify_zeroization != NULL)
  ------------------
  |  Branch (232:17): [True: 0, False: 5]
  ------------------
  233|      0|                break;
  234|      5|            rand->verify_zeroization = OSSL_FUNC_rand_verify_zeroization(fns);
  235|       |#ifdef FIPS_MODULE
  236|       |            fnzeroizecnt++;
  237|       |#endif
  238|      5|            break;
  239|     78|        }
  240|     78|    }
  241|       |    /*
  242|       |     * In order to be a consistent set of functions we must have at least
  243|       |     * a complete set of "rand" functions and a complete set of context
  244|       |     * management functions.  In FIPS mode, we also require the zeroization
  245|       |     * verification function.
  246|       |     *
  247|       |     * In addition, if locking can be enabled, we need a complete set of
  248|       |     * locking functions.
  249|       |     */
  250|      5|    if (fnrandcnt != 3
  ------------------
  |  Branch (250:9): [True: 0, False: 5]
  ------------------
  251|      5|            || fnctxcnt != 3
  ------------------
  |  Branch (251:16): [True: 0, False: 5]
  ------------------
  252|      5|            || (fnenablelockcnt != 0 && fnenablelockcnt != 1)
  ------------------
  |  Branch (252:17): [True: 5, False: 0]
  |  Branch (252:41): [True: 0, False: 5]
  ------------------
  253|      5|            || (fnlockcnt != 0 && fnlockcnt != 2)
  ------------------
  |  Branch (253:17): [True: 5, False: 0]
  |  Branch (253:35): [True: 0, False: 5]
  ------------------
  254|       |#ifdef FIPS_MODULE
  255|       |            || fnzeroizecnt != 1
  256|       |#endif
  257|      5|       ) {
  258|      0|        evp_rand_free(rand);
  259|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  260|      0|        return NULL;
  261|      0|    }
  262|       |
  263|      5|    if (prov != NULL && !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (263:9): [True: 5, False: 0]
  |  Branch (263:25): [True: 0, False: 5]
  ------------------
  264|      0|        evp_rand_free(rand);
  265|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  266|      0|        return NULL;
  267|      0|    }
  268|      5|    rand->prov = prov;
  269|       |
  270|      5|    return rand;
  271|      5|}
evp_rand.c:evp_rand_new:
   78|      5|{
   79|      5|    EVP_RAND *rand = OPENSSL_zalloc(sizeof(*rand));
  ------------------
  |  |   99|      5|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   80|       |
   81|      5|    if (rand == NULL)
  ------------------
  |  Branch (81:9): [True: 0, False: 5]
  ------------------
   82|      0|        return NULL;
   83|       |
   84|      5|    if (!CRYPTO_NEW_REF(&rand->refcnt, 1)) {
  ------------------
  |  Branch (84:9): [True: 0, False: 5]
  ------------------
   85|      0|        OPENSSL_free(rand);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   86|      0|        return NULL;
   87|      0|    }
   88|      5|    return rand;
   89|      5|}
evp_rand.c:evp_rand_up_ref:
   52|     13|{
   53|     13|    EVP_RAND *rand = (EVP_RAND *)vrand;
   54|     13|    int ref = 0;
   55|       |
   56|     13|    if (rand != NULL)
  ------------------
  |  Branch (56:9): [True: 13, False: 0]
  ------------------
   57|     13|        return CRYPTO_UP_REF(&rand->refcnt, &ref);
   58|      0|    return 1;
   59|     13|}
evp_rand.c:evp_rand_free:
   62|     18|{
   63|     18|    EVP_RAND *rand = (EVP_RAND *)vrand;
   64|     18|    int ref = 0;
   65|       |
   66|     18|    if (rand == NULL)
  ------------------
  |  Branch (66:9): [True: 0, False: 18]
  ------------------
   67|      0|        return;
   68|     18|    CRYPTO_DOWN_REF(&rand->refcnt, &ref);
   69|     18|    if (ref > 0)
  ------------------
  |  Branch (69:9): [True: 13, False: 5]
  ------------------
   70|     13|        return;
   71|      5|    OPENSSL_free(rand->type_name);
  ------------------
  |  |  107|      5|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   72|      5|    ossl_provider_free(rand->prov);
   73|      5|    CRYPTO_FREE_REF(&rand->refcnt);
   74|      5|    OPENSSL_free(rand);
  ------------------
  |  |  107|      5|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   75|      5|}
evp_rand.c:evp_rand_lock:
  102|  7.62k|{
  103|  7.62k|    if (rand->meth->lock != NULL)
  ------------------
  |  Branch (103:9): [True: 7.62k, False: 0]
  ------------------
  104|  7.62k|        return rand->meth->lock(rand->algctx);
  105|      0|    return 1;
  106|  7.62k|}
evp_rand.c:evp_rand_get_ctx_params_locked:
  400|  7.61k|{
  401|  7.61k|    return ctx->meth->get_ctx_params(ctx->algctx, params);
  402|  7.61k|}
evp_rand.c:evp_rand_unlock:
  110|  7.62k|{
  111|  7.62k|    if (rand->meth->unlock != NULL)
  ------------------
  |  Branch (111:9): [True: 7.62k, False: 0]
  ------------------
  112|  7.62k|        rand->meth->unlock(rand->algctx);
  113|  7.62k|}
evp_rand.c:evp_rand_instantiate_locked:
  504|      3|{
  505|      3|    return ctx->meth->instantiate(ctx->algctx, strength, prediction_resistance,
  506|      3|                                  pstr, pstr_len, params);
  507|      3|}
evp_rand.c:evp_rand_generate_locked:
  545|  7.61k|{
  546|  7.61k|    size_t chunk, max_request = 0;
  547|  7.61k|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  7.61k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  7.61k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  548|       |
  549|  7.61k|    params[0] = OSSL_PARAM_construct_size_t(OSSL_RAND_PARAM_MAX_REQUEST,
  ------------------
  |  |  443|  7.61k|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  550|  7.61k|                                            &max_request);
  551|  7.61k|    if (!evp_rand_get_ctx_params_locked(ctx, params)
  ------------------
  |  Branch (551:9): [True: 0, False: 7.61k]
  ------------------
  552|  7.61k|            || max_request == 0) {
  ------------------
  |  Branch (552:16): [True: 0, False: 7.61k]
  ------------------
  553|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  554|      0|        return 0;
  555|      0|    }
  556|  15.2k|    for (; outlen > 0; outlen -= chunk, out += chunk) {
  ------------------
  |  Branch (556:12): [True: 7.61k, False: 7.61k]
  ------------------
  557|  7.61k|        chunk = outlen > max_request ? max_request : outlen;
  ------------------
  |  Branch (557:17): [True: 0, False: 7.61k]
  ------------------
  558|  7.61k|        if (!ctx->meth->generate(ctx->algctx, out, chunk, strength,
  ------------------
  |  Branch (558:13): [True: 0, False: 7.61k]
  ------------------
  559|  7.61k|                                 prediction_resistance, addin, addin_len)) {
  560|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  561|      0|            return 0;
  562|      0|        }
  563|       |        /*
  564|       |         * Prediction resistance is only relevant the first time around,
  565|       |         * subsequently, the DRBG has already been properly reseeded.
  566|       |         */
  567|  7.61k|        prediction_resistance = 0;
  568|  7.61k|    }
  569|  7.61k|    return 1;
  570|  7.61k|}

evp_do_ciph_getparams:
   38|    130|int name (const type *obj, OSSL_PARAM params[])                                \
   39|    130|{                                                                              \
   40|    260|    PARAM_CHECK(obj, func, err)                                                \
  ------------------
  |  |   28|    130|    if (obj == NULL)                                                           \
  |  |  ------------------
  |  |  |  Branch (28:9): [True: 0, False: 130]
  |  |  ------------------
  |  |   29|    130|        return 0;                                                              \
  |  |   30|    130|    if (obj->prov == NULL)                                                     \
  |  |  ------------------
  |  |  |  Branch (30:9): [True: 0, False: 130]
  |  |  ------------------
  |  |   31|    130|        return EVP_CTRL_RET_UNSUPPORTED;                                       \
  |  |  ------------------
  |  |  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  |  |  ------------------
  |  |   32|    130|    if (obj->func == NULL) {                                                   \
  |  |  ------------------
  |  |  |  Branch (32:9): [True: 0, False: 130]
  |  |  ------------------
  |  |   33|      0|        errfunc();                                                             \
  |  |   34|      0|        return 0;                                                              \
  |  |   35|      0|    }
  ------------------
   41|    260|    return obj->func(params);                                                  \
   42|    260|}
evp_do_ciph_ctx_getparams:
   45|      7|int name (const type *obj, void *algctx, OSSL_PARAM params[])                  \
   46|      7|{                                                                              \
   47|     14|    PARAM_CHECK(obj, func, err)                                                \
  ------------------
  |  |   28|      7|    if (obj == NULL)                                                           \
  |  |  ------------------
  |  |  |  Branch (28:9): [True: 0, False: 7]
  |  |  ------------------
  |  |   29|      7|        return 0;                                                              \
  |  |   30|      7|    if (obj->prov == NULL)                                                     \
  |  |  ------------------
  |  |  |  Branch (30:9): [True: 0, False: 7]
  |  |  ------------------
  |  |   31|      7|        return EVP_CTRL_RET_UNSUPPORTED;                                       \
  |  |  ------------------
  |  |  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  |  |  ------------------
  |  |   32|      7|    if (obj->func == NULL) {                                                   \
  |  |  ------------------
  |  |  |  Branch (32:9): [True: 0, False: 7]
  |  |  ------------------
  |  |   33|      0|        errfunc();                                                             \
  |  |   34|      0|        return 0;                                                              \
  |  |   35|      0|    }
  ------------------
   48|     14|    return obj->func(algctx, params);                                          \
   49|     14|}
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|  29.6k|{
   63|  29.6k|    if (pkey == NULL || keymgmt == NULL || keydata == NULL
  ------------------
  |  Branch (63:9): [True: 0, False: 29.6k]
  |  Branch (63:25): [True: 0, False: 29.6k]
  |  Branch (63:44): [True: 0, False: 29.6k]
  ------------------
   64|  29.6k|        || !EVP_PKEY_set_type_by_keymgmt(pkey, keymgmt)) {
  ------------------
  |  Branch (64:12): [True: 0, False: 29.6k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   66|      0|        return 0;
   67|      0|    }
   68|  29.6k|    pkey->keydata = keydata;
   69|  29.6k|    evp_keymgmt_util_cache_keyinfo(pkey);
   70|  29.6k|    return 1;
   71|  29.6k|}
evp_keymgmt_util_make_pkey:
   74|  29.6k|{
   75|  29.6k|    EVP_PKEY *pkey = NULL;
   76|       |
   77|  29.6k|    if (keymgmt == NULL
  ------------------
  |  Branch (77:9): [True: 0, False: 29.6k]
  ------------------
   78|  29.6k|        || keydata == NULL
  ------------------
  |  Branch (78:12): [True: 0, False: 29.6k]
  ------------------
   79|  29.6k|        || (pkey = EVP_PKEY_new()) == NULL
  ------------------
  |  Branch (79:12): [True: 0, False: 29.6k]
  ------------------
   80|  29.6k|        || !evp_keymgmt_util_assign_pkey(pkey, keymgmt, keydata)) {
  ------------------
  |  Branch (80:12): [True: 0, False: 29.6k]
  ------------------
   81|      0|        EVP_PKEY_free(pkey);
   82|      0|        return NULL;
   83|      0|    }
   84|  29.6k|    return pkey;
   85|  29.6k|}
evp_keymgmt_util_clear_operation_cache:
  223|  84.0k|{
  224|  84.0k|    if (pk != NULL) {
  ------------------
  |  Branch (224:9): [True: 84.0k, False: 0]
  ------------------
  225|  84.0k|        sk_OP_CACHE_ELEM_pop_free(pk->operation_cache, op_cache_free);
  226|  84.0k|        pk->operation_cache = NULL;
  227|  84.0k|    }
  228|       |
  229|  84.0k|    return 1;
  230|  84.0k|}
evp_keymgmt_util_cache_keyinfo:
  285|  29.6k|{
  286|       |    /*
  287|       |     * Cache information about the provider "origin" key.
  288|       |     *
  289|       |     * This services functions like EVP_PKEY_get_size, EVP_PKEY_get_bits, etc
  290|       |     */
  291|  29.6k|    if (pk->keydata != NULL) {
  ------------------
  |  Branch (291:9): [True: 29.6k, False: 0]
  ------------------
  292|  29.6k|        int bits = 0;
  293|  29.6k|        int security_bits = 0;
  294|  29.6k|        int size = 0;
  295|  29.6k|        OSSL_PARAM params[4];
  296|       |
  297|  29.6k|        params[0] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_BITS, &bits);
  ------------------
  |  |  316|  29.6k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  298|  29.6k|        params[1] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_BITS,
  ------------------
  |  |  427|  29.6k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  299|  29.6k|                                             &security_bits);
  300|  29.6k|        params[2] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_MAX_SIZE, &size);
  ------------------
  |  |  368|  29.6k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  301|  29.6k|        params[3] = OSSL_PARAM_construct_end();
  302|  29.6k|        if (evp_keymgmt_get_params(pk->keymgmt, pk->keydata, params)) {
  ------------------
  |  Branch (302:13): [True: 29.6k, False: 0]
  ------------------
  303|  29.6k|            pk->cache.size = size;
  304|  29.6k|            pk->cache.bits = bits;
  305|  29.6k|            pk->cache.security_bits = security_bits;
  306|  29.6k|        }
  307|  29.6k|    }
  308|  29.6k|}

EVP_KEYMGMT_up_ref:
  245|   148k|{
  246|   148k|    int ref = 0;
  247|       |
  248|   148k|    CRYPTO_UP_REF(&keymgmt->refcnt, &ref);
  249|   148k|    return 1;
  250|   148k|}
EVP_KEYMGMT_free:
  253|   148k|{
  254|   148k|    int ref = 0;
  255|       |
  256|   148k|    if (keymgmt == NULL)
  ------------------
  |  Branch (256:9): [True: 0, False: 148k]
  ------------------
  257|      0|        return;
  258|       |
  259|   148k|    CRYPTO_DOWN_REF(&keymgmt->refcnt, &ref);
  260|   148k|    if (ref > 0)
  ------------------
  |  Branch (260:9): [True: 148k, False: 18]
  ------------------
  261|   148k|        return;
  262|     18|    OPENSSL_free(keymgmt->type_name);
  ------------------
  |  |  107|     18|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  263|     18|    ossl_provider_free(keymgmt->prov);
  264|     18|    CRYPTO_FREE_REF(&keymgmt->refcnt);
  265|     18|    OPENSSL_free(keymgmt);
  ------------------
  |  |  107|     18|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  266|     18|}
EVP_KEYMGMT_get0_provider:
  269|  29.6k|{
  270|  29.6k|    return keymgmt->prov;
  271|  29.6k|}
EVP_KEYMGMT_is_a:
  289|  29.6k|{
  290|  29.6k|    return keymgmt != NULL
  ------------------
  |  Branch (290:12): [True: 29.6k, False: 0]
  ------------------
  291|  29.6k|           && evp_is_a(keymgmt->prov, keymgmt->name_id, NULL, name);
  ------------------
  |  Branch (291:15): [True: 29.6k, False: 1]
  ------------------
  292|  29.6k|}
EVP_KEYMGMT_do_all_provided:
  297|    868|{
  298|    868|    evp_generic_do_all(libctx, OSSL_OP_KEYMGMT,
  ------------------
  |  |  259|    868|# define OSSL_OP_KEYMGMT                            10
  ------------------
  299|    868|                       (void (*)(void *, void *))fn, arg,
  300|    868|                       keymgmt_from_algorithm,
  301|    868|                       (int (*)(void *))EVP_KEYMGMT_up_ref,
  302|    868|                       (void (*)(void *))EVP_KEYMGMT_free);
  303|    868|}
EVP_KEYMGMT_names_do_all:
  308|  29.6k|{
  309|  29.6k|    if (keymgmt->prov != NULL)
  ------------------
  |  Branch (309:9): [True: 29.6k, False: 0]
  ------------------
  310|  29.6k|        return evp_names_do_all(keymgmt->prov, keymgmt->name_id, fn, data);
  311|       |
  312|      0|    return 1;
  313|  29.6k|}
evp_keymgmt_freedata:
  333|  29.6k|{
  334|       |    /* This is mandatory, no need to check for its presence */
  335|  29.6k|    keymgmt->free(keydata);
  336|  29.6k|}
evp_keymgmt_has_load:
  394|  59.3k|{
  395|  59.3k|    return keymgmt != NULL && keymgmt->load != NULL;
  ------------------
  |  Branch (395:12): [True: 59.3k, False: 0]
  |  Branch (395:31): [True: 59.3k, False: 0]
  ------------------
  396|  59.3k|}
evp_keymgmt_load:
  400|  29.6k|{
  401|  29.6k|    if (evp_keymgmt_has_load(keymgmt))
  ------------------
  |  Branch (401:9): [True: 29.6k, False: 0]
  ------------------
  402|  29.6k|        return keymgmt->load(objref, objref_sz);
  403|      0|    return NULL;
  404|  29.6k|}
evp_keymgmt_get_params:
  408|  29.6k|{
  409|  29.6k|    if (keymgmt->get_params == NULL)
  ------------------
  |  Branch (409:9): [True: 0, False: 29.6k]
  ------------------
  410|      0|        return 1;
  411|  29.6k|    return keymgmt->get_params(keydata, params);
  412|  29.6k|}
keymgmt_meth.c:keymgmt_from_algorithm:
   36|     18|{
   37|     18|    const OSSL_DISPATCH *fns = algodef->implementation;
   38|     18|    EVP_KEYMGMT *keymgmt = NULL;
   39|     18|    int setparamfncnt = 0, getparamfncnt = 0;
   40|     18|    int setgenparamfncnt = 0;
   41|     18|    int importfncnt = 0, exportfncnt = 0;
   42|     18|    int importtypesfncnt = 0, exporttypesfncnt = 0;
   43|       |
   44|     18|    if ((keymgmt = keymgmt_new()) == NULL)
  ------------------
  |  Branch (44:9): [True: 0, False: 18]
  ------------------
   45|      0|        return NULL;
   46|       |
   47|     18|    keymgmt->name_id = name_id;
   48|     18|    if ((keymgmt->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (48:9): [True: 0, False: 18]
  ------------------
   49|      0|        EVP_KEYMGMT_free(keymgmt);
   50|      0|        return NULL;
   51|      0|    }
   52|     18|    keymgmt->description = algodef->algorithm_description;
   53|       |
   54|    318|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (54:12): [True: 300, False: 18]
  ------------------
   55|    300|        switch (fns->function_id) {
  ------------------
  |  Branch (55:17): [True: 0, False: 300]
  ------------------
   56|     18|        case OSSL_FUNC_KEYMGMT_NEW:
  ------------------
  |  |  560|     18|# define OSSL_FUNC_KEYMGMT_NEW                         1
  ------------------
  |  Branch (56:9): [True: 18, False: 282]
  ------------------
   57|     18|            if (keymgmt->new == NULL)
  ------------------
  |  Branch (57:17): [True: 18, False: 0]
  ------------------
   58|     18|                keymgmt->new = OSSL_FUNC_keymgmt_new(fns);
   59|     18|            break;
   60|     15|        case OSSL_FUNC_KEYMGMT_GEN_INIT:
  ------------------
  |  |  564|     15|# define OSSL_FUNC_KEYMGMT_GEN_INIT                    2
  ------------------
  |  Branch (60:9): [True: 15, False: 285]
  ------------------
   61|     15|            if (keymgmt->gen_init == NULL)
  ------------------
  |  Branch (61:17): [True: 15, False: 0]
  ------------------
   62|     15|                keymgmt->gen_init = OSSL_FUNC_keymgmt_gen_init(fns);
   63|     15|            break;
   64|      5|        case OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE:
  ------------------
  |  |  565|      5|# define OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE            3
  ------------------
  |  Branch (64:9): [True: 5, False: 295]
  ------------------
   65|      5|            if (keymgmt->gen_set_template == NULL)
  ------------------
  |  Branch (65:17): [True: 5, False: 0]
  ------------------
   66|      5|                keymgmt->gen_set_template =
   67|      5|                    OSSL_FUNC_keymgmt_gen_set_template(fns);
   68|      5|            break;
   69|     15|        case OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS:
  ------------------
  |  |  566|     15|# define OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS              4
  ------------------
  |  Branch (69:9): [True: 15, False: 285]
  ------------------
   70|     15|            if (keymgmt->gen_set_params == NULL) {
  ------------------
  |  Branch (70:17): [True: 15, False: 0]
  ------------------
   71|     15|                setgenparamfncnt++;
   72|     15|                keymgmt->gen_set_params =
   73|     15|                    OSSL_FUNC_keymgmt_gen_set_params(fns);
   74|     15|            }
   75|     15|            break;
   76|     15|        case OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS:
  ------------------
  |  |  567|     15|# define OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS         5
  ------------------
  |  Branch (76:9): [True: 15, False: 285]
  ------------------
   77|     15|            if (keymgmt->gen_settable_params == NULL) {
  ------------------
  |  Branch (77:17): [True: 15, False: 0]
  ------------------
   78|     15|                setgenparamfncnt++;
   79|     15|                keymgmt->gen_settable_params =
   80|     15|                    OSSL_FUNC_keymgmt_gen_settable_params(fns);
   81|     15|            }
   82|     15|            break;
   83|     15|        case OSSL_FUNC_KEYMGMT_GEN:
  ------------------
  |  |  568|     15|# define OSSL_FUNC_KEYMGMT_GEN                         6
  ------------------
  |  Branch (83:9): [True: 15, False: 285]
  ------------------
   84|     15|            if (keymgmt->gen == NULL)
  ------------------
  |  Branch (84:17): [True: 15, False: 0]
  ------------------
   85|     15|                keymgmt->gen = OSSL_FUNC_keymgmt_gen(fns);
   86|     15|            break;
   87|     15|        case OSSL_FUNC_KEYMGMT_GEN_CLEANUP:
  ------------------
  |  |  569|     15|# define OSSL_FUNC_KEYMGMT_GEN_CLEANUP                 7
  ------------------
  |  Branch (87:9): [True: 15, False: 285]
  ------------------
   88|     15|            if (keymgmt->gen_cleanup == NULL)
  ------------------
  |  Branch (88:17): [True: 15, False: 0]
  ------------------
   89|     15|                keymgmt->gen_cleanup = OSSL_FUNC_keymgmt_gen_cleanup(fns);
   90|     15|            break;
   91|     18|        case OSSL_FUNC_KEYMGMT_FREE:
  ------------------
  |  |  589|     18|# define OSSL_FUNC_KEYMGMT_FREE                       10
  ------------------
  |  Branch (91:9): [True: 18, False: 282]
  ------------------
   92|     18|            if (keymgmt->free == NULL)
  ------------------
  |  Branch (92:17): [True: 18, False: 0]
  ------------------
   93|     18|                keymgmt->free = OSSL_FUNC_keymgmt_free(fns);
   94|     18|            break;
   95|     11|        case OSSL_FUNC_KEYMGMT_LOAD:
  ------------------
  |  |  584|     11|# define OSSL_FUNC_KEYMGMT_LOAD                        8
  ------------------
  |  Branch (95:9): [True: 11, False: 289]
  ------------------
   96|     11|            if (keymgmt->load == NULL)
  ------------------
  |  Branch (96:17): [True: 11, False: 0]
  ------------------
   97|     11|                keymgmt->load = OSSL_FUNC_keymgmt_load(fns);
   98|     11|            break;
   99|     15|        case OSSL_FUNC_KEYMGMT_GET_PARAMS:
  ------------------
  |  |  593|     15|#define OSSL_FUNC_KEYMGMT_GET_PARAMS                  11
  ------------------
  |  Branch (99:9): [True: 15, False: 285]
  ------------------
  100|     15|            if (keymgmt->get_params == NULL) {
  ------------------
  |  Branch (100:17): [True: 15, False: 0]
  ------------------
  101|     15|                getparamfncnt++;
  102|     15|                keymgmt->get_params = OSSL_FUNC_keymgmt_get_params(fns);
  103|     15|            }
  104|     15|            break;
  105|     15|        case OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS:
  ------------------
  |  |  594|     15|#define OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS             12
  ------------------
  |  Branch (105:9): [True: 15, False: 285]
  ------------------
  106|     15|            if (keymgmt->gettable_params == NULL) {
  ------------------
  |  Branch (106:17): [True: 15, False: 0]
  ------------------
  107|     15|                getparamfncnt++;
  108|     15|                keymgmt->gettable_params =
  109|     15|                    OSSL_FUNC_keymgmt_gettable_params(fns);
  110|     15|            }
  111|     15|            break;
  112|     12|         case OSSL_FUNC_KEYMGMT_SET_PARAMS:
  ------------------
  |  |  600|     12|#define OSSL_FUNC_KEYMGMT_SET_PARAMS                  13
  ------------------
  |  Branch (112:10): [True: 12, False: 288]
  ------------------
  113|     12|            if (keymgmt->set_params == NULL) {
  ------------------
  |  Branch (113:17): [True: 12, False: 0]
  ------------------
  114|     12|                setparamfncnt++;
  115|     12|                keymgmt->set_params = OSSL_FUNC_keymgmt_set_params(fns);
  116|     12|            }
  117|     12|            break;
  118|     12|        case OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS:
  ------------------
  |  |  601|     12|#define OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS             14
  ------------------
  |  Branch (118:9): [True: 12, False: 288]
  ------------------
  119|     12|            if (keymgmt->settable_params == NULL) {
  ------------------
  |  Branch (119:17): [True: 12, False: 0]
  ------------------
  120|     12|                setparamfncnt++;
  121|     12|                keymgmt->settable_params =
  122|     12|                    OSSL_FUNC_keymgmt_settable_params(fns);
  123|     12|            }
  124|     12|            break;
  125|      4|        case OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME:
  ------------------
  |  |  608|      4|# define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME       20
  ------------------
  |  Branch (125:9): [True: 4, False: 296]
  ------------------
  126|      4|            if (keymgmt->query_operation_name == NULL)
  ------------------
  |  Branch (126:17): [True: 4, False: 0]
  ------------------
  127|      4|                keymgmt->query_operation_name =
  128|      4|                    OSSL_FUNC_keymgmt_query_operation_name(fns);
  129|      4|            break;
  130|     18|        case OSSL_FUNC_KEYMGMT_HAS:
  ------------------
  |  |  613|     18|# define OSSL_FUNC_KEYMGMT_HAS                        21
  ------------------
  |  Branch (130:9): [True: 18, False: 282]
  ------------------
  131|     18|            if (keymgmt->has == NULL)
  ------------------
  |  Branch (131:17): [True: 18, False: 0]
  ------------------
  132|     18|                keymgmt->has = OSSL_FUNC_keymgmt_has(fns);
  133|     18|            break;
  134|     11|        case OSSL_FUNC_KEYMGMT_DUP:
  ------------------
  |  |  643|     11|# define OSSL_FUNC_KEYMGMT_DUP                        44
  ------------------
  |  Branch (134:9): [True: 11, False: 289]
  ------------------
  135|     11|            if (keymgmt->dup == NULL)
  ------------------
  |  Branch (135:17): [True: 11, False: 0]
  ------------------
  136|     11|                keymgmt->dup = OSSL_FUNC_keymgmt_dup(fns);
  137|     11|            break;
  138|     11|        case OSSL_FUNC_KEYMGMT_VALIDATE:
  ------------------
  |  |  617|     11|# define OSSL_FUNC_KEYMGMT_VALIDATE                   22
  ------------------
  |  Branch (138:9): [True: 11, False: 289]
  ------------------
  139|     11|            if (keymgmt->validate == NULL)
  ------------------
  |  Branch (139:17): [True: 11, False: 0]
  ------------------
  140|     11|                keymgmt->validate = OSSL_FUNC_keymgmt_validate(fns);
  141|     11|            break;
  142|     15|        case OSSL_FUNC_KEYMGMT_MATCH:
  ------------------
  |  |  622|     15|# define OSSL_FUNC_KEYMGMT_MATCH                      23
  ------------------
  |  Branch (142:9): [True: 15, False: 285]
  ------------------
  143|     15|            if (keymgmt->match == NULL)
  ------------------
  |  Branch (143:17): [True: 15, False: 0]
  ------------------
  144|     15|                keymgmt->match = OSSL_FUNC_keymgmt_match(fns);
  145|     15|            break;
  146|     15|        case OSSL_FUNC_KEYMGMT_IMPORT:
  ------------------
  |  |  628|     15|# define OSSL_FUNC_KEYMGMT_IMPORT                     40
  ------------------
  |  Branch (146:9): [True: 15, False: 285]
  ------------------
  147|     15|            if (keymgmt->import == NULL) {
  ------------------
  |  Branch (147:17): [True: 15, False: 0]
  ------------------
  148|     15|                importfncnt++;
  149|     15|                keymgmt->import = OSSL_FUNC_keymgmt_import(fns);
  150|     15|            }
  151|     15|            break;
  152|     15|        case OSSL_FUNC_KEYMGMT_IMPORT_TYPES:
  ------------------
  |  |  629|     15|# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES               41
  ------------------
  |  Branch (152:9): [True: 15, False: 285]
  ------------------
  153|     15|            if (keymgmt->import_types == NULL) {
  ------------------
  |  Branch (153:17): [True: 15, False: 0]
  ------------------
  154|     15|                if (importtypesfncnt == 0)
  ------------------
  |  Branch (154:21): [True: 15, False: 0]
  ------------------
  155|     15|                    importfncnt++;
  156|     15|                importtypesfncnt++;
  157|     15|                keymgmt->import_types = OSSL_FUNC_keymgmt_import_types(fns);
  158|     15|            }
  159|     15|            break;
  160|      0|        case OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX:
  ------------------
  |  |  648|      0|# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX            45
  ------------------
  |  Branch (160:9): [True: 0, False: 300]
  ------------------
  161|      0|            if (keymgmt->import_types_ex == NULL) {
  ------------------
  |  Branch (161:17): [True: 0, False: 0]
  ------------------
  162|      0|                if (importtypesfncnt == 0)
  ------------------
  |  Branch (162:21): [True: 0, False: 0]
  ------------------
  163|      0|                    importfncnt++;
  164|      0|                importtypesfncnt++;
  165|      0|                keymgmt->import_types_ex = OSSL_FUNC_keymgmt_import_types_ex(fns);
  166|      0|            }
  167|      0|            break;
  168|     15|        case OSSL_FUNC_KEYMGMT_EXPORT:
  ------------------
  |  |  630|     15|# define OSSL_FUNC_KEYMGMT_EXPORT                     42
  ------------------
  |  Branch (168:9): [True: 15, False: 285]
  ------------------
  169|     15|            if (keymgmt->export == NULL) {
  ------------------
  |  Branch (169:17): [True: 15, False: 0]
  ------------------
  170|     15|                exportfncnt++;
  171|     15|                keymgmt->export = OSSL_FUNC_keymgmt_export(fns);
  172|     15|            }
  173|     15|            break;
  174|     15|        case OSSL_FUNC_KEYMGMT_EXPORT_TYPES:
  ------------------
  |  |  631|     15|# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES               43
  ------------------
  |  Branch (174:9): [True: 15, False: 285]
  ------------------
  175|     15|            if (keymgmt->export_types == NULL) {
  ------------------
  |  Branch (175:17): [True: 15, False: 0]
  ------------------
  176|     15|                if (exporttypesfncnt == 0)
  ------------------
  |  Branch (176:21): [True: 15, False: 0]
  ------------------
  177|     15|                    exportfncnt++;
  178|     15|                exporttypesfncnt++;
  179|     15|                keymgmt->export_types = OSSL_FUNC_keymgmt_export_types(fns);
  180|     15|            }
  181|     15|            break;
  182|      0|        case OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX:
  ------------------
  |  |  649|      0|# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX            46
  ------------------
  |  Branch (182:9): [True: 0, False: 300]
  ------------------
  183|      0|            if (keymgmt->export_types_ex == NULL) {
  ------------------
  |  Branch (183:17): [True: 0, False: 0]
  ------------------
  184|      0|                if (exporttypesfncnt == 0)
  ------------------
  |  Branch (184:21): [True: 0, False: 0]
  ------------------
  185|      0|                    exportfncnt++;
  186|      0|                exporttypesfncnt++;
  187|      0|                keymgmt->export_types_ex = OSSL_FUNC_keymgmt_export_types_ex(fns);
  188|      0|            }
  189|      0|            break;
  190|    300|        }
  191|    300|    }
  192|       |    /*
  193|       |     * Try to check that the method is sensible.
  194|       |     * At least one constructor and the destructor are MANDATORY
  195|       |     * The functions 'has' is MANDATORY
  196|       |     * It makes no sense being able to free stuff if you can't create it.
  197|       |     * It makes no sense providing OSSL_PARAM descriptors for import and
  198|       |     * export if you can't import or export.
  199|       |     */
  200|     18|    if (keymgmt->free == NULL
  ------------------
  |  Branch (200:9): [True: 0, False: 18]
  ------------------
  201|     18|        || (keymgmt->new == NULL
  ------------------
  |  Branch (201:13): [True: 0, False: 18]
  ------------------
  202|     18|            && keymgmt->gen == NULL
  ------------------
  |  Branch (202:16): [True: 0, False: 0]
  ------------------
  203|     18|            && keymgmt->load == NULL)
  ------------------
  |  Branch (203:16): [True: 0, False: 0]
  ------------------
  204|     18|        || keymgmt->has == NULL
  ------------------
  |  Branch (204:12): [True: 0, False: 18]
  ------------------
  205|     18|        || (getparamfncnt != 0 && getparamfncnt != 2)
  ------------------
  |  Branch (205:13): [True: 15, False: 3]
  |  Branch (205:35): [True: 0, False: 15]
  ------------------
  206|     18|        || (setparamfncnt != 0 && setparamfncnt != 2)
  ------------------
  |  Branch (206:13): [True: 12, False: 6]
  |  Branch (206:35): [True: 0, False: 12]
  ------------------
  207|     18|        || (setgenparamfncnt != 0 && setgenparamfncnt != 2)
  ------------------
  |  Branch (207:13): [True: 15, False: 3]
  |  Branch (207:38): [True: 0, False: 15]
  ------------------
  208|     18|        || (importfncnt != 0 && importfncnt != 2)
  ------------------
  |  Branch (208:13): [True: 15, False: 3]
  |  Branch (208:33): [True: 0, False: 15]
  ------------------
  209|     18|        || (exportfncnt != 0 && exportfncnt != 2)
  ------------------
  |  Branch (209:13): [True: 15, False: 3]
  |  Branch (209:33): [True: 0, False: 15]
  ------------------
  210|     18|        || (keymgmt->gen != NULL
  ------------------
  |  Branch (210:13): [True: 15, False: 3]
  ------------------
  211|     18|            && (keymgmt->gen_init == NULL
  ------------------
  |  Branch (211:17): [True: 0, False: 15]
  ------------------
  212|     15|                || keymgmt->gen_cleanup == NULL))) {
  ------------------
  |  Branch (212:20): [True: 0, False: 15]
  ------------------
  213|      0|        EVP_KEYMGMT_free(keymgmt);
  214|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  215|      0|        return NULL;
  216|      0|    }
  217|     18|    keymgmt->prov = prov;
  218|     18|    if (prov != NULL)
  ------------------
  |  Branch (218:9): [True: 18, False: 0]
  ------------------
  219|     18|        ossl_provider_up_ref(prov);
  220|       |
  221|     18|    return keymgmt;
  222|     18|}
keymgmt_meth.c:keymgmt_new:
   21|     18|{
   22|     18|    EVP_KEYMGMT *keymgmt = NULL;
   23|       |
   24|     18|    if ((keymgmt = OPENSSL_zalloc(sizeof(*keymgmt))) == NULL)
  ------------------
  |  |   99|     18|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (24:9): [True: 0, False: 18]
  ------------------
   25|      0|        return NULL;
   26|     18|    if (!CRYPTO_NEW_REF(&keymgmt->refcnt, 1)) {
  ------------------
  |  Branch (26:9): [True: 0, False: 18]
  ------------------
   27|      0|        EVP_KEYMGMT_free(keymgmt);
   28|      0|        return NULL;
   29|      0|    }
   30|     18|    return keymgmt;
   31|     18|}

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

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

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

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

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

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

EVP_sha1:
   98|  21.9k|{
   99|  21.9k|    return &sha1_md;
  100|  21.9k|}
EVP_sha224:
  113|      1|{
  114|      1|    return &sha224_md;
  115|      1|}
EVP_sha256:
  128|      1|{
  129|      1|    return &sha256_md;
  130|      1|}
EVP_sha512_224:
  143|      1|{
  144|      1|    return &sha512_224_md;
  145|      1|}
EVP_sha512_256:
  158|      1|{
  159|      1|    return &sha512_256_md;
  160|      1|}
EVP_sha384:
  173|      1|{
  174|      1|    return &sha384_md;
  175|      1|}
EVP_sha512:
  188|      1|{
  189|      1|    return &sha512_md;
  190|      1|}
EVP_sha3_224:
  193|      1|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  194|      1|{                                                                              \
  195|      1|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  196|      1|        NID_sha3_##bitlen,                                                     \
  197|      1|        NID_RSA_SHA3_##bitlen,                                                 \
  198|      1|        bitlen / 8,                                                            \
  199|      1|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  173|      1|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  200|      1|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  252|      1|#define EVP_ORIG_GLOBAL     1
  ------------------
  201|      1|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      1|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  202|      1|                                 sha3_int_final, NULL,                         \
  203|      1|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  204|      1|    };                                                                         \
  205|      1|    return &sha3_##bitlen##_md;                                                \
  206|      1|}
EVP_sha3_256:
  193|      1|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  194|      1|{                                                                              \
  195|      1|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  196|      1|        NID_sha3_##bitlen,                                                     \
  197|      1|        NID_RSA_SHA3_##bitlen,                                                 \
  198|      1|        bitlen / 8,                                                            \
  199|      1|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  173|      1|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  200|      1|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  252|      1|#define EVP_ORIG_GLOBAL     1
  ------------------
  201|      1|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      1|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  202|      1|                                 sha3_int_final, NULL,                         \
  203|      1|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  204|      1|    };                                                                         \
  205|      1|    return &sha3_##bitlen##_md;                                                \
  206|      1|}
EVP_sha3_384:
  193|      1|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  194|      1|{                                                                              \
  195|      1|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  196|      1|        NID_sha3_##bitlen,                                                     \
  197|      1|        NID_RSA_SHA3_##bitlen,                                                 \
  198|      1|        bitlen / 8,                                                            \
  199|      1|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  173|      1|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  200|      1|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  252|      1|#define EVP_ORIG_GLOBAL     1
  ------------------
  201|      1|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      1|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  202|      1|                                 sha3_int_final, NULL,                         \
  203|      1|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  204|      1|    };                                                                         \
  205|      1|    return &sha3_##bitlen##_md;                                                \
  206|      1|}
EVP_sha3_512:
  193|      1|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  194|      1|{                                                                              \
  195|      1|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  196|      1|        NID_sha3_##bitlen,                                                     \
  197|      1|        NID_RSA_SHA3_##bitlen,                                                 \
  198|      1|        bitlen / 8,                                                            \
  199|      1|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  173|      1|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  200|      1|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  252|      1|#define EVP_ORIG_GLOBAL     1
  ------------------
  201|      1|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      1|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  202|      1|                                 sha3_int_final, NULL,                         \
  203|      1|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  204|      1|    };                                                                         \
  205|      1|    return &sha3_##bitlen##_md;                                                \
  206|      1|}
EVP_shake128:
  208|      1|const EVP_MD *EVP_shake##bitlen(void)                                          \
  209|      1|{                                                                              \
  210|      1|    static const EVP_MD shake##bitlen##_md = {                                 \
  211|      1|        NID_shake##bitlen,                                                     \
  212|      1|        0,                                                                     \
  213|      1|        bitlen / 8,                                                            \
  214|      1|        EVP_MD_FLAG_XOF,                                                       \
  ------------------
  |  |  161|      1|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
  215|      1|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  252|      1|#define EVP_ORIG_GLOBAL     1
  ------------------
  216|      1|        LEGACY_EVP_MD_METH_TABLE(shake_init, sha3_int_update, sha3_int_final,  \
  ------------------
  |  |   40|      1|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  217|      1|                        shake_ctrl, (KECCAK1600_WIDTH - bitlen * 2) / 8),      \
  218|      1|    };                                                                         \
  219|      1|    return &shake##bitlen##_md;                                                \
  220|      1|}
EVP_shake256:
  208|      1|const EVP_MD *EVP_shake##bitlen(void)                                          \
  209|      1|{                                                                              \
  210|      1|    static const EVP_MD shake##bitlen##_md = {                                 \
  211|      1|        NID_shake##bitlen,                                                     \
  212|      1|        0,                                                                     \
  213|      1|        bitlen / 8,                                                            \
  214|      1|        EVP_MD_FLAG_XOF,                                                       \
  ------------------
  |  |  161|      1|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
  215|      1|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  252|      1|#define EVP_ORIG_GLOBAL     1
  ------------------
  216|      1|        LEGACY_EVP_MD_METH_TABLE(shake_init, sha3_int_update, sha3_int_final,  \
  ------------------
  |  |   40|      1|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  217|      1|                        shake_ctrl, (KECCAK1600_WIDTH - bitlen * 2) / 8),      \
  218|      1|    };                                                                         \
  219|      1|    return &shake##bitlen##_md;                                                \
  220|      1|}

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

EVP_add_cipher:
   20|    144|{
   21|    144|    int r;
   22|       |
   23|    144|    if (c == NULL)
  ------------------
  |  Branch (23:9): [True: 0, False: 144]
  ------------------
   24|      0|        return 0;
   25|       |
   26|    144|    r = OBJ_NAME_add(OBJ_nid2sn(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    144|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   27|    144|                     (const char *)c);
   28|    144|    if (r == 0)
  ------------------
  |  Branch (28:9): [True: 0, False: 144]
  ------------------
   29|      0|        return 0;
   30|    144|    r = OBJ_NAME_add(OBJ_nid2ln(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    144|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   31|    144|                     (const char *)c);
   32|    144|    return r;
   33|    144|}
EVP_add_digest:
   36|     22|{
   37|     22|    int r;
   38|     22|    const char *name;
   39|       |
   40|     22|    name = OBJ_nid2sn(md->type);
   41|     22|    r = OBJ_NAME_add(name, OBJ_NAME_TYPE_MD_METH, (const char *)md);
  ------------------
  |  |   25|     22|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   42|     22|    if (r == 0)
  ------------------
  |  Branch (42:9): [True: 0, False: 22]
  ------------------
   43|      0|        return 0;
   44|     22|    r = OBJ_NAME_add(OBJ_nid2ln(md->type), OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|     22|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   45|     22|                     (const char *)md);
   46|     22|    if (r == 0)
  ------------------
  |  Branch (46:9): [True: 0, False: 22]
  ------------------
   47|      0|        return 0;
   48|       |
   49|     22|    if (md->pkey_type && md->type != md->pkey_type) {
  ------------------
  |  Branch (49:9): [True: 17, False: 5]
  |  Branch (49:26): [True: 16, False: 1]
  ------------------
   50|     16|        r = OBJ_NAME_add(OBJ_nid2sn(md->pkey_type),
   51|     16|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     16|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     16|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   52|     16|        if (r == 0)
  ------------------
  |  Branch (52:13): [True: 0, False: 16]
  ------------------
   53|      0|            return 0;
   54|     16|        r = OBJ_NAME_add(OBJ_nid2ln(md->pkey_type),
   55|     16|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     16|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     16|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   56|     16|    }
   57|     22|    return r;
   58|     22|}
evp_cleanup_int:
  154|      2|{
  155|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_KDF_METH);
  ------------------
  |  |   30|      2|# define OBJ_NAME_TYPE_KDF_METH          0x06
  ------------------
  156|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
  157|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  158|       |    /*
  159|       |     * The above calls will only clean out the contents of the name hash
  160|       |     * table, but not the hash table itself.  The following line does that
  161|       |     * part.  -- Richard Levitte
  162|       |     */
  163|      2|    OBJ_NAME_cleanup(-1);
  164|       |
  165|      2|    EVP_PBE_cleanup();
  166|      2|    OBJ_sigid_free();
  167|       |
  168|      2|    evp_app_cleanup_int();
  169|      2|}

evp_pkey_get0_RSA_int:
   35|  3.99k|{
   36|  3.99k|    if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA_PSS) {
  ------------------
  |  |   59|  3.99k|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|  7.99k|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
                  if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA_PSS) {
  ------------------
  |  |   61|  3.38k|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|  3.38k|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (36:9): [True: 3.38k, False: 609]
  |  Branch (36:39): [True: 0, False: 3.38k]
  ------------------
   37|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   38|      0|        return NULL;
   39|      0|    }
   40|  3.99k|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
   41|  3.99k|}
EVP_PKEY_get1_RSA:
   49|  3.99k|{
   50|  3.99k|    RSA *ret = evp_pkey_get0_RSA_int(pkey);
   51|       |
   52|  3.99k|    if (ret != NULL)
  ------------------
  |  Branch (52:9): [True: 3.99k, False: 0]
  ------------------
   53|  3.99k|        RSA_up_ref(ret);
   54|  3.99k|    return ret;
   55|  3.99k|}
evp_pkey_get0_EC_KEY_int:
   70|  18.4k|{
   71|  18.4k|    if (EVP_PKEY_get_base_id(pkey) != EVP_PKEY_EC) {
  ------------------
  |  |   69|  18.4k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  18.4k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (71:9): [True: 0, False: 18.4k]
  ------------------
   72|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   73|      0|        return NULL;
   74|      0|    }
   75|  18.4k|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
   76|  18.4k|}
EVP_PKEY_get1_EC_KEY:
   84|  18.4k|{
   85|  18.4k|    EC_KEY *ret = evp_pkey_get0_EC_KEY_int(pkey);
   86|       |
   87|  18.4k|    if (ret != NULL && !EC_KEY_up_ref(ret))
  ------------------
  |  Branch (87:9): [True: 18.4k, False: 0]
  |  Branch (87:24): [True: 0, False: 18.4k]
  ------------------
   88|      0|        ret = NULL;
   89|  18.4k|    return ret;
   90|  18.4k|}

EVP_PKEY_set_type:
  681|  84.4k|{
  682|  84.4k|    return pkey_set_type(pkey, NULL, type, NULL, -1, NULL);
  683|  84.4k|}
EVP_PKEY_assign:
  751|  30.0k|{
  752|  30.0k|#  ifndef OPENSSL_NO_EC
  753|  30.0k|    int pktype;
  754|       |
  755|  30.0k|    pktype = EVP_PKEY_type(type);
  756|  30.0k|    if ((key != NULL) && (pktype == EVP_PKEY_EC || pktype == EVP_PKEY_SM2)) {
  ------------------
  |  |   69|  30.0k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  60.1k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
                  if ((key != NULL) && (pktype == EVP_PKEY_EC || pktype == EVP_PKEY_SM2)) {
  ------------------
  |  |   70|  11.5k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1228|  11.5k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (756:9): [True: 30.0k, False: 0]
  |  Branch (756:27): [True: 18.4k, False: 11.5k]
  |  Branch (756:52): [True: 0, False: 11.5k]
  ------------------
  757|  18.4k|        const EC_GROUP *group = EC_KEY_get0_group(key);
  758|       |
  759|  18.4k|        if (group != NULL) {
  ------------------
  |  Branch (759:13): [True: 18.4k, False: 0]
  ------------------
  760|  18.4k|            int curve = EC_GROUP_get_curve_name(group);
  761|       |
  762|       |            /*
  763|       |             * Regardless of what is requested the SM2 curve must be SM2 type,
  764|       |             * and non SM2 curves are EC type.
  765|       |             */
  766|  18.4k|            if (curve == NID_sm2 && pktype == EVP_PKEY_EC)
  ------------------
  |  | 1228|  36.9k|#define NID_sm2         1172
  ------------------
                          if (curve == NID_sm2 && pktype == EVP_PKEY_EC)
  ------------------
  |  |   69|      1|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|      1|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (766:17): [True: 1, False: 18.4k]
  |  Branch (766:37): [True: 1, False: 0]
  ------------------
  767|      1|                type = EVP_PKEY_SM2;
  ------------------
  |  |   70|      1|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1228|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  768|  18.4k|            else if(curve != NID_sm2 && pktype == EVP_PKEY_SM2)
  ------------------
  |  | 1228|  36.9k|#define NID_sm2         1172
  ------------------
                          else if(curve != NID_sm2 && pktype == EVP_PKEY_SM2)
  ------------------
  |  |   70|  18.4k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1228|  18.4k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (768:21): [True: 18.4k, False: 0]
  |  Branch (768:41): [True: 0, False: 18.4k]
  ------------------
  769|      0|                type = EVP_PKEY_EC;
  ------------------
  |  |   69|      0|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|      0|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  770|  18.4k|        }
  771|  18.4k|    }
  772|  30.0k|#  endif
  773|       |
  774|  30.0k|    if (pkey == NULL || !EVP_PKEY_set_type(pkey, type))
  ------------------
  |  Branch (774:9): [True: 0, False: 30.0k]
  |  Branch (774:25): [True: 0, False: 30.0k]
  ------------------
  775|      0|        return 0;
  776|       |
  777|  30.0k|    pkey->pkey.ptr = key;
  778|  30.0k|    detect_foreign_key(pkey);
  779|       |
  780|  30.0k|    return (key != NULL);
  781|  30.0k|}
EVP_PKEY_get1_DSA:
  868|  2.58k|{
  869|  2.58k|    DSA *ret = evp_pkey_get0_DSA_int(pkey);
  870|       |
  871|  2.58k|    if (ret != NULL)
  ------------------
  |  Branch (871:9): [True: 2.58k, False: 0]
  ------------------
  872|  2.58k|        DSA_up_ref(ret);
  873|  2.58k|    return ret;
  874|  2.58k|}
ossl_evp_pkey_get1_X25519:
  898|      6|    {                                                                   \
  899|      6|        return evp_pkey_get1_ECX_KEY(pkey, EVP_PKEY_##NAME);            \
  900|      6|    }
ossl_evp_pkey_get1_X448:
  898|     70|    {                                                                   \
  899|     70|        return evp_pkey_get1_ECX_KEY(pkey, EVP_PKEY_##NAME);            \
  900|     70|    }
ossl_evp_pkey_get1_ED25519:
  898|      6|    {                                                                   \
  899|      6|        return evp_pkey_get1_ECX_KEY(pkey, EVP_PKEY_##NAME);            \
  900|      6|    }
ossl_evp_pkey_get1_ED448:
  898|    305|    {                                                                   \
  899|    305|        return evp_pkey_get1_ECX_KEY(pkey, EVP_PKEY_##NAME);            \
  900|    305|    }
evp_pkey_get0_DH_int:
  946|  4.62k|{
  947|  4.62k|    if (pkey->type != EVP_PKEY_DH && pkey->type != EVP_PKEY_DHX) {
  ------------------
  |  |   67|  4.62k|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|  9.25k|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
                  if (pkey->type != EVP_PKEY_DH && pkey->type != EVP_PKEY_DHX) {
  ------------------
  |  |   68|  2.53k|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5295|  2.53k|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (947:9): [True: 2.53k, False: 2.09k]
  |  Branch (947:38): [True: 0, False: 2.53k]
  ------------------
  948|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  949|      0|        return NULL;
  950|      0|    }
  951|  4.62k|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
  952|  4.62k|}
EVP_PKEY_get1_DH:
  960|  4.62k|{
  961|  4.62k|    DH *ret = evp_pkey_get0_DH_int(pkey);
  962|       |
  963|  4.62k|    if (ret != NULL)
  ------------------
  |  Branch (963:9): [True: 4.62k, False: 0]
  ------------------
  964|  4.62k|        DH_up_ref(ret);
  965|  4.62k|    return ret;
  966|  4.62k|}
EVP_PKEY_type:
  970|  48.9k|{
  971|  48.9k|    int ret;
  972|  48.9k|    const EVP_PKEY_ASN1_METHOD *ameth;
  973|  48.9k|    ENGINE *e;
  974|  48.9k|    ameth = EVP_PKEY_asn1_find(&e, type);
  975|  48.9k|    if (ameth)
  ------------------
  |  Branch (975:9): [True: 48.9k, False: 0]
  ------------------
  976|  48.9k|        ret = ameth->pkey_id;
  977|      0|    else
  978|      0|        ret = NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  979|  48.9k|# ifndef OPENSSL_NO_ENGINE
  980|  48.9k|    ENGINE_finish(e);
  981|  48.9k|# endif
  982|  48.9k|    return ret;
  983|  48.9k|}
EVP_PKEY_get_id:
  986|  23.4k|{
  987|  23.4k|    return pkey->type;
  988|  23.4k|}
EVP_PKEY_get_base_id:
  991|  18.8k|{
  992|  18.8k|    return EVP_PKEY_type(pkey->type);
  993|  18.8k|}
EVP_PKEY_new:
 1446|  84.0k|{
 1447|  84.0k|    EVP_PKEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   99|  84.0k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  84.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  84.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1448|       |
 1449|  84.0k|    if (ret == NULL)
  ------------------
  |  Branch (1449:9): [True: 0, False: 84.0k]
  ------------------
 1450|      0|        return NULL;
 1451|       |
 1452|  84.0k|    ret->type = EVP_PKEY_NONE;
  ------------------
  |  |   58|  84.0k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  84.0k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1453|  84.0k|    ret->save_type = EVP_PKEY_NONE;
  ------------------
  |  |   58|  84.0k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  84.0k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1454|       |
 1455|  84.0k|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (1455:9): [True: 0, False: 84.0k]
  ------------------
 1456|      0|        goto err;
 1457|       |
 1458|  84.0k|    ret->lock = CRYPTO_THREAD_lock_new();
 1459|  84.0k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (1459:9): [True: 0, False: 84.0k]
  ------------------
 1460|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1461|      0|        goto err;
 1462|      0|    }
 1463|       |
 1464|  84.0k|#ifndef FIPS_MODULE
 1465|  84.0k|    ret->save_parameters = 1;
 1466|  84.0k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, ret, &ret->ex_data)) {
  ------------------
  |  |  236|  84.0k|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
  |  Branch (1466:9): [True: 0, False: 84.0k]
  ------------------
 1467|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1468|      0|        goto err;
 1469|      0|    }
 1470|  84.0k|#endif
 1471|  84.0k|    return ret;
 1472|       |
 1473|      0| err:
 1474|      0|    CRYPTO_FREE_REF(&ret->references);
 1475|      0|    CRYPTO_THREAD_lock_free(ret->lock);
 1476|      0|    OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1477|      0|    return NULL;
 1478|  84.0k|}
EVP_PKEY_set_type_by_keymgmt:
 1632|  29.6k|{
 1633|  29.6k|#ifndef FIPS_MODULE
 1634|  29.6k|# define EVP_PKEY_TYPE_STR str[0]
 1635|  29.6k|# define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
 1636|       |    /*
 1637|       |     * Find at most two strings that have an associated EVP_PKEY_ASN1_METHOD
 1638|       |     * Ideally, only one should be found.  If two (or more) are found, the
 1639|       |     * match is ambiguous.  This should never happen, but...
 1640|       |     */
 1641|  29.6k|    const char *str[2] = { NULL, NULL };
 1642|       |
 1643|  29.6k|    if (!EVP_KEYMGMT_names_do_all(keymgmt, find_ameth, &str)
  ------------------
  |  Branch (1643:9): [True: 0, False: 29.6k]
  ------------------
 1644|  29.6k|            || str[1] != NULL) {
  ------------------
  |  Branch (1644:16): [True: 0, False: 29.6k]
  ------------------
 1645|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1646|      0|        return 0;
 1647|      0|    }
 1648|       |#else
 1649|       |# define EVP_PKEY_TYPE_STR NULL
 1650|       |# define EVP_PKEY_TYPE_STRLEN -1
 1651|       |#endif
 1652|  29.6k|    return pkey_set_type(pkey, NULL, EVP_PKEY_NONE,
  ------------------
  |  |   58|  29.6k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  29.6k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1653|  29.6k|                         EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1634|  29.6k|# define EVP_PKEY_TYPE_STR str[0]
  ------------------
                                       EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1635|  29.6k|# define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
  |  |  ------------------
  |  |  |  Branch (1635:32): [True: 1, False: 29.6k]
  |  |  ------------------
  ------------------
 1654|  29.6k|                         keymgmt);
 1655|       |
 1656|  29.6k|#undef EVP_PKEY_TYPE_STR
 1657|  29.6k|#undef EVP_PKEY_TYPE_STRLEN
 1658|  29.6k|}
EVP_PKEY_up_ref:
 1661|  30.0k|{
 1662|  30.0k|    int i;
 1663|       |
 1664|  30.0k|    if (CRYPTO_UP_REF(&pkey->references, &i) <= 0)
  ------------------
  |  Branch (1664:9): [True: 0, False: 30.0k]
  ------------------
 1665|      0|        return 0;
 1666|       |
 1667|  30.0k|    REF_PRINT_COUNT("EVP_PKEY", pkey);
  ------------------
  |  |  289|  30.0k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  30.0k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  30.0k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  30.0k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1668|  30.0k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|  30.0k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 30.0k]
  |  |  ------------------
  ------------------
 1669|  30.0k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (1669:13): [True: 30.0k, False: 0]
  ------------------
 1670|  30.0k|}
evp_pkey_free_legacy:
 1728|  84.0k|{
 1729|  84.0k|    const EVP_PKEY_ASN1_METHOD *ameth = x->ameth;
 1730|  84.0k|    ENGINE *tmpe = NULL;
 1731|       |
 1732|  84.0k|    if (ameth == NULL && x->legacy_cache_pkey.ptr != NULL)
  ------------------
  |  Branch (1732:9): [True: 29.6k, False: 54.4k]
  |  Branch (1732:26): [True: 0, False: 29.6k]
  ------------------
 1733|      0|        ameth = EVP_PKEY_asn1_find(&tmpe, x->type);
 1734|       |
 1735|  84.0k|    if (ameth != NULL) {
  ------------------
  |  Branch (1735:9): [True: 54.4k, False: 29.6k]
  ------------------
 1736|  54.4k|        if (x->legacy_cache_pkey.ptr != NULL) {
  ------------------
  |  Branch (1736:13): [True: 0, False: 54.4k]
  ------------------
 1737|       |            /*
 1738|       |             * We should never have both a legacy origin key, and a key in the
 1739|       |             * legacy cache.
 1740|       |             */
 1741|      0|            assert(x->pkey.ptr == NULL);
 1742|       |            /*
 1743|       |             * For the purposes of freeing we make the legacy cache look like
 1744|       |             * a legacy origin key.
 1745|       |             */
 1746|      0|            x->pkey = x->legacy_cache_pkey;
 1747|      0|            x->legacy_cache_pkey.ptr = NULL;
 1748|      0|        }
 1749|  54.4k|        if (ameth->pkey_free != NULL)
  ------------------
  |  Branch (1749:13): [True: 54.4k, False: 0]
  ------------------
 1750|  54.4k|            ameth->pkey_free(x);
 1751|  54.4k|        x->pkey.ptr = NULL;
 1752|  54.4k|    }
 1753|  84.0k|# ifndef OPENSSL_NO_ENGINE
 1754|  84.0k|    ENGINE_finish(tmpe);
 1755|  84.0k|    ENGINE_finish(x->engine);
 1756|  84.0k|    x->engine = NULL;
 1757|  84.0k|    ENGINE_finish(x->pmeth_engine);
 1758|  84.0k|    x->pmeth_engine = NULL;
 1759|  84.0k|# endif
 1760|  84.0k|}
EVP_PKEY_free:
 1781|   285k|{
 1782|   285k|    int i;
 1783|       |
 1784|   285k|    if (x == NULL)
  ------------------
  |  Branch (1784:9): [True: 171k, False: 114k]
  ------------------
 1785|   171k|        return;
 1786|       |
 1787|   114k|    CRYPTO_DOWN_REF(&x->references, &i);
 1788|   114k|    REF_PRINT_COUNT("EVP_PKEY", x);
  ------------------
  |  |  289|   114k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|   114k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|   114k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|   114k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1789|   114k|    if (i > 0)
  ------------------
  |  Branch (1789:9): [True: 30.0k, False: 84.0k]
  ------------------
 1790|  30.0k|        return;
 1791|  84.0k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|  84.0k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 84.0k]
  |  |  ------------------
  ------------------
 1792|  84.0k|    evp_pkey_free_it(x);
 1793|  84.0k|#ifndef FIPS_MODULE
 1794|  84.0k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, x, &x->ex_data);
  ------------------
  |  |  236|  84.0k|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
 1795|  84.0k|#endif
 1796|  84.0k|    CRYPTO_THREAD_lock_free(x->lock);
 1797|  84.0k|    CRYPTO_FREE_REF(&x->references);
 1798|  84.0k|#ifndef FIPS_MODULE
 1799|  84.0k|    sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
  ------------------
  |  |  270|  84.0k|#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))
  ------------------
 1800|  84.0k|#endif
 1801|  84.0k|    OPENSSL_free(x);
  ------------------
  |  |  107|  84.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  84.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  84.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1802|  84.0k|}
evp_pkey_get_legacy:
 2095|  30.0k|{
 2096|  30.0k|    EVP_PKEY *tmp_copy = NULL;
 2097|  30.0k|    void *ret = NULL;
 2098|       |
 2099|  30.0k|    if (!ossl_assert(pk != NULL))
  ------------------
  |  |   52|  30.0k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  30.0k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (2099:9): [True: 0, False: 30.0k]
  ------------------
 2100|      0|        return NULL;
 2101|       |
 2102|       |    /*
 2103|       |     * If this isn't an assigned provider side key, we just use any existing
 2104|       |     * origin legacy key.
 2105|       |     */
 2106|  30.0k|    if (!evp_pkey_is_assigned(pk))
  ------------------
  |  |  634|  30.0k|    ((pk)->pkey.ptr != NULL || (pk)->keydata != NULL)
  |  |  ------------------
  |  |  |  Branch (634:6): [True: 30.0k, False: 0]
  |  |  |  Branch (634:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2107|      0|        return NULL;
 2108|  30.0k|    if (!evp_pkey_is_provided(pk))
  ------------------
  |  |  642|  30.0k|    ((pk)->keymgmt != NULL)
  ------------------
  |  Branch (2108:9): [True: 30.0k, False: 0]
  ------------------
 2109|  30.0k|        return pk->pkey.ptr;
 2110|       |
 2111|      0|    if (!CRYPTO_THREAD_read_lock(pk->lock))
  ------------------
  |  Branch (2111:9): [True: 0, False: 0]
  ------------------
 2112|      0|        return NULL;
 2113|       |
 2114|      0|    ret = pk->legacy_cache_pkey.ptr;
 2115|       |
 2116|      0|    if (!CRYPTO_THREAD_unlock(pk->lock))
  ------------------
  |  Branch (2116:9): [True: 0, False: 0]
  ------------------
 2117|      0|        return NULL;
 2118|       |
 2119|      0|    if (ret != NULL)
  ------------------
  |  Branch (2119:9): [True: 0, False: 0]
  ------------------
 2120|      0|        return ret;
 2121|       |
 2122|      0|    if (!evp_pkey_copy_downgraded(&tmp_copy, pk))
  ------------------
  |  Branch (2122:9): [True: 0, False: 0]
  ------------------
 2123|      0|        goto err;
 2124|       |
 2125|      0|    if (!CRYPTO_THREAD_write_lock(pk->lock))
  ------------------
  |  Branch (2125:9): [True: 0, False: 0]
  ------------------
 2126|      0|        goto err;
 2127|       |
 2128|       |    /* Check again in case some other thread has updated it in the meantime */
 2129|      0|    ret = pk->legacy_cache_pkey.ptr;
 2130|      0|    if (ret == NULL) {
  ------------------
  |  Branch (2130:9): [True: 0, False: 0]
  ------------------
 2131|       |        /* Steal the legacy key reference from the temporary copy */
 2132|      0|        ret = pk->legacy_cache_pkey.ptr = tmp_copy->pkey.ptr;
 2133|      0|        tmp_copy->pkey.ptr = NULL;
 2134|      0|    }
 2135|       |
 2136|      0|    if (!CRYPTO_THREAD_unlock(pk->lock)) {
  ------------------
  |  Branch (2136:9): [True: 0, False: 0]
  ------------------
 2137|      0|        ret = NULL;
 2138|      0|        goto err;
 2139|      0|    }
 2140|       |
 2141|      0| err:
 2142|      0|    EVP_PKEY_free(tmp_copy);
 2143|       |
 2144|      0|    return ret;
 2145|      0|}
p_lib.c:detect_foreign_key:
  717|  30.0k|{
  718|  30.0k|    switch (pkey->type) {
  719|    609|    case EVP_PKEY_RSA:
  ------------------
  |  |   59|    609|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|    609|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (719:5): [True: 609, False: 29.4k]
  ------------------
  720|  3.99k|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   61|  3.99k|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|  3.99k|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (720:5): [True: 3.38k, False: 26.6k]
  ------------------
  721|  3.99k|        pkey->foreign = pkey->pkey.rsa != NULL
  ------------------
  |  Branch (721:25): [True: 3.99k, False: 0]
  ------------------
  722|  3.99k|                        && ossl_rsa_is_foreign(pkey->pkey.rsa);
  ------------------
  |  Branch (722:28): [True: 0, False: 3.99k]
  ------------------
  723|  3.99k|        break;
  724|      0|#  ifndef OPENSSL_NO_EC
  725|      1|    case EVP_PKEY_SM2:
  ------------------
  |  |   70|      1|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1228|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (725:5): [True: 1, False: 30.0k]
  ------------------
  726|      1|        break;
  727|  18.4k|    case EVP_PKEY_EC:
  ------------------
  |  |   69|  18.4k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  18.4k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (727:5): [True: 18.4k, False: 11.5k]
  ------------------
  728|  18.4k|        pkey->foreign = pkey->pkey.ec != NULL
  ------------------
  |  Branch (728:25): [True: 18.4k, False: 0]
  ------------------
  729|  18.4k|                        && ossl_ec_key_is_foreign(pkey->pkey.ec);
  ------------------
  |  Branch (729:28): [True: 0, False: 18.4k]
  ------------------
  730|  18.4k|        break;
  731|      0|#  endif
  732|      0|#  ifndef OPENSSL_NO_DSA
  733|  2.58k|    case EVP_PKEY_DSA:
  ------------------
  |  |   62|  2.58k|# define EVP_PKEY_DSA    NID_dsa
  |  |  ------------------
  |  |  |  |  136|  2.58k|#define NID_dsa         116
  |  |  ------------------
  ------------------
  |  Branch (733:5): [True: 2.58k, False: 27.4k]
  ------------------
  734|  2.58k|        pkey->foreign = pkey->pkey.dsa != NULL
  ------------------
  |  Branch (734:25): [True: 2.58k, False: 0]
  ------------------
  735|  2.58k|                        && ossl_dsa_is_foreign(pkey->pkey.dsa);
  ------------------
  |  Branch (735:28): [True: 0, False: 2.58k]
  ------------------
  736|  2.58k|        break;
  737|      0|#endif
  738|      0|#  ifndef OPENSSL_NO_DH
  739|  2.09k|    case EVP_PKEY_DH:
  ------------------
  |  |   67|  2.09k|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|  2.09k|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
  |  Branch (739:5): [True: 2.09k, False: 27.9k]
  ------------------
  740|  2.09k|        pkey->foreign = pkey->pkey.dh != NULL
  ------------------
  |  Branch (740:25): [True: 2.09k, False: 0]
  ------------------
  741|  2.09k|                        && ossl_dh_is_foreign(pkey->pkey.dh);
  ------------------
  |  Branch (741:28): [True: 0, False: 2.09k]
  ------------------
  742|  2.09k|        break;
  743|      0|#endif
  744|  2.91k|    default:
  ------------------
  |  Branch (744:5): [True: 2.91k, False: 27.1k]
  ------------------
  745|  2.91k|        pkey->foreign = 0;
  746|  2.91k|        break;
  747|  30.0k|    }
  748|  30.0k|}
p_lib.c:evp_pkey_get0_DSA_int:
  847|  2.58k|{
  848|  2.58k|    if (pkey->type != EVP_PKEY_DSA) {
  ------------------
  |  |   62|  2.58k|# define EVP_PKEY_DSA    NID_dsa
  |  |  ------------------
  |  |  |  |  136|  2.58k|#define NID_dsa         116
  |  |  ------------------
  ------------------
  |  Branch (848:9): [True: 0, False: 2.58k]
  ------------------
  849|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  850|      0|        return NULL;
  851|      0|    }
  852|  2.58k|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
  853|  2.58k|}
p_lib.c:evp_pkey_get1_ECX_KEY:
  888|    387|{
  889|    387|    ECX_KEY *ret = (ECX_KEY *)evp_pkey_get0_ECX_KEY(pkey, type);
  890|       |
  891|    387|    if (ret != NULL && !ossl_ecx_key_up_ref(ret))
  ------------------
  |  Branch (891:9): [True: 387, False: 0]
  |  Branch (891:24): [True: 0, False: 387]
  ------------------
  892|      0|        ret = NULL;
  893|    387|    return ret;
  894|    387|}
p_lib.c:evp_pkey_get0_ECX_KEY:
  879|    387|{
  880|    387|    if (EVP_PKEY_get_base_id(pkey) != type) {
  ------------------
  |  Branch (880:9): [True: 0, False: 387]
  ------------------
  881|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  882|      0|        return NULL;
  883|      0|    }
  884|    387|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
  885|    387|}
p_lib.c:pkey_set_type:
 1495|   235k|{
 1496|   235k|#ifndef FIPS_MODULE
 1497|   235k|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
 1498|   235k|    ENGINE **eptr = (e == NULL) ? &e :  NULL;
  ------------------
  |  Branch (1498:21): [True: 235k, False: 0]
  ------------------
 1499|   235k|#endif
 1500|       |
 1501|       |    /*
 1502|       |     * The setups can't set both legacy and provider side methods.
 1503|       |     * It is forbidden
 1504|       |     */
 1505|   235k|    if (!ossl_assert(type == EVP_PKEY_NONE || keymgmt == NULL)
  ------------------
  |  |   52|   470k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 150k, False: 84.4k]
  |  |  |  Branch (52:43): [True: 84.4k, False: 0]
  |  |  ------------------
  |  |   53|   470k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1505:9): [True: 0, False: 235k]
  ------------------
 1506|   235k|        || !ossl_assert(e == NULL || keymgmt == NULL)) {
  ------------------
  |  |   52|   235k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 235k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|   235k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1506:12): [True: 0, False: 235k]
  ------------------
 1507|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1508|      0|        return 0;
 1509|      0|    }
 1510|       |
 1511|   235k|    if (pkey != NULL) {
  ------------------
  |  Branch (1511:9): [True: 114k, False: 121k]
  ------------------
 1512|   114k|        int free_it = 0;
 1513|       |
 1514|   114k|#ifndef FIPS_MODULE
 1515|   114k|        free_it = free_it || pkey->pkey.ptr != NULL;
  ------------------
  |  Branch (1515:19): [True: 0, False: 114k]
  |  Branch (1515:30): [True: 0, False: 114k]
  ------------------
 1516|   114k|#endif
 1517|   114k|        free_it = free_it || pkey->keydata != NULL;
  ------------------
  |  Branch (1517:19): [True: 0, False: 114k]
  |  Branch (1517:30): [True: 0, False: 114k]
  ------------------
 1518|   114k|        if (free_it)
  ------------------
  |  Branch (1518:13): [True: 0, False: 114k]
  ------------------
 1519|      0|            evp_pkey_free_it(pkey);
 1520|   114k|#ifndef FIPS_MODULE
 1521|       |        /*
 1522|       |         * If key type matches and a method exists then this lookup has
 1523|       |         * succeeded once so just indicate success.
 1524|       |         */
 1525|   114k|        if (pkey->type != EVP_PKEY_NONE
  ------------------
  |  |   58|   114k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|   228k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1525:13): [True: 30.0k, False: 84.0k]
  ------------------
 1526|   114k|            && type == pkey->save_type
  ------------------
  |  Branch (1526:16): [True: 27.4k, False: 2.58k]
  ------------------
 1527|   114k|            && pkey->ameth != NULL)
  ------------------
  |  Branch (1527:16): [True: 27.4k, False: 0]
  ------------------
 1528|  27.4k|            return 1;
 1529|  86.6k|# ifndef OPENSSL_NO_ENGINE
 1530|       |        /* If we have ENGINEs release them */
 1531|  86.6k|        ENGINE_finish(pkey->engine);
 1532|  86.6k|        pkey->engine = NULL;
 1533|  86.6k|        ENGINE_finish(pkey->pmeth_engine);
 1534|  86.6k|        pkey->pmeth_engine = NULL;
 1535|  86.6k|# endif
 1536|  86.6k|#endif
 1537|  86.6k|    }
 1538|   207k|#ifndef FIPS_MODULE
 1539|   207k|    if (str != NULL)
  ------------------
  |  Branch (1539:9): [True: 150k, False: 57.0k]
  ------------------
 1540|   150k|        ameth = EVP_PKEY_asn1_find_str(eptr, str, len);
 1541|  57.0k|    else if (type != EVP_PKEY_NONE)
  ------------------
  |  |   58|  57.0k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  57.0k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1541:14): [True: 57.0k, False: 1]
  ------------------
 1542|  57.0k|        ameth = EVP_PKEY_asn1_find(eptr, type);
 1543|   207k|# ifndef OPENSSL_NO_ENGINE
 1544|   207k|    if (pkey == NULL && eptr != NULL)
  ------------------
  |  Branch (1544:9): [True: 121k, False: 86.6k]
  |  Branch (1544:25): [True: 121k, False: 0]
  ------------------
 1545|   121k|        ENGINE_finish(e);
 1546|   207k|# endif
 1547|   207k|#endif
 1548|       |
 1549|       |
 1550|   207k|    {
 1551|   207k|        int check = 1;
 1552|       |
 1553|   207k|#ifndef FIPS_MODULE
 1554|   207k|        check = check && ameth == NULL;
  ------------------
  |  Branch (1554:17): [True: 207k, False: 0]
  |  Branch (1554:26): [True: 91.6k, False: 116k]
  ------------------
 1555|   207k|#endif
 1556|   207k|        check = check && keymgmt == NULL;
  ------------------
  |  Branch (1556:17): [True: 91.6k, False: 116k]
  |  Branch (1556:26): [True: 91.6k, False: 1]
  ------------------
 1557|   207k|        if (check) {
  ------------------
  |  Branch (1557:13): [True: 91.6k, False: 116k]
  ------------------
 1558|  91.6k|            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|  91.6k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  91.6k|    (ERR_new(),                                                 \
  |  |  |  |  404|  91.6k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  91.6k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  91.6k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  91.6k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  91.6k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1559|  91.6k|            return 0;
 1560|  91.6k|        }
 1561|   207k|    }
 1562|   116k|    if (pkey != NULL) {
  ------------------
  |  Branch (1562:9): [True: 86.6k, False: 29.6k]
  ------------------
 1563|  86.6k|        if (keymgmt != NULL && !EVP_KEYMGMT_up_ref(keymgmt)) {
  ------------------
  |  Branch (1563:13): [True: 29.6k, False: 57.0k]
  |  Branch (1563:32): [True: 0, False: 29.6k]
  ------------------
 1564|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1565|      0|            return 0;
 1566|      0|        }
 1567|       |
 1568|  86.6k|        pkey->keymgmt = keymgmt;
 1569|       |
 1570|  86.6k|        pkey->save_type = type;
 1571|  86.6k|        pkey->type = type;
 1572|       |
 1573|  86.6k|#ifndef FIPS_MODULE
 1574|       |        /*
 1575|       |         * If the internal "origin" key is provider side, don't save |ameth|.
 1576|       |         * The main reason is that |ameth| is one factor to detect that the
 1577|       |         * internal "origin" key is a legacy one.
 1578|       |         */
 1579|  86.6k|        if (keymgmt == NULL)
  ------------------
  |  Branch (1579:13): [True: 57.0k, False: 29.6k]
  ------------------
 1580|  57.0k|            pkey->ameth = ameth;
 1581|       |
 1582|       |        /*
 1583|       |         * The EVP_PKEY_ASN1_METHOD |pkey_id| retains its legacy key purpose
 1584|       |         * for any key type that has a legacy implementation, regardless of
 1585|       |         * if the internal key is a legacy or a provider side one.  When
 1586|       |         * there is no legacy implementation for the key, the type becomes
 1587|       |         * EVP_PKEY_KEYMGMT, which indicates that one should be cautious
 1588|       |         * with functions that expect legacy internal keys.
 1589|       |         */
 1590|  86.6k|        if (ameth != NULL) {
  ------------------
  |  Branch (1590:13): [True: 86.6k, False: 1]
  ------------------
 1591|  86.6k|            if (type == EVP_PKEY_NONE)
  ------------------
  |  |   58|  86.6k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  86.6k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1591:17): [True: 29.6k, False: 57.0k]
  ------------------
 1592|  29.6k|                pkey->type = ameth->pkey_id;
 1593|  86.6k|        } else {
 1594|      1|            pkey->type = EVP_PKEY_KEYMGMT;
  ------------------
  |  |   83|      1|# define EVP_PKEY_KEYMGMT -1
  ------------------
 1595|      1|        }
 1596|  86.6k|# ifndef OPENSSL_NO_ENGINE
 1597|  86.6k|        if (eptr == NULL && e != NULL && !ENGINE_init(e)) {
  ------------------
  |  Branch (1597:13): [True: 0, False: 86.6k]
  |  Branch (1597:29): [True: 0, False: 0]
  |  Branch (1597:42): [True: 0, False: 0]
  ------------------
 1598|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1599|      0|            return 0;
 1600|      0|        }
 1601|  86.6k|# endif
 1602|  86.6k|        pkey->engine = e;
 1603|  86.6k|#endif
 1604|  86.6k|    }
 1605|   116k|    return 1;
 1606|   116k|}
p_lib.c:find_ameth:
 1610|   121k|{
 1611|   121k|    const char **str = data;
 1612|       |
 1613|       |    /*
 1614|       |     * The error messages from pkey_set_type() are uninteresting here,
 1615|       |     * and misleading.
 1616|       |     */
 1617|   121k|    ERR_set_mark();
 1618|       |
 1619|   121k|    if (pkey_set_type(NULL, NULL, EVP_PKEY_NONE, name, strlen(name),
  ------------------
  |  |   58|   121k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|   121k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1619:9): [True: 29.6k, False: 91.6k]
  ------------------
 1620|   121k|                      NULL)) {
 1621|  29.6k|        if (str[0] == NULL)
  ------------------
  |  Branch (1621:13): [True: 29.6k, False: 0]
  ------------------
 1622|  29.6k|            str[0] = name;
 1623|      0|        else if (str[1] == NULL)
  ------------------
  |  Branch (1623:18): [True: 0, False: 0]
  ------------------
 1624|      0|            str[1] = name;
 1625|  29.6k|    }
 1626|       |
 1627|   121k|    ERR_pop_to_mark();
 1628|   121k|}
p_lib.c:evp_pkey_free_it:
 1764|  84.0k|{
 1765|       |    /* internal function; x is never NULL */
 1766|  84.0k|    evp_keymgmt_util_clear_operation_cache(x);
 1767|  84.0k|#ifndef FIPS_MODULE
 1768|  84.0k|    evp_pkey_free_legacy(x);
 1769|  84.0k|#endif
 1770|       |
 1771|  84.0k|    if (x->keymgmt != NULL) {
  ------------------
  |  Branch (1771:9): [True: 29.6k, False: 54.4k]
  ------------------
 1772|  29.6k|        evp_keymgmt_freedata(x->keymgmt, x->keydata);
 1773|  29.6k|        EVP_KEYMGMT_free(x->keymgmt);
 1774|  29.6k|        x->keymgmt = NULL;
 1775|  29.6k|        x->keydata = NULL;
 1776|  29.6k|    }
 1777|  84.0k|    x->type = EVP_PKEY_NONE;
  ------------------
  |  |   58|  84.0k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  84.0k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1778|  84.0k|}

EVP_PKEY_CTX_free:
  406|  23.5k|{
  407|  23.5k|    if (ctx == NULL)
  ------------------
  |  Branch (407:9): [True: 23.5k, False: 0]
  ------------------
  408|  23.5k|        return;
  409|      0|    if (ctx->pmeth && ctx->pmeth->cleanup)
  ------------------
  |  Branch (409:9): [True: 0, False: 0]
  |  Branch (409:23): [True: 0, False: 0]
  ------------------
  410|      0|        ctx->pmeth->cleanup(ctx);
  411|       |
  412|      0|    evp_pkey_ctx_free_old_ops(ctx);
  413|      0|#ifndef FIPS_MODULE
  414|      0|    evp_pkey_ctx_free_all_cached_data(ctx);
  415|      0|#endif
  416|      0|    EVP_KEYMGMT_free(ctx->keymgmt);
  417|       |
  418|      0|    OPENSSL_free(ctx->propquery);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  419|      0|    EVP_PKEY_free(ctx->pkey);
  420|      0|    EVP_PKEY_free(ctx->peerkey);
  421|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  422|      0|    ENGINE_finish(ctx->engine);
  423|      0|#endif
  424|      0|    BN_free(ctx->rsa_pubexp);
  425|      0|    OPENSSL_free(ctx);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  426|      0|}
evp_app_cleanup_int:
  636|      2|{
  637|      2|    if (app_pkey_methods != NULL)
  ------------------
  |  Branch (637:9): [True: 0, False: 2]
  ------------------
  638|      0|        sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free);
  639|      2|}

ossl_do_ex_data_init:
   15|      2|{
   16|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   17|       |
   18|      2|    if (global == NULL)
  ------------------
  |  Branch (18:9): [True: 0, False: 2]
  ------------------
   19|      0|        return 0;
   20|       |
   21|      2|    global->ex_data_lock = CRYPTO_THREAD_lock_new();
   22|      2|    return global->ex_data_lock != NULL;
   23|      2|}
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) {
  ------------------
  |  |  237|     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|   486k|{
  222|   486k|    int mx, i;
  223|   486k|    void *ptr;
  224|   486k|    EX_CALLBACK **storage = NULL;
  225|   486k|    EX_CALLBACK *stack[10];
  226|   486k|    EX_CALLBACKS *ip;
  227|   486k|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  228|       |
  229|   486k|    if (global == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 486k]
  ------------------
  230|      0|        return 0;
  231|       |
  232|   486k|    ip = get_and_lock(global, class_index, 1);
  233|   486k|    if (ip == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 486k]
  ------------------
  234|      0|        return 0;
  235|       |
  236|   486k|    ad->ctx = ctx;
  237|   486k|    ad->sk = NULL;
  238|   486k|    mx = sk_EX_CALLBACK_num(ip->meth);
  239|   486k|    if (mx > 0) {
  ------------------
  |  Branch (239:9): [True: 0, False: 486k]
  ------------------
  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);
  ------------------
  |  |   97|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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|   486k|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  249|       |
  250|   486k|    if (mx > 0 && storage == NULL)
  ------------------
  |  Branch (250:9): [True: 0, False: 486k]
  |  Branch (250:19): [True: 0, False: 0]
  ------------------
  251|      0|        return 0;
  252|   486k|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (252:17): [True: 0, False: 486k]
  ------------------
  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|   486k|    if (storage != stack)
  ------------------
  |  Branch (259:9): [True: 486k, False: 0]
  ------------------
  260|   486k|        OPENSSL_free(storage);
  ------------------
  |  |  107|   486k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   486k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   486k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|   486k|    return 1;
  262|   486k|}
CRYPTO_new_ex_data:
  265|   480k|{
  266|   480k|    return ossl_crypto_new_ex_data_ex(NULL, class_index, obj, ad);
  267|   480k|}
CRYPTO_free_ex_data:
  368|   486k|{
  369|   486k|    int mx, i;
  370|   486k|    EX_CALLBACKS *ip;
  371|   486k|    void *ptr;
  372|   486k|    const EX_CALLBACK *f;
  373|   486k|    struct ex_callback_entry stack[10];
  374|   486k|    struct ex_callback_entry *storage = NULL;
  375|   486k|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
  376|       |
  377|   486k|    if (global == NULL)
  ------------------
  |  Branch (377:9): [True: 0, False: 486k]
  ------------------
  378|      0|        goto err;
  379|       |
  380|   486k|    ip = get_and_lock(global, class_index, 1);
  381|   486k|    if (ip == NULL)
  ------------------
  |  Branch (381:9): [True: 0, False: 486k]
  ------------------
  382|      0|        goto err;
  383|       |
  384|   486k|    mx = sk_EX_CALLBACK_num(ip->meth);
  385|   486k|    if (mx > 0) {
  ------------------
  |  Branch (385:9): [True: 0, False: 486k]
  ------------------
  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);
  ------------------
  |  |   97|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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|   486k|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  397|       |
  398|   486k|    if (storage != NULL) {
  ------------------
  |  Branch (398:9): [True: 0, False: 486k]
  ------------------
  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|   486k|    if (storage != stack)
  ------------------
  |  Branch (411:9): [True: 486k, False: 0]
  ------------------
  412|   486k|        OPENSSL_free(storage);
  ------------------
  |  |  107|   486k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   486k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   486k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  413|   486k| err:
  414|   486k|    sk_void_free(ad->sk);
  ------------------
  |  |  193|   486k|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
  415|   486k|    ad->sk = NULL;
  416|   486k|    ad->ctx = NULL;
  417|   486k|}
ex_data.c:get_and_lock:
   33|   972k|{
   34|   972k|    EX_CALLBACKS *ip;
   35|       |
   36|   972k|    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
  ------------------
  |  |  237|   972k|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (36:9): [True: 0, False: 972k]
  |  Branch (36:28): [True: 0, False: 972k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   38|      0|        return NULL;
   39|      0|    }
   40|       |
   41|   972k|    if (global->ex_data_lock == NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 972k]
  ------------------
   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|   972k|    if (read) {
  ------------------
  |  Branch (49:9): [True: 972k, False: 2]
  ------------------
   50|   972k|        if (!CRYPTO_THREAD_read_lock(global->ex_data_lock))
  ------------------
  |  Branch (50:13): [True: 0, False: 972k]
  ------------------
   51|      0|            return NULL;
   52|   972k|    } 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|   972k|    ip = &global->ex_data[class_index];
   58|   972k|    return ip;
   59|   972k|}

ossl_ffc_numbers_to_dh_named_group:
  116|  5.21k|{
  117|  5.21k|    size_t i;
  118|       |
  119|  78.1k|    for (i = 0; i < OSSL_NELEM(dh_named_groups); ++i) {
  ------------------
  |  |   14|  78.1k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (119:17): [True: 72.9k, False: 5.21k]
  ------------------
  120|       |        /* Keep searching until a matching p and g is found */
  121|  72.9k|        if (BN_cmp(p, dh_named_groups[i].p) == 0
  ------------------
  |  Branch (121:13): [True: 0, False: 72.9k]
  ------------------
  122|  72.9k|            && 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|  72.9k|            && (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|  72.9k|    }
  127|  5.21k|    return NULL;
  128|  5.21k|}

ossl_ffc_params_init:
   21|  25.0k|{
   22|  25.0k|    memset(params, 0, sizeof(*params));
   23|  25.0k|    params->pcounter = -1;
   24|  25.0k|    params->gindex = FFC_UNVERIFIABLE_GINDEX;
  ------------------
  |  |   23|  25.0k|# define FFC_UNVERIFIABLE_GINDEX -1
  ------------------
   25|  25.0k|    params->flags = FFC_PARAM_FLAG_VALIDATE_PQG;
  ------------------
  |  |   46|  25.0k|    (FFC_PARAM_FLAG_VALIDATE_PQ | FFC_PARAM_FLAG_VALIDATE_G)
  |  |  ------------------
  |  |  |  |   43|  25.0k|# define FFC_PARAM_FLAG_VALIDATE_PQ    0x01
  |  |  ------------------
  |  |                   (FFC_PARAM_FLAG_VALIDATE_PQ | FFC_PARAM_FLAG_VALIDATE_G)
  |  |  ------------------
  |  |  |  |   44|  25.0k|# define FFC_PARAM_FLAG_VALIDATE_G     0x02
  |  |  ------------------
  ------------------
   26|  25.0k|}
ossl_ffc_params_cleanup:
   29|  12.5k|{
   30|  12.5k|    BN_free(params->p);
   31|  12.5k|    BN_free(params->q);
   32|  12.5k|    BN_free(params->g);
   33|  12.5k|    BN_free(params->j);
   34|  12.5k|    OPENSSL_free(params->seed);
  ------------------
  |  |  107|  12.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  12.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  12.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   35|  12.5k|    ossl_ffc_params_init(params);
   36|  12.5k|}
ossl_ffc_params_set0_pqg:
   39|  3.06k|{
   40|  3.06k|    if (p != NULL && p != d->p) {
  ------------------
  |  Branch (40:9): [True: 3.06k, False: 0]
  |  Branch (40:22): [True: 3.06k, False: 0]
  ------------------
   41|  3.06k|        BN_free(d->p);
   42|  3.06k|        d->p = p;
   43|  3.06k|    }
   44|  3.06k|    if (q != NULL && q != d->q) {
  ------------------
  |  Branch (44:9): [True: 3.06k, False: 0]
  |  Branch (44:22): [True: 3.06k, False: 0]
  ------------------
   45|  3.06k|        BN_free(d->q);
   46|  3.06k|        d->q = q;
   47|  3.06k|    }
   48|  3.06k|    if (g != NULL && g != d->g) {
  ------------------
  |  Branch (48:9): [True: 3.06k, False: 0]
  |  Branch (48:22): [True: 3.06k, False: 0]
  ------------------
   49|  3.06k|        BN_free(d->g);
   50|  3.06k|        d->g = g;
   51|  3.06k|    }
   52|  3.06k|}
ossl_ffc_params_get0_pqg:
   56|  2.58k|{
   57|  2.58k|    if (p != NULL)
  ------------------
  |  Branch (57:9): [True: 2.58k, False: 0]
  ------------------
   58|  2.58k|        *p = d->p;
   59|  2.58k|    if (q != NULL)
  ------------------
  |  Branch (59:9): [True: 2.58k, False: 0]
  ------------------
   60|  2.58k|        *q = d->q;
   61|  2.58k|    if (g != NULL)
  ------------------
  |  Branch (61:9): [True: 2.58k, False: 0]
  ------------------
   62|  2.58k|        *g = d->g;
   63|  2.58k|}
ossl_ffc_params_set0_j:
   68|  3.06k|{
   69|  3.06k|    BN_free(d->j);
   70|  3.06k|    d->j = NULL;
   71|  3.06k|    if (j != NULL)
  ------------------
  |  Branch (71:9): [True: 1.73k, False: 1.33k]
  ------------------
   72|  1.73k|        d->j = j;
   73|  3.06k|}
ossl_ffc_params_todata:
  210|  6.80k|{
  211|  6.80k|    int test_flags;
  212|       |
  213|  6.80k|    if (ffc->p != NULL
  ------------------
  |  Branch (213:9): [True: 6.80k, False: 0]
  ------------------
  214|  6.80k|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_P, ffc->p))
  ------------------
  |  |  354|  6.80k|# define OSSL_PKEY_PARAM_FFC_P "p"
  ------------------
  |  Branch (214:12): [True: 0, False: 6.80k]
  ------------------
  215|      0|        return 0;
  216|  6.80k|    if (ffc->q != NULL
  ------------------
  |  Branch (216:9): [True: 4.70k, False: 2.09k]
  ------------------
  217|  6.80k|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_Q, ffc->q))
  ------------------
  |  |  357|  4.70k|# define OSSL_PKEY_PARAM_FFC_Q "q"
  ------------------
  |  Branch (217:12): [True: 0, False: 4.70k]
  ------------------
  218|      0|        return 0;
  219|  6.80k|    if (ffc->g != NULL
  ------------------
  |  Branch (219:9): [True: 6.80k, False: 0]
  ------------------
  220|  6.80k|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_G, ffc->g))
  ------------------
  |  |  351|  6.80k|# define OSSL_PKEY_PARAM_FFC_G "g"
  ------------------
  |  Branch (220:12): [True: 0, False: 6.80k]
  ------------------
  221|      0|        return 0;
  222|  6.80k|    if (ffc->j != NULL
  ------------------
  |  Branch (222:9): [True: 1.72k, False: 5.08k]
  ------------------
  223|  6.80k|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_COFACTOR,
  ------------------
  |  |  348|  1.72k|# define OSSL_PKEY_PARAM_FFC_COFACTOR "j"
  ------------------
  |  Branch (223:12): [True: 0, False: 1.72k]
  ------------------
  224|  1.72k|                                    ffc->j))
  225|      0|        return 0;
  226|  6.80k|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_GINDEX,
  ------------------
  |  |  352|  6.80k|# define OSSL_PKEY_PARAM_FFC_GINDEX "gindex"
  ------------------
  |  Branch (226:9): [True: 0, False: 6.80k]
  ------------------
  227|  6.80k|                                  ffc->gindex))
  228|      0|        return 0;
  229|  6.80k|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_PCOUNTER,
  ------------------
  |  |  356|  6.80k|# define OSSL_PKEY_PARAM_FFC_PCOUNTER "pcounter"
  ------------------
  |  Branch (229:9): [True: 0, False: 6.80k]
  ------------------
  230|  6.80k|                                  ffc->pcounter))
  231|      0|        return 0;
  232|  6.80k|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_H, ffc->h))
  ------------------
  |  |  353|  6.80k|# define OSSL_PKEY_PARAM_FFC_H "hindex"
  ------------------
  |  Branch (232:9): [True: 0, False: 6.80k]
  ------------------
  233|      0|        return 0;
  234|  6.80k|    if (ffc->seed != NULL
  ------------------
  |  Branch (234:9): [True: 0, False: 6.80k]
  ------------------
  235|  6.80k|        && !ossl_param_build_set_octet_string(bld, params,
  ------------------
  |  Branch (235:12): [True: 0, False: 0]
  ------------------
  236|      0|                                              OSSL_PKEY_PARAM_FFC_SEED,
  ------------------
  |  |  359|      0|# define OSSL_PKEY_PARAM_FFC_SEED "seed"
  ------------------
  237|      0|                                              ffc->seed, ffc->seedlen))
  238|      0|        return 0;
  239|  6.80k|    if (ffc->nid != NID_undef) {
  ------------------
  |  |   18|  6.80k|#define NID_undef                       0
  ------------------
  |  Branch (239:9): [True: 0, False: 6.80k]
  ------------------
  240|      0|        const DH_NAMED_GROUP *group = ossl_ffc_uid_to_dh_named_group(ffc->nid);
  241|      0|        const char *name = ossl_ffc_named_group_get_name(group);
  242|       |
  243|      0|        if (name == NULL
  ------------------
  |  Branch (243:13): [True: 0, False: 0]
  ------------------
  244|      0|            || !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (244:16): [True: 0, False: 0]
  ------------------
  245|      0|                                                 OSSL_PKEY_PARAM_GROUP_NAME,
  ------------------
  |  |  364|      0|# define OSSL_PKEY_PARAM_GROUP_NAME "group"
  ------------------
  246|      0|                                                 name))
  247|      0|            return 0;
  248|      0|    }
  249|  6.80k|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_PQ) != 0);
  ------------------
  |  |   43|  6.80k|# define FFC_PARAM_FLAG_VALIDATE_PQ    0x01
  ------------------
  250|  6.80k|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (250:9): [True: 0, False: 6.80k]
  ------------------
  251|  6.80k|                                  OSSL_PKEY_PARAM_FFC_VALIDATE_PQ, test_flags))
  ------------------
  |  |  363|  6.80k|# define OSSL_PKEY_PARAM_FFC_VALIDATE_PQ "validate-pq"
  ------------------
  252|      0|        return 0;
  253|  6.80k|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_G) != 0);
  ------------------
  |  |   44|  6.80k|# define FFC_PARAM_FLAG_VALIDATE_G     0x02
  ------------------
  254|  6.80k|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (254:9): [True: 0, False: 6.80k]
  ------------------
  255|  6.80k|                                  OSSL_PKEY_PARAM_FFC_VALIDATE_G, test_flags))
  ------------------
  |  |  361|  6.80k|# define OSSL_PKEY_PARAM_FFC_VALIDATE_G "validate-g"
  ------------------
  256|      0|        return 0;
  257|  6.80k|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_LEGACY) != 0);
  ------------------
  |  |   47|  6.80k|#define FFC_PARAM_FLAG_VALIDATE_LEGACY 0x04
  ------------------
  258|  6.80k|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (258:9): [True: 0, False: 6.80k]
  ------------------
  259|  6.80k|                                  OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY,
  ------------------
  |  |  362|  6.80k|# define OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY "validate-legacy"
  ------------------
  260|  6.80k|                                  test_flags))
  261|      0|        return 0;
  262|       |
  263|  6.80k|    if (ffc->mdname != NULL
  ------------------
  |  Branch (263:9): [True: 0, False: 6.80k]
  ------------------
  264|  6.80k|        && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (264:12): [True: 0, False: 0]
  ------------------
  265|      0|                                             OSSL_PKEY_PARAM_FFC_DIGEST,
  ------------------
  |  |  349|      0|# define OSSL_PKEY_PARAM_FFC_DIGEST OSSL_PKEY_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  322|      0|# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  266|      0|                                             ffc->mdname))
  267|      0|       return 0;
  268|  6.80k|    if (ffc->mdprops != NULL
  ------------------
  |  Branch (268:9): [True: 0, False: 6.80k]
  ------------------
  269|  6.80k|        && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (269:12): [True: 0, False: 0]
  ------------------
  270|      0|                                             OSSL_PKEY_PARAM_FFC_DIGEST_PROPS,
  ------------------
  |  |  350|      0|# define OSSL_PKEY_PARAM_FFC_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  373|      0|# define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  271|      0|                                             ffc->mdprops))
  272|      0|        return 0;
  273|  6.80k|    return 1;
  274|  6.80k|}

ossl_safe_getenv:
   19|      1|{
   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|      1|#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
   92|      1|# if __GLIBC_PREREQ(2, 17)
   93|      1|#  define SECURE_GETENV
   94|      1|    return secure_getenv(name);
   95|      1|# endif
   96|      1|#endif
   97|       |
   98|       |#ifndef SECURE_GETENV
   99|       |    if (OPENSSL_issetugid())
  100|       |        return NULL;
  101|       |    return getenv(name);
  102|       |#endif
  103|      1|}

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

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

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);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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:
  348|      3|{
  349|      3|    THREAD_EVENT_HANDLER **hands;
  350|      3|    THREAD_EVENT_HANDLER *hand;
  351|       |#ifdef FIPS_MODULE
  352|       |    OSSL_LIB_CTX *ctx = arg;
  353|       |
  354|       |    /*
  355|       |     * In FIPS mode the list of THREAD_EVENT_HANDLERs is unique per combination
  356|       |     * of OSSL_LIB_CTX and thread. This is because in FIPS mode each
  357|       |     * OSSL_LIB_CTX gets informed about thread stop events individually.
  358|       |     */
  359|       |    CRYPTO_THREAD_LOCAL *local
  360|       |        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX);
  361|       |#else
  362|       |    /*
  363|       |     * Outside of FIPS mode the list of THREAD_EVENT_HANDLERs is unique per
  364|       |     * thread, but may hold multiple OSSL_LIB_CTXs. We only get told about
  365|       |     * thread stop events globally, so we have to ensure all affected
  366|       |     * OSSL_LIB_CTXs are informed.
  367|       |     */
  368|      3|    CRYPTO_THREAD_LOCAL *local = &destructor_key.value;
  369|      3|#endif
  370|       |
  371|      3|    hands = init_get_thread_local(local, 1, 0);
  372|      3|    if (hands == NULL)
  ------------------
  |  Branch (372:9): [True: 0, False: 3]
  ------------------
  373|      0|        return 0;
  374|       |
  375|       |#ifdef FIPS_MODULE
  376|       |    if (*hands == NULL) {
  377|       |        /*
  378|       |         * We've not yet registered any handlers for this thread. We need to get
  379|       |         * libcrypto to tell us about later thread stop events. c_thread_start
  380|       |         * is a callback to libcrypto defined in fipsprov.c
  381|       |         */
  382|       |        if (!c_thread_start(FIPS_get_core_handle(ctx), ossl_arg_thread_stop,
  383|       |                            ctx))
  384|       |            return 0;
  385|       |    }
  386|       |#endif
  387|       |
  388|      3|    hand = OPENSSL_malloc(sizeof(*hand));
  ------------------
  |  |   97|      3|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  389|      3|    if (hand == NULL)
  ------------------
  |  Branch (389:9): [True: 0, False: 3]
  ------------------
  390|      0|        return 0;
  391|       |
  392|      3|    hand->handfn = handfn;
  393|      3|    hand->arg = arg;
  394|      3|#ifndef FIPS_MODULE
  395|      3|    hand->index = index;
  396|      3|#endif
  397|      3|    hand->next = *hands;
  398|      3|    *hands = hand;
  399|       |
  400|      3|    return 1;
  401|      3|}
ossl_init_thread_deregister:
  457|      1|{
  458|      1|    return init_thread_deregister(index, 0);
  459|      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)
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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:
  304|      4|{
  305|      4|    THREAD_EVENT_HANDLER *curr, *prev = NULL, *tmp;
  306|      4|#ifndef FIPS_MODULE
  307|      4|    GLOBAL_TEVENT_REGISTER *gtr;
  308|      4|#endif
  309|       |
  310|       |    /* Can't do much about this */
  311|      4|    if (hands == NULL)
  ------------------
  |  Branch (311:9): [True: 2, False: 2]
  ------------------
  312|      2|        return;
  313|       |
  314|      2|#ifndef FIPS_MODULE
  315|      2|    gtr = get_global_tevent_register();
  316|      2|    if (gtr == NULL)
  ------------------
  |  Branch (316:9): [True: 0, False: 2]
  ------------------
  317|      0|        return;
  318|       |
  319|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (319:9): [True: 0, False: 2]
  ------------------
  320|      0|        return;
  321|      2|#endif
  322|       |
  323|      2|    curr = *hands;
  324|      5|    while (curr != NULL) {
  ------------------
  |  Branch (324:12): [True: 3, False: 2]
  ------------------
  325|      3|        if (arg != NULL && curr->arg != arg) {
  ------------------
  |  Branch (325:13): [True: 0, False: 3]
  |  Branch (325:28): [True: 0, False: 0]
  ------------------
  326|      0|            prev = curr;
  327|      0|            curr = curr->next;
  328|      0|            continue;
  329|      0|        }
  330|      3|        curr->handfn(curr->arg);
  331|      3|        if (prev == NULL)
  ------------------
  |  Branch (331:13): [True: 3, False: 0]
  ------------------
  332|      3|            *hands = curr->next;
  333|      0|        else
  334|      0|            prev->next = curr->next;
  335|       |
  336|      3|        tmp = curr;
  337|      3|        curr = curr->next;
  338|       |
  339|      3|        OPENSSL_free(tmp);
  ------------------
  |  |  107|      3|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  340|      3|    }
  341|      2|#ifndef FIPS_MODULE
  342|      2|    CRYPTO_THREAD_unlock(gtr->lock);
  343|      2|#endif
  344|      2|}
initthread.c:init_thread_deregister:
  405|      3|{
  406|      3|    GLOBAL_TEVENT_REGISTER *gtr;
  407|      3|    int i;
  408|       |
  409|      3|    gtr = get_global_tevent_register();
  410|      3|    if (gtr == NULL)
  ------------------
  |  Branch (410:9): [True: 0, False: 3]
  ------------------
  411|      0|        return 0;
  412|      3|    if (!all) {
  ------------------
  |  Branch (412:9): [True: 1, False: 2]
  ------------------
  413|      1|        if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (413:13): [True: 0, False: 1]
  ------------------
  414|      0|            return 0;
  415|      2|    } else {
  416|      2|        glob_tevent_reg = NULL;
  417|      2|    }
  418|      3|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (418:17): [True: 0, False: 3]
  ------------------
  419|      0|        THREAD_EVENT_HANDLER **hands
  420|      0|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  421|      0|        THREAD_EVENT_HANDLER *curr = NULL, *prev = NULL, *tmp;
  422|       |
  423|      0|        if (hands == NULL) {
  ------------------
  |  Branch (423:13): [True: 0, False: 0]
  ------------------
  424|      0|            if (!all)
  ------------------
  |  Branch (424:17): [True: 0, False: 0]
  ------------------
  425|      0|                CRYPTO_THREAD_unlock(gtr->lock);
  426|      0|            return 0;
  427|      0|        }
  428|      0|        curr = *hands;
  429|      0|        while (curr != NULL) {
  ------------------
  |  Branch (429:16): [True: 0, False: 0]
  ------------------
  430|      0|            if (all || curr->index == index) {
  ------------------
  |  Branch (430:17): [True: 0, False: 0]
  |  Branch (430:24): [True: 0, False: 0]
  ------------------
  431|      0|                if (prev != NULL)
  ------------------
  |  Branch (431:21): [True: 0, False: 0]
  ------------------
  432|      0|                    prev->next = curr->next;
  433|      0|                else
  434|      0|                    *hands = curr->next;
  435|      0|                tmp = curr;
  436|      0|                curr = curr->next;
  437|      0|                OPENSSL_free(tmp);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  438|      0|                continue;
  439|      0|            }
  440|      0|            prev = curr;
  441|      0|            curr = curr->next;
  442|      0|        }
  443|      0|        if (all)
  ------------------
  |  Branch (443:13): [True: 0, False: 0]
  ------------------
  444|      0|            OPENSSL_free(hands);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  445|      0|    }
  446|      3|    if (all) {
  ------------------
  |  Branch (446:9): [True: 2, False: 1]
  ------------------
  447|      2|        CRYPTO_THREAD_lock_free(gtr->lock);
  448|      2|        sk_THREAD_EVENT_HANDLER_PTR_free(gtr->skhands);
  449|      2|        OPENSSL_free(gtr);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  450|      2|    } else {
  451|      1|        CRYPTO_THREAD_unlock(gtr->lock);
  452|      1|    }
  453|      3|    return 1;
  454|      3|}

OPENSSL_LH_new:
   48|    205|{
   49|    205|    OPENSSL_LHASH *ret;
   50|       |
   51|    205|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |   99|    205|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    205|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    205|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (51:9): [True: 0, False: 205]
  ------------------
   52|      0|        return NULL;
   53|    205|    if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
  ------------------
  |  |   99|    205|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    205|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    205|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (53:9): [True: 0, False: 205]
  ------------------
   54|      0|        goto err;
   55|    205|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (55:18): [True: 0, False: 205]
  ------------------
   56|    205|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (56:18): [True: 0, False: 205]
  ------------------
   57|    205|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|    205|#define MIN_NODES       16
  ------------------
   58|    205|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|    205|#define MIN_NODES       16
  ------------------
   59|    205|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|    205|#define MIN_NODES       16
  ------------------
   60|    205|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|    205|#define UP_LOAD         (2*LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   81|    205|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   61|    205|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|    205|#define DOWN_LOAD       (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   81|    205|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   62|    205|    return ret;
   63|       |
   64|      0|err:
   65|      0|    OPENSSL_free(ret->b);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   66|      0|    OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|      0|    return NULL;
   68|    205|}
OPENSSL_LH_free:
   71|    207|{
   72|    207|    if (lh == NULL)
  ------------------
  |  Branch (72:9): [True: 2, False: 205]
  ------------------
   73|      2|        return;
   74|       |
   75|    205|    OPENSSL_LH_flush(lh);
   76|    205|    OPENSSL_free(lh->b);
  ------------------
  |  |  107|    205|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    205|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    205|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|    205|    OPENSSL_free(lh);
  ------------------
  |  |  107|    205|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    205|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    205|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   78|    205|}
OPENSSL_LH_flush:
   81|    233|{
   82|    233|    unsigned int i;
   83|    233|    OPENSSL_LH_NODE *n, *nn;
   84|       |
   85|    233|    if (lh == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 233]
  ------------------
   86|      0|        return;
   87|       |
   88|  4.27k|    for (i = 0; i < lh->num_nodes; i++) {
  ------------------
  |  Branch (88:17): [True: 4.04k, False: 233]
  ------------------
   89|  4.04k|        n = lh->b[i];
   90|  8.28k|        while (n != NULL) {
  ------------------
  |  Branch (90:16): [True: 4.24k, False: 4.04k]
  ------------------
   91|  4.24k|            nn = n->next;
   92|  4.24k|            OPENSSL_free(n);
  ------------------
  |  |  107|  4.24k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  4.24k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  4.24k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|  4.24k|            n = nn;
   94|  4.24k|        }
   95|  4.04k|        lh->b[i] = NULL;
   96|  4.04k|    }
   97|       |
   98|    233|    lh->num_items = 0;
   99|    233|}
OPENSSL_LH_insert:
  102|  10.2k|{
  103|  10.2k|    unsigned long hash;
  104|  10.2k|    OPENSSL_LH_NODE *nn, **rn;
  105|  10.2k|    void *ret;
  106|       |
  107|  10.2k|    lh->error = 0;
  108|  10.2k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   81|  10.2k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (108:9): [True: 2.17k, False: 8.06k]
  |  Branch (108:76): [True: 0, False: 2.17k]
  ------------------
  109|      0|        return NULL;        /* 'lh->error++' already done in 'expand' */
  110|       |
  111|  10.2k|    rn = getrn(lh, data, &hash);
  112|       |
  113|  10.2k|    if (*rn == NULL) {
  ------------------
  |  Branch (113:9): [True: 4.48k, False: 5.76k]
  ------------------
  114|  4.48k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |   97|  4.48k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  4.48k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  4.48k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (114:13): [True: 0, False: 4.48k]
  ------------------
  115|      0|            lh->error++;
  116|      0|            return NULL;
  117|      0|        }
  118|  4.48k|        nn->data = data;
  119|  4.48k|        nn->next = NULL;
  120|  4.48k|        nn->hash = hash;
  121|  4.48k|        *rn = nn;
  122|  4.48k|        ret = NULL;
  123|  4.48k|        lh->num_items++;
  124|  5.76k|    } else {                    /* replace same key */
  125|  5.76k|        ret = (*rn)->data;
  126|  5.76k|        (*rn)->data = data;
  127|  5.76k|    }
  128|  10.2k|    return ret;
  129|  10.2k|}
OPENSSL_LH_delete:
  132|    242|{
  133|    242|    unsigned long hash;
  134|    242|    OPENSSL_LH_NODE *nn, **rn;
  135|    242|    void *ret;
  136|       |
  137|    242|    lh->error = 0;
  138|    242|    rn = getrn(lh, data, &hash);
  139|       |
  140|    242|    if (*rn == NULL) {
  ------------------
  |  Branch (140:9): [True: 0, False: 242]
  ------------------
  141|      0|        return NULL;
  142|    242|    } else {
  143|    242|        nn = *rn;
  144|    242|        *rn = nn->next;
  145|    242|        ret = nn->data;
  146|    242|        OPENSSL_free(nn);
  ------------------
  |  |  107|    242|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    242|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    242|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  147|    242|    }
  148|       |
  149|    242|    lh->num_items--;
  150|    242|    if ((lh->num_nodes > MIN_NODES) &&
  ------------------
  |  |   39|    242|#define MIN_NODES       16
  ------------------
  |  Branch (150:9): [True: 242, False: 0]
  ------------------
  151|    242|        (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
  ------------------
  |  |   81|    242|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (151:9): [True: 1, False: 241]
  ------------------
  152|      1|        contract(lh);
  153|       |
  154|    242|    return ret;
  155|    242|}
OPENSSL_LH_retrieve:
  158|   384k|{
  159|   384k|    unsigned long hash;
  160|   384k|    OPENSSL_LH_NODE **rn;
  161|       |
  162|   384k|    if (lh->error != 0)
  ------------------
  |  Branch (162:9): [True: 0, False: 384k]
  ------------------
  163|      0|        lh->error = 0;
  164|       |
  165|   384k|    rn = getrn(lh, data, &hash);
  166|       |
  167|   384k|    return *rn == NULL ? NULL : (*rn)->data;
  ------------------
  |  Branch (167:12): [True: 11.1k, False: 372k]
  ------------------
  168|   384k|}
OPENSSL_LH_doall:
  198|    234|{
  199|    234|    doall_util_fn(lh, 0, func, (OPENSSL_LH_DOALL_FUNCARG)0, NULL);
  200|    234|}
OPENSSL_LH_doall_arg:
  203|  29.8k|{
  204|  29.8k|    doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg);
  205|  29.8k|}
OPENSSL_LH_strhash:
  318|  21.2k|{
  319|  21.2k|    unsigned long ret = 0;
  320|  21.2k|    long n;
  321|  21.2k|    unsigned long v;
  322|  21.2k|    int r;
  323|       |
  324|  21.2k|    if ((c == NULL) || (*c == '\0'))
  ------------------
  |  Branch (324:9): [True: 0, False: 21.2k]
  |  Branch (324:24): [True: 20.3k, False: 958]
  ------------------
  325|  20.3k|        return ret;
  326|       |
  327|    958|    n = 0x100;
  328|  12.3k|    while (*c) {
  ------------------
  |  Branch (328:12): [True: 11.4k, False: 958]
  ------------------
  329|  11.4k|        v = n | (*c);
  330|  11.4k|        n += 0x100;
  331|  11.4k|        r = (int)((v >> 2) ^ v) & 0x0f;
  332|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  333|  11.4k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  334|  11.4k|        ret &= 0xFFFFFFFFL;
  335|  11.4k|        ret ^= v * v;
  336|  11.4k|        c++;
  337|  11.4k|    }
  338|    958|    return (ret >> 16) ^ ret;
  339|  21.2k|}
ossl_lh_strcasehash:
  356|   485k|{
  357|   485k|    unsigned long ret = 0;
  358|   485k|    long n;
  359|   485k|    unsigned long v;
  360|   485k|    int r;
  361|       |#if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
  362|       |    const long int case_adjust = ~0x40;
  363|       |#else
  364|   485k|    const long int case_adjust = ~0x20;
  365|   485k|#endif
  366|       |
  367|   485k|    if (c == NULL || *c == '\0')
  ------------------
  |  Branch (367:9): [True: 0, False: 485k]
  |  Branch (367:22): [True: 0, False: 485k]
  ------------------
  368|      0|        return ret;
  369|       |
  370|  4.77M|    for (n = 0x100; *c != '\0'; n += 0x100) {
  ------------------
  |  Branch (370:21): [True: 4.28M, False: 485k]
  ------------------
  371|  4.28M|        v = n | (case_adjust & *c);
  372|  4.28M|        r = (int)((v >> 2) ^ v) & 0x0f;
  373|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  374|  4.28M|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  375|  4.28M|        ret &= 0xFFFFFFFFL;
  376|  4.28M|        ret ^= v * v;
  377|  4.28M|        c++;
  378|  4.28M|    }
  379|   485k|    return (ret >> 16) ^ ret;
  380|   485k|}
OPENSSL_LH_num_items:
  383|  29.8k|{
  384|  29.8k|    return lh ? lh->num_items : 0;
  ------------------
  |  Branch (384:12): [True: 29.8k, False: 0]
  ------------------
  385|  29.8k|}
OPENSSL_LH_get_down_load:
  388|      4|{
  389|      4|    return lh->down_load;
  390|      4|}
OPENSSL_LH_set_down_load:
  393|      7|{
  394|      7|    lh->down_load = down_load;
  395|      7|}
OPENSSL_LH_error:
  398|  1.56k|{
  399|  1.56k|    return lh->error;
  400|  1.56k|}
lhash.c:doall_util_fn:
  173|  30.0k|{
  174|  30.0k|    int i;
  175|  30.0k|    OPENSSL_LH_NODE *a, *n;
  176|       |
  177|  30.0k|    if (lh == NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 30.0k]
  ------------------
  178|      0|        return;
  179|       |
  180|       |    /*
  181|       |     * reverse the order so we search from 'top to bottom' We were having
  182|       |     * memory leaks otherwise
  183|       |     */
  184|  6.07M|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (184:33): [True: 6.04M, False: 30.0k]
  ------------------
  185|  6.04M|        a = lh->b[i];
  186|  18.0M|        while (a != NULL) {
  ------------------
  |  Branch (186:16): [True: 12.0M, False: 6.04M]
  ------------------
  187|  12.0M|            n = a->next;
  188|  12.0M|            if (use_arg)
  ------------------
  |  Branch (188:17): [True: 12.0M, False: 1.86k]
  ------------------
  189|  12.0M|                func_arg(a->data, arg);
  190|  1.86k|            else
  191|  1.86k|                func(a->data);
  192|  12.0M|            a = n;
  193|  12.0M|        }
  194|  6.04M|    }
  195|  30.0k|}
lhash.c:expand:
  208|  2.17k|{
  209|  2.17k|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  210|  2.17k|    unsigned int p, pmax, nni, j;
  211|  2.17k|    unsigned long hash;
  212|       |
  213|  2.17k|    nni = lh->num_alloc_nodes;
  214|  2.17k|    p = lh->p;
  215|  2.17k|    pmax = lh->pmax;
  216|  2.17k|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (216:9): [True: 24, False: 2.15k]
  ------------------
  217|     24|        j = nni * 2;
  218|     24|        n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j);
  ------------------
  |  |  101|     24|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     24|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     24|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  219|     24|        if (n == NULL) {
  ------------------
  |  Branch (219:13): [True: 0, False: 24]
  ------------------
  220|      0|            lh->error++;
  221|      0|            return 0;
  222|      0|        }
  223|     24|        lh->b = n;
  224|     24|        memset(n + nni, 0, sizeof(*n) * (j - nni));
  225|     24|        lh->pmax = nni;
  226|     24|        lh->num_alloc_nodes = j;
  227|     24|        lh->p = 0;
  228|  2.15k|    } else {
  229|  2.15k|        lh->p++;
  230|  2.15k|    }
  231|       |
  232|  2.17k|    lh->num_nodes++;
  233|  2.17k|    n1 = &(lh->b[p]);
  234|  2.17k|    n2 = &(lh->b[p + pmax]);
  235|  2.17k|    *n2 = NULL;
  236|       |
  237|  9.39k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (237:20): [True: 7.21k, False: 2.17k]
  ------------------
  238|  7.21k|        hash = np->hash;
  239|  7.21k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (239:13): [True: 1.83k, False: 5.38k]
  ------------------
  240|  1.83k|            *n1 = (*n1)->next;
  241|  1.83k|            np->next = *n2;
  242|  1.83k|            *n2 = np;
  243|  1.83k|        } else
  244|  5.38k|            n1 = &((*n1)->next);
  245|  7.21k|        np = *n1;
  246|  7.21k|    }
  247|       |
  248|  2.17k|    return 1;
  249|  2.17k|}
lhash.c:contract:
  252|      1|{
  253|      1|    OPENSSL_LH_NODE **n, *n1, *np;
  254|       |
  255|      1|    np = lh->b[lh->p + lh->pmax - 1];
  256|      1|    lh->b[lh->p + lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */
  257|      1|    if (lh->p == 0) {
  ------------------
  |  Branch (257:9): [True: 0, False: 1]
  ------------------
  258|      0|        n = OPENSSL_realloc(lh->b,
  ------------------
  |  |  101|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  259|      0|                            (unsigned int)(sizeof(OPENSSL_LH_NODE *) * lh->pmax));
  260|      0|        if (n == NULL) {
  ------------------
  |  Branch (260:13): [True: 0, False: 0]
  ------------------
  261|       |            /* fputs("realloc error in lhash", stderr); */
  262|      0|            lh->error++;
  263|      0|        } else {
  264|      0|            lh->b = n;
  265|      0|        }
  266|      0|        lh->num_alloc_nodes /= 2;
  267|      0|        lh->pmax /= 2;
  268|      0|        lh->p = lh->pmax - 1;
  269|      0|    } else
  270|      1|        lh->p--;
  271|       |
  272|      1|    lh->num_nodes--;
  273|       |
  274|      1|    n1 = lh->b[(int)lh->p];
  275|      1|    if (n1 == NULL)
  ------------------
  |  Branch (275:9): [True: 1, False: 0]
  ------------------
  276|      1|        lh->b[(int)lh->p] = np;
  277|      0|    else {
  278|      0|        while (n1->next != NULL)
  ------------------
  |  Branch (278:16): [True: 0, False: 0]
  ------------------
  279|      0|            n1 = n1->next;
  280|      0|        n1->next = np;
  281|      0|    }
  282|      1|}
lhash.c:getrn:
  286|   394k|{
  287|   394k|    OPENSSL_LH_NODE **ret, *n1;
  288|   394k|    unsigned long hash, nn;
  289|   394k|    OPENSSL_LH_COMPFUNC cf;
  290|       |
  291|   394k|    hash = (*(lh->hash)) (data);
  292|   394k|    *rhash = hash;
  293|       |
  294|   394k|    nn = hash % lh->pmax;
  295|   394k|    if (nn < lh->p)
  ------------------
  |  Branch (295:9): [True: 161k, False: 233k]
  ------------------
  296|   161k|        nn = hash % lh->num_alloc_nodes;
  297|       |
  298|   394k|    cf = lh->comp;
  299|   394k|    ret = &(lh->b[(int)nn]);
  300|   693k|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (300:21): [True: 678k, False: 15.6k]
  ------------------
  301|   678k|        if (n1->hash != hash) {
  ------------------
  |  Branch (301:13): [True: 298k, False: 379k]
  ------------------
  302|   298k|            ret = &(n1->next);
  303|   298k|            continue;
  304|   298k|        }
  305|   379k|        if (cf(n1->data, data) == 0)
  ------------------
  |  Branch (305:13): [True: 378k, False: 292]
  ------------------
  306|   378k|            break;
  307|    292|        ret = &(n1->next);
  308|    292|    }
  309|   394k|    return ret;
  310|   394k|}

CRYPTO_malloc:
  172|  28.0M|{
  173|  28.0M|    void *ptr;
  174|       |
  175|  28.0M|    INCREMENT(malloc_count);
  176|  28.0M|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (176:9): [True: 0, False: 28.0M]
  ------------------
  177|      0|        ptr = malloc_impl(num, file, line);
  178|      0|        if (ptr != NULL || num == 0)
  ------------------
  |  Branch (178:13): [True: 0, False: 0]
  |  Branch (178:28): [True: 0, False: 0]
  ------------------
  179|      0|            return ptr;
  180|      0|        goto err;
  181|      0|    }
  182|       |
  183|  28.0M|    if (num == 0)
  ------------------
  |  Branch (183:9): [True: 0, False: 28.0M]
  ------------------
  184|      0|        return NULL;
  185|       |
  186|  28.0M|    FAILTEST();
  187|  28.0M|    if (allow_customize) {
  ------------------
  |  Branch (187:9): [True: 2, False: 28.0M]
  ------------------
  188|       |        /*
  189|       |         * Disallow customization after the first allocation. We only set this
  190|       |         * if necessary to avoid a store to the same cache line on every
  191|       |         * allocation.
  192|       |         */
  193|      2|        allow_customize = 0;
  194|      2|    }
  195|       |
  196|  28.0M|    ptr = malloc(num);
  197|  28.0M|    if (ptr != NULL)
  ------------------
  |  Branch (197:9): [True: 28.0M, False: 0]
  ------------------
  198|  28.0M|        return ptr;
  199|      0| err:
  200|       |    /*
  201|       |     * ossl_err_get_state_int() in err.c uses CRYPTO_zalloc(num, NULL, 0) for
  202|       |     * ERR_STATE allocation. Prevent mem alloc error loop while reporting error.
  203|       |     */
  204|      0|    if (file != NULL || line != 0) {
  ------------------
  |  Branch (204:9): [True: 0, False: 0]
  |  Branch (204:25): [True: 0, False: 0]
  ------------------
  205|      0|        ERR_new();
  206|      0|        ERR_set_debug(file, line, NULL);
  207|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  208|      0|    }
  209|      0|    return NULL;
  210|  28.0M|}
CRYPTO_zalloc:
  213|  18.2M|{
  214|  18.2M|    void *ret;
  215|       |
  216|  18.2M|    ret = CRYPTO_malloc(num, file, line);
  217|  18.2M|    if (ret != NULL)
  ------------------
  |  Branch (217:9): [True: 18.2M, False: 0]
  ------------------
  218|  18.2M|        memset(ret, 0, num);
  219|       |
  220|  18.2M|    return ret;
  221|  18.2M|}
CRYPTO_realloc:
  224|  1.58M|{
  225|  1.58M|    INCREMENT(realloc_count);
  226|  1.58M|    if (realloc_impl != CRYPTO_realloc)
  ------------------
  |  Branch (226:9): [True: 0, False: 1.58M]
  ------------------
  227|      0|        return realloc_impl(str, num, file, line);
  228|       |
  229|  1.58M|    if (str == NULL)
  ------------------
  |  Branch (229:9): [True: 1.49M, False: 88.1k]
  ------------------
  230|  1.49M|        return CRYPTO_malloc(num, file, line);
  231|       |
  232|  88.1k|    if (num == 0) {
  ------------------
  |  Branch (232:9): [True: 0, False: 88.1k]
  ------------------
  233|      0|        CRYPTO_free(str, file, line);
  234|      0|        return NULL;
  235|      0|    }
  236|       |
  237|  88.1k|    FAILTEST();
  238|  88.1k|    return realloc(str, num);
  239|  88.1k|}
CRYPTO_clear_realloc:
  243|  1.60M|{
  244|  1.60M|    void *ret = NULL;
  245|       |
  246|  1.60M|    if (str == NULL)
  ------------------
  |  Branch (246:9): [True: 1.20M, False: 397k]
  ------------------
  247|  1.20M|        return CRYPTO_malloc(num, file, line);
  248|       |
  249|   397k|    if (num == 0) {
  ------------------
  |  Branch (249:9): [True: 0, False: 397k]
  ------------------
  250|      0|        CRYPTO_clear_free(str, old_len, file, line);
  251|      0|        return NULL;
  252|      0|    }
  253|       |
  254|       |    /* Can't shrink the buffer since memcpy below copies |old_len| bytes. */
  255|   397k|    if (num < old_len) {
  ------------------
  |  Branch (255:9): [True: 0, False: 397k]
  ------------------
  256|      0|        OPENSSL_cleanse((char*)str + num, old_len - num);
  257|      0|        return str;
  258|      0|    }
  259|       |
  260|   397k|    ret = CRYPTO_malloc(num, file, line);
  261|   397k|    if (ret != NULL) {
  ------------------
  |  Branch (261:9): [True: 397k, False: 0]
  ------------------
  262|   397k|        memcpy(ret, str, old_len);
  263|   397k|        CRYPTO_clear_free(str, old_len, file, line);
  264|   397k|    }
  265|   397k|    return ret;
  266|   397k|}
CRYPTO_free:
  269|  43.6M|{
  270|  43.6M|    INCREMENT(free_count);
  271|  43.6M|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (271:9): [True: 0, False: 43.6M]
  ------------------
  272|      0|        free_impl(str, file, line);
  273|      0|        return;
  274|      0|    }
  275|       |
  276|  43.6M|    free(str);
  277|  43.6M|}
CRYPTO_clear_free:
  280|  2.64M|{
  281|  2.64M|    if (str == NULL)
  ------------------
  |  Branch (281:9): [True: 116k, False: 2.53M]
  ------------------
  282|   116k|        return;
  283|  2.53M|    if (num)
  ------------------
  |  Branch (283:9): [True: 2.53M, False: 0]
  ------------------
  284|  2.53M|        OPENSSL_cleanse(str, num);
  285|  2.53M|    CRYPTO_free(str, file, line);
  286|  2.53M|}

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_malloc:
  155|      3|{
  156|      3|#ifndef OPENSSL_NO_SECURE_MEMORY
  157|      3|    void *ret = NULL;
  158|      3|    size_t actual_size;
  159|      3|    int reason = CRYPTO_R_SECURE_MALLOC_FAILURE;
  ------------------
  |  |   47|      3|# define CRYPTO_R_SECURE_MALLOC_FAILURE                   111
  ------------------
  160|       |
  161|      3|    if (!secure_mem_initialized) {
  ------------------
  |  Branch (161:9): [True: 3, False: 0]
  ------------------
  162|      3|        return CRYPTO_malloc(num, file, line);
  163|      3|    }
  164|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock)) {
  ------------------
  |  Branch (164:9): [True: 0, False: 0]
  ------------------
  165|      0|        reason = ERR_R_CRYPTO_LIB;
  ------------------
  |  |  327|      0|# define ERR_R_CRYPTO_LIB       (ERR_LIB_CRYPTO/* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  |  |  ------------------
  |  |               # define ERR_R_CRYPTO_LIB       (ERR_LIB_CRYPTO/* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|      0|        goto err;
  167|      0|    }
  168|      0|    ret = sh_malloc(num);
  169|      0|    actual_size = ret ? sh_actual_size(ret) : 0;
  ------------------
  |  Branch (169:19): [True: 0, False: 0]
  ------------------
  170|      0|    secure_mem_used += actual_size;
  171|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  172|      0| err:
  173|      0|    if (ret == NULL && (file != NULL || line != 0)) {
  ------------------
  |  Branch (173:9): [True: 0, False: 0]
  |  Branch (173:25): [True: 0, False: 0]
  |  Branch (173:41): [True: 0, False: 0]
  ------------------
  174|      0|        ERR_new();
  175|      0|        ERR_set_debug(file, line, NULL);
  176|      0|        ERR_set_error(ERR_LIB_CRYPTO, reason, NULL);
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
  177|      0|    }
  178|      0|    return ret;
  179|       |#else
  180|       |    return CRYPTO_malloc(num, file, line);
  181|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  182|      0|}
CRYPTO_secure_zalloc:
  185|      3|{
  186|      3|#ifndef OPENSSL_NO_SECURE_MEMORY
  187|      3|    if (secure_mem_initialized)
  ------------------
  |  Branch (187:9): [True: 0, False: 3]
  ------------------
  188|       |        /* CRYPTO_secure_malloc() zeroes allocations when it is implemented */
  189|      0|        return CRYPTO_secure_malloc(num, file, line);
  190|      3|#endif
  191|      3|    return CRYPTO_zalloc(num, file, line);
  192|      3|}
CRYPTO_secure_clear_free:
  219|    393|{
  220|    393|#ifndef OPENSSL_NO_SECURE_MEMORY
  221|    393|    size_t actual_size;
  222|       |
  223|    393|    if (ptr == NULL)
  ------------------
  |  Branch (223:9): [True: 387, False: 6]
  ------------------
  224|    387|        return;
  225|      6|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (225:9): [True: 6, False: 0]
  ------------------
  226|      6|        OPENSSL_cleanse(ptr, num);
  227|      6|        CRYPTO_free(ptr, file, line);
  228|      6|        return;
  229|      6|    }
  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|      6|{
  247|      6|#ifndef OPENSSL_NO_SECURE_MEMORY
  248|      6|    if (!secure_mem_initialized)
  ------------------
  |  Branch (248:9): [True: 6, False: 0]
  ------------------
  249|      6|        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|      6|}
mem_sec.c:sh_done:
  595|      2|{
  596|      2|    OPENSSL_free(sh.freelist);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  597|      2|    OPENSSL_free(sh.bittable);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  598|      2|    OPENSSL_free(sh.bitmalloc);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  599|      2|#if !defined(_WIN32)
  600|      2|    if (sh.map_result != MAP_FAILED && sh.map_size)
  ------------------
  |  Branch (600:9): [True: 2, False: 0]
  |  Branch (600:40): [True: 0, False: 2]
  ------------------
  601|      0|        munmap(sh.map_result, sh.map_size);
  602|       |#else
  603|       |    if (sh.map_result != NULL && sh.map_size)
  604|       |        VirtualFree(sh.map_result, 0, MEM_RELEASE);
  605|       |#endif
  606|      2|    memset(&sh, 0, sizeof(sh));
  607|      2|}

CRYPTO_ctr128_encrypt_ctr32:
  155|  7.62k|{
  156|  7.62k|    unsigned int n, ctr32;
  157|       |
  158|  7.62k|   n = *num;
  159|       |
  160|  7.62k|    while (n && len) {
  ------------------
  |  Branch (160:12): [True: 0, False: 7.62k]
  |  Branch (160:17): [True: 0, False: 0]
  ------------------
  161|      0|        *(out++) = *(in++) ^ ecount_buf[n];
  162|      0|        --len;
  163|      0|        n = (n + 1) % 16;
  164|      0|    }
  165|       |
  166|  7.62k|    ctr32 = GETU32(ivec + 12);
  ------------------
  |  |  103|  7.62k|# define GETU32(p)       ((u32)(p)[0]<<24|(u32)(p)[1]<<16|(u32)(p)[2]<<8|(u32)(p)[3])
  ------------------
  167|  13.0k|    while (len >= 16) {
  ------------------
  |  Branch (167:12): [True: 5.43k, False: 7.62k]
  ------------------
  168|  5.43k|        size_t blocks = len / 16;
  169|       |        /*
  170|       |         * 1<<28 is just a not-so-small yet not-so-large number...
  171|       |         * Below condition is practically never met, but it has to
  172|       |         * be checked for code correctness.
  173|       |         */
  174|  5.43k|        if (sizeof(size_t) > sizeof(unsigned int) && blocks > (1U << 28))
  ------------------
  |  Branch (174:13): [Folded - Ignored]
  |  Branch (174:54): [True: 0, False: 5.43k]
  ------------------
  175|      0|            blocks = (1U << 28);
  176|       |        /*
  177|       |         * As (*func) operates on 32-bit counter, caller
  178|       |         * has to handle overflow. 'if' below detects the
  179|       |         * overflow, which is then handled by limiting the
  180|       |         * amount of blocks to the exact overflow point...
  181|       |         */
  182|  5.43k|        ctr32 += (u32)blocks;
  183|  5.43k|        if (ctr32 < blocks) {
  ------------------
  |  Branch (183:13): [True: 0, False: 5.43k]
  ------------------
  184|      0|            blocks -= ctr32;
  185|      0|            ctr32 = 0;
  186|      0|        }
  187|  5.43k|        (*func) (in, out, blocks, key, ivec);
  188|       |        /* (*ctr) does not update ivec, caller does: */
  189|  5.43k|        PUTU32(ivec + 12, ctr32);
  ------------------
  |  |  104|  5.43k|# define PUTU32(p,v)     ((p)[0]=(u8)((v)>>24),(p)[1]=(u8)((v)>>16),(p)[2]=(u8)((v)>>8),(p)[3]=(u8)(v))
  ------------------
  190|       |        /* ... overflow was detected, propagate carry. */
  191|  5.43k|        if (ctr32 == 0)
  ------------------
  |  Branch (191:13): [True: 0, False: 5.43k]
  ------------------
  192|      0|            ctr96_inc(ivec);
  193|  5.43k|        blocks *= 16;
  194|  5.43k|        len -= blocks;
  195|  5.43k|        out += blocks;
  196|  5.43k|        in += blocks;
  197|  5.43k|    }
  198|  7.62k|    if (len) {
  ------------------
  |  Branch (198:9): [True: 7.61k, False: 2]
  ------------------
  199|  7.61k|        memset(ecount_buf, 0, 16);
  200|  7.61k|        (*func) (ecount_buf, ecount_buf, 1, key, ivec);
  201|  7.61k|        ++ctr32;
  202|  7.61k|        PUTU32(ivec + 12, ctr32);
  ------------------
  |  |  104|  7.61k|# define PUTU32(p,v)     ((p)[0]=(u8)((v)>>24),(p)[1]=(u8)((v)>>16),(p)[2]=(u8)((v)>>8),(p)[3]=(u8)(v))
  ------------------
  203|  7.61k|        if (ctr32 == 0)
  ------------------
  |  Branch (203:13): [True: 0, False: 7.61k]
  ------------------
  204|      0|            ctr96_inc(ivec);
  205|  77.0k|        while (len--) {
  ------------------
  |  Branch (205:16): [True: 69.3k, False: 7.61k]
  ------------------
  206|  69.3k|            out[n] = in[n] ^ ecount_buf[n];
  207|  69.3k|            ++n;
  208|  69.3k|        }
  209|  7.61k|    }
  210|       |
  211|  7.62k|    *num = n;
  212|  7.62k|}

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

CRYPTO_strdup:
   22|  3.23k|{
   23|  3.23k|    char *ret;
   24|       |
   25|  3.23k|    if (str == NULL)
  ------------------
  |  Branch (25:9): [True: 0, False: 3.23k]
  ------------------
   26|      0|        return NULL;
   27|  3.23k|    ret = CRYPTO_malloc(strlen(str) + 1, file, line);
   28|  3.23k|    if (ret != NULL)
  ------------------
  |  Branch (28:9): [True: 3.23k, False: 0]
  ------------------
   29|  3.23k|        strcpy(ret, str);
   30|  3.23k|    return ret;
   31|  3.23k|}
CRYPTO_strndup:
   34|    444|{
   35|    444|    size_t maxlen;
   36|    444|    char *ret;
   37|       |
   38|    444|    if (str == NULL)
  ------------------
  |  Branch (38:9): [True: 0, False: 444]
  ------------------
   39|      0|        return NULL;
   40|       |
   41|    444|    maxlen = OPENSSL_strnlen(str, s);
   42|       |
   43|    444|    ret = CRYPTO_malloc(maxlen + 1, file, line);
   44|    444|    if (ret) {
  ------------------
  |  Branch (44:9): [True: 444, False: 0]
  ------------------
   45|    444|        memcpy(ret, str, maxlen);
   46|    444|        ret[maxlen] = CH_ZERO;
  ------------------
  |  |   19|    444|#define CH_ZERO '\0'
  ------------------
   47|    444|    }
   48|    444|    return ret;
   49|    444|}
CRYPTO_memdup:
   52|  1.20M|{
   53|  1.20M|    void *ret;
   54|       |
   55|  1.20M|    if (data == NULL || siz >= INT_MAX)
  ------------------
  |  Branch (55:9): [True: 0, False: 1.20M]
  |  Branch (55:25): [True: 0, False: 1.20M]
  ------------------
   56|      0|        return NULL;
   57|       |
   58|  1.20M|    ret = CRYPTO_malloc(siz, file, line);
   59|  1.20M|    if (ret == NULL)
  ------------------
  |  Branch (59:9): [True: 0, False: 1.20M]
  ------------------
   60|      0|        return NULL;
   61|  1.20M|    return memcpy(ret, data, siz);
   62|  1.20M|}
OPENSSL_strnlen:
   65|   151k|{
   66|   151k|    const char *p;
   67|       |
   68|  1.53M|    for (p = str; maxlen-- != 0 && *p != CH_ZERO; ++p) ;
  ------------------
  |  |   19|  1.53M|#define CH_ZERO '\0'
  ------------------
  |  Branch (68:19): [True: 1.53M, False: 444]
  |  Branch (68:36): [True: 1.38M, False: 151k]
  ------------------
   69|       |
   70|   151k|    return p - str;
   71|   151k|}
OPENSSL_strlcpy:
   74|   415k|{
   75|   415k|    size_t l = 0;
   76|  4.67M|    for (; size > 1 && *src; size--) {
  ------------------
  |  Branch (76:12): [True: 4.66M, False: 2.01k]
  |  Branch (76:24): [True: 4.25M, False: 413k]
  ------------------
   77|  4.25M|        *dst++ = *src++;
   78|  4.25M|        l++;
   79|  4.25M|    }
   80|   415k|    if (size)
  ------------------
  |  Branch (80:9): [True: 414k, False: 412]
  ------------------
   81|   414k|        *dst = CH_ZERO;
  ------------------
  |  |   19|   414k|#define CH_ZERO '\0'
  ------------------
   82|   415k|    return l + strlen(src);
   83|   415k|}
OPENSSL_strlcat:
   86|   288k|{
   87|   288k|    size_t l = 0;
   88|  3.52M|    for (; size > 0 && *dst; size--, dst++)
  ------------------
  |  Branch (88:12): [True: 3.52M, False: 0]
  |  Branch (88:24): [True: 3.23M, False: 288k]
  ------------------
   89|  3.23M|        l++;
   90|   288k|    return l + OPENSSL_strlcpy(dst, src, size);
   91|   288k|}
OPENSSL_strcasecmp:
  340|   807k|{
  341|   807k|    int t;
  342|       |
  343|  6.28M|    while ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) == 0)
  ------------------
  |  Branch (343:12): [True: 6.11M, False: 175k]
  ------------------
  344|  6.11M|        if (*s1++ == '\0')
  ------------------
  |  Branch (344:13): [True: 632k, False: 5.48M]
  ------------------
  345|   632k|            return 0;
  346|   175k|    return t;
  347|   807k|}
OPENSSL_strncasecmp:
  350|  87.4k|{
  351|  87.4k|    int t;
  352|  87.4k|    size_t i;
  353|       |
  354|   280k|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (354:17): [True: 221k, False: 59.3k]
  ------------------
  355|   221k|        if ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) != 0)
  ------------------
  |  Branch (355:13): [True: 28.1k, False: 193k]
  ------------------
  356|  28.1k|            return t;
  357|   193k|        else if (*s1++ == '\0')
  ------------------
  |  Branch (357:18): [True: 0, False: 193k]
  ------------------
  358|      0|            return 0;
  359|  59.3k|    return 0;
  360|  87.4k|}

OBJ_NAME_init:
   64|  1.22k|{
   65|  1.22k|    return RUN_ONCE(&init, o_names_init);
  ------------------
  |  |  130|  1.22k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1.22k, False: 0]
  |  |  ------------------
  ------------------
   66|  1.22k|}
OBJ_NAME_get:
  152|    556|{
  153|    556|    OBJ_NAME on, *ret;
  154|    556|    int num = 0, alias;
  155|    556|    const char *value = NULL;
  156|       |
  157|    556|    if (name == NULL)
  ------------------
  |  Branch (157:9): [True: 0, False: 556]
  ------------------
  158|      0|        return NULL;
  159|    556|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (159:9): [True: 0, False: 556]
  ------------------
  160|      0|        return NULL;
  161|    556|    if (!CRYPTO_THREAD_read_lock(obj_lock))
  ------------------
  |  Branch (161:9): [True: 0, False: 556]
  ------------------
  162|      0|        return NULL;
  163|       |
  164|    556|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    556|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  165|    556|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    556|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  166|       |
  167|    556|    on.name = name;
  168|    556|    on.type = type;
  169|       |
  170|    651|    for (;;) {
  171|    651|        ret = lh_OBJ_NAME_retrieve(names_lh, &on);
  172|    651|        if (ret == NULL)
  ------------------
  |  Branch (172:13): [True: 157, False: 494]
  ------------------
  173|    157|            break;
  174|    494|        if ((ret->alias) && !alias) {
  ------------------
  |  Branch (174:13): [True: 95, False: 399]
  |  Branch (174:29): [True: 95, False: 0]
  ------------------
  175|     95|            if (++num > 10)
  ------------------
  |  Branch (175:17): [True: 0, False: 95]
  ------------------
  176|      0|                break;
  177|     95|            on.name = ret->data;
  178|    399|        } else {
  179|    399|            value = ret->data;
  180|    399|            break;
  181|    399|        }
  182|    494|    }
  183|       |
  184|    556|    CRYPTO_THREAD_unlock(obj_lock);
  185|    556|    return value;
  186|    556|}
OBJ_NAME_add:
  189|    424|{
  190|    424|    OBJ_NAME *onp, *ret;
  191|    424|    int alias, ok = 0;
  192|       |
  193|    424|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (193:9): [True: 0, False: 424]
  ------------------
  194|      0|        return 0;
  195|       |
  196|    424|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    424|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  197|    424|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    424|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  198|       |
  199|    424|    onp = OPENSSL_malloc(sizeof(*onp));
  ------------------
  |  |   97|    424|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    424|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    424|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  200|    424|    if (onp == NULL)
  ------------------
  |  Branch (200:9): [True: 0, False: 424]
  ------------------
  201|      0|        return 0;
  202|       |
  203|    424|    onp->name = name;
  204|    424|    onp->alias = alias;
  205|    424|    onp->type = type;
  206|    424|    onp->data = data;
  207|       |
  208|    424|    if (!CRYPTO_THREAD_write_lock(obj_lock)) {
  ------------------
  |  Branch (208:9): [True: 0, False: 424]
  ------------------
  209|      0|        OPENSSL_free(onp);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  210|      0|        return 0;
  211|      0|    }
  212|       |
  213|    424|    ret = lh_OBJ_NAME_insert(names_lh, onp);
  214|    424|    if (ret != NULL) {
  ------------------
  |  Branch (214:9): [True: 182, False: 242]
  ------------------
  215|       |        /* free things */
  216|    182|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (216:13): [True: 0, False: 182]
  ------------------
  217|    182|            && (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|    182|        OPENSSL_free(ret);
  ------------------
  |  |  107|    182|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    182|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    182|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  227|    242|    } else {
  228|    242|        if (lh_OBJ_NAME_error(names_lh)) {
  ------------------
  |  Branch (228:13): [True: 0, False: 242]
  ------------------
  229|       |            /* ERROR */
  230|      0|            OPENSSL_free(onp);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  231|      0|            goto unlock;
  232|      0|        }
  233|    242|    }
  234|       |
  235|    424|    ok = 1;
  236|       |
  237|    424|unlock:
  238|    424|    CRYPTO_THREAD_unlock(obj_lock);
  239|    424|    return ok;
  240|    424|}
OBJ_NAME_remove:
  243|    242|{
  244|    242|    OBJ_NAME on, *ret;
  245|    242|    int ok = 0;
  246|       |
  247|    242|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (247:9): [True: 0, False: 242]
  ------------------
  248|      0|        return 0;
  249|       |
  250|    242|    if (!CRYPTO_THREAD_write_lock(obj_lock))
  ------------------
  |  Branch (250:9): [True: 0, False: 242]
  ------------------
  251|      0|        return 0;
  252|       |
  253|    242|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    242|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  254|    242|    on.name = name;
  255|    242|    on.type = type;
  256|    242|    ret = lh_OBJ_NAME_delete(names_lh, &on);
  257|    242|    if (ret != NULL) {
  ------------------
  |  Branch (257:9): [True: 242, False: 0]
  ------------------
  258|       |        /* free things */
  259|    242|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (259:13): [True: 0, False: 242]
  ------------------
  260|    242|            && (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|    242|        OPENSSL_free(ret);
  ------------------
  |  |  107|    242|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    242|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    242|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  270|    242|        ok = 1;
  271|    242|    }
  272|       |
  273|    242|    CRYPTO_THREAD_unlock(obj_lock);
  274|    242|    return ok;
  275|    242|}
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: 4, False: 4]
  ------------------
  372|      4|        return;
  373|       |
  374|      4|    free_type = type;
  375|      4|    down_load = lh_OBJ_NAME_get_down_load(names_lh);
  376|      4|    lh_OBJ_NAME_set_down_load(names_lh, 0);
  377|       |
  378|      4|    lh_OBJ_NAME_doall(names_lh, names_lh_free_doall);
  379|      4|    if (type < 0) {
  ------------------
  |  Branch (379:9): [True: 1, False: 3]
  ------------------
  380|      1|        lh_OBJ_NAME_free(names_lh);
  381|      1|        sk_NAME_FUNCS_pop_free(name_funcs_stack, name_funcs_free);
  382|      1|        CRYPTO_THREAD_lock_free(obj_lock);
  383|      1|        names_lh = NULL;
  384|      1|        name_funcs_stack = NULL;
  385|      1|        obj_lock = NULL;
  386|      1|    } else
  387|      3|        lh_OBJ_NAME_set_down_load(names_lh, down_load);
  388|      4|}
o_names.c:o_names_init:
   51|      1|{
   52|      1|    names_lh = NULL;
   53|      1|    obj_lock = CRYPTO_THREAD_lock_new();
   54|      1|    if (obj_lock != NULL)
  ------------------
  |  Branch (54:9): [True: 1, False: 0]
  ------------------
   55|      1|        names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
   56|      1|    if (names_lh == NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 1]
  ------------------
   57|      0|        CRYPTO_THREAD_lock_free(obj_lock);
   58|      0|        obj_lock = NULL;
   59|      0|    }
   60|      1|    return names_lh != NULL && obj_lock != NULL;
  ------------------
  |  Branch (60:12): [True: 1, False: 0]
  |  Branch (60:32): [True: 1, False: 0]
  ------------------
   61|      1|}
o_names.c:obj_name_hash:
  136|  1.31k|{
  137|  1.31k|    unsigned long ret;
  138|       |
  139|  1.31k|    if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 1.31k]
  ------------------
  140|  1.31k|        && (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.31k|    } else {
  145|  1.31k|        ret = ossl_lh_strcasehash(a->name);
  146|  1.31k|    }
  147|  1.31k|    ret ^= a->type;
  148|  1.31k|    return ret;
  149|  1.31k|}
o_names.c:obj_name_cmp:
  120|    918|{
  121|    918|    int ret;
  122|       |
  123|    918|    ret = a->type - b->type;
  124|    918|    if (ret == 0) {
  ------------------
  |  Branch (124:9): [True: 918, False: 0]
  ------------------
  125|    918|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (125:13): [True: 0, False: 918]
  ------------------
  126|    918|            && (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|    918|            ret = OPENSSL_strcasecmp(a->name, b->name);
  131|    918|    }
  132|    918|    return ret;
  133|    918|}
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|    543|{
  355|    543|    if (onp == NULL)
  ------------------
  |  Branch (355:9): [True: 0, False: 543]
  ------------------
  356|      0|        return;
  357|       |
  358|    543|    if (free_type < 0 || free_type == onp->type)
  ------------------
  |  Branch (358:9): [True: 0, False: 543]
  |  Branch (358:26): [True: 242, False: 301]
  ------------------
  359|    242|        OBJ_NAME_remove(onp->name, onp->type);
  360|    543|}

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:
  299|  2.94M|{
  300|  2.94M|    ADDED_OBJ ad, *adp = NULL;
  301|  2.94M|    ASN1_OBJECT ob;
  302|       |
  303|  2.94M|    if (n == NID_undef
  ------------------
  |  |   18|  5.89M|#define NID_undef                       0
  ------------------
  |  Branch (303:9): [True: 2.42M, False: 518k]
  ------------------
  304|  2.94M|        || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  | 1187|  1.03M|#define NUM_NID 1320
  ------------------
                      || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  |   18|   518k|#define NID_undef                       0
  ------------------
  |  Branch (304:13): [True: 518k, False: 0]
  |  Branch (304:22): [True: 518k, False: 0]
  |  Branch (304:37): [True: 518k, False: 0]
  ------------------
  305|  2.94M|        return (ASN1_OBJECT *)&(nid_objs[n]);
  306|       |
  307|      0|    ad.type = ADDED_NID;
  ------------------
  |  |   33|      0|#define ADDED_NID       3
  ------------------
  308|      0|    ad.obj = &ob;
  309|      0|    ob.nid = n;
  310|      0|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (310:9): [True: 0, False: 0]
  ------------------
  311|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  312|      0|        return NULL;
  313|      0|    }
  314|      0|    if (added != NULL)
  ------------------
  |  Branch (314:9): [True: 0, False: 0]
  ------------------
  315|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  316|      0|    ossl_obj_unlock(1);
  317|      0|    if (adp != NULL)
  ------------------
  |  Branch (317:9): [True: 0, False: 0]
  ------------------
  318|      0|        return adp->obj;
  319|       |
  320|      0|    ERR_raise(ERR_LIB_OBJ, OBJ_R_UNKNOWN_NID);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  321|      0|    return NULL;
  322|      0|}
OBJ_nid2sn:
  325|  42.3k|{
  326|  42.3k|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  327|       |
  328|  42.3k|    return ob == NULL ? NULL : ob->sn;
  ------------------
  |  Branch (328:12): [True: 0, False: 42.3k]
  ------------------
  329|  42.3k|}
OBJ_nid2ln:
  332|   109k|{
  333|   109k|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  334|       |
  335|   109k|    return ob == NULL ? NULL : ob->ln;
  ------------------
  |  Branch (335:12): [True: 0, False: 109k]
  ------------------
  336|   109k|}
OBJ_obj2txt:
  437|   113k|{
  438|   113k|    int i, n = 0, len, nid, first, use_bn;
  439|   113k|    BIGNUM *bl;
  440|   113k|    unsigned long l;
  441|   113k|    const unsigned char *p;
  442|   113k|    char tbuf[DECIMAL_SIZE(i) + DECIMAL_SIZE(l) + 2];
  443|   113k|    const char *s;
  444|       |
  445|       |    /* Ensure that, at every state, |buf| is NUL-terminated. */
  446|   113k|    if (buf != NULL && buf_len > 0)
  ------------------
  |  Branch (446:9): [True: 113k, False: 0]
  |  Branch (446:24): [True: 113k, False: 0]
  ------------------
  447|   113k|        buf[0] = '\0';
  448|       |
  449|   113k|    if (a == NULL || a->data == NULL)
  ------------------
  |  Branch (449:9): [True: 0, False: 113k]
  |  Branch (449:22): [True: 1, False: 113k]
  ------------------
  450|      1|        return 0;
  451|       |
  452|   113k|    if (!no_name && (nid = OBJ_obj2nid(a)) != NID_undef) {
  ------------------
  |  |   18|   113k|#define NID_undef                       0
  ------------------
  |  Branch (452:9): [True: 113k, False: 210]
  |  Branch (452:21): [True: 109k, False: 4.07k]
  ------------------
  453|   109k|        s = OBJ_nid2ln(nid);
  454|   109k|        if (s == NULL)
  ------------------
  |  Branch (454:13): [True: 0, False: 109k]
  ------------------
  455|      0|            s = OBJ_nid2sn(nid);
  456|   109k|        if (s != NULL) {
  ------------------
  |  Branch (456:13): [True: 109k, False: 0]
  ------------------
  457|   109k|            if (buf != NULL)
  ------------------
  |  Branch (457:17): [True: 109k, False: 0]
  ------------------
  458|   109k|                OPENSSL_strlcpy(buf, s, buf_len);
  459|   109k|            return (int)strlen(s);
  460|   109k|        }
  461|   109k|    }
  462|       |
  463|  4.28k|    len = a->length;
  464|  4.28k|    p = a->data;
  465|       |
  466|  4.28k|    first = 1;
  467|  4.28k|    bl = NULL;
  468|       |
  469|       |    /*
  470|       |     * RFC 2578 (STD 58) says this about OBJECT IDENTIFIERs:
  471|       |     *
  472|       |     * > 3.5. OBJECT IDENTIFIER values
  473|       |     * >
  474|       |     * > An OBJECT IDENTIFIER value is an ordered list of non-negative
  475|       |     * > numbers. For the SMIv2, each number in the list is referred to as a
  476|       |     * > sub-identifier, there are at most 128 sub-identifiers in a value,
  477|       |     * > and each sub-identifier has a maximum value of 2^32-1 (4294967295
  478|       |     * > decimal).
  479|       |     *
  480|       |     * So a legitimate OID according to this RFC is at most (32 * 128 / 7),
  481|       |     * i.e. 586 bytes long.
  482|       |     *
  483|       |     * Ref: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5
  484|       |     */
  485|  4.28k|    if (len > 586)
  ------------------
  |  Branch (485:9): [True: 1, False: 4.28k]
  ------------------
  486|      1|        goto err;
  487|       |
  488|  39.7k|    while (len > 0) {
  ------------------
  |  Branch (488:12): [True: 35.4k, False: 4.28k]
  ------------------
  489|  35.4k|        l = 0;
  490|  35.4k|        use_bn = 0;
  491|  91.4k|        for (;;) {
  492|  91.4k|            unsigned char c = *p++;
  493|       |
  494|  91.4k|            len--;
  495|  91.4k|            if (len == 0 && (c & 0x80) != 0)
  ------------------
  |  Branch (495:17): [True: 4.28k, False: 87.1k]
  |  Branch (495:29): [True: 0, False: 4.28k]
  ------------------
  496|      0|                goto err;
  497|  91.4k|            if (use_bn) {
  ------------------
  |  Branch (497:17): [True: 16.2k, False: 75.1k]
  ------------------
  498|  16.2k|                if (!BN_add_word(bl, c & 0x7f))
  ------------------
  |  Branch (498:21): [True: 0, False: 16.2k]
  ------------------
  499|      0|                    goto err;
  500|  75.1k|            } else {
  501|  75.1k|                l |= c & 0x7f;
  502|  75.1k|            }
  503|  91.4k|            if ((c & 0x80) == 0)
  ------------------
  |  Branch (503:17): [True: 35.4k, False: 55.9k]
  ------------------
  504|  35.4k|                break;
  505|  55.9k|            if (!use_bn && l > (ULONG_MAX >> 7L)) {
  ------------------
  |  Branch (505:17): [True: 43.2k, False: 12.7k]
  |  Branch (505:28): [True: 3.52k, False: 39.7k]
  ------------------
  506|  3.52k|                if (bl == NULL && (bl = BN_new()) == NULL)
  ------------------
  |  Branch (506:21): [True: 1.64k, False: 1.88k]
  |  Branch (506:35): [True: 0, False: 1.64k]
  ------------------
  507|      0|                    goto err;
  508|  3.52k|                if (!BN_set_word(bl, l))
  ------------------
  |  Branch (508:21): [True: 0, False: 3.52k]
  ------------------
  509|      0|                    goto err;
  510|  3.52k|                use_bn = 1;
  511|  3.52k|            }
  512|  55.9k|            if (use_bn) {
  ------------------
  |  Branch (512:17): [True: 16.2k, False: 39.7k]
  ------------------
  513|  16.2k|                if (!BN_lshift(bl, bl, 7))
  ------------------
  |  Branch (513:21): [True: 0, False: 16.2k]
  ------------------
  514|      0|                    goto err;
  515|  39.7k|            } else {
  516|  39.7k|                l <<= 7L;
  517|  39.7k|            }
  518|  55.9k|        }
  519|       |
  520|  35.4k|        if (first) {
  ------------------
  |  Branch (520:13): [True: 4.28k, False: 31.1k]
  ------------------
  521|  4.28k|            first = 0;
  522|  4.28k|            if (l >= 80) {
  ------------------
  |  Branch (522:17): [True: 2.27k, False: 2.00k]
  ------------------
  523|  2.27k|                i = 2;
  524|  2.27k|                if (use_bn) {
  ------------------
  |  Branch (524:21): [True: 1.53k, False: 739]
  ------------------
  525|  1.53k|                    if (!BN_sub_word(bl, 80))
  ------------------
  |  Branch (525:25): [True: 0, False: 1.53k]
  ------------------
  526|      0|                        goto err;
  527|  1.53k|                } else {
  528|    739|                    l -= 80;
  529|    739|                }
  530|  2.27k|            } else {
  531|  2.00k|                i = (int)(l / 40);
  532|  2.00k|                l -= (long)(i * 40);
  533|  2.00k|            }
  534|  4.28k|            if (buf != NULL && buf_len > 1) {
  ------------------
  |  Branch (534:17): [True: 4.28k, False: 0]
  |  Branch (534:32): [True: 4.28k, False: 0]
  ------------------
  535|  4.28k|                *buf++ = i + '0';
  536|  4.28k|                *buf = '\0';
  537|  4.28k|                buf_len--;
  538|  4.28k|            }
  539|  4.28k|            n++;
  540|  4.28k|        }
  541|       |
  542|  35.4k|        if (use_bn) {
  ------------------
  |  Branch (542:13): [True: 3.52k, False: 31.9k]
  ------------------
  543|  3.52k|            char *bndec;
  544|  3.52k|            bndec = BN_bn2dec(bl);
  545|  3.52k|            if (!bndec)
  ------------------
  |  Branch (545:17): [True: 0, False: 3.52k]
  ------------------
  546|      0|                goto err;
  547|  3.52k|            i = strlen(bndec);
  548|  3.52k|            if (buf != NULL) {
  ------------------
  |  Branch (548:17): [True: 3.52k, False: 0]
  ------------------
  549|  3.52k|                if (buf_len > 1) {
  ------------------
  |  Branch (549:21): [True: 3.11k, False: 415]
  ------------------
  550|  3.11k|                    *buf++ = '.';
  551|  3.11k|                    *buf = '\0';
  552|  3.11k|                    buf_len--;
  553|  3.11k|                }
  554|  3.52k|                OPENSSL_strlcpy(buf, bndec, buf_len);
  555|  3.52k|                if (i > buf_len) {
  ------------------
  |  Branch (555:21): [True: 1.46k, False: 2.06k]
  ------------------
  556|  1.46k|                    buf += buf_len;
  557|  1.46k|                    buf_len = 0;
  558|  2.06k|                } else {
  559|  2.06k|                    buf += i;
  560|  2.06k|                    buf_len -= i;
  561|  2.06k|                }
  562|  3.52k|            }
  563|  3.52k|            n++;
  564|  3.52k|            n += i;
  565|  3.52k|            OPENSSL_free(bndec);
  ------------------
  |  |  107|  3.52k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.52k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.52k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  566|  31.9k|        } else {
  567|  31.9k|            BIO_snprintf(tbuf, sizeof(tbuf), ".%lu", l);
  568|  31.9k|            i = strlen(tbuf);
  569|  31.9k|            if (buf && buf_len > 0) {
  ------------------
  |  Branch (569:17): [True: 31.9k, False: 0]
  |  Branch (569:24): [True: 14.3k, False: 17.6k]
  ------------------
  570|  14.3k|                OPENSSL_strlcpy(buf, tbuf, buf_len);
  571|  14.3k|                if (i > buf_len) {
  ------------------
  |  Branch (571:21): [True: 401, False: 13.9k]
  ------------------
  572|    401|                    buf += buf_len;
  573|    401|                    buf_len = 0;
  574|  13.9k|                } else {
  575|  13.9k|                    buf += i;
  576|  13.9k|                    buf_len -= i;
  577|  13.9k|                }
  578|  14.3k|            }
  579|  31.9k|            n += i;
  580|  31.9k|            l = 0;
  581|  31.9k|        }
  582|  35.4k|    }
  583|       |
  584|  4.28k|    BN_free(bl);
  585|  4.28k|    return n;
  586|       |
  587|      1| err:
  588|      1|    BN_free(bl);
  589|      1|    return -1;
  590|  4.28k|}
OBJ_bsearch_:
  660|  1.44M|{
  661|  1.44M|    return OBJ_bsearch_ex_(key, base, num, size, cmp, 0);
  662|  1.44M|}
OBJ_bsearch_ex_:
  668|  1.44M|{
  669|  1.44M|    const char *p = ossl_bsearch(key, base, num, size, cmp, flags);
  670|       |
  671|       |#ifdef CHARSET_EBCDIC
  672|       |    /*
  673|       |     * THIS IS A KLUDGE - Because the *_obj is sorted in ASCII order, and I
  674|       |     * don't have perl (yet), we revert to a *LINEAR* search when the object
  675|       |     * wasn't found in the binary search.
  676|       |     */
  677|       |    if (p == NULL) {
  678|       |        const char *base_ = base;
  679|       |        int l, h, i = 0, c = 0;
  680|       |
  681|       |        for (i = 0; i < num; ++i) {
  682|       |            p = &(base_[i * size]);
  683|       |            c = (*cmp) (key, p);
  684|       |            if (c == 0
  685|       |                || (c < 0 && (flags & OBJ_BSEARCH_VALUE_ON_NOMATCH)))
  686|       |                return p;
  687|       |        }
  688|       |    }
  689|       |#endif
  690|  1.44M|    return p;
  691|  1.44M|}
OBJ_length:
  806|  29.7k|{
  807|  29.7k|    if (obj == NULL)
  ------------------
  |  Branch (807:9): [True: 0, False: 29.7k]
  ------------------
  808|      0|        return 0;
  809|  29.7k|    return obj->length;
  810|  29.7k|}
OBJ_get0_data:
  813|    159|{
  814|    159|    if (obj == NULL)
  ------------------
  |  Branch (814:9): [True: 0, False: 159]
  ------------------
  815|      0|        return NULL;
  816|    159|    return obj->data;
  817|    159|}
OBJ_obj2nid:
  825|  1.81M|{
  826|  1.81M|    return ossl_obj_obj2nid(a, 1);
  827|  1.81M|}
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|   974k|{
   94|   974k|    if (!lock)
  ------------------
  |  Branch (94:9): [True: 0, False: 974k]
  ------------------
   95|      0|        return 1;
   96|   974k|    if (!ossl_init_added_lock())
  ------------------
  |  Branch (96:9): [True: 0, False: 974k]
  ------------------
   97|      0|        return 0;
   98|   974k|    return CRYPTO_THREAD_read_lock(ossl_obj_lock);
   99|   974k|}
obj_dat.c:ossl_init_added_lock:
   75|   974k|{
   76|   974k|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   77|       |    /* Make sure we've loaded config before checking for any "added" objects */
   78|   974k|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  455|   974k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
   79|   974k|#endif
   80|   974k|    return RUN_ONCE(&ossl_obj_lock_init, obj_lock_initialise);
  ------------------
  |  |  130|   974k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 974k, False: 0]
  |  |  ------------------
  ------------------
   81|   974k|}
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|   974k|{
  103|   974k|    if (lock)
  ------------------
  |  Branch (103:9): [True: 974k, False: 0]
  ------------------
  104|   974k|        CRYPTO_THREAD_unlock(ossl_obj_lock);
  105|   974k|}
obj_dat.c:ossl_obj_obj2nid:
  355|  1.81M|{
  356|  1.81M|    int nid = NID_undef;
  ------------------
  |  |   18|  1.81M|#define NID_undef                       0
  ------------------
  357|  1.81M|    const unsigned int *op;
  358|  1.81M|    ADDED_OBJ ad, *adp;
  359|       |
  360|  1.81M|    if (a == NULL)
  ------------------
  |  Branch (360:9): [True: 0, False: 1.81M]
  ------------------
  361|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  362|  1.81M|    if (a->nid != NID_undef)
  ------------------
  |  |   18|  1.81M|#define NID_undef                       0
  ------------------
  |  Branch (362:9): [True: 496k, False: 1.31M]
  ------------------
  363|   496k|        return a->nid;
  364|  1.31M|    if (a->length == 0)
  ------------------
  |  Branch (364:9): [True: 2.74k, False: 1.31M]
  ------------------
  365|  2.74k|        return NID_undef;
  ------------------
  |  |   18|  2.74k|#define NID_undef                       0
  ------------------
  366|       |
  367|  1.31M|    op = OBJ_bsearch_obj(&a, obj_objs, NUM_OBJ);
  ------------------
  |  | 5141|  1.31M|#define NUM_OBJ 1177
  ------------------
  368|  1.31M|    if (op != NULL)
  ------------------
  |  Branch (368:9): [True: 337k, False: 974k]
  ------------------
  369|   337k|        return nid_objs[*op].nid;
  370|   974k|    if (!ossl_obj_read_lock(lock)) {
  ------------------
  |  Branch (370:9): [True: 0, False: 974k]
  ------------------
  371|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  372|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  373|      0|    }
  374|   974k|    if (added != NULL) {
  ------------------
  |  Branch (374:9): [True: 0, False: 974k]
  ------------------
  375|      0|        ad.type = ADDED_DATA;
  ------------------
  |  |   30|      0|#define ADDED_DATA      0
  ------------------
  376|      0|        ad.obj = (ASN1_OBJECT *)a; /* casting away const is harmless here */
  377|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  378|      0|        if (adp != NULL)
  ------------------
  |  Branch (378:13): [True: 0, False: 0]
  ------------------
  379|      0|            nid = adp->obj->nid;
  380|      0|    }
  381|   974k|    ossl_obj_unlock(lock);
  382|   974k|    return nid;
  383|   974k|}
obj_dat.c:obj_cmp:
  339|  13.4M|{
  340|  13.4M|    int j;
  341|  13.4M|    const ASN1_OBJECT *a = *ap;
  342|  13.4M|    const ASN1_OBJECT *b = &nid_objs[*bp];
  343|       |
  344|  13.4M|    j = (a->length - b->length);
  345|  13.4M|    if (j)
  ------------------
  |  Branch (345:9): [True: 7.98M, False: 5.41M]
  ------------------
  346|  7.98M|        return j;
  347|  5.41M|    if (a->length == 0)
  ------------------
  |  Branch (347:9): [True: 0, False: 5.41M]
  ------------------
  348|      0|        return 0;
  349|  5.41M|    return memcmp(a->data, b->data, a->length);
  350|  5.41M|}

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|  1.20M|{
   18|  1.20M|    ASN1_OBJECT *r;
   19|       |
   20|  1.20M|    if (o == NULL)
  ------------------
  |  Branch (20:9): [True: 0, False: 1.20M]
  ------------------
   21|      0|        return NULL;
   22|       |    /* If object isn't dynamic it's an internal OID which is never freed */
   23|  1.20M|    if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC))
  ------------------
  |  |  110|  1.20M|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  |  Branch (23:9): [True: 2.76k, False: 1.20M]
  ------------------
   24|  2.76k|        return (ASN1_OBJECT *)o;
   25|       |
   26|  1.20M|    r = ASN1_OBJECT_new();
   27|  1.20M|    if (r == NULL) {
  ------------------
  |  Branch (27:9): [True: 0, False: 1.20M]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|  1.20M|    r->flags = o->flags | (ASN1_OBJECT_FLAG_DYNAMIC |
  ------------------
  |  |  110|  1.20M|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
   35|  1.20M|                           ASN1_OBJECT_FLAG_DYNAMIC_STRINGS |
  ------------------
  |  |  112|  1.20M|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
   36|  1.20M|                           ASN1_OBJECT_FLAG_DYNAMIC_DATA);
  ------------------
  |  |  113|  1.20M|# define ASN1_OBJECT_FLAG_DYNAMIC_DATA    0x08/* internal use */
  ------------------
   37|       |
   38|  1.20M|    if (o->length > 0 && (r->data = OPENSSL_memdup(o->data, o->length)) == NULL)
  ------------------
  |  |  109|  1.20M|        CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.20M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.20M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (38:9): [True: 1.20M, False: 0]
  |  Branch (38:26): [True: 0, False: 1.20M]
  ------------------
   39|      0|        goto err;
   40|       |
   41|  1.20M|    r->length = o->length;
   42|  1.20M|    r->nid = o->nid;
   43|       |
   44|  1.20M|    if (o->ln != NULL && (r->ln = OPENSSL_strdup(o->ln)) == NULL)
  ------------------
  |  |  111|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (44:9): [True: 0, False: 1.20M]
  |  Branch (44:26): [True: 0, False: 0]
  ------------------
   45|      0|        goto err;
   46|       |
   47|  1.20M|    if (o->sn != NULL && (r->sn = OPENSSL_strdup(o->sn)) == NULL)
  ------------------
  |  |  111|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (47:9): [True: 0, False: 1.20M]
  |  Branch (47:26): [True: 0, False: 0]
  ------------------
   48|      0|        goto err;
   49|       |
   50|  1.20M|    return r;
   51|      0| err:
   52|      0|    ASN1_OBJECT_free(r);
   53|      0|    return NULL;
   54|  1.20M|}

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|}

WPACKET_allocate_bytes:
   20|   172k|{
   21|   172k|    if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
  ------------------
  |  Branch (21:9): [True: 0, False: 172k]
  ------------------
   22|      0|        return 0;
   23|       |
   24|   172k|    pkt->written += len;
   25|   172k|    pkt->curr += len;
   26|   172k|    return 1;
   27|   172k|}
WPACKET_reserve_bytes:
   47|   172k|{
   48|       |    /* Internal API, so should not fail */
   49|   172k|    if (!ossl_assert(pkt->subs != NULL && len != 0))
  ------------------
  |  |   52|   345k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 172k, False: 0]
  |  |  |  Branch (52:43): [True: 172k, False: 0]
  |  |  ------------------
  |  |   53|   172k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (49:9): [True: 0, False: 172k]
  ------------------
   50|      0|        return 0;
   51|       |
   52|   172k|    if (pkt->maxsize - pkt->written < len)
  ------------------
  |  Branch (52:9): [True: 0, False: 172k]
  ------------------
   53|      0|        return 0;
   54|       |
   55|   172k|    if (pkt->buf != NULL && (pkt->buf->length - pkt->written < len)) {
  ------------------
  |  Branch (55:9): [True: 0, False: 172k]
  |  Branch (55:29): [True: 0, False: 0]
  ------------------
   56|      0|        size_t newlen;
   57|      0|        size_t reflen;
   58|       |
   59|      0|        reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
  ------------------
  |  Branch (59:18): [True: 0, False: 0]
  ------------------
   60|       |
   61|      0|        if (reflen > SIZE_MAX / 2) {
  ------------------
  |  Branch (61:13): [True: 0, False: 0]
  ------------------
   62|      0|            newlen = SIZE_MAX;
   63|      0|        } else {
   64|      0|            newlen = reflen * 2;
   65|      0|            if (newlen < DEFAULT_BUF_SIZE)
  ------------------
  |  |   17|      0|#define DEFAULT_BUF_SIZE    256
  ------------------
  |  Branch (65:17): [True: 0, False: 0]
  ------------------
   66|      0|                newlen = DEFAULT_BUF_SIZE;
  ------------------
  |  |   17|      0|#define DEFAULT_BUF_SIZE    256
  ------------------
   67|      0|        }
   68|      0|        if (BUF_MEM_grow(pkt->buf, newlen) == 0)
  ------------------
  |  Branch (68:13): [True: 0, False: 0]
  ------------------
   69|      0|            return 0;
   70|      0|    }
   71|   172k|    if (allocbytes != NULL) {
  ------------------
  |  Branch (71:9): [True: 172k, False: 0]
  ------------------
   72|   172k|        *allocbytes = WPACKET_get_curr(pkt);
   73|   172k|        if (pkt->endfirst && *allocbytes != NULL)
  ------------------
  |  Branch (73:13): [True: 0, False: 172k]
  |  Branch (73:30): [True: 0, False: 0]
  ------------------
   74|      0|            *allocbytes -= len;
   75|   172k|    }
   76|       |
   77|   172k|    return 1;
   78|   172k|}
WPACKET_init_null:
  180|  20.6k|{
  181|  20.6k|    pkt->staticbuf = NULL;
  182|  20.6k|    pkt->buf = NULL;
  183|  20.6k|    pkt->maxsize = maxmaxsize(lenbytes);
  184|  20.6k|    pkt->endfirst = 0;
  185|       |
  186|  20.6k|    return wpacket_intern_init_len(pkt, 0);
  187|  20.6k|}
WPACKET_close:
  335|  61.9k|{
  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|  61.9k|    if (pkt->subs == NULL || pkt->subs->parent == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 61.9k]
  |  Branch (340:30): [True: 0, False: 61.9k]
  ------------------
  341|      0|        return 0;
  342|       |
  343|  61.9k|    return wpacket_intern_close(pkt, pkt->subs, 1);
  344|  61.9k|}
WPACKET_finish:
  347|  20.6k|{
  348|  20.6k|    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|  20.6k|    if (pkt->subs == NULL || pkt->subs->parent != NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 20.6k]
  |  Branch (354:30): [True: 0, False: 20.6k]
  ------------------
  355|      0|        return 0;
  356|       |
  357|  20.6k|    ret = wpacket_intern_close(pkt, pkt->subs, 1);
  358|  20.6k|    if (ret) {
  ------------------
  |  Branch (358:9): [True: 20.6k, False: 0]
  ------------------
  359|  20.6k|        OPENSSL_free(pkt->subs);
  ------------------
  |  |  107|  20.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  20.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  20.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  360|  20.6k|        pkt->subs = NULL;
  361|  20.6k|    }
  362|       |
  363|  20.6k|    return ret;
  364|  20.6k|}
WPACKET_start_sub_packet_len__:
  367|  61.9k|{
  368|  61.9k|    WPACKET_SUB *sub;
  369|  61.9k|    unsigned char *lenchars;
  370|       |
  371|       |    /* Internal API, so should not fail */
  372|  61.9k|    if (!ossl_assert(pkt->subs != NULL))
  ------------------
  |  |   52|  61.9k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  61.9k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (372:9): [True: 0, False: 61.9k]
  ------------------
  373|      0|        return 0;
  374|       |
  375|       |    /* We don't support lenbytes greater than 0 when doing endfirst writing */
  376|  61.9k|    if (lenbytes > 0 && pkt->endfirst)
  ------------------
  |  Branch (376:9): [True: 0, False: 61.9k]
  |  Branch (376:25): [True: 0, False: 0]
  ------------------
  377|      0|        return 0;
  378|       |
  379|  61.9k|    if ((sub = OPENSSL_zalloc(sizeof(*sub))) == NULL)
  ------------------
  |  |   99|  61.9k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  61.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  61.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (379:9): [True: 0, False: 61.9k]
  ------------------
  380|      0|        return 0;
  381|       |
  382|  61.9k|    sub->parent = pkt->subs;
  383|  61.9k|    pkt->subs = sub;
  384|  61.9k|    sub->pwritten = pkt->written + lenbytes;
  385|  61.9k|    sub->lenbytes = lenbytes;
  386|       |
  387|  61.9k|    if (lenbytes == 0) {
  ------------------
  |  Branch (387:9): [True: 61.9k, False: 0]
  ------------------
  388|  61.9k|        sub->packet_len = 0;
  389|  61.9k|        return 1;
  390|  61.9k|    }
  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|  61.9k|{
  402|  61.9k|    return WPACKET_start_sub_packet_len__(pkt, 0);
  403|  61.9k|}
WPACKET_put_bytes__:
  406|   131k|{
  407|   131k|    unsigned char *data;
  408|       |
  409|       |    /* Internal API, so should not fail */
  410|   131k|    if (!ossl_assert(size <= sizeof(uint64_t))
  ------------------
  |  |   52|   262k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   262k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (410:9): [True: 0, False: 131k]
  ------------------
  411|   131k|            || !WPACKET_allocate_bytes(pkt, size, &data)
  ------------------
  |  Branch (411:16): [True: 0, False: 131k]
  ------------------
  412|   131k|            || !put_value(data, val, size))
  ------------------
  |  Branch (412:16): [True: 0, False: 131k]
  ------------------
  413|      0|        return 0;
  414|       |
  415|   131k|    return 1;
  416|   131k|}
WPACKET_get_total_written:
  487|  20.6k|{
  488|       |    /* Internal API, so should not fail */
  489|  20.6k|    if (!ossl_assert(written != NULL))
  ------------------
  |  |   52|  20.6k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  20.6k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (489:9): [True: 0, False: 20.6k]
  ------------------
  490|      0|        return 0;
  491|       |
  492|  20.6k|    *written = pkt->written;
  493|       |
  494|  20.6k|    return 1;
  495|  20.6k|}
WPACKET_get_length:
  498|  20.6k|{
  499|       |    /* Internal API, so should not fail */
  500|  20.6k|    if (!ossl_assert(pkt->subs != NULL && len != NULL))
  ------------------
  |  |   52|  41.2k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 20.6k, False: 0]
  |  |  |  Branch (52:43): [True: 20.6k, False: 0]
  |  |  ------------------
  |  |   53|  20.6k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (500:9): [True: 0, False: 20.6k]
  ------------------
  501|      0|        return 0;
  502|       |
  503|  20.6k|    *len = pkt->written - pkt->subs->pwritten;
  504|       |
  505|  20.6k|    return 1;
  506|  20.6k|}
WPACKET_get_curr:
  509|   172k|{
  510|   172k|    unsigned char *buf = GETBUF(pkt);
  ------------------
  |  |   40|   172k|#define GETBUF(p)   (((p)->staticbuf != NULL) \
  |  |  ------------------
  |  |  |  Branch (40:22): [True: 0, False: 172k]
  |  |  ------------------
  |  |   41|   172k|                     ? (p)->staticbuf \
  |  |   42|   172k|                     : ((p)->buf != NULL \
  |  |  ------------------
  |  |  |  Branch (42:25): [True: 0, False: 172k]
  |  |  ------------------
  |  |   43|   172k|                        ? (unsigned char *)(p)->buf->data \
  |  |   44|   172k|                        : NULL))
  ------------------
  511|       |
  512|   172k|    if (buf == NULL)
  ------------------
  |  Branch (512:9): [True: 172k, False: 0]
  ------------------
  513|   172k|        return NULL;
  514|       |
  515|      0|    if (pkt->endfirst)
  ------------------
  |  Branch (515:9): [True: 0, False: 0]
  ------------------
  516|      0|        return buf + pkt->maxsize - pkt->curr;
  517|       |
  518|      0|    return buf + pkt->curr;
  519|      0|}
WPACKET_is_null_buf:
  522|  20.6k|{
  523|  20.6k|    return pkt->buf == NULL && pkt->staticbuf == NULL;
  ------------------
  |  Branch (523:12): [True: 20.6k, False: 0]
  |  Branch (523:32): [True: 20.6k, False: 0]
  ------------------
  524|  20.6k|}
WPACKET_cleanup:
  527|      3|{
  528|      3|    WPACKET_SUB *sub, *parent;
  529|       |
  530|     11|    for (sub = pkt->subs; sub != NULL; sub = parent) {
  ------------------
  |  Branch (530:27): [True: 8, False: 3]
  ------------------
  531|      8|        parent = sub->parent;
  532|      8|        OPENSSL_free(sub);
  ------------------
  |  |  107|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  533|      8|    }
  534|      3|    pkt->subs = NULL;
  535|      3|}
packet.c:maxmaxsize:
   96|  20.6k|{
   97|  20.6k|    if (lenbytes >= sizeof(size_t) || lenbytes == 0)
  ------------------
  |  Branch (97:9): [True: 0, False: 20.6k]
  |  Branch (97:39): [True: 20.6k, False: 0]
  ------------------
   98|  20.6k|        return SIZE_MAX;
   99|       |
  100|      0|    return ((size_t)1 << (lenbytes * 8)) - 1 + lenbytes;
  101|  20.6k|}
packet.c:wpacket_intern_init_len:
  104|  20.6k|{
  105|  20.6k|    unsigned char *lenchars;
  106|       |
  107|  20.6k|    pkt->curr = 0;
  108|  20.6k|    pkt->written = 0;
  109|       |
  110|  20.6k|    if ((pkt->subs = OPENSSL_zalloc(sizeof(*pkt->subs))) == NULL)
  ------------------
  |  |   99|  20.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  20.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  20.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (110:9): [True: 0, False: 20.6k]
  ------------------
  111|      0|        return 0;
  112|       |
  113|  20.6k|    if (lenbytes == 0)
  ------------------
  |  Branch (113:9): [True: 20.6k, False: 0]
  ------------------
  114|  20.6k|        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);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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|  82.5k|{
  252|  82.5k|    size_t packlen = pkt->written - sub->pwritten;
  253|       |
  254|  82.5k|    if (packlen == 0
  ------------------
  |  Branch (254:9): [True: 0, False: 82.5k]
  ------------------
  255|  82.5k|            && (sub->flags & WPACKET_FLAGS_NON_ZERO_LENGTH) != 0)
  ------------------
  |  |  686|      0|#define WPACKET_FLAGS_NON_ZERO_LENGTH           1
  ------------------
  |  Branch (255:16): [True: 0, False: 0]
  ------------------
  256|      0|        return 0;
  257|       |
  258|  82.5k|    if (packlen == 0
  ------------------
  |  Branch (258:9): [True: 0, False: 82.5k]
  ------------------
  259|  82.5k|            && sub->flags & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) {
  ------------------
  |  |  692|      0|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
  ------------------
  |  Branch (259:16): [True: 0, False: 0]
  ------------------
  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|  82.5k|    if (sub->lenbytes > 0) {
  ------------------
  |  Branch (276:9): [True: 0, False: 82.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|  82.5k|    } else if (pkt->endfirst && sub->parent != NULL
  ------------------
  |  Branch (293:16): [True: 0, False: 82.5k]
  |  Branch (293:33): [True: 0, False: 0]
  ------------------
  294|  82.5k|               && (packlen != 0
  ------------------
  |  Branch (294:20): [True: 0, False: 0]
  ------------------
  295|      0|                   || (sub->flags
  ------------------
  |  Branch (295:23): [True: 0, False: 0]
  ------------------
  296|      0|                       & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) == 0)) {
  ------------------
  |  |  692|      0|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
  ------------------
  297|      0|        size_t tmplen = packlen;
  298|      0|        size_t numlenbytes = 1;
  299|       |
  300|      0|        while ((tmplen = tmplen >> 8) > 0)
  ------------------
  |  Branch (300:16): [True: 0, False: 0]
  ------------------
  301|      0|            numlenbytes++;
  302|      0|        if (!WPACKET_put_bytes__(pkt, packlen, numlenbytes))
  ------------------
  |  Branch (302:13): [True: 0, False: 0]
  ------------------
  303|      0|            return 0;
  304|      0|        if (packlen > 0x7f) {
  ------------------
  |  Branch (304:13): [True: 0, False: 0]
  ------------------
  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|      0|    }
  310|       |
  311|  82.5k|    if (doclose) {
  ------------------
  |  Branch (311:9): [True: 82.5k, False: 0]
  ------------------
  312|  82.5k|        pkt->subs = sub->parent;
  313|  82.5k|        OPENSSL_free(sub);
  ------------------
  |  |  107|  82.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  82.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  82.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  314|  82.5k|    }
  315|       |
  316|  82.5k|    return 1;
  317|  82.5k|}
packet.c:put_value:
  212|   131k|{
  213|   131k|    if (data == NULL)
  ------------------
  |  Branch (213:9): [True: 131k, False: 0]
  ------------------
  214|   131k|        return 1;
  215|       |
  216|      0|    for (data += len - 1; len > 0; len--) {
  ------------------
  |  Branch (216:27): [True: 0, False: 0]
  ------------------
  217|      0|        *data = (unsigned char)(value & 0xff);
  218|      0|        data--;
  219|      0|        value >>= 8;
  220|      0|    }
  221|       |
  222|       |    /* Check whether we could fit the value in the assigned number of bytes */
  223|      0|    if (value > 0)
  ------------------
  |  Branch (223:9): [True: 0, False: 0]
  ------------------
  224|      0|        return 0;
  225|       |
  226|      0|    return 1;
  227|      0|}

ossl_param_build_set_int:
   24|   104k|{
   25|   104k|    if (bld != NULL)
  ------------------
  |  Branch (25:9): [True: 0, False: 104k]
  ------------------
   26|      0|        return OSSL_PARAM_BLD_push_int(bld, key, num);
   27|   104k|    p = OSSL_PARAM_locate(p, key);
   28|   104k|    if (p != NULL)
  ------------------
  |  Branch (28:9): [True: 0, False: 104k]
  ------------------
   29|      0|        return OSSL_PARAM_set_int(p, num);
   30|   104k|    return 1;
   31|   104k|}
ossl_param_build_set_long:
   35|  1.12k|{
   36|  1.12k|    if (bld != NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 1.12k]
  ------------------
   37|      0|        return OSSL_PARAM_BLD_push_long(bld, key, num);
   38|  1.12k|    p = OSSL_PARAM_locate(p, key);
   39|  1.12k|    if (p != NULL)
  ------------------
  |  Branch (39:9): [True: 0, False: 1.12k]
  ------------------
   40|      0|        return OSSL_PARAM_set_long(p, num);
   41|  1.12k|    return 1;
   42|  1.12k|}
ossl_param_build_set_utf8_string:
   46|  97.8k|{
   47|  97.8k|    if (bld != NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 97.8k]
  ------------------
   48|      0|        return OSSL_PARAM_BLD_push_utf8_string(bld, key, buf, 0);
   49|  97.8k|    p = OSSL_PARAM_locate(p, key);
   50|  97.8k|    if (p != NULL)
  ------------------
  |  Branch (50:9): [True: 0, False: 97.8k]
  ------------------
   51|      0|        return OSSL_PARAM_set_utf8_string(p, buf);
   52|  97.8k|    return 1;
   53|  97.8k|}
ossl_param_build_set_octet_string:
   59|    387|{
   60|    387|    if (bld != NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 387]
  ------------------
   61|      0|        return OSSL_PARAM_BLD_push_octet_string(bld, key, data, data_len);
   62|       |
   63|    387|    p = OSSL_PARAM_locate(p, key);
   64|    387|    if (p != NULL)
  ------------------
  |  Branch (64:9): [True: 0, False: 387]
  ------------------
   65|      0|        return OSSL_PARAM_set_octet_string(p, data, data_len);
   66|    387|    return 1;
   67|    387|}
ossl_param_build_set_bn:
   88|  34.8k|{
   89|  34.8k|    if (bld != NULL)
  ------------------
  |  Branch (89:9): [True: 0, False: 34.8k]
  ------------------
   90|      0|        return OSSL_PARAM_BLD_push_BN(bld, key, bn);
   91|       |
   92|  34.8k|    p = OSSL_PARAM_locate(p, key);
   93|  34.8k|    if (p != NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 34.8k]
  ------------------
   94|      0|        return OSSL_PARAM_set_BN(p, bn) > 0;
   95|  34.8k|    return 1;
   96|  34.8k|}

OSSL_PARAM_locate:
   54|   983k|{
   55|   983k|    if (p != NULL && key != NULL)
  ------------------
  |  Branch (55:9): [True: 983k, False: 0]
  |  Branch (55:22): [True: 983k, False: 0]
  ------------------
   56|  3.15M|        for (; p->key != NULL; p++)
  ------------------
  |  Branch (56:16): [True: 2.55M, False: 601k]
  ------------------
   57|  2.55M|            if (strcmp(key, p->key) == 0)
  ------------------
  |  Branch (57:17): [True: 382k, False: 2.17M]
  ------------------
   58|   382k|                return p;
   59|   601k|    return NULL;
   60|   983k|}
OSSL_PARAM_locate_const:
   63|   479k|{
   64|   479k|    return OSSL_PARAM_locate((OSSL_PARAM *)p, key);
   65|   479k|}
OSSL_PARAM_modified:
   81|      2|{
   82|      2|    return p != NULL && p->return_size != OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|      2|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
  |  Branch (82:12): [True: 2, False: 0]
  |  Branch (82:25): [True: 2, False: 0]
  ------------------
   83|      2|}
OSSL_PARAM_get_int:
  256|      9|{
  257|      9|#ifndef OPENSSL_SMALL_FOOTPRINT
  258|      9|    switch (sizeof(int)) {
  ------------------
  |  Branch (258:13): [Folded - Ignored]
  ------------------
  259|      9|    case sizeof(int32_t):
  ------------------
  |  Branch (259:5): [True: 9, False: 0]
  ------------------
  260|      9|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
  261|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (261:5): [True: 0, False: 9]
  ------------------
  262|      0|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
  263|      9|    }
  264|      0|#endif
  265|      0|    return general_get_int(p, val, sizeof(*val));
  266|      9|}
OSSL_PARAM_set_int:
  269|  89.6k|{
  270|  89.6k|#ifndef OPENSSL_SMALL_FOOTPRINT
  271|  89.6k|    switch (sizeof(int)) {
  ------------------
  |  Branch (271:13): [Folded - Ignored]
  ------------------
  272|  89.6k|    case sizeof(int32_t):
  ------------------
  |  Branch (272:5): [True: 89.6k, False: 0]
  ------------------
  273|  89.6k|        return OSSL_PARAM_set_int32(p, (int32_t)val);
  274|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (274:5): [True: 0, False: 89.6k]
  ------------------
  275|      0|        return OSSL_PARAM_set_int64(p, (int64_t)val);
  276|  89.6k|    }
  277|      0|#endif
  278|      0|    return general_set_int(p, &val, sizeof(val));
  279|  89.6k|}
OSSL_PARAM_construct_int:
  282|   173k|{
  283|   173k|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(int));
  ------------------
  |  |  106|   173k|# define OSSL_PARAM_INTEGER              1
  ------------------
  284|   173k|}
OSSL_PARAM_get_uint:
  287|      2|{
  288|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  289|      2|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (289:13): [Folded - Ignored]
  ------------------
  290|      2|    case sizeof(uint32_t):
  ------------------
  |  Branch (290:5): [True: 2, False: 0]
  ------------------
  291|      2|        return OSSL_PARAM_get_uint32(p, (uint32_t *)val);
  292|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (292:5): [True: 0, False: 2]
  ------------------
  293|      0|        return OSSL_PARAM_get_uint64(p, (uint64_t *)val);
  294|      2|    }
  295|      0|#endif
  296|      0|    return general_get_uint(p, val, sizeof(*val));
  297|      2|}
OSSL_PARAM_set_uint:
  300|  7.74k|{
  301|  7.74k|#ifndef OPENSSL_SMALL_FOOTPRINT
  302|  7.74k|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (302:13): [Folded - Ignored]
  ------------------
  303|  7.74k|    case sizeof(uint32_t):
  ------------------
  |  Branch (303:5): [True: 7.74k, False: 0]
  ------------------
  304|  7.74k|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
  305|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (305:5): [True: 0, False: 7.74k]
  ------------------
  306|      0|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
  307|  7.74k|    }
  308|      0|#endif
  309|      0|    return general_set_uint(p, &val, sizeof(val));
  310|  7.74k|}
OSSL_PARAM_construct_uint:
  313|  7.75k|{
  314|  7.75k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|  7.75k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  315|  7.75k|                                sizeof(unsigned int));
  316|  7.75k|}
OSSL_PARAM_get_int32:
  382|      9|{
  383|      9|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (383:9): [True: 0, False: 9]
  |  Branch (383:24): [True: 0, False: 9]
  ------------------
  384|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  385|      0|        return 0;
  386|      0|    }
  387|       |
  388|      9|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      9|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (388:9): [True: 2, False: 7]
  ------------------
  389|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  390|      2|        int64_t i64;
  391|       |
  392|      2|        switch (p->data_size) {
  ------------------
  |  Branch (392:17): [True: 0, False: 2]
  ------------------
  393|      2|        case sizeof(int32_t):
  ------------------
  |  Branch (393:9): [True: 2, False: 0]
  ------------------
  394|      2|            *val = *(const int32_t *)p->data;
  395|      2|            return 1;
  396|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (396:9): [True: 0, False: 2]
  ------------------
  397|      0|            i64 = *(const int64_t *)p->data;
  398|      0|            if (i64 >= INT32_MIN && i64 <= INT32_MAX) {
  ------------------
  |  Branch (398:17): [True: 0, False: 0]
  |  Branch (398:37): [True: 0, False: 0]
  ------------------
  399|      0|                *val = (int32_t)i64;
  400|      0|                return 1;
  401|      0|            }
  402|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  403|      0|            return 0;
  404|      2|        }
  405|      0|#endif
  406|      0|        return general_get_int(p, val, sizeof(*val));
  407|       |
  408|      7|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      7|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (408:16): [True: 7, False: 0]
  ------------------
  409|      7|#ifndef OPENSSL_SMALL_FOOTPRINT
  410|      7|        uint32_t u32;
  411|      7|        uint64_t u64;
  412|       |
  413|      7|        switch (p->data_size) {
  ------------------
  |  Branch (413:17): [True: 0, False: 7]
  ------------------
  414|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (414:9): [True: 0, False: 7]
  ------------------
  415|      0|            u32 = *(const uint32_t *)p->data;
  416|      0|            if (u32 <= INT32_MAX) {
  ------------------
  |  Branch (416:17): [True: 0, False: 0]
  ------------------
  417|      0|                *val = (int32_t)u32;
  418|      0|                return 1;
  419|      0|            }
  420|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  421|      0|            return 0;
  422|      7|        case sizeof(uint64_t):
  ------------------
  |  Branch (422:9): [True: 7, False: 0]
  ------------------
  423|      7|            u64 = *(const uint64_t *)p->data;
  424|      7|            if (u64 <= INT32_MAX) {
  ------------------
  |  Branch (424:17): [True: 7, False: 0]
  ------------------
  425|      7|                *val = (int32_t)u64;
  426|      7|                return 1;
  427|      7|            }
  428|      0|            err_out_of_range;
  ------------------
  |  |   25|      7|    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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  429|      0|            return 0;
  430|      7|        }
  431|      0|#endif
  432|      0|        return general_get_int(p, val, sizeof(*val));
  433|       |
  434|      7|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (434:16): [True: 0, False: 0]
  ------------------
  435|      0|#ifndef OPENSSL_SYS_UEFI
  436|      0|        double d;
  437|       |
  438|      0|        switch (p->data_size) {
  ------------------
  |  Branch (438:17): [True: 0, False: 0]
  ------------------
  439|      0|        case sizeof(double):
  ------------------
  |  Branch (439:9): [True: 0, False: 0]
  ------------------
  440|      0|            d = *(const double *)p->data;
  441|      0|            if (d >= INT32_MIN && d <= INT32_MAX && d == (int32_t)d) {
  ------------------
  |  Branch (441:17): [True: 0, False: 0]
  |  Branch (441:35): [True: 0, False: 0]
  |  Branch (441:53): [True: 0, False: 0]
  ------------------
  442|      0|                *val = (int32_t)d;
  443|      0|                return 1;
  444|      0|            }
  445|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  446|      0|            return 0;
  447|      0|        }
  448|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  449|      0|        return 0;
  450|      0|#endif
  451|      0|    }
  452|      0|    err_bad_type;
  ------------------
  |  |   35|      9|    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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  453|      0|    return 0;
  454|      9|}
OSSL_PARAM_set_int32:
  457|  89.6k|{
  458|  89.6k|    uint32_t u32;
  459|  89.6k|    unsigned int shift;
  460|       |
  461|  89.6k|    if (p == NULL) {
  ------------------
  |  Branch (461:9): [True: 0, False: 89.6k]
  ------------------
  462|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|      0|        return 0;
  464|      0|    }
  465|  89.6k|    p->return_size = 0;
  466|  89.6k|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  89.6k|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (466:9): [True: 89.6k, False: 5]
  ------------------
  467|  89.6k|#ifndef OPENSSL_SMALL_FOOTPRINT
  468|  89.6k|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  469|  89.6k|        if (p->data == NULL)
  ------------------
  |  Branch (469:13): [True: 0, False: 89.6k]
  ------------------
  470|      0|            return 1;
  471|  89.6k|        switch (p->data_size) {
  ------------------
  |  Branch (471:17): [True: 0, False: 89.6k]
  ------------------
  472|  89.6k|        case sizeof(int32_t):
  ------------------
  |  Branch (472:9): [True: 89.6k, False: 0]
  ------------------
  473|  89.6k|            *(int32_t *)p->data = val;
  474|  89.6k|            return 1;
  475|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (475:9): [True: 0, False: 89.6k]
  ------------------
  476|      0|            p->return_size = sizeof(int64_t);
  477|      0|            *(int64_t *)p->data = (int64_t)val;
  478|      0|            return 1;
  479|  89.6k|        }
  480|      0|#endif
  481|      0|        return general_set_int(p, &val, sizeof(val));
  482|  89.6k|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER && val >= 0) {
  ------------------
  |  |  107|     10|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (482:16): [True: 5, False: 0]
  |  Branch (482:63): [True: 5, False: 0]
  ------------------
  483|      5|#ifndef OPENSSL_SMALL_FOOTPRINT
  484|      5|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  485|      5|        if (p->data == NULL)
  ------------------
  |  Branch (485:13): [True: 0, False: 5]
  ------------------
  486|      0|            return 1;
  487|      5|        switch (p->data_size) {
  ------------------
  |  Branch (487:17): [True: 0, False: 5]
  ------------------
  488|      5|        case sizeof(uint32_t):
  ------------------
  |  Branch (488:9): [True: 5, False: 0]
  ------------------
  489|      5|            *(uint32_t *)p->data = (uint32_t)val;
  490|      5|            return 1;
  491|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (491:9): [True: 0, False: 5]
  ------------------
  492|      0|            p->return_size = sizeof(uint64_t);
  493|      0|            *(uint64_t *)p->data = (uint64_t)val;
  494|      0|            return 1;
  495|      5|        }
  496|      0|#endif
  497|      0|        return general_set_int(p, &val, sizeof(val));
  498|      5|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (498:16): [True: 0, False: 0]
  ------------------
  499|      0|#ifndef OPENSSL_SYS_UEFI
  500|      0|        p->return_size = sizeof(double);
  501|      0|        if (p->data == NULL)
  ------------------
  |  Branch (501:13): [True: 0, False: 0]
  ------------------
  502|      0|            return 1;
  503|      0|        switch (p->data_size) {
  ------------------
  |  Branch (503:17): [True: 0, False: 0]
  ------------------
  504|      0|        case sizeof(double):
  ------------------
  |  Branch (504:9): [True: 0, False: 0]
  ------------------
  505|      0|            shift = real_shift();
  506|      0|            if (shift < 8 * sizeof(val) - 1) {
  ------------------
  |  Branch (506:17): [True: 0, False: 0]
  ------------------
  507|      0|                u32 = val < 0 ? -val : val;
  ------------------
  |  Branch (507:23): [True: 0, False: 0]
  ------------------
  508|      0|                if ((u32 >> shift) != 0) {
  ------------------
  |  Branch (508:21): [True: 0, False: 0]
  ------------------
  509|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  510|      0|                    return 0;
  511|      0|                }
  512|      0|            }
  513|      0|            *(double *)p->data = (double)val;
  514|      0|            return 1;
  515|      0|        }
  516|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  517|      0|        return 0;
  518|      0|#endif
  519|      0|    }
  520|      0|    err_bad_type;
  ------------------
  |  |   35|  89.6k|    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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  521|      0|    return 0;
  522|  89.6k|}
OSSL_PARAM_get_uint32:
  531|      2|{
  532|      2|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (532:9): [True: 0, False: 2]
  |  Branch (532:24): [True: 0, False: 2]
  ------------------
  533|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  534|      0|        return 0;
  535|      0|    }
  536|       |
  537|      2|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      2|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (537:9): [True: 2, False: 0]
  ------------------
  538|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  539|      2|        uint64_t u64;
  540|       |
  541|      2|        switch (p->data_size) {
  ------------------
  |  Branch (541:17): [True: 0, False: 2]
  ------------------
  542|      2|        case sizeof(uint32_t):
  ------------------
  |  Branch (542:9): [True: 2, False: 0]
  ------------------
  543|      2|            *val = *(const uint32_t *)p->data;
  544|      2|            return 1;
  545|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (545:9): [True: 0, False: 2]
  ------------------
  546|      0|            u64 = *(const uint64_t *)p->data;
  547|      0|            if (u64 <= UINT32_MAX) {
  ------------------
  |  Branch (547:17): [True: 0, False: 0]
  ------------------
  548|      0|                *val = (uint32_t)u64;
  549|      0|                return 1;
  550|      0|            }
  551|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  552|      0|            return 0;
  553|      2|        }
  554|      0|#endif
  555|      0|        return general_get_uint(p, val, sizeof(*val));
  556|      2|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (556:16): [True: 0, False: 0]
  ------------------
  557|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  558|      0|        int32_t i32;
  559|      0|        int64_t i64;
  560|       |
  561|      0|        switch (p->data_size) {
  ------------------
  |  Branch (561:17): [True: 0, False: 0]
  ------------------
  562|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (562:9): [True: 0, False: 0]
  ------------------
  563|      0|            i32 = *(const int32_t *)p->data;
  564|      0|            if (i32 >= 0) {
  ------------------
  |  Branch (564:17): [True: 0, False: 0]
  ------------------
  565|      0|                *val = i32;
  566|      0|                return 1;
  567|      0|            }
  568|      0|            err_unsigned_negative;
  ------------------
  |  |   22|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   23|      0|              CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  569|      0|            return 0;
  570|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (570:9): [True: 0, False: 0]
  ------------------
  571|      0|            i64 = *(const int64_t *)p->data;
  572|      0|            if (i64 >= 0 && i64 <= UINT32_MAX) {
  ------------------
  |  Branch (572:17): [True: 0, False: 0]
  |  Branch (572:29): [True: 0, False: 0]
  ------------------
  573|      0|                *val = (uint32_t)i64;
  574|      0|                return 1;
  575|      0|            }
  576|      0|            if (i64 < 0)
  ------------------
  |  Branch (576:17): [True: 0, False: 0]
  ------------------
  577|      0|                err_unsigned_negative;
  ------------------
  |  |   22|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   23|      0|              CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  578|      0|            else
  579|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  580|      0|            return 0;
  581|      0|        }
  582|      0|#endif
  583|      0|        return general_get_uint(p, val, sizeof(*val));
  584|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (584:16): [True: 0, False: 0]
  ------------------
  585|      0|#ifndef OPENSSL_SYS_UEFI
  586|      0|        double d;
  587|       |
  588|      0|        switch (p->data_size) {
  ------------------
  |  Branch (588:17): [True: 0, False: 0]
  ------------------
  589|      0|        case sizeof(double):
  ------------------
  |  Branch (589:9): [True: 0, False: 0]
  ------------------
  590|      0|            d = *(const double *)p->data;
  591|      0|            if (d >= 0 && d <= UINT32_MAX && d == (uint32_t)d) {
  ------------------
  |  Branch (591:17): [True: 0, False: 0]
  |  Branch (591:27): [True: 0, False: 0]
  |  Branch (591:46): [True: 0, False: 0]
  ------------------
  592|      0|                *val = (uint32_t)d;
  593|      0|                return 1;
  594|      0|            }
  595|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  596|      0|            return 0;
  597|      0|        }
  598|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  599|      0|        return 0;
  600|      0|#endif
  601|      0|    }
  602|      0|    err_bad_type;
  ------------------
  |  |   35|      2|    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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|      0|    return 0;
  604|      2|}
OSSL_PARAM_set_uint32:
  607|  7.74k|{
  608|  7.74k|    unsigned int shift;
  609|       |
  610|  7.74k|    if (p == NULL) {
  ------------------
  |  Branch (610:9): [True: 0, False: 7.74k]
  ------------------
  611|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  612|      0|        return 0;
  613|      0|    }
  614|  7.74k|    p->return_size = 0;
  615|       |
  616|  7.74k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  7.74k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (616:9): [True: 7.74k, False: 0]
  ------------------
  617|  7.74k|#ifndef OPENSSL_SMALL_FOOTPRINT
  618|  7.74k|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  619|  7.74k|        if (p->data == NULL)
  ------------------
  |  Branch (619:13): [True: 0, False: 7.74k]
  ------------------
  620|      0|            return 1;
  621|  7.74k|        switch (p->data_size) {
  ------------------
  |  Branch (621:17): [True: 0, False: 7.74k]
  ------------------
  622|  7.74k|        case sizeof(uint32_t):
  ------------------
  |  Branch (622:9): [True: 7.74k, False: 0]
  ------------------
  623|  7.74k|            *(uint32_t *)p->data = val;
  624|  7.74k|            return 1;
  625|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (625:9): [True: 0, False: 7.74k]
  ------------------
  626|      0|            p->return_size = sizeof(uint64_t);
  627|      0|            *(uint64_t *)p->data = val;
  628|      0|            return 1;
  629|  7.74k|        }
  630|      0|#endif
  631|      0|        return general_set_uint(p, &val, sizeof(val));
  632|  7.74k|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (632:16): [True: 0, False: 0]
  ------------------
  633|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  634|      0|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  635|      0|        if (p->data == NULL)
  ------------------
  |  Branch (635:13): [True: 0, False: 0]
  ------------------
  636|      0|            return 1;
  637|      0|        switch (p->data_size) {
  ------------------
  |  Branch (637:17): [True: 0, False: 0]
  ------------------
  638|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (638:9): [True: 0, False: 0]
  ------------------
  639|      0|            if (val <= INT32_MAX) {
  ------------------
  |  Branch (639:17): [True: 0, False: 0]
  ------------------
  640|      0|                *(int32_t *)p->data = (int32_t)val;
  641|      0|                return 1;
  642|      0|            }
  643|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  644|      0|            return 0;
  645|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (645:9): [True: 0, False: 0]
  ------------------
  646|      0|            p->return_size = sizeof(int64_t);
  647|      0|            *(int64_t *)p->data = (int64_t)val;
  648|      0|            return 1;
  649|      0|        }
  650|      0|#endif
  651|      0|        return general_set_uint(p, &val, sizeof(val));
  652|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (652:16): [True: 0, False: 0]
  ------------------
  653|      0|#ifndef OPENSSL_SYS_UEFI
  654|      0|        p->return_size = sizeof(double);
  655|      0|        if (p->data == NULL)
  ------------------
  |  Branch (655:13): [True: 0, False: 0]
  ------------------
  656|      0|            return 1;
  657|      0|        switch (p->data_size) {
  ------------------
  |  Branch (657:17): [True: 0, False: 0]
  ------------------
  658|      0|        case sizeof(double):
  ------------------
  |  Branch (658:9): [True: 0, False: 0]
  ------------------
  659|      0|            shift = real_shift();
  660|      0|            if (shift < 8 * sizeof(val) && (val >> shift) != 0) {
  ------------------
  |  Branch (660:17): [True: 0, False: 0]
  |  Branch (660:44): [True: 0, False: 0]
  ------------------
  661|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  662|      0|                return 0;
  663|      0|            }
  664|      0|            *(double *)p->data = (double)val;
  665|      0|            return 1;
  666|      0|        }
  667|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  668|      0|        return 0;
  669|      0|#endif
  670|      0|    }
  671|      0|    err_bad_type;
  ------------------
  |  |   35|  7.74k|    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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  672|      0|    return 0;
  673|  7.74k|}
OSSL_PARAM_get_int64:
  682|      2|{
  683|      2|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (683:9): [True: 0, False: 2]
  |  Branch (683:24): [True: 0, False: 2]
  ------------------
  684|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  685|      0|        return 0;
  686|      0|    }
  687|       |
  688|      2|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      2|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (688:9): [True: 2, False: 0]
  ------------------
  689|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  690|      2|        switch (p->data_size) {
  ------------------
  |  Branch (690:17): [True: 0, False: 2]
  ------------------
  691|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (691:9): [True: 0, False: 2]
  ------------------
  692|      0|            *val = *(const int32_t *)p->data;
  693|      0|            return 1;
  694|      2|        case sizeof(int64_t):
  ------------------
  |  Branch (694:9): [True: 2, False: 0]
  ------------------
  695|      2|            *val = *(const int64_t *)p->data;
  696|      2|            return 1;
  697|      2|        }
  698|      0|#endif
  699|      0|        return general_get_int(p, val, sizeof(*val));
  700|      2|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (700:16): [True: 0, False: 0]
  ------------------
  701|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  702|      0|        uint64_t u64;
  703|       |
  704|      0|        switch (p->data_size) {
  ------------------
  |  Branch (704:17): [True: 0, False: 0]
  ------------------
  705|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (705:9): [True: 0, False: 0]
  ------------------
  706|      0|            *val = *(const uint32_t *)p->data;
  707|      0|            return 1;
  708|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (708:9): [True: 0, False: 0]
  ------------------
  709|      0|            u64 = *(const uint64_t *)p->data;
  710|      0|            if (u64 <= INT64_MAX) {
  ------------------
  |  Branch (710:17): [True: 0, False: 0]
  ------------------
  711|      0|                *val = (int64_t)u64;
  712|      0|                return 1;
  713|      0|            }
  714|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  715|      0|            return 0;
  716|      0|        }
  717|      0|#endif
  718|      0|        return general_get_int(p, val, sizeof(*val));
  719|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (719:16): [True: 0, False: 0]
  ------------------
  720|      0|#ifndef OPENSSL_SYS_UEFI
  721|      0|        double d;
  722|       |
  723|      0|        switch (p->data_size) {
  ------------------
  |  Branch (723:17): [True: 0, False: 0]
  ------------------
  724|      0|        case sizeof(double):
  ------------------
  |  Branch (724:9): [True: 0, False: 0]
  ------------------
  725|      0|            d = *(const double *)p->data;
  726|      0|            if (d >= INT64_MIN
  ------------------
  |  Branch (726:17): [True: 0, False: 0]
  ------------------
  727|       |                    /*
  728|       |                     * By subtracting 65535 (2^16-1) we cancel the low order
  729|       |                     * 15 bits of INT64_MAX to avoid using imprecise floating
  730|       |                     * point values.
  731|       |                     */
  732|      0|                    && d < (double)(INT64_MAX - 65535) + 65536.0
  ------------------
  |  Branch (732:24): [True: 0, False: 0]
  ------------------
  733|      0|                    && d == (int64_t)d) {
  ------------------
  |  Branch (733:24): [True: 0, False: 0]
  ------------------
  734|      0|                *val = (int64_t)d;
  735|      0|                return 1;
  736|      0|            }
  737|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  738|      0|            return 0;
  739|      0|        }
  740|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  741|      0|        return 0;
  742|      0|#endif
  743|      0|    }
  744|      0|    err_bad_type;
  ------------------
  |  |   35|      2|    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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|      0|    return 0;
  746|      2|}
OSSL_PARAM_set_uint64:
  899|  8.06k|{
  900|  8.06k|    if (p == NULL) {
  ------------------
  |  Branch (900:9): [True: 0, False: 8.06k]
  ------------------
  901|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  902|      0|        return 0;
  903|      0|    }
  904|  8.06k|    p->return_size = 0;
  905|       |
  906|  8.06k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  8.06k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (906:9): [True: 8.06k, False: 0]
  ------------------
  907|  8.06k|#ifndef OPENSSL_SMALL_FOOTPRINT
  908|  8.06k|        p->return_size = sizeof(uint64_t); /* Expected size */
  909|  8.06k|        if (p->data == NULL)
  ------------------
  |  Branch (909:13): [True: 0, False: 8.06k]
  ------------------
  910|      0|            return 1;
  911|  8.06k|        switch (p->data_size) {
  ------------------
  |  Branch (911:17): [True: 0, False: 8.06k]
  ------------------
  912|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (912:9): [True: 0, False: 8.06k]
  ------------------
  913|      0|            if (val <= UINT32_MAX) {
  ------------------
  |  Branch (913:17): [True: 0, False: 0]
  ------------------
  914|      0|                p->return_size = sizeof(uint32_t);
  915|      0|                *(uint32_t *)p->data = (uint32_t)val;
  916|      0|                return 1;
  917|      0|            }
  918|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  919|      0|            return 0;
  920|  8.06k|        case sizeof(uint64_t):
  ------------------
  |  Branch (920:9): [True: 8.06k, False: 0]
  ------------------
  921|  8.06k|            *(uint64_t *)p->data = val;
  922|  8.06k|            return 1;
  923|  8.06k|        }
  924|      0|#endif
  925|      0|        return general_set_uint(p, &val, sizeof(val));
  926|  8.06k|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (926:16): [True: 0, False: 0]
  ------------------
  927|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  928|      0|        p->return_size = sizeof(int64_t); /* Expected size */
  929|      0|        if (p->data == NULL)
  ------------------
  |  Branch (929:13): [True: 0, False: 0]
  ------------------
  930|      0|            return 1;
  931|      0|        switch (p->data_size) {
  ------------------
  |  Branch (931:17): [True: 0, False: 0]
  ------------------
  932|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (932:9): [True: 0, False: 0]
  ------------------
  933|      0|            if (val <= INT32_MAX) {
  ------------------
  |  Branch (933:17): [True: 0, False: 0]
  ------------------
  934|      0|                p->return_size = sizeof(int32_t);
  935|      0|                *(int32_t *)p->data = (int32_t)val;
  936|      0|                return 1;
  937|      0|            }
  938|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  939|      0|            return 0;
  940|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (940:9): [True: 0, False: 0]
  ------------------
  941|      0|            if (val <= INT64_MAX) {
  ------------------
  |  Branch (941:17): [True: 0, False: 0]
  ------------------
  942|      0|                *(int64_t *)p->data = (int64_t)val;
  943|      0|                return 1;
  944|      0|            }
  945|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  946|      0|            return 0;
  947|      0|        }
  948|      0|#endif
  949|      0|        return general_set_uint(p, &val, sizeof(val));
  950|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (950:16): [True: 0, False: 0]
  ------------------
  951|      0|#ifndef OPENSSL_SYS_UEFI
  952|      0|        p->return_size = sizeof(double);
  953|      0|        switch (p->data_size) {
  ------------------
  |  Branch (953:17): [True: 0, False: 0]
  ------------------
  954|      0|        case sizeof(double):
  ------------------
  |  Branch (954:9): [True: 0, False: 0]
  ------------------
  955|      0|            if ((val >> real_shift()) == 0) {
  ------------------
  |  Branch (955:17): [True: 0, False: 0]
  ------------------
  956|      0|                *(double *)p->data = (double)val;
  957|      0|                return 1;
  958|      0|            }
  959|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  960|      0|            return 0;
  961|      0|        }
  962|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  963|      0|        return 0;
  964|      0|#endif
  965|      0|    }
  966|      0|    err_bad_type;
  ------------------
  |  |   35|  8.06k|    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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  967|      0|    return 0;
  968|  8.06k|}
OSSL_PARAM_set_size_t:
  990|  8.06k|{
  991|  8.06k|#ifndef OPENSSL_SMALL_FOOTPRINT
  992|  8.06k|    switch (sizeof(size_t)) {
  ------------------
  |  Branch (992:13): [Folded - Ignored]
  ------------------
  993|      0|    case sizeof(uint32_t):
  ------------------
  |  Branch (993:5): [True: 0, False: 8.06k]
  ------------------
  994|      0|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
  995|  8.06k|    case sizeof(uint64_t):
  ------------------
  |  Branch (995:5): [True: 8.06k, False: 0]
  ------------------
  996|  8.06k|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
  997|  8.06k|    }
  998|      0|#endif
  999|      0|    return general_set_uint(p, &val, sizeof(val));
 1000|  8.06k|}
OSSL_PARAM_construct_size_t:
 1003|  8.06k|{
 1004|  8.06k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|  8.06k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
 1005|  8.06k|                                sizeof(size_t));
 1006|  8.06k|}
OSSL_PARAM_get_time_t:
 1009|      2|{
 1010|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
 1011|      2|    switch (sizeof(time_t)) {
  ------------------
  |  Branch (1011:13): [Folded - Ignored]
  ------------------
 1012|      0|    case sizeof(int32_t):
  ------------------
  |  Branch (1012:5): [True: 0, False: 2]
  ------------------
 1013|      0|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
 1014|      2|    case sizeof(int64_t):
  ------------------
  |  Branch (1014:5): [True: 2, False: 0]
  ------------------
 1015|      2|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
 1016|      2|    }
 1017|      0|#endif
 1018|      0|    return general_get_int(p, val, sizeof(*val));
 1019|      2|}
OSSL_PARAM_construct_time_t:
 1035|      2|{
 1036|      2|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(time_t));
  ------------------
  |  |  106|      2|# define OSSL_PARAM_INTEGER              1
  ------------------
 1037|      2|}
OSSL_PARAM_get_utf8_string:
 1327|  84.0k|{
 1328|  84.0k|    int ret = get_string_internal(p, (void **)val, &max_len, NULL,
 1329|  84.0k|                                  OSSL_PARAM_UTF8_STRING);
  ------------------
  |  |  117|  84.0k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1330|       |
 1331|       |    /*
 1332|       |     * We try to ensure that the copied string is terminated with a
 1333|       |     * NUL byte.  That should be easy, just place a NUL byte at
 1334|       |     * |((char*)*val)[p->data_size]|.
 1335|       |     * Unfortunately, we have seen cases where |p->data_size| doesn't
 1336|       |     * correctly reflect the length of the string, and just happens
 1337|       |     * to be out of bounds according to |max_len|, so in that case, we
 1338|       |     * make the extra step of trying to find the true length of the
 1339|       |     * string that |p->data| points at, and use that as an index to
 1340|       |     * place the NUL byte in |*val|.
 1341|       |     */
 1342|  84.0k|    size_t data_length = p->data_size;
 1343|       |
 1344|  84.0k|    if (ret == 0)
  ------------------
  |  Branch (1344:9): [True: 0, False: 84.0k]
  ------------------
 1345|      0|        return 0;
 1346|  84.0k|    if (data_length >= max_len)
  ------------------
  |  Branch (1346:9): [True: 0, False: 84.0k]
  ------------------
 1347|      0|        data_length = OPENSSL_strnlen(p->data, data_length);
 1348|  84.0k|    if (data_length >= max_len) {
  ------------------
  |  Branch (1348:9): [True: 0, False: 84.0k]
  ------------------
 1349|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1350|      0|        return 0;            /* No space for a terminating NUL byte */
 1351|      0|    }
 1352|  84.0k|    (*val)[data_length] = '\0';
 1353|       |
 1354|  84.0k|    return ret;
 1355|  84.0k|}
OSSL_PARAM_construct_utf8_string:
 1419|   138k|{
 1420|   138k|    if (buf != NULL && bsize == 0)
  ------------------
  |  Branch (1420:9): [True: 138k, False: 0]
  |  Branch (1420:24): [True: 138k, False: 0]
  ------------------
 1421|   138k|        bsize = strlen(buf);
 1422|   138k|    return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize);
  ------------------
  |  |  117|   138k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1423|   138k|}
OSSL_PARAM_construct_octet_string:
 1427|  84.0k|{
 1428|  84.0k|    return ossl_param_construct(key, OSSL_PARAM_OCTET_STRING, buf, bsize);
  ------------------
  |  |  123|  84.0k|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
 1429|  84.0k|}
OSSL_PARAM_get_utf8_ptr:
 1449|   108k|{
 1450|   108k|    return get_ptr_internal(p, (const void **)val, NULL, OSSL_PARAM_UTF8_PTR);
  ------------------
  |  |  141|   108k|# define OSSL_PARAM_UTF8_PTR             6
  ------------------
 1451|   108k|}
OSSL_PARAM_construct_end:
 1612|   113k|{
 1613|   113k|    OSSL_PARAM end = OSSL_PARAM_END;
  ------------------
  |  |   25|   113k|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1614|       |
 1615|   113k|    return end;
 1616|   113k|}
OSSL_PARAM_get_utf8_string_ptr:
 1636|   108k|{
 1637|   108k|    int rv;
 1638|       |
 1639|   108k|    ERR_set_mark();
 1640|   108k|    rv = OSSL_PARAM_get_utf8_ptr(p, val);
 1641|   108k|    ERR_pop_to_mark();
 1642|       |
 1643|   108k|    return rv || get_string_ptr_internal(p, (const void **)val, NULL,
  ------------------
  |  Branch (1643:12): [True: 0, False: 108k]
  |  Branch (1643:18): [True: 108k, False: 0]
  ------------------
 1644|   108k|                                         OSSL_PARAM_UTF8_STRING);
  ------------------
  |  |  117|   108k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1645|   108k|}
params.c:ossl_param_construct:
   69|   412k|{
   70|   412k|    OSSL_PARAM res;
   71|       |
   72|   412k|    res.key = key;
   73|   412k|    res.data_type = data_type;
   74|   412k|    res.data = data;
   75|   412k|    res.data_size = data_size;
   76|   412k|    res.return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|   412k|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
   77|   412k|    return res;
   78|   412k|}
params.c:get_string_internal:
 1279|  84.0k|{
 1280|  84.0k|    size_t sz, alloc_sz;
 1281|       |
 1282|  84.0k|    if ((val == NULL && used_len == NULL) || p == NULL) {
  ------------------
  |  Branch (1282:10): [True: 0, False: 84.0k]
  |  Branch (1282:25): [True: 0, False: 0]
  |  Branch (1282:46): [True: 0, False: 84.0k]
  ------------------
 1283|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1284|      0|        return 0;
 1285|      0|    }
 1286|  84.0k|    if (p->data_type != type) {
  ------------------
  |  Branch (1286:9): [True: 0, False: 84.0k]
  ------------------
 1287|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1288|      0|        return 0;
 1289|      0|    }
 1290|       |
 1291|  84.0k|    sz = p->data_size;
 1292|       |    /*
 1293|       |     * If the input size is 0, or the input string needs NUL byte
 1294|       |     * termination, allocate an extra byte.
 1295|       |     */
 1296|  84.0k|    alloc_sz = sz + (type == OSSL_PARAM_UTF8_STRING || sz == 0);
  ------------------
  |  |  117|   168k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (1296:22): [True: 84.0k, False: 0]
  |  Branch (1296:56): [True: 0, False: 0]
  ------------------
 1297|       |
 1298|  84.0k|    if (used_len != NULL)
  ------------------
  |  Branch (1298:9): [True: 0, False: 84.0k]
  ------------------
 1299|      0|        *used_len = sz;
 1300|       |
 1301|  84.0k|    if (p->data == NULL) {
  ------------------
  |  Branch (1301:9): [True: 0, False: 84.0k]
  ------------------
 1302|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1303|      0|        return 0;
 1304|      0|    }
 1305|       |
 1306|  84.0k|    if (val == NULL)
  ------------------
  |  Branch (1306:9): [True: 0, False: 84.0k]
  ------------------
 1307|      0|        return 1;
 1308|       |
 1309|  84.0k|    if (*val == NULL) {
  ------------------
  |  Branch (1309:9): [True: 84.0k, False: 0]
  ------------------
 1310|  84.0k|        char *const q = OPENSSL_malloc(alloc_sz);
  ------------------
  |  |   97|  84.0k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  84.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  84.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1311|       |
 1312|  84.0k|        if (q == NULL)
  ------------------
  |  Branch (1312:13): [True: 0, False: 84.0k]
  ------------------
 1313|      0|            return 0;
 1314|  84.0k|        *val = q;
 1315|  84.0k|        *max_len = alloc_sz;
 1316|  84.0k|    }
 1317|       |
 1318|  84.0k|    if (*max_len < sz) {
  ------------------
  |  Branch (1318:9): [True: 0, False: 84.0k]
  ------------------
 1319|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1320|      0|        return 0;
 1321|      0|    }
 1322|  84.0k|    memcpy(*val, p->data, sz);
 1323|  84.0k|    return 1;
 1324|  84.0k|}
params.c:get_ptr_internal:
 1433|   108k|{
 1434|   108k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (1434:9): [True: 0, False: 108k]
  |  Branch (1434:24): [True: 0, False: 108k]
  ------------------
 1435|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1436|      0|        return 0;
 1437|      0|    }
 1438|   108k|    if (p->data_type != type) {
  ------------------
  |  Branch (1438:9): [True: 108k, False: 0]
  ------------------
 1439|   108k|        err_bad_type;
  ------------------
  |  |   35|   108k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|   108k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|   108k|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|   108k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|   108k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|   108k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|   108k|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|   108k|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1440|   108k|        return 0;
 1441|   108k|    }
 1442|      0|    if (used_len != NULL)
  ------------------
  |  Branch (1442:9): [True: 0, False: 0]
  ------------------
 1443|      0|        *used_len = p->data_size;
 1444|      0|    *val = *(const void **)p->data;
 1445|      0|    return 1;
 1446|   108k|}
params.c:get_string_ptr_internal:
 1620|   108k|{
 1621|   108k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (1621:9): [True: 0, False: 108k]
  |  Branch (1621:24): [True: 0, False: 108k]
  ------------------
 1622|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1623|      0|        return 0;
 1624|      0|    }
 1625|   108k|    if (p->data_type != type) {
  ------------------
  |  Branch (1625:9): [True: 0, False: 108k]
  ------------------
 1626|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1627|      0|        return 0;
 1628|      0|    }
 1629|   108k|    if (used_len != NULL)
  ------------------
  |  Branch (1629:9): [True: 0, False: 108k]
  ------------------
 1630|      0|        *used_len = p->data_size;
 1631|   108k|    *val = p->data;
 1632|   108k|    return 1;
 1633|   108k|}

ossl_pw_clear_passphrase_data:
   17|  59.7k|{
   18|  59.7k|    if (data != NULL) {
  ------------------
  |  Branch (18:9): [True: 59.7k, False: 0]
  ------------------
   19|  59.7k|        if (data->type == is_expl_passphrase)
  ------------------
  |  Branch (19:13): [True: 0, False: 59.7k]
  ------------------
   20|      0|            OPENSSL_clear_free(data->_.expl_passphrase.passphrase_copy,
  ------------------
  |  |  105|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   21|  59.7k|                               data->_.expl_passphrase.passphrase_len);
   22|  59.7k|        ossl_pw_clear_passphrase_cache(data);
   23|  59.7k|        memset(data, 0, sizeof(*data));
   24|  59.7k|    }
   25|  59.7k|}
ossl_pw_clear_passphrase_cache:
   28|   114k|{
   29|   114k|    OPENSSL_clear_free(data->cached_passphrase, data->cached_passphrase_len);
  ------------------
  |  |  105|   114k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   114k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   114k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   30|   114k|    data->cached_passphrase = NULL;
   31|   114k|}
ossl_pw_enable_passphrase_caching:
   95|  54.6k|{
   96|  54.6k|    data->flag_cache_passphrase = 1;
   97|  54.6k|    return 1;
   98|  54.6k|}

ossl_err_load_PEM_strings:
   68|      2|{
   69|      2|#ifndef OPENSSL_NO_ERR
   70|      2|    if (ERR_reason_error_string(PEM_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (70:9): [True: 2, False: 0]
  ------------------
   71|      2|        ERR_load_strings_const(PEM_str_reasons);
   72|      2|#endif
   73|      2|    return 1;
   74|      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|}

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

ossl_ctx_global_properties_free:
  112|      2|{
  113|      2|    OSSL_GLOBAL_PROPERTIES *globp = vglobp;
  114|       |
  115|      2|    if (globp != NULL) {
  ------------------
  |  Branch (115:9): [True: 2, False: 0]
  ------------------
  116|      2|        ossl_property_free(globp->list);
  117|      2|        OPENSSL_free(globp);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  118|      2|    }
  119|      2|}
ossl_ctx_global_properties_new:
  122|      2|{
  123|      2|    return OPENSSL_zalloc(sizeof(OSSL_GLOBAL_PROPERTIES));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  124|      2|}
ossl_ctx_global_properties:
  128|      5|{
  129|      5|    OSSL_GLOBAL_PROPERTIES *globp;
  130|       |
  131|      5|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  132|      5|    if (loadconfig && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  455|      0|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (132:9): [True: 0, False: 5]
  |  Branch (132:23): [True: 0, False: 0]
  ------------------
  133|      0|        return NULL;
  134|      5|#endif
  135|      5|    globp = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_GLOBAL_PROPERTIES);
  ------------------
  |  |  114|      5|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  136|       |
  137|      5|    return globp != NULL ? &globp->list : NULL;
  ------------------
  |  Branch (137:12): [True: 5, False: 0]
  ------------------
  138|      5|}
ossl_method_store_new:
  241|      8|{
  242|      8|    OSSL_METHOD_STORE *res;
  243|       |
  244|      8|    res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |   99|      8|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  245|      8|    if (res != NULL) {
  ------------------
  |  Branch (245:9): [True: 8, False: 0]
  ------------------
  246|      8|        res->ctx = ctx;
  247|      8|        if ((res->algs = ossl_sa_ALGORITHM_new()) == NULL
  ------------------
  |  Branch (247:13): [True: 0, False: 8]
  ------------------
  248|      8|            || (res->lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (248:16): [True: 0, False: 8]
  ------------------
  249|      8|            || (res->biglock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (249:16): [True: 0, False: 8]
  ------------------
  250|      0|            ossl_method_store_free(res);
  251|      0|            return NULL;
  252|      0|        }
  253|      8|    }
  254|      8|    return res;
  255|      8|}
ossl_method_store_free:
  258|      8|{
  259|      8|    if (store != NULL) {
  ------------------
  |  Branch (259:9): [True: 8, False: 0]
  ------------------
  260|      8|        if (store->algs != NULL)
  ------------------
  |  Branch (260:13): [True: 8, False: 0]
  ------------------
  261|      8|            ossl_sa_ALGORITHM_doall_arg(store->algs, &alg_cleanup, store);
  262|      8|        ossl_sa_ALGORITHM_free(store->algs);
  263|      8|        CRYPTO_THREAD_lock_free(store->lock);
  264|      8|        CRYPTO_THREAD_lock_free(store->biglock);
  265|      8|        OPENSSL_free(store);
  ------------------
  |  |  107|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  266|      8|    }
  267|      8|}
ossl_method_lock_store:
  270|  1.75k|{
  271|  1.75k|    return store != NULL ? CRYPTO_THREAD_write_lock(store->biglock) : 0;
  ------------------
  |  Branch (271:12): [True: 1.75k, False: 0]
  ------------------
  272|  1.75k|}
ossl_method_unlock_store:
  275|  1.75k|{
  276|  1.75k|    return store != NULL ? CRYPTO_THREAD_unlock(store->biglock) : 0;
  ------------------
  |  Branch (276:12): [True: 1.75k, False: 0]
  ------------------
  277|  1.75k|}
ossl_method_store_add:
  293|    220|{
  294|    220|    ALGORITHM *alg = NULL;
  295|    220|    IMPLEMENTATION *impl;
  296|    220|    int ret = 0;
  297|    220|    int i;
  298|       |
  299|    220|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (299:9): [True: 0, False: 220]
  |  Branch (299:21): [True: 0, False: 220]
  |  Branch (299:39): [True: 0, False: 220]
  ------------------
  300|      0|        return 0;
  301|    220|    if (properties == NULL)
  ------------------
  |  Branch (301:9): [True: 0, False: 220]
  ------------------
  302|      0|        properties = "";
  303|       |
  304|    220|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|    220|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    220|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (304:9): [True: 0, False: 220]
  ------------------
  305|      0|        return 0;
  306|       |
  307|       |    /* Create new entry */
  308|    220|    impl = OPENSSL_malloc(sizeof(*impl));
  ------------------
  |  |   97|    220|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    220|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    220|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  309|    220|    if (impl == NULL)
  ------------------
  |  Branch (309:9): [True: 0, False: 220]
  ------------------
  310|      0|        return 0;
  311|    220|    impl->method.method = method;
  312|    220|    impl->method.up_ref = method_up_ref;
  313|    220|    impl->method.free = method_destruct;
  314|    220|    if (!ossl_method_up_ref(&impl->method)) {
  ------------------
  |  Branch (314:9): [True: 0, False: 220]
  ------------------
  315|      0|        OPENSSL_free(impl);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  316|      0|        return 0;
  317|      0|    }
  318|    220|    impl->provider = prov;
  319|       |
  320|       |    /* Insert into the hash table if required */
  321|    220|    if (!ossl_property_write_lock(store)) {
  ------------------
  |  Branch (321:9): [True: 0, False: 220]
  ------------------
  322|      0|        OPENSSL_free(impl);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  323|      0|        return 0;
  324|      0|    }
  325|    220|    ossl_method_cache_flush(store, nid);
  326|    220|    if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) {
  ------------------
  |  Branch (326:9): [True: 16, False: 204]
  ------------------
  327|     16|        impl->properties = ossl_parse_property(store->ctx, properties);
  328|     16|        if (impl->properties == NULL)
  ------------------
  |  Branch (328:13): [True: 0, False: 16]
  ------------------
  329|      0|            goto err;
  330|     16|        if (!ossl_prop_defn_set(store->ctx, properties, &impl->properties)) {
  ------------------
  |  Branch (330:13): [True: 0, False: 16]
  ------------------
  331|      0|            ossl_property_free(impl->properties);
  332|      0|            impl->properties = NULL;
  333|      0|            goto err;
  334|      0|        }
  335|     16|    }
  336|       |
  337|    220|    alg = ossl_method_store_retrieve(store, nid);
  338|    220|    if (alg == NULL) {
  ------------------
  |  Branch (338:9): [True: 192, False: 28]
  ------------------
  339|    192|        if ((alg = OPENSSL_zalloc(sizeof(*alg))) == NULL
  ------------------
  |  |   99|    192|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    192|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    192|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (339:13): [True: 0, False: 192]
  ------------------
  340|    192|                || (alg->impls = sk_IMPLEMENTATION_new_null()) == NULL
  ------------------
  |  Branch (340:20): [True: 0, False: 192]
  ------------------
  341|    192|                || (alg->cache = lh_QUERY_new(&query_hash, &query_cmp)) == NULL)
  ------------------
  |  Branch (341:20): [True: 0, False: 192]
  ------------------
  342|      0|            goto err;
  343|    192|        alg->nid = nid;
  344|    192|        if (!ossl_method_store_insert(store, alg))
  ------------------
  |  Branch (344:13): [True: 0, False: 192]
  ------------------
  345|      0|            goto err;
  346|    192|    }
  347|       |
  348|       |    /* Push onto stack if there isn't one there already */
  349|    279|    for (i = 0; i < sk_IMPLEMENTATION_num(alg->impls); i++) {
  ------------------
  |  Branch (349:17): [True: 59, False: 220]
  ------------------
  350|     59|        const IMPLEMENTATION *tmpimpl = sk_IMPLEMENTATION_value(alg->impls, i);
  351|       |
  352|     59|        if (tmpimpl->provider == impl->provider
  ------------------
  |  Branch (352:13): [True: 59, False: 0]
  ------------------
  353|     59|            && tmpimpl->properties == impl->properties)
  ------------------
  |  Branch (353:16): [True: 0, False: 59]
  ------------------
  354|      0|            break;
  355|     59|    }
  356|    220|    if (i == sk_IMPLEMENTATION_num(alg->impls)
  ------------------
  |  Branch (356:9): [True: 220, False: 0]
  ------------------
  357|    220|        && sk_IMPLEMENTATION_push(alg->impls, impl))
  ------------------
  |  Branch (357:12): [True: 220, False: 0]
  ------------------
  358|    220|        ret = 1;
  359|    220|    ossl_property_unlock(store);
  360|    220|    if (ret == 0)
  ------------------
  |  Branch (360:9): [True: 0, False: 220]
  ------------------
  361|      0|        impl_free(impl);
  362|    220|    return ret;
  363|       |
  364|      0|err:
  365|      0|    ossl_property_unlock(store);
  366|      0|    alg_cleanup(0, alg, NULL);
  367|      0|    impl_free(impl);
  368|      0|    return 0;
  369|    220|}
ossl_method_store_do_all:
  484|  1.75k|{
  485|  1.75k|    struct alg_do_each_data_st data;
  486|       |
  487|  1.75k|    data.fn = fn;
  488|  1.75k|    data.fnarg = fnarg;
  489|  1.75k|    if (store != NULL)
  ------------------
  |  Branch (489:9): [True: 1.75k, False: 0]
  ------------------
  490|  1.75k|        ossl_sa_ALGORITHM_doall_arg(store->algs, alg_do_each, &data);
  491|  1.75k|}
ossl_method_store_fetch:
  496|      5|{
  497|      5|    OSSL_PROPERTY_LIST **plp;
  498|      5|    ALGORITHM *alg;
  499|      5|    IMPLEMENTATION *impl, *best_impl = NULL;
  500|      5|    OSSL_PROPERTY_LIST *pq = NULL, *p2 = NULL;
  501|      5|    const OSSL_PROVIDER *prov = prov_rw != NULL ? *prov_rw : NULL;
  ------------------
  |  Branch (501:33): [True: 5, False: 0]
  ------------------
  502|      5|    int ret = 0;
  503|      5|    int j, best = -1, score, optional;
  504|       |
  505|      5|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (505:9): [True: 0, False: 5]
  |  Branch (505:21): [True: 0, False: 5]
  |  Branch (505:39): [True: 0, False: 5]
  ------------------
  506|      0|        return 0;
  507|       |
  508|      5|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  509|      5|    if (ossl_lib_ctx_is_default(store->ctx)
  ------------------
  |  Branch (509:9): [True: 5, False: 0]
  ------------------
  510|      5|            && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  455|      5|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (510:16): [True: 0, False: 5]
  ------------------
  511|      0|        return 0;
  512|      5|#endif
  513|       |
  514|       |    /* This only needs to be a read lock, because the query won't create anything */
  515|      5|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (515:9): [True: 0, False: 5]
  ------------------
  516|      0|        return 0;
  517|      5|    alg = ossl_method_store_retrieve(store, nid);
  518|      5|    if (alg == NULL) {
  ------------------
  |  Branch (518:9): [True: 0, False: 5]
  ------------------
  519|      0|        ossl_property_unlock(store);
  520|      0|        return 0;
  521|      0|    }
  522|       |
  523|      5|    if (prop_query != NULL)
  ------------------
  |  Branch (523:9): [True: 5, False: 0]
  ------------------
  524|      5|        p2 = pq = ossl_parse_query(store->ctx, prop_query, 0);
  525|      5|    plp = ossl_ctx_global_properties(store->ctx, 0);
  526|      5|    if (plp != NULL && *plp != NULL) {
  ------------------
  |  Branch (526:9): [True: 5, False: 0]
  |  Branch (526:24): [True: 0, False: 5]
  ------------------
  527|      0|        if (pq == NULL) {
  ------------------
  |  Branch (527:13): [True: 0, False: 0]
  ------------------
  528|      0|            pq = *plp;
  529|      0|        } else {
  530|      0|            p2 = ossl_property_merge(pq, *plp);
  531|      0|            ossl_property_free(pq);
  532|      0|            if (p2 == NULL)
  ------------------
  |  Branch (532:17): [True: 0, False: 0]
  ------------------
  533|      0|                goto fin;
  534|      0|            pq = p2;
  535|      0|        }
  536|      0|    }
  537|       |
  538|      5|    if (pq == NULL) {
  ------------------
  |  Branch (538:9): [True: 0, False: 5]
  ------------------
  539|      0|        for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (539:21): [True: 0, False: 0]
  ------------------
  540|      0|            if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
  ------------------
  |  Branch (540:17): [True: 0, False: 0]
  ------------------
  541|      0|                && (prov == NULL || impl->provider == prov)) {
  ------------------
  |  Branch (541:21): [True: 0, False: 0]
  |  Branch (541:37): [True: 0, False: 0]
  ------------------
  542|      0|                best_impl = impl;
  543|      0|                ret = 1;
  544|      0|                break;
  545|      0|            }
  546|      0|        }
  547|      0|        goto fin;
  548|      0|    }
  549|      5|    optional = ossl_property_has_optional(pq);
  550|      5|    for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (550:17): [True: 5, False: 0]
  ------------------
  551|      5|        if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
  ------------------
  |  Branch (551:13): [True: 5, False: 0]
  ------------------
  552|      5|            && (prov == NULL || impl->provider == prov)) {
  ------------------
  |  Branch (552:17): [True: 5, False: 0]
  |  Branch (552:33): [True: 0, False: 0]
  ------------------
  553|      5|            score = ossl_property_match_count(pq, impl->properties);
  554|      5|            if (score > best) {
  ------------------
  |  Branch (554:17): [True: 5, False: 0]
  ------------------
  555|      5|                best_impl = impl;
  556|      5|                best = score;
  557|      5|                ret = 1;
  558|      5|                if (!optional)
  ------------------
  |  Branch (558:21): [True: 5, False: 0]
  ------------------
  559|      5|                    goto fin;
  560|      5|            }
  561|      5|        }
  562|      5|    }
  563|      5|fin:
  564|      5|    if (ret && ossl_method_up_ref(&best_impl->method)) {
  ------------------
  |  Branch (564:9): [True: 5, False: 0]
  |  Branch (564:16): [True: 5, False: 0]
  ------------------
  565|      5|        *method = best_impl->method.method;
  566|      5|        if (prov_rw != NULL)
  ------------------
  |  Branch (566:13): [True: 5, False: 0]
  ------------------
  567|      5|            *prov_rw = best_impl->provider;
  568|      5|    } else {
  569|      0|        ret = 0;
  570|      0|    }
  571|      5|    ossl_property_unlock(store);
  572|      5|    ossl_property_free(p2);
  573|      5|    return ret;
  574|      5|}
ossl_method_store_cache_get:
  674|  20.3k|{
  675|  20.3k|    ALGORITHM *alg;
  676|  20.3k|    QUERY elem, *r;
  677|  20.3k|    int res = 0;
  678|       |
  679|  20.3k|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (679:9): [True: 0, False: 20.3k]
  |  Branch (679:21): [True: 0, False: 20.3k]
  |  Branch (679:38): [True: 0, False: 20.3k]
  ------------------
  680|      0|        return 0;
  681|       |
  682|  20.3k|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (682:9): [True: 0, False: 20.3k]
  ------------------
  683|      0|        return 0;
  684|  20.3k|    alg = ossl_method_store_retrieve(store, nid);
  685|  20.3k|    if (alg == NULL)
  ------------------
  |  Branch (685:9): [True: 1, False: 20.3k]
  ------------------
  686|      1|        goto err;
  687|       |
  688|  20.3k|    elem.query = prop_query;
  689|  20.3k|    elem.provider = prov;
  690|  20.3k|    r = lh_QUERY_retrieve(alg->cache, &elem);
  691|  20.3k|    if (r == NULL)
  ------------------
  |  Branch (691:9): [True: 2, False: 20.3k]
  ------------------
  692|      2|        goto err;
  693|  20.3k|    if (ossl_method_up_ref(&r->method)) {
  ------------------
  |  Branch (693:9): [True: 20.3k, False: 0]
  ------------------
  694|  20.3k|        *method = r->method.method;
  695|  20.3k|        res = 1;
  696|  20.3k|    }
  697|  20.3k|err:
  698|  20.3k|    ossl_property_unlock(store);
  699|  20.3k|    return res;
  700|  20.3k|}
ossl_method_store_cache_set:
  706|      5|{
  707|      5|    QUERY elem, *old, *p = NULL;
  708|      5|    ALGORITHM *alg;
  709|      5|    size_t len;
  710|      5|    int res = 1;
  711|       |
  712|      5|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (712:9): [True: 0, False: 5]
  |  Branch (712:21): [True: 0, False: 5]
  |  Branch (712:38): [True: 0, False: 5]
  ------------------
  713|      0|        return 0;
  714|       |
  715|      5|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|      5|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      5|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (715:9): [True: 0, False: 5]
  ------------------
  716|      0|        return 0;
  717|       |
  718|      5|    if (!ossl_property_write_lock(store))
  ------------------
  |  Branch (718:9): [True: 0, False: 5]
  ------------------
  719|      0|        return 0;
  720|      5|    if (store->cache_need_flush)
  ------------------
  |  Branch (720:9): [True: 0, False: 5]
  ------------------
  721|      0|        ossl_method_cache_flush_some(store);
  722|      5|    alg = ossl_method_store_retrieve(store, nid);
  723|      5|    if (alg == NULL)
  ------------------
  |  Branch (723:9): [True: 0, False: 5]
  ------------------
  724|      0|        goto err;
  725|       |
  726|      5|    if (method == NULL) {
  ------------------
  |  Branch (726:9): [True: 0, False: 5]
  ------------------
  727|      0|        elem.query = prop_query;
  728|      0|        elem.provider = prov;
  729|      0|        if ((old = lh_QUERY_delete(alg->cache, &elem)) != NULL) {
  ------------------
  |  Branch (729:13): [True: 0, False: 0]
  ------------------
  730|      0|            impl_cache_free(old);
  731|      0|            store->cache_nelem--;
  732|      0|        }
  733|      0|        goto end;
  734|      0|    }
  735|      5|    p = OPENSSL_malloc(sizeof(*p) + (len = strlen(prop_query)));
  ------------------
  |  |   97|      5|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  736|      5|    if (p != NULL) {
  ------------------
  |  Branch (736:9): [True: 5, False: 0]
  ------------------
  737|      5|        p->query = p->body;
  738|      5|        p->provider = prov;
  739|      5|        p->method.method = method;
  740|      5|        p->method.up_ref = method_up_ref;
  741|      5|        p->method.free = method_destruct;
  742|      5|        if (!ossl_method_up_ref(&p->method))
  ------------------
  |  Branch (742:13): [True: 0, False: 5]
  ------------------
  743|      0|            goto err;
  744|      5|        memcpy((char *)p->query, prop_query, len + 1);
  745|      5|        if ((old = lh_QUERY_insert(alg->cache, p)) != NULL) {
  ------------------
  |  Branch (745:13): [True: 0, False: 5]
  ------------------
  746|      0|            impl_cache_free(old);
  747|      0|            goto end;
  748|      0|        }
  749|      5|        if (!lh_QUERY_error(alg->cache)) {
  ------------------
  |  Branch (749:13): [True: 5, False: 0]
  ------------------
  750|      5|            if (++store->cache_nelem >= IMPL_CACHE_FLUSH_THRESHOLD)
  ------------------
  |  |   33|      5|#define IMPL_CACHE_FLUSH_THRESHOLD  500
  ------------------
  |  Branch (750:17): [True: 0, False: 5]
  ------------------
  751|      0|                store->cache_need_flush = 1;
  752|      5|            goto end;
  753|      5|        }
  754|      0|        ossl_method_free(&p->method);
  755|      0|    }
  756|      0|err:
  757|      0|    res = 0;
  758|      0|    OPENSSL_free(p);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  759|      5|end:
  760|      5|    ossl_property_unlock(store);
  761|      5|    return res;
  762|      0|}
property.c:alg_cleanup:
  223|    192|{
  224|    192|    OSSL_METHOD_STORE *store = arg;
  225|       |
  226|    192|    if (a != NULL) {
  ------------------
  |  Branch (226:9): [True: 192, False: 0]
  ------------------
  227|    192|        sk_IMPLEMENTATION_pop_free(a->impls, &impl_free);
  228|    192|        lh_QUERY_doall(a->cache, &impl_cache_free);
  229|    192|        lh_QUERY_free(a->cache);
  230|    192|        OPENSSL_free(a);
  ------------------
  |  |  107|    192|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    192|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    192|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  231|    192|    }
  232|    192|    if (store != NULL)
  ------------------
  |  Branch (232:9): [True: 192, False: 0]
  ------------------
  233|    192|        ossl_sa_ALGORITHM_set(store->algs, idx, NULL);
  234|    192|}
property.c:ossl_method_up_ref:
  160|  20.5k|{
  161|  20.5k|    return (*method->up_ref)(method->method);
  162|  20.5k|}
property.c:ossl_property_write_lock:
  175|    225|{
  176|    225|    return p != NULL ? CRYPTO_THREAD_write_lock(p->lock) : 0;
  ------------------
  |  Branch (176:12): [True: 225, False: 0]
  ------------------
  177|    225|}
property.c:ossl_method_store_retrieve:
  280|  20.7k|{
  281|  20.7k|    return ossl_sa_ALGORITHM_get(store->algs, nid);
  282|  20.7k|}
property.c:query_hash:
  185|  20.3k|{
  186|  20.3k|    return OPENSSL_LH_strhash(a->query);
  187|  20.3k|}
property.c:query_cmp:
  190|  20.3k|{
  191|  20.3k|    int res = strcmp(a->query, b->query);
  192|       |
  193|  20.3k|    if (res == 0 && a->provider != NULL && b->provider != NULL)
  ------------------
  |  Branch (193:9): [True: 20.3k, False: 0]
  |  Branch (193:21): [True: 20.3k, False: 0]
  |  Branch (193:44): [True: 0, False: 20.3k]
  ------------------
  194|      0|        res = b->provider > a->provider ? 1
  ------------------
  |  Branch (194:15): [True: 0, False: 0]
  ------------------
  195|      0|            : b->provider < a->provider ? -1
  ------------------
  |  Branch (195:15): [True: 0, False: 0]
  ------------------
  196|      0|            : 0;
  197|  20.3k|    return res;
  198|  20.3k|}
property.c:ossl_method_store_insert:
  285|    192|{
  286|    192|    return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg);
  287|    192|}
property.c:ossl_property_unlock:
  180|  20.5k|{
  181|  20.5k|    return p != 0 ? CRYPTO_THREAD_unlock(p->lock) : 0;
  ------------------
  |  Branch (181:12): [True: 20.5k, False: 0]
  ------------------
  182|  20.5k|}
property.c:impl_free:
  201|    220|{
  202|    220|    if (impl != NULL) {
  ------------------
  |  Branch (202:9): [True: 220, False: 0]
  ------------------
  203|    220|        ossl_method_free(&impl->method);
  204|    220|        OPENSSL_free(impl);
  ------------------
  |  |  107|    220|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    220|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    220|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  205|    220|    }
  206|    220|}
property.c:ossl_method_cache_flush_alg:
  578|     28|{
  579|     28|    store->cache_nelem -= lh_QUERY_num_items(alg->cache);
  580|     28|    impl_cache_flush_alg(0, alg);
  581|     28|}
property.c:alg_do_each:
  470|   129k|{
  471|   129k|    struct alg_do_each_data_st *data = arg;
  472|   129k|    int i, end = sk_IMPLEMENTATION_num(alg->impls);
  473|       |
  474|   283k|    for (i = 0; i < end; i++) {
  ------------------
  |  Branch (474:17): [True: 154k, False: 129k]
  ------------------
  475|   154k|        IMPLEMENTATION *impl = sk_IMPLEMENTATION_value(alg->impls, i);
  476|       |
  477|   154k|        alg_do_one(alg, impl, data->fn, data->fnarg);
  478|   154k|    }
  479|   129k|}
property.c:alg_do_one:
  460|   154k|{
  461|   154k|    fn(alg->nid, impl->method.method, fnarg);
  462|   154k|}
property.c:ossl_property_read_lock:
  170|  20.3k|{
  171|  20.3k|    return p != NULL ? CRYPTO_THREAD_read_lock(p->lock) : 0;
  ------------------
  |  Branch (171:12): [True: 20.3k, False: 0]
  ------------------
  172|  20.3k|}
property.c:ossl_method_cache_flush:
  584|    220|{
  585|    220|    ALGORITHM *alg = ossl_method_store_retrieve(store, nid);
  586|       |
  587|    220|    if (alg != NULL)
  ------------------
  |  Branch (587:9): [True: 28, False: 192]
  ------------------
  588|     28|        ossl_method_cache_flush_alg(store, alg);
  589|    220|}
property.c:impl_cache_flush_alg:
  217|     28|{
  218|     28|    lh_QUERY_doall(alg->cache, &impl_cache_free);
  219|     28|    lh_QUERY_flush(alg->cache);
  220|     28|}
property.c:impl_cache_free:
  209|      5|{
  210|      5|    if (elem != NULL) {
  ------------------
  |  Branch (210:9): [True: 5, False: 0]
  ------------------
  211|      5|        ossl_method_free(&elem->method);
  212|      5|        OPENSSL_free(elem);
  ------------------
  |  |  107|      5|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  213|      5|    }
  214|      5|}
property.c:ossl_method_free:
  165|    225|{
  166|    225|    (*method->free)(method->method);
  167|    225|}

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:
  315|     56|{
  316|     56|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  317|     56|    OSSL_PROPERTY_LIST *res = NULL;
  318|     56|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|     56|# define STACK_OF(type) struct stack_st_##type
  ------------------
  319|     56|    const char *s = defn;
  320|     56|    int done;
  321|       |
  322|     56|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (322:9): [True: 0, False: 56]
  |  Branch (322:22): [True: 0, False: 56]
  ------------------
  323|      0|        return NULL;
  324|       |
  325|     56|    s = skip_space(s);
  326|     56|    done = *s == '\0';
  327|    269|    while (!done) {
  ------------------
  |  Branch (327:12): [True: 213, False: 56]
  ------------------
  328|    213|        const char *start = s;
  329|       |
  330|    213|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |   97|    213|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    213|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    213|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  331|    213|        if (prop == NULL)
  ------------------
  |  Branch (331:13): [True: 0, False: 213]
  ------------------
  332|      0|            goto err;
  333|    213|        memset(&prop->v, 0, sizeof(prop->v));
  334|    213|        prop->optional = 0;
  335|    213|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (335:13): [True: 0, False: 213]
  ------------------
  336|      0|            goto err;
  337|    213|        prop->oper = OSSL_PROPERTY_OPER_EQ;
  338|    213|        if (prop->name_idx == 0) {
  ------------------
  |  Branch (338:13): [True: 0, False: 213]
  ------------------
  339|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  ------------------
  340|      0|                           "Unknown name HERE-->%s", start);
  341|      0|            goto err;
  342|      0|        }
  343|    213|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (343:13): [True: 213, False: 0]
  ------------------
  344|    213|            if (!parse_value(ctx, &s, prop, 1)) {
  ------------------
  |  Branch (344:17): [True: 0, False: 213]
  ------------------
  345|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  ------------------
  346|      0|                               "HERE-->%s", start);
  347|      0|                goto err;
  348|      0|            }
  349|    213|        } else {
  350|       |            /* A name alone means a true Boolean */
  351|      0|            prop->type = OSSL_PROPERTY_TYPE_STRING;
  352|      0|            prop->v.str_val = OSSL_PROPERTY_TRUE;
  ------------------
  |  |   37|      0|#define OSSL_PROPERTY_TRUE      1
  ------------------
  353|      0|        }
  354|       |
  355|    213|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (355:13): [True: 0, False: 213]
  ------------------
  356|      0|            goto err;
  357|    213|        prop = NULL;
  358|    213|        done = !match_ch(&s, ',');
  359|    213|    }
  360|     56|    if (*s != '\0') {
  ------------------
  |  Branch (360:9): [True: 0, False: 56]
  ------------------
  361|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  ------------------
  362|      0|                       "HERE-->%s", s);
  363|      0|        goto err;
  364|      0|    }
  365|     56|    res = stack_to_property_list(ctx, sk);
  366|       |
  367|     56|err:
  368|     56|    OPENSSL_free(prop);
  ------------------
  |  |  107|     56|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     56|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     56|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  369|     56|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  370|     56|    return res;
  371|     56|}
ossl_parse_query:
  375|      5|{
  376|      5|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|      5|# define STACK_OF(type) struct stack_st_##type
  ------------------
  377|      5|    OSSL_PROPERTY_LIST *res = NULL;
  378|      5|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  379|      5|    int done;
  380|       |
  381|      5|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (381:9): [True: 0, False: 5]
  |  Branch (381:22): [True: 0, False: 5]
  ------------------
  382|      0|        return NULL;
  383|       |
  384|      5|    s = skip_space(s);
  385|      5|    done = *s == '\0';
  386|      5|    while (!done) {
  ------------------
  |  Branch (386:12): [True: 0, False: 5]
  ------------------
  387|      0|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |   97|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  388|      0|        if (prop == NULL)
  ------------------
  |  Branch (388:13): [True: 0, False: 0]
  ------------------
  389|      0|            goto err;
  390|      0|        memset(&prop->v, 0, sizeof(prop->v));
  391|       |
  392|      0|        if (match_ch(&s, '-')) {
  ------------------
  |  Branch (392:13): [True: 0, False: 0]
  ------------------
  393|      0|            prop->oper = OSSL_PROPERTY_OVERRIDE;
  394|      0|            prop->optional = 0;
  395|      0|            if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (395:17): [True: 0, False: 0]
  ------------------
  396|      0|                goto err;
  397|      0|            goto skip_value;
  398|      0|        }
  399|      0|        prop->optional = match_ch(&s, '?');
  400|      0|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (400:13): [True: 0, False: 0]
  ------------------
  401|      0|            goto err;
  402|       |
  403|      0|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (403:13): [True: 0, False: 0]
  ------------------
  404|      0|            prop->oper = OSSL_PROPERTY_OPER_EQ;
  405|      0|        } else if (MATCH(&s, "!=")) {
  ------------------
  |  |   42|      0|#define MATCH(s, m) match(s, m, sizeof(m) - 1)
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  406|      0|            prop->oper = OSSL_PROPERTY_OPER_NE;
  407|      0|        } else {
  408|       |            /* A name alone is a Boolean comparison for true */
  409|      0|            prop->oper = OSSL_PROPERTY_OPER_EQ;
  410|      0|            prop->type = OSSL_PROPERTY_TYPE_STRING;
  411|      0|            prop->v.str_val = OSSL_PROPERTY_TRUE;
  ------------------
  |  |   37|      0|#define OSSL_PROPERTY_TRUE      1
  ------------------
  412|      0|            goto skip_value;
  413|      0|        }
  414|      0|        if (!parse_value(ctx, &s, prop, create_values))
  ------------------
  |  Branch (414:13): [True: 0, False: 0]
  ------------------
  415|      0|            prop->type = OSSL_PROPERTY_TYPE_VALUE_UNDEFINED;
  416|       |
  417|      0|skip_value:
  418|      0|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (418:13): [True: 0, False: 0]
  ------------------
  419|      0|            goto err;
  420|      0|        prop = NULL;
  421|      0|        done = !match_ch(&s, ',');
  422|      0|    }
  423|      5|    if (*s != '\0') {
  ------------------
  |  Branch (423:9): [True: 0, False: 5]
  ------------------
  424|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  ------------------
  425|      0|                       "HERE-->%s", s);
  426|      0|        goto err;
  427|      0|    }
  428|      5|    res = stack_to_property_list(ctx, sk);
  429|       |
  430|      5|err:
  431|      5|    OPENSSL_free(prop);
  ------------------
  |  |  107|      5|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  432|      5|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  433|      5|    return res;
  434|      5|}
ossl_property_match_count:
  442|      5|{
  443|      5|    const OSSL_PROPERTY_DEFINITION *const q = query->properties;
  444|      5|    const OSSL_PROPERTY_DEFINITION *const d = defn->properties;
  445|      5|    int i = 0, j = 0, matches = 0;
  446|      5|    OSSL_PROPERTY_OPER oper;
  447|       |
  448|      5|    while (i < query->num_properties) {
  ------------------
  |  Branch (448:12): [True: 0, False: 5]
  ------------------
  449|      0|        if ((oper = q[i].oper) == OSSL_PROPERTY_OVERRIDE) {
  ------------------
  |  Branch (449:13): [True: 0, False: 0]
  ------------------
  450|      0|            i++;
  451|      0|            continue;
  452|      0|        }
  453|      0|        if (j < defn->num_properties) {
  ------------------
  |  Branch (453:13): [True: 0, False: 0]
  ------------------
  454|      0|            if (q[i].name_idx > d[j].name_idx) {  /* skip defn, not in query */
  ------------------
  |  Branch (454:17): [True: 0, False: 0]
  ------------------
  455|      0|                j++;
  456|      0|                continue;
  457|      0|            }
  458|      0|            if (q[i].name_idx == d[j].name_idx) { /* both in defn and query */
  ------------------
  |  Branch (458:17): [True: 0, False: 0]
  ------------------
  459|      0|                const int eq = q[i].type == d[j].type
  ------------------
  |  Branch (459:32): [True: 0, False: 0]
  ------------------
  460|      0|                               && memcmp(&q[i].v, &d[j].v, sizeof(q[i].v)) == 0;
  ------------------
  |  Branch (460:35): [True: 0, False: 0]
  ------------------
  461|       |
  462|      0|                if ((eq && oper == OSSL_PROPERTY_OPER_EQ)
  ------------------
  |  Branch (462:22): [True: 0, False: 0]
  |  Branch (462:28): [True: 0, False: 0]
  ------------------
  463|      0|                    || (!eq && oper == OSSL_PROPERTY_OPER_NE))
  ------------------
  |  Branch (463:25): [True: 0, False: 0]
  |  Branch (463:32): [True: 0, False: 0]
  ------------------
  464|      0|                    matches++;
  465|      0|                else if (!q[i].optional)
  ------------------
  |  Branch (465:26): [True: 0, False: 0]
  ------------------
  466|      0|                    return -1;
  467|      0|                i++;
  468|      0|                j++;
  469|      0|                continue;
  470|      0|            }
  471|      0|        }
  472|       |
  473|       |        /*
  474|       |         * Handle the cases of a missing value and a query with no corresponding
  475|       |         * definition.  The former fails for any comparison except inequality,
  476|       |         * the latter is treated as a comparison against the Boolean false.
  477|       |         */
  478|      0|        if (q[i].type == OSSL_PROPERTY_TYPE_VALUE_UNDEFINED) {
  ------------------
  |  Branch (478:13): [True: 0, False: 0]
  ------------------
  479|      0|            if (oper == OSSL_PROPERTY_OPER_NE)
  ------------------
  |  Branch (479:17): [True: 0, False: 0]
  ------------------
  480|      0|                matches++;
  481|      0|            else if (!q[i].optional)
  ------------------
  |  Branch (481:22): [True: 0, False: 0]
  ------------------
  482|      0|                return -1;
  483|      0|        } else if (q[i].type != OSSL_PROPERTY_TYPE_STRING
  ------------------
  |  Branch (483:20): [True: 0, False: 0]
  ------------------
  484|      0|                   || (oper == OSSL_PROPERTY_OPER_EQ
  ------------------
  |  Branch (484:24): [True: 0, False: 0]
  ------------------
  485|      0|                       && q[i].v.str_val != OSSL_PROPERTY_FALSE)
  ------------------
  |  |   38|      0|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (485:27): [True: 0, False: 0]
  ------------------
  486|      0|                   || (oper == OSSL_PROPERTY_OPER_NE
  ------------------
  |  Branch (486:24): [True: 0, False: 0]
  ------------------
  487|      0|                       && q[i].v.str_val == OSSL_PROPERTY_FALSE)) {
  ------------------
  |  |   38|      0|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (487:27): [True: 0, False: 0]
  ------------------
  488|      0|            if (!q[i].optional)
  ------------------
  |  Branch (488:17): [True: 0, False: 0]
  ------------------
  489|      0|                return -1;
  490|      0|        } else {
  491|      0|            matches++;
  492|      0|        }
  493|      0|        i++;
  494|      0|    }
  495|      5|    return matches;
  496|      5|}
ossl_property_free:
  499|     63|{
  500|     63|    OPENSSL_free(p);
  ------------------
  |  |  107|     63|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     63|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     63|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  501|     63|}
ossl_property_parse_init:
  545|      2|{
  546|      2|    static const char *const predefined_names[] = {
  547|      2|        "provider",     /* Name of provider (default, legacy, fips) */
  548|      2|        "version",      /* Version number of this provider */
  549|      2|        "fips",         /* FIPS validated or FIPS supporting algorithm */
  550|      2|        "output",       /* Output type for encoders */
  551|      2|        "input",        /* Input type for decoders */
  552|      2|        "structure",    /* Structure name for encoders and decoders */
  553|      2|    };
  554|      2|    size_t i;
  555|       |
  556|     14|    for (i = 0; i < OSSL_NELEM(predefined_names); i++)
  ------------------
  |  |   14|     14|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (556:17): [True: 12, False: 2]
  ------------------
  557|     12|        if (ossl_property_name(ctx, predefined_names[i], 1) == 0)
  ------------------
  |  Branch (557:13): [True: 0, False: 12]
  ------------------
  558|      0|            goto err;
  559|       |
  560|       |    /*
  561|       |     * Pre-populate the two Boolean values. We must do them before any other
  562|       |     * values and in this order so that we get the same index as the global
  563|       |     * OSSL_PROPERTY_TRUE and OSSL_PROPERTY_FALSE values
  564|       |     */
  565|      2|    if ((ossl_property_value(ctx, "yes", 1) != OSSL_PROPERTY_TRUE)
  ------------------
  |  |   37|      2|#define OSSL_PROPERTY_TRUE      1
  ------------------
  |  Branch (565:9): [True: 0, False: 2]
  ------------------
  566|      2|        || (ossl_property_value(ctx, "no", 1) != OSSL_PROPERTY_FALSE))
  ------------------
  |  |   38|      2|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (566:12): [True: 0, False: 2]
  ------------------
  567|      0|        goto err;
  568|       |
  569|      2|    return 1;
  570|      0|err:
  571|      0|    return 0;
  572|      2|}
property_parse.c:pd_compare:
  258|    204|{
  259|    204|    const OSSL_PROPERTY_DEFINITION *pd1 = *p1;
  260|    204|    const OSSL_PROPERTY_DEFINITION *pd2 = *p2;
  261|       |
  262|    204|    if (pd1->name_idx < pd2->name_idx)
  ------------------
  |  Branch (262:9): [True: 204, False: 0]
  ------------------
  263|    204|        return -1;
  264|      0|    if (pd1->name_idx > pd2->name_idx)
  ------------------
  |  Branch (264:9): [True: 0, False: 0]
  ------------------
  265|      0|        return 1;
  266|      0|    return 0;
  267|      0|}
property_parse.c:skip_space:
   25|    857|{
   26|    857|    while (ossl_isspace(*s))
  ------------------
  |  |   82|    857|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|    857|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 0, False: 857]
  |  |  ------------------
  ------------------
   27|      0|        s++;
   28|    857|    return s;
   29|    857|}
property_parse.c:parse_name:
   57|    213|{
   58|    213|    char name[100];
   59|    213|    int err = 0;
   60|    213|    size_t i = 0;
   61|    213|    const char *s = *t;
   62|    213|    int user_name = 0;
   63|       |
   64|    213|    for (;;) {
   65|    213|        if (!ossl_isalpha(*s)) {
  ------------------
  |  |   71|    213|# define ossl_isalpha(c)        (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|    213|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    213|# define CTYPE_MASK_lower       0x1
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|    213|# define CTYPE_MASK_upper       0x2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (65:13): [True: 0, False: 213]
  ------------------
   66|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  ------------------
   67|      0|                           "HERE-->%s", *t);
   68|      0|            return 0;
   69|      0|        }
   70|  1.36k|        do {
   71|  1.36k|            if (i < sizeof(name) - 1)
  ------------------
  |  Branch (71:17): [True: 1.36k, False: 0]
  ------------------
   72|  1.36k|                name[i++] = ossl_tolower(*s);
   73|      0|            else
   74|      0|                err = 1;
   75|  1.36k|        } while (*++s == '_' || ossl_isalnum(*s));
  ------------------
  |  |   70|  1.36k|# define ossl_isalnum(c)        (ossl_ctype_check((c), CTYPE_MASK_alnum))
  |  |  ------------------
  |  |  |  |   41|  1.36k|# define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  1.36k|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   27|  1.36k|# define CTYPE_MASK_lower       0x1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   28|  1.36k|# define CTYPE_MASK_upper       0x2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  1.36k|# define CTYPE_MASK_digit       0x4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (70:33): [True: 1.15k, False: 213]
  |  |  ------------------
  ------------------
  |  Branch (75:18): [True: 0, False: 1.36k]
  ------------------
   76|    213|        if (*s != '.')
  ------------------
  |  Branch (76:13): [True: 213, False: 0]
  ------------------
   77|    213|            break;
   78|      0|        user_name = 1;
   79|      0|        if (i < sizeof(name) - 1)
  ------------------
  |  Branch (79:13): [True: 0, False: 0]
  ------------------
   80|      0|            name[i++] = *s;
   81|      0|        else
   82|      0|            err = 1;
   83|      0|        s++;
   84|      0|    }
   85|    213|    name[i] = '\0';
   86|    213|    if (err) {
  ------------------
  |  Branch (86:9): [True: 0, False: 213]
  ------------------
   87|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  ------------------
   88|      0|        return 0;
   89|      0|    }
   90|    213|    *t = skip_space(s);
   91|    213|    *idx = ossl_property_name(ctx, name, user_name && create);
  ------------------
  |  Branch (91:42): [True: 0, False: 213]
  |  Branch (91:55): [True: 0, False: 0]
  ------------------
   92|    213|    return 1;
   93|    213|}
property_parse.c:match_ch:
   32|    426|{
   33|    426|    const char *s = *t;
   34|       |
   35|    426|    if (*s == m) {
  ------------------
  |  Branch (35:9): [True: 370, False: 56]
  ------------------
   36|    370|        *t = skip_space(s + 1);
   37|    370|        return 1;
   38|    370|    }
   39|     56|    return 0;
   40|    426|}
property_parse.c:parse_value:
  227|    213|{
  228|    213|    const char *s = *t;
  229|    213|    int r = 0;
  230|       |
  231|    213|    if (*s == '"' || *s == '\'') {
  ------------------
  |  Branch (231:9): [True: 0, False: 213]
  |  Branch (231:22): [True: 0, False: 213]
  ------------------
  232|      0|        s++;
  233|      0|        r = parse_string(ctx, &s, s[-1], res, create);
  234|    213|    } else if (*s == '+') {
  ------------------
  |  Branch (234:16): [True: 0, False: 213]
  ------------------
  235|      0|        s++;
  236|      0|        r = parse_number(&s, res);
  237|    213|    } else if (*s == '-') {
  ------------------
  |  Branch (237:16): [True: 0, False: 213]
  ------------------
  238|      0|        s++;
  239|      0|        r = parse_number(&s, res);
  240|      0|        res->v.int_val = -res->v.int_val;
  241|    213|    } else if (*s == '0' && s[1] == 'x') {
  ------------------
  |  Branch (241:16): [True: 0, False: 213]
  |  Branch (241:29): [True: 0, False: 0]
  ------------------
  242|      0|        s += 2;
  243|      0|        r = parse_hex(&s, res);
  244|    213|    } else if (*s == '0' && ossl_isdigit(s[1])) {
  ------------------
  |  Branch (244:16): [True: 0, False: 213]
  |  Branch (244:29): [True: 0, False: 0]
  ------------------
  245|      0|        s++;
  246|      0|        r = parse_oct(&s, res);
  247|    213|    } else if (ossl_isdigit(*s)) {
  ------------------
  |  Branch (247:16): [True: 0, False: 213]
  ------------------
  248|      0|        return parse_number(t, res);
  249|    213|    } else if (ossl_isalpha(*s))
  ------------------
  |  |   71|    213|# define ossl_isalpha(c)        (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|    213|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    213|# define CTYPE_MASK_lower       0x1
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|    213|# define CTYPE_MASK_upper       0x2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:33): [True: 213, False: 0]
  |  |  ------------------
  ------------------
  250|    213|        return parse_unquoted(ctx, t, res, create);
  251|      0|    if (r)
  ------------------
  |  Branch (251:9): [True: 0, False: 0]
  ------------------
  252|      0|        *t = s;
  253|      0|    return r;
  254|    213|}
property_parse.c:parse_unquoted:
  195|    213|{
  196|    213|    char v[1000];
  197|    213|    const char *s = *t;
  198|    213|    size_t i = 0;
  199|    213|    int err = 0;
  200|       |
  201|    213|    if (*s == '\0' || *s == ',')
  ------------------
  |  Branch (201:9): [True: 0, False: 213]
  |  Branch (201:23): [True: 0, False: 213]
  ------------------
  202|      0|        return 0;
  203|  1.57k|    while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   80|  3.15k|# define ossl_isprint(c)        (ossl_ctype_check((c), CTYPE_MASK_print))
  |  |  ------------------
  |  |  |  |   35|  1.57k|# define CTYPE_MASK_print       0x100
  |  |  ------------------
  |  |  |  Branch (80:33): [True: 1.52k, False: 56]
  |  |  ------------------
  ------------------
                  while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   82|  3.09k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  1.52k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  ------------------
  |  Branch (203:32): [True: 1.52k, False: 0]
  |  Branch (203:53): [True: 1.36k, False: 157]
  ------------------
  204|  1.36k|        if (i < sizeof(v) - 1)
  ------------------
  |  Branch (204:13): [True: 1.36k, False: 0]
  ------------------
  205|  1.36k|            v[i++] = ossl_tolower(*s);
  206|      0|        else
  207|      0|            err = 1;
  208|  1.36k|        s++;
  209|  1.36k|    }
  210|    213|    if (!ossl_isspace(*s) && *s != '\0' && *s != ',') {
  ------------------
  |  |   82|    426|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|    213|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  ------------------
  |  Branch (210:9): [True: 213, False: 0]
  |  Branch (210:30): [True: 157, False: 56]
  |  Branch (210:44): [True: 0, False: 157]
  ------------------
  211|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  ------------------
  212|      0|                       "HERE-->%s", s);
  213|      0|        return 0;
  214|      0|    }
  215|    213|    v[i] = 0;
  216|    213|    if (err)
  ------------------
  |  Branch (216:9): [True: 0, False: 213]
  ------------------
  217|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  ------------------
  218|    213|    else if ((res->v.str_val = ossl_property_value(ctx, v, create)) == 0)
  ------------------
  |  Branch (218:14): [True: 0, False: 213]
  ------------------
  219|      0|        err = 1;
  220|    213|    *t = skip_space(s);
  221|    213|    res->type = OSSL_PROPERTY_TYPE_STRING;
  222|    213|    return !err;
  223|    213|}
property_parse.c:stack_to_property_list:
  283|     61|{
  284|     61|    const int n = sk_OSSL_PROPERTY_DEFINITION_num(sk);
  285|     61|    OSSL_PROPERTY_LIST *r;
  286|     61|    OSSL_PROPERTY_IDX prev_name_idx = 0;
  287|     61|    int i;
  288|       |
  289|     61|    r = OPENSSL_malloc(sizeof(*r)
  ------------------
  |  |   97|    122|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     61|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     61|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (97:23): [True: 5, False: 56]
  |  |  ------------------
  ------------------
  290|     61|                       + (n <= 0 ? 0 : n - 1) * sizeof(r->properties[0]));
  291|     61|    if (r != NULL) {
  ------------------
  |  Branch (291:9): [True: 61, False: 0]
  ------------------
  292|     61|        sk_OSSL_PROPERTY_DEFINITION_sort(sk);
  293|       |
  294|     61|        r->has_optional = 0;
  295|    274|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (295:21): [True: 213, False: 61]
  ------------------
  296|    213|            r->properties[i] = *sk_OSSL_PROPERTY_DEFINITION_value(sk, i);
  297|    213|            r->has_optional |= r->properties[i].optional;
  298|       |
  299|       |            /* Check for duplicated names */
  300|    213|            if (i > 0 && r->properties[i].name_idx == prev_name_idx) {
  ------------------
  |  Branch (300:17): [True: 157, False: 56]
  |  Branch (300:26): [True: 0, False: 157]
  ------------------
  301|      0|                OPENSSL_free(r);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  302|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  ------------------
  303|      0|                               "Duplicated name `%s'",
  304|      0|                               ossl_property_name_str(ctx, prev_name_idx));
  305|      0|                return NULL;
  306|      0|            }
  307|    213|            prev_name_idx = r->properties[i].name_idx;
  308|    213|        }
  309|     61|        r->num_properties = n;
  310|     61|    }
  311|     61|    return r;
  312|     61|}
property_parse.c:pd_free:
  270|    213|{
  271|    213|    OPENSSL_free(pd);
  ------------------
  |  |  107|    213|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    213|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    213|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  272|    213|}

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

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);
  ------------------
  |  |  238|      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);
  ------------------
  |  |  238|      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);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|      2|}
ossl_property_string_data_new:
   96|      2|void *ossl_property_string_data_new(OSSL_LIB_CTX *ctx) {
   97|      2|    PROPERTY_STRING_DATA *propdata = OPENSSL_zalloc(sizeof(*propdata));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   98|       |
   99|      2|    if (propdata == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 2]
  ------------------
  100|      0|        return NULL;
  101|       |
  102|      2|    propdata->lock = CRYPTO_THREAD_lock_new();
  103|      2|    propdata->prop_names = lh_PROPERTY_STRING_new(&property_hash,
  104|      2|                                                  &property_cmp);
  105|      2|    propdata->prop_values = lh_PROPERTY_STRING_new(&property_hash,
  106|      2|                                                   &property_cmp);
  107|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  108|      2|    propdata->prop_namelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  235|      2|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  109|      2|    propdata->prop_valuelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  235|      2|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  110|      2|#endif
  111|      2|    if (propdata->lock == NULL
  ------------------
  |  Branch (111:9): [True: 0, False: 2]
  ------------------
  112|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  113|      2|            || propdata->prop_namelist == NULL
  ------------------
  |  Branch (113:16): [True: 0, False: 2]
  ------------------
  114|      2|            || propdata->prop_valuelist == NULL
  ------------------
  |  Branch (114:16): [True: 0, False: 2]
  ------------------
  115|      2|#endif
  116|      2|            || propdata->prop_names == NULL
  ------------------
  |  Branch (116:16): [True: 0, False: 2]
  ------------------
  117|      2|            || propdata->prop_values == NULL) {
  ------------------
  |  Branch (117:16): [True: 0, False: 2]
  ------------------
  118|      0|        ossl_property_string_data_free(propdata);
  119|      0|        return NULL;
  120|      0|    }
  121|      2|    return propdata;
  122|      2|}
ossl_property_name:
  253|    429|{
  254|    429|    return ossl_property_string(ctx, 1, create, s);
  255|    429|}
ossl_property_value:
  264|    217|{
  265|    217|    return ossl_property_string(ctx, 0, create, s);
  266|    217|}
ossl_property_value_str:
  269|    157|{
  270|    157|    return ossl_property_str(0, ctx, idx);
  271|    157|}
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|     30|{
   62|     30|    OPENSSL_free(ps);
  ------------------
  |  |  107|     30|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     30|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     30|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   63|     30|}
property_string.c:property_hash:
   51|    706|{
   52|    706|    return OPENSSL_LH_strhash(a->s);
   53|    706|}
property_string.c:property_cmp:
   56|    616|{
   57|    616|    return strcmp(a->s, b->s);
   58|    616|}
property_string.c:ossl_property_string:
  144|    646|{
  145|    646|    PROPERTY_STRING p, *ps, *ps_new;
  146|    646|    PROP_TABLE *t;
  147|    646|    OSSL_PROPERTY_IDX *pidx;
  148|    646|    PROPERTY_STRING_DATA *propdata
  149|    646|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |  101|    646|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  150|       |
  151|    646|    if (propdata == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 646]
  ------------------
  152|      0|        return 0;
  153|       |
  154|    646|    t = name ? propdata->prop_names : propdata->prop_values;
  ------------------
  |  Branch (154:9): [True: 429, False: 217]
  ------------------
  155|    646|    p.s = s;
  156|    646|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (156:9): [True: 0, False: 646]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  158|      0|        return 0;
  159|      0|    }
  160|    646|    ps = lh_PROPERTY_STRING_retrieve(t, &p);
  161|    646|    if (ps == NULL && create) {
  ------------------
  |  Branch (161:9): [True: 30, False: 616]
  |  Branch (161:23): [True: 30, False: 0]
  ------------------
  162|     30|        CRYPTO_THREAD_unlock(propdata->lock);
  163|     30|        if (!CRYPTO_THREAD_write_lock(propdata->lock)) {
  ------------------
  |  Branch (163:13): [True: 0, False: 30]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  165|      0|            return 0;
  166|      0|        }
  167|     30|        pidx = name ? &propdata->prop_name_idx : &propdata->prop_value_idx;
  ------------------
  |  Branch (167:16): [True: 12, False: 18]
  ------------------
  168|     30|        ps = lh_PROPERTY_STRING_retrieve(t, &p);
  169|     30|        if (ps == NULL && (ps_new = new_property_string(s, pidx)) != NULL) {
  ------------------
  |  Branch (169:13): [True: 30, False: 0]
  |  Branch (169:27): [True: 30, False: 0]
  ------------------
  170|     30|#ifndef OPENSSL_SMALL_FOOTPRINT
  171|     30|            STACK_OF(OPENSSL_CSTRING) *slist;
  ------------------
  |  |   31|     30|# define STACK_OF(type) struct stack_st_##type
  ------------------
  172|       |
  173|     30|            slist = name ? propdata->prop_namelist : propdata->prop_valuelist;
  ------------------
  |  Branch (173:21): [True: 12, False: 18]
  ------------------
  174|     30|            if (sk_OPENSSL_CSTRING_push(slist, ps_new->s) <= 0) {
  ------------------
  |  |  242|     30|#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: 30]
  ------------------
  175|      0|                property_free(ps_new);
  176|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  177|      0|                return 0;
  178|      0|            }
  179|     30|#endif
  180|     30|            lh_PROPERTY_STRING_insert(t, ps_new);
  181|     30|            if (lh_PROPERTY_STRING_error(t)) {
  ------------------
  |  Branch (181:17): [True: 0, False: 30]
  ------------------
  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);
  ------------------
  |  |  244|      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|     30|            ps = ps_new;
  195|     30|        }
  196|     30|    }
  197|    646|    CRYPTO_THREAD_unlock(propdata->lock);
  198|    646|    return ps != NULL ? ps->idx : 0;
  ------------------
  |  Branch (198:12): [True: 646, False: 0]
  ------------------
  199|    646|}
property_string.c:new_property_string:
  126|     30|{
  127|     30|    const size_t l = strlen(s);
  128|     30|    PROPERTY_STRING *ps = OPENSSL_malloc(sizeof(*ps) + l);
  ------------------
  |  |   97|     30|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     30|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     30|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  129|       |
  130|     30|    if (ps != NULL) {
  ------------------
  |  Branch (130:9): [True: 30, False: 0]
  ------------------
  131|     30|        memcpy(ps->body, s, l + 1);
  132|     30|        ps->s = ps->body;
  133|     30|        ps->idx = ++*pidx;
  134|     30|        if (ps->idx == 0) {
  ------------------
  |  Branch (134:13): [True: 0, False: 30]
  ------------------
  135|      0|            OPENSSL_free(ps);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|      0|            return NULL;
  137|      0|        }
  138|     30|    }
  139|     30|    return ps;
  140|     30|}
property_string.c:ossl_property_str:
  218|    157|{
  219|    157|    const char *r;
  220|    157|    PROPERTY_STRING_DATA *propdata
  221|    157|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |  101|    157|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  222|       |
  223|    157|    if (propdata == NULL)
  ------------------
  |  Branch (223:9): [True: 0, False: 157]
  ------------------
  224|      0|        return NULL;
  225|       |
  226|    157|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (226:9): [True: 0, False: 157]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|    157|    r = sk_OPENSSL_CSTRING_value(name ? propdata->prop_namelist
  ------------------
  |  |  233|    314|#define sk_OPENSSL_CSTRING_value(sk, idx) ((const char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), (idx)))
  |  |  ------------------
  |  |  |  Branch (233:116): [True: 0, False: 157]
  |  |  ------------------
  ------------------
  244|    157|                                      : propdata->prop_valuelist, idx - 1);
  245|    157|#endif
  246|    157|    CRYPTO_THREAD_unlock(propdata->lock);
  247|       |
  248|    157|    return r;
  249|    157|}

OSSL_PROVIDER_get0_provider_ctx:
  104|   311k|{
  105|   311k|    return ossl_provider_prov_ctx(prov);
  106|   311k|}

ossl_child_prov_ctx_new:
   38|      2|{
   39|      2|    return OPENSSL_zalloc(sizeof(struct child_prov_globals));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      2|}
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);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|      2|}

ossl_prov_conf_ctx_new:
   31|      2|{
   32|      2|    PROVIDER_CONF_GLOBAL *pcgbl = OPENSSL_zalloc(sizeof(*pcgbl));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|       |
   34|      2|    if (pcgbl == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 2]
  ------------------
   35|      0|        return NULL;
   36|       |
   37|      2|    pcgbl->lock = CRYPTO_THREAD_lock_new();
   38|      2|    if (pcgbl->lock == NULL) {
  ------------------
  |  Branch (38:9): [True: 0, False: 2]
  ------------------
   39|      0|        OPENSSL_free(pcgbl);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      0|        return NULL;
   41|      0|    }
   42|       |
   43|      2|    return pcgbl;
   44|      2|}
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");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   54|      2|    CRYPTO_THREAD_lock_free(pcgbl->lock);
   55|      2|    OPENSSL_free(pcgbl);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|      2|}

ossl_provider_store_free:
  286|      2|{
  287|      2|    struct provider_store_st *store = vstore;
  288|      2|    size_t i;
  289|       |
  290|      2|    if (store == NULL)
  ------------------
  |  Branch (290:9): [True: 0, False: 2]
  ------------------
  291|      0|        return;
  292|      2|    store->freeing = 1;
  293|      2|    OPENSSL_free(store->default_path);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  294|      2|    sk_OSSL_PROVIDER_pop_free(store->providers, provider_deactivate_free);
  295|      2|#ifndef FIPS_MODULE
  296|      2|    sk_OSSL_PROVIDER_CHILD_CB_pop_free(store->child_cbs,
  297|      2|                                       ossl_provider_child_cb_free);
  298|      2|#endif
  299|      2|    CRYPTO_THREAD_lock_free(store->default_path_lock);
  300|      2|    CRYPTO_THREAD_lock_free(store->lock);
  301|      2|    for (i = 0; i < store->numprovinfo; i++)
  ------------------
  |  Branch (301:17): [True: 0, False: 2]
  ------------------
  302|      0|        ossl_provider_info_clear(&store->provinfo[i]);
  303|      2|    OPENSSL_free(store->provinfo);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  304|      2|    OPENSSL_free(store);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  305|      2|}
ossl_provider_store_new:
  308|      2|{
  309|      2|    struct provider_store_st *store = OPENSSL_zalloc(sizeof(*store));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  310|       |
  311|      2|    if (store == NULL
  ------------------
  |  Branch (311:9): [True: 0, False: 2]
  ------------------
  312|      2|        || (store->providers = sk_OSSL_PROVIDER_new(ossl_provider_cmp)) == NULL
  ------------------
  |  Branch (312:12): [True: 0, False: 2]
  ------------------
  313|      2|        || (store->default_path_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (313:12): [True: 0, False: 2]
  ------------------
  314|      2|#ifndef FIPS_MODULE
  315|      2|        || (store->child_cbs = sk_OSSL_PROVIDER_CHILD_CB_new_null()) == NULL
  ------------------
  |  Branch (315:12): [True: 0, False: 2]
  ------------------
  316|      2|#endif
  317|      2|        || (store->lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (317:12): [True: 0, False: 2]
  ------------------
  318|      0|        ossl_provider_store_free(store);
  319|      0|        return NULL;
  320|      0|    }
  321|      2|    store->libctx = ctx;
  322|      2|    store->use_fallbacks = 1;
  323|       |
  324|      2|    return store;
  325|      2|}
ossl_provider_up_ref:
  477|    220|{
  478|    220|    int ref = 0;
  479|       |
  480|    220|    if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0)
  ------------------
  |  Branch (480:9): [True: 0, False: 220]
  ------------------
  481|      0|        return 0;
  482|       |
  483|    220|#ifndef FIPS_MODULE
  484|    220|    if (prov->ischild) {
  ------------------
  |  Branch (484:9): [True: 0, False: 220]
  ------------------
  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|    220|#endif
  491|       |
  492|    220|    return ref;
  493|    220|}
ossl_provider_free:
  699|    221|{
  700|    221|    if (prov != NULL) {
  ------------------
  |  Branch (700:9): [True: 221, False: 0]
  ------------------
  701|    221|        int ref = 0;
  702|       |
  703|    221|        CRYPTO_DOWN_REF(&prov->refcnt, &ref);
  704|       |
  705|       |        /*
  706|       |         * When the refcount drops to zero, we clean up the provider.
  707|       |         * Note that this also does teardown, which may seem late,
  708|       |         * considering that init happens on first activation.  However,
  709|       |         * there may be other structures hanging on to the provider after
  710|       |         * the last deactivation and may therefore need full access to the
  711|       |         * provider's services.  Therefore, we deinit late.
  712|       |         */
  713|    221|        if (ref == 0) {
  ------------------
  |  Branch (713:13): [True: 1, False: 220]
  ------------------
  714|      1|            if (prov->flag_initialized) {
  ------------------
  |  Branch (714:17): [True: 1, False: 0]
  ------------------
  715|      1|                ossl_provider_teardown(prov);
  716|      1|#ifndef OPENSSL_NO_ERR
  717|      1|# ifndef FIPS_MODULE
  718|      1|                if (prov->error_strings != NULL) {
  ------------------
  |  Branch (718:21): [True: 0, False: 1]
  ------------------
  719|      0|                    ERR_unload_strings(prov->error_lib, prov->error_strings);
  720|      0|                    OPENSSL_free(prov->error_strings);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  721|      0|                    prov->error_strings = NULL;
  722|      0|                }
  723|      1|# endif
  724|      1|#endif
  725|      1|                OPENSSL_free(prov->operation_bits);
  ------------------
  |  |  107|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  726|      1|                prov->operation_bits = NULL;
  727|      1|                prov->operation_bits_sz = 0;
  728|      1|                prov->flag_initialized = 0;
  729|      1|            }
  730|       |
  731|      1|#ifndef FIPS_MODULE
  732|       |            /*
  733|       |             * We deregister thread handling whether or not the provider was
  734|       |             * initialized. If init was attempted but was not successful then
  735|       |             * the provider may still have registered a thread handler.
  736|       |             */
  737|      1|            ossl_init_thread_deregister(prov);
  738|      1|            DSO_free(prov->module);
  739|      1|#endif
  740|      1|            OPENSSL_free(prov->name);
  ------------------
  |  |  107|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  741|      1|            OPENSSL_free(prov->path);
  ------------------
  |  |  107|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  742|      1|            sk_INFOPAIR_pop_free(prov->parameters, infopair_free);
  743|      1|            CRYPTO_THREAD_lock_free(prov->opbits_lock);
  744|      1|            CRYPTO_THREAD_lock_free(prov->flag_lock);
  745|       |#ifndef HAVE_ATOMICS
  746|       |            CRYPTO_THREAD_lock_free(prov->activatecnt_lock);
  747|       |#endif
  748|      1|            CRYPTO_FREE_REF(&prov->refcnt);
  749|      1|            OPENSSL_free(prov);
  ------------------
  |  |  107|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  750|      1|        }
  751|    220|#ifndef FIPS_MODULE
  752|    220|        else if (prov->ischild) {
  ------------------
  |  Branch (752:18): [True: 0, False: 220]
  ------------------
  753|      0|            ossl_provider_free_parent(prov, 0);
  754|      0|        }
  755|    221|#endif
  756|    221|    }
  757|    221|}
ossl_provider_deactivate:
 1315|      1|{
 1316|      1|    int count;
 1317|       |
 1318|      1|    if (prov == NULL
  ------------------
  |  Branch (1318:9): [True: 0, False: 1]
  ------------------
 1319|      1|            || (count = provider_deactivate(prov, 1, removechildren)) < 0)
  ------------------
  |  Branch (1319:16): [True: 0, False: 1]
  ------------------
 1320|      0|        return 0;
 1321|      1|    return count == 0 ? provider_remove_store_methods(prov) : 1;
  ------------------
  |  Branch (1321:12): [True: 1, False: 0]
  ------------------
 1322|      1|}
ossl_provider_ctx:
 1325|  20.4k|{
 1326|  20.4k|    return prov != NULL ? prov->provctx : NULL;
  ------------------
  |  Branch (1326:12): [True: 20.4k, False: 0]
  ------------------
 1327|  20.4k|}
ossl_provider_doall_activated:
 1405|  1.75k|{
 1406|  1.75k|    int ret = 0, curr, max, ref = 0;
 1407|  1.75k|    struct provider_store_st *store = get_provider_store(ctx);
 1408|  1.75k|    STACK_OF(OSSL_PROVIDER) *provs = NULL;
  ------------------
  |  |   31|  1.75k|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1409|       |
 1410|  1.75k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
 1411|       |    /*
 1412|       |     * Make sure any providers are loaded from config before we try to use
 1413|       |     * them.
 1414|       |     */
 1415|  1.75k|    if (ossl_lib_ctx_is_default(ctx))
  ------------------
  |  Branch (1415:9): [True: 1.75k, False: 0]
  ------------------
 1416|  1.75k|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  455|  1.75k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
 1417|  1.75k|#endif
 1418|       |
 1419|  1.75k|    if (store == NULL)
  ------------------
  |  Branch (1419:9): [True: 0, False: 1.75k]
  ------------------
 1420|      0|        return 1;
 1421|  1.75k|    if (!provider_activate_fallbacks(store))
  ------------------
  |  Branch (1421:9): [True: 0, False: 1.75k]
  ------------------
 1422|      0|        return 0;
 1423|       |
 1424|       |    /*
 1425|       |     * Under lock, grab a copy of the provider list and up_ref each
 1426|       |     * provider so that they don't disappear underneath us.
 1427|       |     */
 1428|  1.75k|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1428:9): [True: 0, False: 1.75k]
  ------------------
 1429|      0|        return 0;
 1430|  1.75k|    provs = sk_OSSL_PROVIDER_dup(store->providers);
 1431|  1.75k|    if (provs == NULL) {
  ------------------
  |  Branch (1431:9): [True: 0, False: 1.75k]
  ------------------
 1432|      0|        CRYPTO_THREAD_unlock(store->lock);
 1433|      0|        return 0;
 1434|      0|    }
 1435|  1.75k|    max = sk_OSSL_PROVIDER_num(provs);
 1436|       |    /*
 1437|       |     * We work backwards through the stack so that we can safely delete items
 1438|       |     * as we go.
 1439|       |     */
 1440|  3.51k|    for (curr = max - 1; curr >= 0; curr--) {
  ------------------
  |  Branch (1440:26): [True: 1.75k, False: 1.75k]
  ------------------
 1441|  1.75k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1442|       |
 1443|  1.75k|        if (!CRYPTO_THREAD_read_lock(prov->flag_lock))
  ------------------
  |  Branch (1443:13): [True: 0, False: 1.75k]
  ------------------
 1444|      0|            goto err_unlock;
 1445|  1.75k|        if (prov->flag_activated) {
  ------------------
  |  Branch (1445:13): [True: 1.75k, False: 0]
  ------------------
 1446|       |            /*
 1447|       |             * We call CRYPTO_UP_REF directly rather than ossl_provider_up_ref
 1448|       |             * to avoid upping the ref count on the parent provider, which we
 1449|       |             * must not do while holding locks.
 1450|       |             */
 1451|  1.75k|            if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0) {
  ------------------
  |  Branch (1451:17): [True: 0, False: 1.75k]
  ------------------
 1452|      0|                CRYPTO_THREAD_unlock(prov->flag_lock);
 1453|      0|                goto err_unlock;
 1454|      0|            }
 1455|       |            /*
 1456|       |             * It's already activated, but we up the activated count to ensure
 1457|       |             * it remains activated until after we've called the user callback.
 1458|       |             * In theory this could mean the parent provider goes inactive,
 1459|       |             * whilst still activated in the child for a short period. That's ok.
 1460|       |             */
 1461|  1.75k|            if (!CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1461:17): [True: 0, False: 1.75k]
  ------------------
 1462|  1.75k|                                   prov->activatecnt_lock)) {
 1463|      0|                CRYPTO_DOWN_REF(&prov->refcnt, &ref);
 1464|      0|                CRYPTO_THREAD_unlock(prov->flag_lock);
 1465|      0|                goto err_unlock;
 1466|      0|            }
 1467|  1.75k|        } else {
 1468|      0|            sk_OSSL_PROVIDER_delete(provs, curr);
 1469|      0|            max--;
 1470|      0|        }
 1471|  1.75k|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1472|  1.75k|    }
 1473|  1.75k|    CRYPTO_THREAD_unlock(store->lock);
 1474|       |
 1475|       |    /*
 1476|       |     * Now, we sweep through all providers not under lock
 1477|       |     */
 1478|  3.51k|    for (curr = 0; curr < max; curr++) {
  ------------------
  |  Branch (1478:20): [True: 1.75k, False: 1.75k]
  ------------------
 1479|  1.75k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1480|       |
 1481|  1.75k|        if (!cb(prov, cbdata)) {
  ------------------
  |  Branch (1481:13): [True: 0, False: 1.75k]
  ------------------
 1482|      0|            curr = -1;
 1483|      0|            goto finish;
 1484|      0|        }
 1485|  1.75k|    }
 1486|  1.75k|    curr = -1;
 1487|       |
 1488|  1.75k|    ret = 1;
 1489|  1.75k|    goto finish;
 1490|       |
 1491|      0| err_unlock:
 1492|      0|    CRYPTO_THREAD_unlock(store->lock);
 1493|  1.75k| finish:
 1494|       |    /*
 1495|       |     * The pop_free call doesn't do what we want on an error condition. We
 1496|       |     * either start from the first item in the stack, or part way through if
 1497|       |     * we only processed some of the items.
 1498|       |     */
 1499|  3.51k|    for (curr++; curr < max; curr++) {
  ------------------
  |  Branch (1499:18): [True: 1.75k, False: 1.75k]
  ------------------
 1500|  1.75k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1501|       |
 1502|  1.75k|        if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &ref,
  ------------------
  |  Branch (1502:13): [True: 0, False: 1.75k]
  ------------------
 1503|  1.75k|                               prov->activatecnt_lock)) {
 1504|      0|            ret = 0;
 1505|      0|            continue;
 1506|      0|        }
 1507|  1.75k|        if (ref < 1) {
  ------------------
  |  Branch (1507:13): [True: 0, False: 1.75k]
  ------------------
 1508|       |            /*
 1509|       |             * Looks like we need to deactivate properly. We could just have
 1510|       |             * done this originally, but it involves taking a write lock so
 1511|       |             * we avoid it. We up the count again and do a full deactivation
 1512|       |             */
 1513|      0|            if (CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1513:17): [True: 0, False: 0]
  ------------------
 1514|      0|                                  prov->activatecnt_lock))
 1515|      0|                provider_deactivate(prov, 0, 1);
 1516|      0|            else
 1517|      0|                ret = 0;
 1518|      0|        }
 1519|       |        /*
 1520|       |         * As above where we did the up-ref, we don't call ossl_provider_free
 1521|       |         * to avoid making upcalls. There should always be at least one ref
 1522|       |         * to the provider in the store, so this should never drop to 0.
 1523|       |         */
 1524|  1.75k|        if (!CRYPTO_DOWN_REF(&prov->refcnt, &ref)) {
  ------------------
  |  Branch (1524:13): [True: 0, False: 1.75k]
  ------------------
 1525|      0|            ret = 0;
 1526|      0|            continue;
 1527|      0|        }
 1528|       |        /*
 1529|       |         * Not much we can do if this assert ever fails. So we don't use
 1530|       |         * ossl_assert here.
 1531|       |         */
 1532|  1.75k|        assert(ref > 0);
 1533|  1.75k|    }
 1534|  1.75k|    sk_OSSL_PROVIDER_free(provs);
 1535|  1.75k|    return ret;
 1536|  1.75k|}
ossl_provider_prov_ctx:
 1589|   311k|{
 1590|   311k|    if (prov != NULL)
  ------------------
  |  Branch (1590:9): [True: 311k, False: 0]
  ------------------
 1591|   311k|        return prov->provctx;
 1592|       |
 1593|      0|    return NULL;
 1594|   311k|}
ossl_provider_libctx:
 1605|   289k|{
 1606|   289k|    return prov != NULL ? prov->libctx : NULL;
  ------------------
  |  Branch (1606:12): [True: 269k, False: 20.3k]
  ------------------
 1607|   289k|}
ossl_provider_teardown:
 1611|      1|{
 1612|      1|    if (prov->teardown != NULL
  ------------------
  |  Branch (1612:9): [True: 1, False: 0]
  ------------------
 1613|      1|#ifndef FIPS_MODULE
 1614|      1|            && !prov->ischild
  ------------------
  |  Branch (1614:16): [True: 1, False: 0]
  ------------------
 1615|      1|#endif
 1616|      1|       )
 1617|      1|        prov->teardown(prov->provctx);
 1618|      1|}
ossl_provider_query_operation:
 1656|  1.75k|{
 1657|  1.75k|    const OSSL_ALGORITHM *res;
 1658|       |
 1659|  1.75k|    if (prov->query_operation == NULL)
  ------------------
  |  Branch (1659:9): [True: 0, False: 1.75k]
  ------------------
 1660|      0|        return NULL;
 1661|  1.75k|    res = prov->query_operation(prov->provctx, operation_id, no_cache);
 1662|       |#if defined(OPENSSL_NO_CACHED_FETCH)
 1663|       |    /* Forcing the non-caching of queries */
 1664|       |    if (no_cache != NULL)
 1665|       |        *no_cache = 1;
 1666|       |#endif
 1667|  1.75k|    return res;
 1668|  1.75k|}
ossl_provider_unquery_operation:
 1673|  1.75k|{
 1674|  1.75k|    if (prov->unquery_operation != NULL)
  ------------------
  |  Branch (1674:9): [True: 0, False: 1.75k]
  ------------------
 1675|      0|        prov->unquery_operation(prov->provctx, operation_id, algs);
 1676|  1.75k|}
ossl_provider_set_operation_bit:
 1679|      5|{
 1680|      5|    size_t byte = bitnum / 8;
 1681|      5|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 1682|       |
 1683|      5|    if (!CRYPTO_THREAD_write_lock(provider->opbits_lock))
  ------------------
  |  Branch (1683:9): [True: 0, False: 5]
  ------------------
 1684|      0|        return 0;
 1685|      5|    if (provider->operation_bits_sz <= byte) {
  ------------------
  |  Branch (1685:9): [True: 3, False: 2]
  ------------------
 1686|      3|        unsigned char *tmp = OPENSSL_realloc(provider->operation_bits,
  ------------------
  |  |  101|      3|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1687|      3|                                             byte + 1);
 1688|       |
 1689|      3|        if (tmp == NULL) {
  ------------------
  |  Branch (1689:13): [True: 0, False: 3]
  ------------------
 1690|      0|            CRYPTO_THREAD_unlock(provider->opbits_lock);
 1691|      0|            return 0;
 1692|      0|        }
 1693|      3|        provider->operation_bits = tmp;
 1694|      3|        memset(provider->operation_bits + provider->operation_bits_sz,
 1695|      3|               '\0', byte + 1 - provider->operation_bits_sz);
 1696|      3|        provider->operation_bits_sz = byte + 1;
 1697|      3|    }
 1698|      5|    provider->operation_bits[byte] |= bit;
 1699|      5|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 1700|      5|    return 1;
 1701|      5|}
ossl_provider_test_operation_bit:
 1705|  1.75k|{
 1706|  1.75k|    size_t byte = bitnum / 8;
 1707|  1.75k|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 1708|       |
 1709|  1.75k|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|  1.75k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  1.75k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1709:9): [True: 0, False: 1.75k]
  ------------------
 1710|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1711|      0|        return 0;
 1712|      0|    }
 1713|       |
 1714|  1.75k|    *result = 0;
 1715|  1.75k|    if (!CRYPTO_THREAD_read_lock(provider->opbits_lock))
  ------------------
  |  Branch (1715:9): [True: 0, False: 1.75k]
  ------------------
 1716|      0|        return 0;
 1717|  1.75k|    if (provider->operation_bits_sz > byte)
  ------------------
  |  Branch (1717:9): [True: 1.75k, False: 3]
  ------------------
 1718|  1.75k|        *result = ((provider->operation_bits[byte] & bit) != 0);
 1719|  1.75k|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 1720|  1.75k|    return 1;
 1721|  1.75k|}
provider_core.c:provider_deactivate_free:
  235|      1|{
  236|      1|    if (prov->flag_activated)
  ------------------
  |  Branch (236:9): [True: 1, False: 0]
  ------------------
  237|      1|        ossl_provider_deactivate(prov, 1);
  238|      1|    ossl_provider_free(prov);
  239|      1|}
provider_core.c:get_provider_store:
  328|  1.75k|{
  329|  1.75k|    struct provider_store_st *store = NULL;
  330|       |
  331|  1.75k|    store = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_PROVIDER_STORE_INDEX);
  ------------------
  |  |   99|  1.75k|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  332|  1.75k|    if (store == NULL)
  ------------------
  |  Branch (332:9): [True: 0, False: 1.75k]
  ------------------
  333|  1.75k|        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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  334|  1.75k|    return store;
  335|  1.75k|}
provider_core.c:provider_new:
  440|      1|{
  441|      1|    OSSL_PROVIDER *prov = NULL;
  442|       |
  443|      1|    if ((prov = OPENSSL_zalloc(sizeof(*prov))) == NULL)
  ------------------
  |  |   99|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (443:9): [True: 0, False: 1]
  ------------------
  444|      0|        return NULL;
  445|      1|    if (!CRYPTO_NEW_REF(&prov->refcnt, 1)) {
  ------------------
  |  Branch (445:9): [True: 0, False: 1]
  ------------------
  446|      0|        OPENSSL_free(prov);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  447|      0|        return NULL;
  448|      0|    }
  449|       |#ifndef HAVE_ATOMICS
  450|       |    if ((prov->activatecnt_lock = CRYPTO_THREAD_lock_new()) == NULL) {
  451|       |        ossl_provider_free(prov);
  452|       |        ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  453|       |        return NULL;
  454|       |    }
  455|       |#endif
  456|       |
  457|      1|    if ((prov->opbits_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (457:9): [True: 0, False: 1]
  ------------------
  458|      1|        || (prov->flag_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (458:12): [True: 0, False: 1]
  ------------------
  459|      1|        || (prov->parameters = sk_INFOPAIR_deep_copy(parameters,
  ------------------
  |  Branch (459:12): [True: 0, False: 1]
  ------------------
  460|      1|                                                     infopair_copy,
  461|      1|                                                     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  464|      0|        return NULL;
  465|      0|    }
  466|      1|    if ((prov->name = OPENSSL_strdup(name)) == NULL) {
  ------------------
  |  |  111|      1|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (466:9): [True: 0, False: 1]
  ------------------
  467|      0|        ossl_provider_free(prov);
  468|      0|        return NULL;
  469|      0|    }
  470|       |
  471|      1|    prov->init_function = init_function;
  472|       |
  473|      1|    return prov;
  474|      1|}
provider_core.c:provider_activate:
 1159|      1|{
 1160|      1|    int count = -1;
 1161|      1|    struct provider_store_st *store;
 1162|      1|    int ret = 1;
 1163|       |
 1164|      1|    store = prov->store;
 1165|       |    /*
 1166|       |    * If the provider hasn't been added to the store, then we don't need
 1167|       |    * any locks because we've not shared it with other threads.
 1168|       |    */
 1169|      1|    if (store == NULL) {
  ------------------
  |  Branch (1169:9): [True: 1, False: 0]
  ------------------
 1170|      1|        lock = 0;
 1171|      1|        if (!provider_init(prov))
  ------------------
  |  Branch (1171:13): [True: 0, False: 1]
  ------------------
 1172|      0|            return -1;
 1173|      1|    }
 1174|       |
 1175|      1|#ifndef FIPS_MODULE
 1176|      1|    if (prov->ischild && upcalls && !ossl_provider_up_ref_parent(prov, 1))
  ------------------
  |  Branch (1176:9): [True: 0, False: 1]
  |  Branch (1176:26): [True: 0, False: 0]
  |  Branch (1176:37): [True: 0, False: 0]
  ------------------
 1177|      0|        return -1;
 1178|      1|#endif
 1179|       |
 1180|      1|    if (lock && !CRYPTO_THREAD_read_lock(store->lock)) {
  ------------------
  |  Branch (1180:9): [True: 0, False: 1]
  |  Branch (1180:17): [True: 0, False: 0]
  ------------------
 1181|      0|#ifndef FIPS_MODULE
 1182|      0|        if (prov->ischild && upcalls)
  ------------------
  |  Branch (1182:13): [True: 0, False: 0]
  |  Branch (1182:30): [True: 0, False: 0]
  ------------------
 1183|      0|            ossl_provider_free_parent(prov, 1);
 1184|      0|#endif
 1185|      0|        return -1;
 1186|      0|    }
 1187|       |
 1188|      1|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1188:9): [True: 0, False: 1]
  |  Branch (1188:17): [True: 0, False: 0]
  ------------------
 1189|      0|        CRYPTO_THREAD_unlock(store->lock);
 1190|      0|#ifndef FIPS_MODULE
 1191|      0|        if (prov->ischild && upcalls)
  ------------------
  |  Branch (1191:13): [True: 0, False: 0]
  |  Branch (1191:30): [True: 0, False: 0]
  ------------------
 1192|      0|            ossl_provider_free_parent(prov, 1);
 1193|      0|#endif
 1194|      0|        return -1;
 1195|      0|    }
 1196|      1|    if (CRYPTO_atomic_add(&prov->activatecnt, 1, &count, prov->activatecnt_lock)) {
  ------------------
  |  Branch (1196:9): [True: 1, False: 0]
  ------------------
 1197|      1|        prov->flag_activated = 1;
 1198|       |
 1199|      1|        if (count == 1 && store != NULL) {
  ------------------
  |  Branch (1199:13): [True: 1, False: 0]
  |  Branch (1199:27): [True: 0, False: 1]
  ------------------
 1200|      0|            ret = create_provider_children(prov);
 1201|      0|        }
 1202|      1|    }
 1203|      1|    if (lock) {
  ------------------
  |  Branch (1203:9): [True: 0, False: 1]
  ------------------
 1204|      0|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1205|      0|        CRYPTO_THREAD_unlock(store->lock);
 1206|       |        /*
 1207|       |         * This can be done outside the lock. We tolerate other threads getting
 1208|       |         * the wrong result briefly when creating OSSL_DECODER_CTXs.
 1209|       |         */
 1210|      0|#ifndef FIPS_MODULE
 1211|      0|        if (count == 1)
  ------------------
  |  Branch (1211:13): [True: 0, False: 0]
  ------------------
 1212|      0|            ossl_decoder_cache_flush(prov->libctx);
 1213|      0|#endif
 1214|      0|    }
 1215|       |
 1216|      1|    if (!ret)
  ------------------
  |  Branch (1216:9): [True: 0, False: 1]
  ------------------
 1217|      0|        return -1;
 1218|       |
 1219|      1|    return count;
 1220|      1|}
provider_core.c:provider_init:
  867|      1|{
  868|      1|    const OSSL_DISPATCH *provider_dispatch = NULL;
  869|      1|    void *tmp_provctx = NULL;    /* safety measure */
  870|      1|#ifndef OPENSSL_NO_ERR
  871|      1|# ifndef FIPS_MODULE
  872|      1|    OSSL_FUNC_provider_get_reason_strings_fn *p_get_reason_strings = NULL;
  873|      1|# endif
  874|      1|#endif
  875|      1|    int ok = 0;
  876|       |
  877|      1|    if (!ossl_assert(!prov->flag_initialized)) {
  ------------------
  |  |   52|      1|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      1|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (877:9): [True: 0, False: 1]
  ------------------
  878|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  879|      0|        goto end;
  880|      0|    }
  881|       |
  882|       |    /*
  883|       |     * If the init function isn't set, it indicates that this provider is
  884|       |     * a loadable module.
  885|       |     */
  886|      1|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (886:9): [True: 0, False: 1]
  ------------------
  887|       |#ifdef FIPS_MODULE
  888|       |        goto end;
  889|       |#else
  890|      0|        if (prov->module == NULL) {
  ------------------
  |  Branch (890:13): [True: 0, False: 0]
  ------------------
  891|      0|            char *allocated_path = NULL;
  892|      0|            const char *module_path = NULL;
  893|      0|            char *merged_path = NULL;
  894|      0|            const char *load_dir = NULL;
  895|      0|            char *allocated_load_dir = NULL;
  896|      0|            struct provider_store_st *store;
  897|       |
  898|      0|            if ((prov->module = DSO_new()) == NULL) {
  ------------------
  |  Branch (898:17): [True: 0, False: 0]
  ------------------
  899|       |                /* DSO_new() generates an error already */
  900|      0|                goto end;
  901|      0|            }
  902|       |
  903|      0|            if ((store = get_provider_store(prov->libctx)) == NULL
  ------------------
  |  Branch (903:17): [True: 0, False: 0]
  ------------------
  904|      0|                    || !CRYPTO_THREAD_read_lock(store->default_path_lock))
  ------------------
  |  Branch (904:24): [True: 0, False: 0]
  ------------------
  905|      0|                goto end;
  906|       |
  907|      0|            if (store->default_path != NULL) {
  ------------------
  |  Branch (907:17): [True: 0, False: 0]
  ------------------
  908|      0|                allocated_load_dir = OPENSSL_strdup(store->default_path);
  ------------------
  |  |  111|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  909|      0|                CRYPTO_THREAD_unlock(store->default_path_lock);
  910|      0|                if (allocated_load_dir == NULL)
  ------------------
  |  Branch (910:21): [True: 0, False: 0]
  ------------------
  911|      0|                    goto end;
  912|      0|                load_dir = allocated_load_dir;
  913|      0|            } else {
  914|      0|                CRYPTO_THREAD_unlock(store->default_path_lock);
  915|      0|            }
  916|       |
  917|      0|            if (load_dir == NULL) {
  ------------------
  |  Branch (917:17): [True: 0, False: 0]
  ------------------
  918|      0|                load_dir = ossl_safe_getenv("OPENSSL_MODULES");
  919|      0|                if (load_dir == NULL)
  ------------------
  |  Branch (919:21): [True: 0, False: 0]
  ------------------
  920|      0|                    load_dir = MODULESDIR;
  921|      0|            }
  922|       |
  923|      0|            DSO_ctrl(prov->module, DSO_CTRL_SET_FLAGS,
  ------------------
  |  |   19|      0|# define DSO_CTRL_SET_FLAGS      2
  ------------------
  924|      0|                     DSO_FLAG_NAME_TRANSLATION_EXT_ONLY, NULL);
  ------------------
  |  |   41|      0|# define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY      0x02
  ------------------
  925|       |
  926|      0|            module_path = prov->path;
  927|      0|            if (module_path == NULL)
  ------------------
  |  Branch (927:17): [True: 0, False: 0]
  ------------------
  928|      0|                module_path = allocated_path =
  929|      0|                    DSO_convert_filename(prov->module, prov->name);
  930|      0|            if (module_path != NULL)
  ------------------
  |  Branch (930:17): [True: 0, False: 0]
  ------------------
  931|      0|                merged_path = DSO_merge(prov->module, module_path, load_dir);
  932|       |
  933|      0|            if (merged_path == NULL
  ------------------
  |  Branch (933:17): [True: 0, False: 0]
  ------------------
  934|      0|                || (DSO_load(prov->module, merged_path, NULL, 0)) == NULL) {
  ------------------
  |  Branch (934:20): [True: 0, False: 0]
  ------------------
  935|      0|                DSO_free(prov->module);
  936|      0|                prov->module = NULL;
  937|      0|            }
  938|       |
  939|      0|            OPENSSL_free(merged_path);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  940|      0|            OPENSSL_free(allocated_path);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  941|      0|            OPENSSL_free(allocated_load_dir);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  942|      0|        }
  943|       |
  944|      0|        if (prov->module == NULL) {
  ------------------
  |  Branch (944:13): [True: 0, False: 0]
  ------------------
  945|       |            /* DSO has already recorded errors, this is just a tracepoint */
  946|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  947|      0|                           "name=%s", prov->name);
  948|      0|            goto end;
  949|      0|        }
  950|       |
  951|      0|        prov->init_function = (OSSL_provider_init_fn *)
  952|      0|            DSO_bind_func(prov->module, "OSSL_provider_init");
  953|      0|#endif
  954|      0|    }
  955|       |
  956|       |    /* Check for and call the initialise function for the provider. */
  957|      1|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (957:9): [True: 0, False: 1]
  ------------------
  958|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  959|      0|                       "name=%s, provider has no provider init function",
  960|      0|                       prov->name);
  961|      0|        goto end;
  962|      0|    }
  963|       |
  964|      1|    if (!prov->init_function((OSSL_CORE_HANDLE *)prov, core_dispatch,
  ------------------
  |  Branch (964:9): [True: 0, False: 1]
  ------------------
  965|      1|                             &provider_dispatch, &tmp_provctx)) {
  966|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  967|      0|                       "name=%s", prov->name);
  968|      0|        goto end;
  969|      0|    }
  970|      1|    prov->provctx = tmp_provctx;
  971|      1|    prov->dispatch = provider_dispatch;
  972|       |
  973|      6|    for (; provider_dispatch->function_id != 0; provider_dispatch++) {
  ------------------
  |  Branch (973:12): [True: 5, False: 1]
  ------------------
  974|      5|        switch (provider_dispatch->function_id) {
  ------------------
  |  Branch (974:17): [True: 0, False: 5]
  ------------------
  975|      1|        case OSSL_FUNC_PROVIDER_TEARDOWN:
  ------------------
  |  |  229|      1|# define OSSL_FUNC_PROVIDER_TEARDOWN           1024
  ------------------
  |  Branch (975:9): [True: 1, False: 4]
  ------------------
  976|      1|            prov->teardown =
  977|      1|                OSSL_FUNC_provider_teardown(provider_dispatch);
  978|      1|            break;
  979|      1|        case OSSL_FUNC_PROVIDER_GETTABLE_PARAMS:
  ------------------
  |  |  231|      1|# define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS    1025
  ------------------
  |  Branch (979:9): [True: 1, False: 4]
  ------------------
  980|      1|            prov->gettable_params =
  981|      1|                OSSL_FUNC_provider_gettable_params(provider_dispatch);
  982|      1|            break;
  983|      1|        case OSSL_FUNC_PROVIDER_GET_PARAMS:
  ------------------
  |  |  234|      1|# define OSSL_FUNC_PROVIDER_GET_PARAMS         1026
  ------------------
  |  Branch (983:9): [True: 1, False: 4]
  ------------------
  984|      1|            prov->get_params =
  985|      1|                OSSL_FUNC_provider_get_params(provider_dispatch);
  986|      1|            break;
  987|      0|        case OSSL_FUNC_PROVIDER_SELF_TEST:
  ------------------
  |  |  249|      0|# define OSSL_FUNC_PROVIDER_SELF_TEST          1031
  ------------------
  |  Branch (987:9): [True: 0, False: 5]
  ------------------
  988|      0|            prov->self_test =
  989|      0|                OSSL_FUNC_provider_self_test(provider_dispatch);
  990|      0|            break;
  991|      1|        case OSSL_FUNC_PROVIDER_GET_CAPABILITIES:
  ------------------
  |  |  246|      1|# define OSSL_FUNC_PROVIDER_GET_CAPABILITIES   1030
  ------------------
  |  Branch (991:9): [True: 1, False: 4]
  ------------------
  992|      1|            prov->get_capabilities =
  993|      1|                OSSL_FUNC_provider_get_capabilities(provider_dispatch);
  994|      1|            break;
  995|      1|        case OSSL_FUNC_PROVIDER_QUERY_OPERATION:
  ------------------
  |  |  237|      1|# define OSSL_FUNC_PROVIDER_QUERY_OPERATION    1027
  ------------------
  |  Branch (995:9): [True: 1, False: 4]
  ------------------
  996|      1|            prov->query_operation =
  997|      1|                OSSL_FUNC_provider_query_operation(provider_dispatch);
  998|      1|            break;
  999|      0|        case OSSL_FUNC_PROVIDER_UNQUERY_OPERATION:
  ------------------
  |  |  240|      0|# define OSSL_FUNC_PROVIDER_UNQUERY_OPERATION  1028
  ------------------
  |  Branch (999:9): [True: 0, False: 5]
  ------------------
 1000|      0|            prov->unquery_operation =
 1001|      0|                OSSL_FUNC_provider_unquery_operation(provider_dispatch);
 1002|      0|            break;
 1003|      0|#ifndef OPENSSL_NO_ERR
 1004|      0|# ifndef FIPS_MODULE
 1005|      0|        case OSSL_FUNC_PROVIDER_GET_REASON_STRINGS:
  ------------------
  |  |  243|      0|# define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1029
  ------------------
  |  Branch (1005:9): [True: 0, False: 5]
  ------------------
 1006|      0|            p_get_reason_strings =
 1007|      0|                OSSL_FUNC_provider_get_reason_strings(provider_dispatch);
 1008|      0|            break;
 1009|      5|# endif
 1010|      5|#endif
 1011|      5|        }
 1012|      5|    }
 1013|       |
 1014|      1|#ifndef OPENSSL_NO_ERR
 1015|      1|# ifndef FIPS_MODULE
 1016|      1|    if (p_get_reason_strings != NULL) {
  ------------------
  |  Branch (1016:9): [True: 0, False: 1]
  ------------------
 1017|      0|        const OSSL_ITEM *reasonstrings = p_get_reason_strings(prov->provctx);
 1018|      0|        size_t cnt, cnt2;
 1019|       |
 1020|       |        /*
 1021|       |         * ERR_load_strings() handles ERR_STRING_DATA rather than OSSL_ITEM,
 1022|       |         * although they are essentially the same type.
 1023|       |         * Furthermore, ERR_load_strings() patches the array's error number
 1024|       |         * with the error library number, so we need to make a copy of that
 1025|       |         * array either way.
 1026|       |         */
 1027|      0|        cnt = 0;
 1028|      0|        while (reasonstrings[cnt].id != 0) {
  ------------------
  |  Branch (1028:16): [True: 0, False: 0]
  ------------------
 1029|      0|            if (ERR_GET_LIB(reasonstrings[cnt].id) != 0)
  ------------------
  |  Branch (1029:17): [True: 0, False: 0]
  ------------------
 1030|      0|                goto end;
 1031|      0|            cnt++;
 1032|      0|        }
 1033|      0|        cnt++;                   /* One for the terminating item */
 1034|       |
 1035|       |        /* Allocate one extra item for the "library" name */
 1036|      0|        prov->error_strings =
 1037|      0|            OPENSSL_zalloc(sizeof(ERR_STRING_DATA) * (cnt + 1));
  ------------------
  |  |   99|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1038|      0|        if (prov->error_strings == NULL)
  ------------------
  |  Branch (1038:13): [True: 0, False: 0]
  ------------------
 1039|      0|            goto end;
 1040|       |
 1041|       |        /*
 1042|       |         * Set the "library" name.
 1043|       |         */
 1044|      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
  |  |  ------------------
  ------------------
 1045|      0|        prov->error_strings[0].string = prov->name;
 1046|       |        /*
 1047|       |         * Copy reasonstrings item 0..cnt-1 to prov->error_trings positions
 1048|       |         * 1..cnt.
 1049|       |         */
 1050|      0|        for (cnt2 = 1; cnt2 <= cnt; cnt2++) {
  ------------------
  |  Branch (1050:24): [True: 0, False: 0]
  ------------------
 1051|      0|            prov->error_strings[cnt2].error = (int)reasonstrings[cnt2-1].id;
 1052|      0|            prov->error_strings[cnt2].string = reasonstrings[cnt2-1].ptr;
 1053|      0|        }
 1054|       |
 1055|      0|        ERR_load_strings(prov->error_lib, prov->error_strings);
 1056|      0|    }
 1057|      1|# endif
 1058|      1|#endif
 1059|       |
 1060|       |    /* With this flag set, this provider has become fully "loaded". */
 1061|      1|    prov->flag_initialized = 1;
 1062|      1|    ok = 1;
 1063|       |
 1064|      1| end:
 1065|      1|    return ok;
 1066|      1|}
provider_core.c:core_get_libctx:
 2001|      1|{
 2002|       |    /*
 2003|       |     * We created this object originally and we know it is actually an
 2004|       |     * OSSL_PROVIDER *, so the cast is safe
 2005|       |     */
 2006|      1|    OSSL_PROVIDER *prov = (OSSL_PROVIDER *)handle;
 2007|       |
 2008|       |    /*
 2009|       |     * Using ossl_provider_libctx would be wrong as that returns
 2010|       |     * NULL for |prov| == NULL and NULL libctx has a special meaning
 2011|       |     * that does not apply here. Here |prov| == NULL can happen only in
 2012|       |     * case of a coding error.
 2013|       |     */
 2014|      1|    assert(prov != NULL);
 2015|      1|    return (OPENSSL_CORE_CTX *)prov->libctx;
 2016|      1|}
provider_core.c:provider_deactivate:
 1076|      1|{
 1077|      1|    int count;
 1078|      1|    struct provider_store_st *store;
 1079|      1|#ifndef FIPS_MODULE
 1080|      1|    int freeparent = 0;
 1081|      1|#endif
 1082|      1|    int lock = 1;
 1083|       |
 1084|      1|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|      1|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      1|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1084:9): [True: 0, False: 1]
  ------------------
 1085|      0|        return -1;
 1086|       |
 1087|       |    /*
 1088|       |     * No need to lock if we've got no store because we've not been shared with
 1089|       |     * other threads.
 1090|       |     */
 1091|      1|    store = get_provider_store(prov->libctx);
 1092|      1|    if (store == NULL)
  ------------------
  |  Branch (1092:9): [True: 0, False: 1]
  ------------------
 1093|      0|        lock = 0;
 1094|       |
 1095|      1|    if (lock && !CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1095:9): [True: 1, False: 0]
  |  Branch (1095:17): [True: 0, False: 1]
  ------------------
 1096|      0|        return -1;
 1097|      1|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1097:9): [True: 1, False: 0]
  |  Branch (1097:17): [True: 0, False: 1]
  ------------------
 1098|      0|        CRYPTO_THREAD_unlock(store->lock);
 1099|      0|        return -1;
 1100|      0|    }
 1101|       |
 1102|      1|    CRYPTO_atomic_add(&prov->activatecnt, -1, &count, prov->activatecnt_lock);
 1103|      1|#ifndef FIPS_MODULE
 1104|      1|    if (count >= 1 && prov->ischild && upcalls) {
  ------------------
  |  Branch (1104:9): [True: 0, False: 1]
  |  Branch (1104:23): [True: 0, False: 0]
  |  Branch (1104:40): [True: 0, False: 0]
  ------------------
 1105|       |        /*
 1106|       |         * We have had a direct activation in this child libctx so we need to
 1107|       |         * now down the ref count in the parent provider. We do the actual down
 1108|       |         * ref outside of the flag_lock, since it could involve getting other
 1109|       |         * locks.
 1110|       |         */
 1111|      0|        freeparent = 1;
 1112|      0|    }
 1113|      1|#endif
 1114|       |
 1115|      1|    if (count < 1)
  ------------------
  |  Branch (1115:9): [True: 1, False: 0]
  ------------------
 1116|      1|        prov->flag_activated = 0;
 1117|      0|#ifndef FIPS_MODULE
 1118|      0|    else
 1119|      0|        removechildren = 0;
 1120|      1|#endif
 1121|       |
 1122|      1|#ifndef FIPS_MODULE
 1123|      1|    if (removechildren && store != NULL) {
  ------------------
  |  Branch (1123:9): [True: 1, False: 0]
  |  Branch (1123:27): [True: 1, False: 0]
  ------------------
 1124|      1|        int i, max = sk_OSSL_PROVIDER_CHILD_CB_num(store->child_cbs);
 1125|      1|        OSSL_PROVIDER_CHILD_CB *child_cb;
 1126|       |
 1127|      1|        for (i = 0; i < max; i++) {
  ------------------
  |  Branch (1127:21): [True: 0, False: 1]
  ------------------
 1128|      0|            child_cb = sk_OSSL_PROVIDER_CHILD_CB_value(store->child_cbs, i);
 1129|      0|            child_cb->remove_cb((OSSL_CORE_HANDLE *)prov, child_cb->cbdata);
 1130|      0|        }
 1131|      1|    }
 1132|      1|#endif
 1133|      1|    if (lock) {
  ------------------
  |  Branch (1133:9): [True: 1, False: 0]
  ------------------
 1134|      1|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1135|      1|        CRYPTO_THREAD_unlock(store->lock);
 1136|       |        /*
 1137|       |         * This can be done outside the lock. We tolerate other threads getting
 1138|       |         * the wrong result briefly when creating OSSL_DECODER_CTXs.
 1139|       |         */
 1140|      1|#ifndef FIPS_MODULE
 1141|      1|        if (count < 1)
  ------------------
  |  Branch (1141:13): [True: 1, False: 0]
  ------------------
 1142|      1|            ossl_decoder_cache_flush(prov->libctx);
 1143|      1|#endif
 1144|      1|    }
 1145|      1|#ifndef FIPS_MODULE
 1146|      1|    if (freeparent)
  ------------------
  |  Branch (1146:9): [True: 0, False: 1]
  ------------------
 1147|      0|        ossl_provider_free_parent(prov, 1);
 1148|      1|#endif
 1149|       |
 1150|       |    /* We don't deinit here, that's done in ossl_provider_free() */
 1151|      1|    return count;
 1152|      1|}
provider_core.c:provider_remove_store_methods:
 1255|      1|{
 1256|      1|    struct provider_store_st *store;
 1257|      1|    int freeing;
 1258|       |
 1259|      1|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (1259:9): [True: 0, False: 1]
  ------------------
 1260|      0|        return 0;
 1261|       |
 1262|      1|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1262:9): [True: 0, False: 1]
  ------------------
 1263|      0|        return 0;
 1264|      1|    freeing = store->freeing;
 1265|      1|    CRYPTO_THREAD_unlock(store->lock);
 1266|       |
 1267|      1|    if (!freeing) {
  ------------------
  |  Branch (1267:9): [True: 0, False: 1]
  ------------------
 1268|      0|        int acc;
 1269|       |
 1270|      0|        if (!CRYPTO_THREAD_write_lock(prov->opbits_lock))
  ------------------
  |  Branch (1270:13): [True: 0, False: 0]
  ------------------
 1271|      0|            return 0;
 1272|      0|        OPENSSL_free(prov->operation_bits);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1273|      0|        prov->operation_bits = NULL;
 1274|      0|        prov->operation_bits_sz = 0;
 1275|      0|        CRYPTO_THREAD_unlock(prov->opbits_lock);
 1276|       |
 1277|      0|        acc = evp_method_store_remove_all_provided(prov)
 1278|      0|#ifndef FIPS_MODULE
 1279|      0|            + ossl_encoder_store_remove_all_provided(prov)
 1280|      0|            + ossl_decoder_store_remove_all_provided(prov)
 1281|      0|            + ossl_store_loader_store_remove_all_provided(prov)
 1282|      0|#endif
 1283|      0|            ;
 1284|       |
 1285|      0|#ifndef FIPS_MODULE
 1286|      0|        return acc == 4;
 1287|       |#else
 1288|       |        return acc == 1;
 1289|       |#endif
 1290|      0|    }
 1291|      1|    return 1;
 1292|      1|}
provider_core.c:provider_activate_fallbacks:
 1335|  1.75k|{
 1336|  1.75k|    int use_fallbacks;
 1337|  1.75k|    int activated_fallback_count = 0;
 1338|  1.75k|    int ret = 0;
 1339|  1.75k|    const OSSL_PROVIDER_INFO *p;
 1340|       |
 1341|  1.75k|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1341:9): [True: 0, False: 1.75k]
  ------------------
 1342|      0|        return 0;
 1343|  1.75k|    use_fallbacks = store->use_fallbacks;
 1344|  1.75k|    CRYPTO_THREAD_unlock(store->lock);
 1345|  1.75k|    if (!use_fallbacks)
  ------------------
  |  Branch (1345:9): [True: 1.75k, False: 1]
  ------------------
 1346|  1.75k|        return 1;
 1347|       |
 1348|      1|    if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (1348:9): [True: 0, False: 1]
  ------------------
 1349|      0|        return 0;
 1350|       |    /* Check again, just in case another thread changed it */
 1351|      1|    use_fallbacks = store->use_fallbacks;
 1352|      1|    if (!use_fallbacks) {
  ------------------
  |  Branch (1352:9): [True: 0, False: 1]
  ------------------
 1353|      0|        CRYPTO_THREAD_unlock(store->lock);
 1354|      0|        return 1;
 1355|      0|    }
 1356|       |
 1357|      4|    for (p = ossl_predefined_providers; p->name != NULL; p++) {
  ------------------
  |  Branch (1357:41): [True: 3, False: 1]
  ------------------
 1358|      3|        OSSL_PROVIDER *prov = NULL;
 1359|       |
 1360|      3|        if (!p->is_fallback)
  ------------------
  |  Branch (1360:13): [True: 2, False: 1]
  ------------------
 1361|      2|            continue;
 1362|       |        /*
 1363|       |         * We use the internal constructor directly here,
 1364|       |         * otherwise we get a call loop
 1365|       |         */
 1366|      1|        prov = provider_new(p->name, p->init, NULL);
 1367|      1|        if (prov == NULL)
  ------------------
  |  Branch (1367:13): [True: 0, False: 1]
  ------------------
 1368|      0|            goto err;
 1369|      1|        prov->libctx = store->libctx;
 1370|      1|#ifndef FIPS_MODULE
 1371|      1|        prov->error_lib = ERR_get_next_error_library();
 1372|      1|#endif
 1373|       |
 1374|       |        /*
 1375|       |         * We are calling provider_activate while holding the store lock. This
 1376|       |         * means the init function will be called while holding a lock. Normally
 1377|       |         * we try to avoid calling a user callback while holding a lock.
 1378|       |         * However, fallbacks are never third party providers so we accept this.
 1379|       |         */
 1380|      1|        if (provider_activate(prov, 0, 0) < 0) {
  ------------------
  |  Branch (1380:13): [True: 0, False: 1]
  ------------------
 1381|      0|            ossl_provider_free(prov);
 1382|      0|            goto err;
 1383|      0|        }
 1384|      1|        prov->store = store;
 1385|      1|        if (sk_OSSL_PROVIDER_push(store->providers, prov) == 0) {
  ------------------
  |  Branch (1385:13): [True: 0, False: 1]
  ------------------
 1386|      0|            ossl_provider_free(prov);
 1387|      0|            goto err;
 1388|      0|        }
 1389|      1|        activated_fallback_count++;
 1390|      1|    }
 1391|       |
 1392|      1|    if (activated_fallback_count > 0) {
  ------------------
  |  Branch (1392:9): [True: 1, False: 0]
  ------------------
 1393|      1|        store->use_fallbacks = 0;
 1394|      1|        ret = 1;
 1395|      1|    }
 1396|      1| err:
 1397|      1|    CRYPTO_THREAD_unlock(store->lock);
 1398|      1|    return ret;
 1399|      1|}

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

ossl_rand_cleanup_int:
   80|      2|{
   81|      2|# ifndef OPENSSL_NO_DEPRECATED_3_0
   82|      2|    const RAND_METHOD *meth = default_RAND_meth;
   83|       |
   84|      2|    if (!rand_inited)
  ------------------
  |  Branch (84:9): [True: 1, False: 1]
  ------------------
   85|      1|        return;
   86|       |
   87|      1|    if (meth != NULL && meth->cleanup != NULL)
  ------------------
  |  Branch (87:9): [True: 1, False: 0]
  |  Branch (87:25): [True: 0, False: 1]
  ------------------
   88|      0|        meth->cleanup();
   89|      1|    RAND_set_rand_method(NULL);
   90|      1|# endif
   91|      1|    ossl_rand_pool_cleanup();
   92|      1|# ifndef OPENSSL_NO_ENGINE
   93|      1|    CRYPTO_THREAD_lock_free(rand_engine_lock);
   94|      1|    rand_engine_lock = NULL;
   95|      1|# endif
   96|      1|# ifndef OPENSSL_NO_DEPRECATED_3_0
   97|      1|    CRYPTO_THREAD_lock_free(rand_meth_lock);
   98|      1|    rand_meth_lock = NULL;
   99|      1|# endif
  100|      1|    ossl_release_default_drbg_ctx();
  101|      1|    rand_inited = 0;
  102|      1|}
RAND_set_rand_method:
  181|      1|{
  182|      1|    return rand_set_rand_method_internal(meth, NULL);
  183|      1|}
RAND_get_rand_method:
  186|  7.61k|{
  187|  7.61k|    const RAND_METHOD *tmp_meth = NULL;
  188|       |
  189|  7.61k|    if (!RUN_ONCE(&rand_init, do_rand_init))
  ------------------
  |  |  130|  7.61k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 7.61k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (189:9): [True: 0, False: 7.61k]
  ------------------
  190|      0|        return NULL;
  191|       |
  192|  7.61k|    if (!CRYPTO_THREAD_read_lock(rand_meth_lock))
  ------------------
  |  Branch (192:9): [True: 0, False: 7.61k]
  ------------------
  193|      0|        return NULL;
  194|  7.61k|    tmp_meth = default_RAND_meth;
  195|  7.61k|    CRYPTO_THREAD_unlock(rand_meth_lock);
  196|  7.61k|    if (tmp_meth != NULL)
  ------------------
  |  Branch (196:9): [True: 7.61k, False: 1]
  ------------------
  197|  7.61k|        return tmp_meth;
  198|       |
  199|      1|    if (!CRYPTO_THREAD_write_lock(rand_meth_lock))
  ------------------
  |  Branch (199:9): [True: 0, False: 1]
  ------------------
  200|      0|        return NULL;
  201|      1|    if (default_RAND_meth == NULL) {
  ------------------
  |  Branch (201:9): [True: 1, False: 0]
  ------------------
  202|      1|#  ifndef OPENSSL_NO_ENGINE
  203|      1|        ENGINE *e;
  204|       |
  205|       |        /* If we have an engine that can do RAND, use it. */
  206|      1|        if ((e = ENGINE_get_default_RAND()) != NULL
  ------------------
  |  Branch (206:13): [True: 0, False: 1]
  ------------------
  207|      1|                && (tmp_meth = ENGINE_get_RAND(e)) != NULL) {
  ------------------
  |  Branch (207:20): [True: 0, False: 0]
  ------------------
  208|      0|            funct_ref = e;
  209|      0|            default_RAND_meth = tmp_meth;
  210|      1|        } else {
  211|      1|            ENGINE_finish(e);
  212|      1|            default_RAND_meth = &ossl_rand_meth;
  213|      1|        }
  214|       |#  else
  215|       |        default_RAND_meth = &ossl_rand_meth;
  216|       |#  endif
  217|      1|    }
  218|      1|    tmp_meth = default_RAND_meth;
  219|      1|    CRYPTO_THREAD_unlock(rand_meth_lock);
  220|      1|    return tmp_meth;
  221|      1|}
RAND_priv_bytes_ex:
  335|  7.61k|{
  336|  7.61k|    EVP_RAND_CTX *rand;
  337|  7.61k|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  338|  7.61k|    const RAND_METHOD *meth = RAND_get_rand_method();
  339|       |
  340|  7.61k|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (340:9): [True: 7.61k, False: 0]
  |  Branch (340:25): [True: 0, False: 7.61k]
  ------------------
  341|      0|        if (meth->bytes != NULL)
  ------------------
  |  Branch (341:13): [True: 0, False: 0]
  ------------------
  342|      0|            return meth->bytes(buf, num);
  343|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  344|      0|        return -1;
  345|      0|    }
  346|  7.61k|#endif
  347|       |
  348|  7.61k|    rand = RAND_get0_private(ctx);
  349|  7.61k|    if (rand != NULL)
  ------------------
  |  Branch (349:9): [True: 7.61k, False: 0]
  ------------------
  350|  7.61k|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  351|       |
  352|      0|    return 0;
  353|  7.61k|}
ossl_rand_ctx_new:
  453|      2|{
  454|      2|    RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  455|       |
  456|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (456:9): [True: 0, False: 2]
  ------------------
  457|      0|        return NULL;
  458|       |
  459|      2|#ifndef FIPS_MODULE
  460|       |    /*
  461|       |     * We need to ensure that base libcrypto thread handling has been
  462|       |     * initialised.
  463|       |     */
  464|      2|     OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  465|      2|#endif
  466|       |
  467|      2|    dgbl->lock = CRYPTO_THREAD_lock_new();
  468|      2|    if (dgbl->lock == NULL)
  ------------------
  |  Branch (468:9): [True: 0, False: 2]
  ------------------
  469|      0|        goto err1;
  470|       |
  471|      2|    if (!CRYPTO_THREAD_init_local(&dgbl->private, NULL))
  ------------------
  |  Branch (471:9): [True: 0, False: 2]
  ------------------
  472|      0|        goto err1;
  473|       |
  474|      2|    if (!CRYPTO_THREAD_init_local(&dgbl->public, NULL))
  ------------------
  |  Branch (474:9): [True: 0, False: 2]
  ------------------
  475|      0|        goto err2;
  476|       |
  477|      2|    return dgbl;
  478|       |
  479|      0| err2:
  480|      0|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  481|      0| err1:
  482|      0|    CRYPTO_THREAD_lock_free(dgbl->lock);
  483|      0|    OPENSSL_free(dgbl);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  484|      0|    return NULL;
  485|      0|}
ossl_rand_ctx_free:
  488|      2|{
  489|      2|    RAND_GLOBAL *dgbl = vdgbl;
  490|       |
  491|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (491:9): [True: 0, False: 2]
  ------------------
  492|      0|        return;
  493|       |
  494|      2|    CRYPTO_THREAD_lock_free(dgbl->lock);
  495|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  496|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->public);
  497|      2|    EVP_RAND_CTX_free(dgbl->primary);
  498|      2|    EVP_RAND_CTX_free(dgbl->seed);
  499|      2|    OPENSSL_free(dgbl->rng_name);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  500|      2|    OPENSSL_free(dgbl->rng_cipher);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  501|      2|    OPENSSL_free(dgbl->rng_digest);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  502|      2|    OPENSSL_free(dgbl->rng_propq);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  503|      2|    OPENSSL_free(dgbl->seed_name);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  504|      2|    OPENSSL_free(dgbl->seed_propq);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  505|       |
  506|      2|    OPENSSL_free(dgbl);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  507|      2|}
RAND_get0_primary:
  625|      1|{
  626|      1|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
  627|      1|    EVP_RAND_CTX *ret;
  628|       |
  629|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (629:9): [True: 0, False: 1]
  ------------------
  630|      0|        return NULL;
  631|       |
  632|      1|    if (!CRYPTO_THREAD_read_lock(dgbl->lock))
  ------------------
  |  Branch (632:9): [True: 0, False: 1]
  ------------------
  633|      0|        return NULL;
  634|       |
  635|      1|    ret = dgbl->primary;
  636|      1|    CRYPTO_THREAD_unlock(dgbl->lock);
  637|       |
  638|      1|    if (ret != NULL)
  ------------------
  |  Branch (638:9): [True: 0, False: 1]
  ------------------
  639|      0|        return ret;
  640|       |
  641|      1|    if (!CRYPTO_THREAD_write_lock(dgbl->lock))
  ------------------
  |  Branch (641:9): [True: 0, False: 1]
  ------------------
  642|      0|        return NULL;
  643|       |
  644|      1|    ret = dgbl->primary;
  645|      1|    if (ret != NULL) {
  ------------------
  |  Branch (645:9): [True: 0, False: 1]
  ------------------
  646|      0|        CRYPTO_THREAD_unlock(dgbl->lock);
  647|      0|        return ret;
  648|      0|    }
  649|       |
  650|      1|#ifndef FIPS_MODULE
  651|      1|    if (dgbl->seed == NULL) {
  ------------------
  |  Branch (651:9): [True: 1, False: 0]
  ------------------
  652|      1|        ERR_set_mark();
  653|      1|        dgbl->seed = rand_new_seed(ctx);
  654|      1|        ERR_pop_to_mark();
  655|      1|    }
  656|      1|#endif
  657|       |
  658|      1|    ret = dgbl->primary = rand_new_drbg(ctx, dgbl->seed,
  659|      1|                                        PRIMARY_RESEED_INTERVAL,
  ------------------
  |  |   23|      1|# define PRIMARY_RESEED_INTERVAL                 (1 << 8)
  ------------------
  660|      1|                                        PRIMARY_RESEED_TIME_INTERVAL, 1);
  ------------------
  |  |   25|      1|# define PRIMARY_RESEED_TIME_INTERVAL            (60 * 60) /* 1 hour */
  ------------------
  661|       |    /*
  662|       |    * The primary DRBG may be shared between multiple threads so we must
  663|       |    * enable locking.
  664|       |    */
  665|      1|    if (ret != NULL && !EVP_RAND_enable_locking(ret)) {
  ------------------
  |  Branch (665:9): [True: 1, False: 0]
  |  Branch (665:24): [True: 0, False: 1]
  ------------------
  666|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  667|      0|        EVP_RAND_CTX_free(ret);
  668|      0|        ret = dgbl->primary = NULL;
  669|      0|    }
  670|      1|    CRYPTO_THREAD_unlock(dgbl->lock);
  671|       |
  672|      1|    return ret;
  673|      1|}
RAND_get0_private:
  713|  7.61k|{
  714|  7.61k|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
  715|  7.61k|    EVP_RAND_CTX *rand, *primary;
  716|       |
  717|  7.61k|    if (dgbl == NULL)
  ------------------
  |  Branch (717:9): [True: 0, False: 7.61k]
  ------------------
  718|      0|        return NULL;
  719|       |
  720|  7.61k|    rand = CRYPTO_THREAD_get_local(&dgbl->private);
  721|  7.61k|    if (rand == NULL) {
  ------------------
  |  Branch (721:9): [True: 1, False: 7.61k]
  ------------------
  722|      1|        primary = RAND_get0_primary(ctx);
  723|      1|        if (primary == NULL)
  ------------------
  |  Branch (723:13): [True: 0, False: 1]
  ------------------
  724|      0|            return NULL;
  725|       |
  726|      1|        ctx = ossl_lib_ctx_get_concrete(ctx);
  727|       |        /*
  728|       |         * If the public is also NULL then this is the first time we've
  729|       |         * used this thread.
  730|       |         */
  731|      1|        if (CRYPTO_THREAD_get_local(&dgbl->public) == NULL
  ------------------
  |  Branch (731:13): [True: 1, False: 0]
  ------------------
  732|      1|                && !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
  ------------------
  |  Branch (732:20): [True: 0, False: 1]
  ------------------
  733|      0|            return NULL;
  734|      1|        rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
  ------------------
  |  |   24|      1|# define SECONDARY_RESEED_INTERVAL               (1 << 16)
  ------------------
  735|      1|                             SECONDARY_RESEED_TIME_INTERVAL, 0);
  ------------------
  |  |   26|      1|# define SECONDARY_RESEED_TIME_INTERVAL          (7 * 60)  /* 7 minutes */
  ------------------
  736|      1|        CRYPTO_THREAD_set_local(&dgbl->private, rand);
  737|      1|    }
  738|  7.61k|    return rand;
  739|  7.61k|}
rand_lib.c:do_rand_init:
   48|      1|{
   49|      1|# ifndef OPENSSL_NO_ENGINE
   50|      1|    rand_engine_lock = CRYPTO_THREAD_lock_new();
   51|      1|    if (rand_engine_lock == NULL)
  ------------------
  |  Branch (51:9): [True: 0, False: 1]
  ------------------
   52|      0|        return 0;
   53|      1|# endif
   54|       |
   55|      1|# ifndef OPENSSL_NO_DEPRECATED_3_0
   56|      1|    rand_meth_lock = CRYPTO_THREAD_lock_new();
   57|      1|    if (rand_meth_lock == NULL)
  ------------------
  |  Branch (57:9): [True: 0, False: 1]
  ------------------
   58|      0|        goto err;
   59|      1|# endif
   60|       |
   61|      1|    if (!ossl_rand_pool_init())
  ------------------
  |  Branch (61:9): [True: 0, False: 1]
  ------------------
   62|      0|        goto err;
   63|       |
   64|      1|    rand_inited = 1;
   65|      1|    return 1;
   66|       |
   67|      0| err:
   68|      0|# ifndef OPENSSL_NO_DEPRECATED_3_0
   69|      0|    CRYPTO_THREAD_lock_free(rand_meth_lock);
   70|      0|    rand_meth_lock = NULL;
   71|      0|# endif
   72|      0|# ifndef OPENSSL_NO_ENGINE
   73|      0|    CRYPTO_THREAD_lock_free(rand_engine_lock);
   74|      0|    rand_engine_lock = NULL;
   75|      0|# endif
   76|      0|    return 0;
   77|      1|}
rand_lib.c:rand_set_rand_method_internal:
  165|      1|{
  166|      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 (166:9): [True: 0, False: 1]
  ------------------
  167|      0|        return 0;
  168|       |
  169|      1|    if (!CRYPTO_THREAD_write_lock(rand_meth_lock))
  ------------------
  |  Branch (169:9): [True: 0, False: 1]
  ------------------
  170|      0|        return 0;
  171|      1|#  ifndef OPENSSL_NO_ENGINE
  172|      1|    ENGINE_finish(funct_ref);
  173|      1|    funct_ref = e;
  174|      1|#  endif
  175|      1|    default_RAND_meth = meth;
  176|      1|    CRYPTO_THREAD_unlock(rand_meth_lock);
  177|      1|    return 1;
  178|      1|}
rand_lib.c:rand_get_global:
  510|  7.62k|{
  511|  7.62k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_INDEX);
  ------------------
  |  |  103|  7.62k|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  512|  7.62k|}
rand_lib.c:rand_new_seed:
  534|      1|{
  535|      1|    EVP_RAND *rand;
  536|      1|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  537|      1|    EVP_RAND_CTX *ctx;
  538|      1|    char *name;
  539|       |
  540|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (540:9): [True: 0, False: 1]
  ------------------
  541|      0|        return NULL;
  542|      1|    name = dgbl->seed_name != NULL ? dgbl->seed_name : "SEED-SRC";
  ------------------
  |  Branch (542:12): [True: 0, False: 1]
  ------------------
  543|      1|    rand = EVP_RAND_fetch(libctx, name, dgbl->seed_propq);
  544|      1|    if (rand == NULL) {
  ------------------
  |  Branch (544:9): [True: 0, False: 1]
  ------------------
  545|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  546|      0|        return NULL;
  547|      0|    }
  548|      1|    ctx = EVP_RAND_CTX_new(rand, NULL);
  549|      1|    EVP_RAND_free(rand);
  550|      1|    if (ctx == NULL) {
  ------------------
  |  Branch (550:9): [True: 0, False: 1]
  ------------------
  551|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  552|      0|        return NULL;
  553|      0|    }
  554|      1|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, NULL)) {
  ------------------
  |  Branch (554:9): [True: 0, False: 1]
  ------------------
  555|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  556|      0|        EVP_RAND_CTX_free(ctx);
  557|      0|        return NULL;
  558|      0|    }
  559|      1|    return ctx;
  560|      1|}
rand_lib.c:rand_new_drbg:
  566|      2|{
  567|      2|    EVP_RAND *rand;
  568|      2|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  569|      2|    EVP_RAND_CTX *ctx;
  570|      2|    OSSL_PARAM params[8], *p = params;
  571|      2|    const OSSL_PARAM *settables;
  572|      2|    char *name, *cipher;
  573|       |
  574|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (574:9): [True: 0, False: 2]
  ------------------
  575|      0|        return NULL;
  576|      2|    name = dgbl->rng_name != NULL ? dgbl->rng_name : "CTR-DRBG";
  ------------------
  |  Branch (576:12): [True: 0, False: 2]
  ------------------
  577|      2|    rand = EVP_RAND_fetch(libctx, name, dgbl->rng_propq);
  578|      2|    if (rand == NULL) {
  ------------------
  |  Branch (578:9): [True: 0, False: 2]
  ------------------
  579|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  580|      0|        return NULL;
  581|      0|    }
  582|      2|    ctx = EVP_RAND_CTX_new(rand, parent);
  583|      2|    EVP_RAND_free(rand);
  584|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (584:9): [True: 0, False: 2]
  ------------------
  585|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  586|      0|        return NULL;
  587|      0|    }
  588|       |
  589|      2|    settables = EVP_RAND_CTX_settable_params(ctx);
  590|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_CIPHER)) {
  ------------------
  |  |  202|      2|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  112|      2|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  |  Branch (590:9): [True: 2, False: 0]
  ------------------
  591|      2|        cipher = dgbl->rng_cipher != NULL ? dgbl->rng_cipher : "AES-256-CTR";
  ------------------
  |  Branch (591:18): [True: 0, False: 2]
  ------------------
  592|      2|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
  ------------------
  |  |  202|      2|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  112|      2|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  593|      2|                                                cipher, 0);
  594|      2|    }
  595|      2|    if (dgbl->rng_digest != NULL
  ------------------
  |  Branch (595:9): [True: 0, False: 2]
  ------------------
  596|      2|            && OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_DIGEST))
  ------------------
  |  |  203|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  113|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  |  Branch (596:16): [True: 0, False: 0]
  ------------------
  597|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_DIGEST,
  ------------------
  |  |  203|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  113|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  598|      0|                                                dgbl->rng_digest, 0);
  599|      2|    if (dgbl->rng_propq != NULL)
  ------------------
  |  Branch (599:9): [True: 0, False: 2]
  ------------------
  600|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_PROPERTIES,
  ------------------
  |  |  215|      0|# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  116|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  601|      0|                                                dgbl->rng_propq, 0);
  602|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_ALG_PARAM_MAC))
  ------------------
  |  |  115|      2|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  |  Branch (602:9): [True: 0, False: 2]
  ------------------
  603|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_ALG_PARAM_MAC, "HMAC", 0);
  ------------------
  |  |  115|      0|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  604|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_USE_DF))
  ------------------
  |  |  222|      2|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  |  Branch (604:9): [True: 2, False: 0]
  ------------------
  605|      2|        *p++ = OSSL_PARAM_construct_int(OSSL_DRBG_PARAM_USE_DF, &use_df);
  ------------------
  |  |  222|      2|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  606|      2|    *p++ = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_REQUESTS,
  ------------------
  |  |  218|      2|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  607|      2|                                     &reseed_interval);
  608|      2|    *p++ = OSSL_PARAM_construct_time_t(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL,
  ------------------
  |  |  220|      2|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  609|      2|                                       &reseed_time_interval);
  610|      2|    *p = OSSL_PARAM_construct_end();
  611|      2|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, params)) {
  ------------------
  |  Branch (611:9): [True: 0, False: 2]
  ------------------
  612|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  613|      0|        EVP_RAND_CTX_free(ctx);
  614|      0|        return NULL;
  615|      0|    }
  616|      2|    return ctx;
  617|      2|}
rand_lib.c:rand_delete_thread_state:
  515|      1|{
  516|      1|    OSSL_LIB_CTX *ctx = arg;
  517|      1|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
  518|      1|    EVP_RAND_CTX *rand;
  519|       |
  520|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (520:9): [True: 0, False: 1]
  ------------------
  521|      0|        return;
  522|       |
  523|      1|    rand = CRYPTO_THREAD_get_local(&dgbl->public);
  524|      1|    CRYPTO_THREAD_set_local(&dgbl->public, NULL);
  525|      1|    EVP_RAND_CTX_free(rand);
  526|       |
  527|      1|    rand = CRYPTO_THREAD_get_local(&dgbl->private);
  528|      1|    CRYPTO_THREAD_set_local(&dgbl->private, NULL);
  529|      1|    EVP_RAND_CTX_free(rand);
  530|      1|}

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

ossl_rand_pool_new:
   24|      1|{
   25|      1|    RAND_POOL *pool = OPENSSL_zalloc(sizeof(*pool));
  ------------------
  |  |   99|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      1|    size_t min_alloc_size = RAND_POOL_MIN_ALLOCATION(secure);
  ------------------
  |  |   60|      1|# define RAND_POOL_MIN_ALLOCATION(secure) ((secure) ? 16 : 48)
  |  |  ------------------
  |  |  |  Branch (60:44): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   27|       |
   28|      1|    if (pool == NULL)
  ------------------
  |  Branch (28:9): [True: 0, False: 1]
  ------------------
   29|      0|        return NULL;
   30|       |
   31|      1|    pool->min_len = min_len;
   32|      1|    pool->max_len = (max_len > RAND_POOL_MAX_LENGTH) ?
  ------------------
  |  |   36|      1|# define RAND_POOL_MAX_LENGTH    (RAND_POOL_FACTOR * \
  |  |  ------------------
  |  |  |  |   35|      1|# define RAND_POOL_FACTOR        256
  |  |  ------------------
  |  |   37|      1|                                  3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   37|      1|# define RAND_DRBG_STRENGTH             256
  |  |  ------------------
  ------------------
  |  Branch (32:21): [True: 0, False: 1]
  ------------------
   33|      1|        RAND_POOL_MAX_LENGTH : max_len;
  ------------------
  |  |   36|      0|# define RAND_POOL_MAX_LENGTH    (RAND_POOL_FACTOR * \
  |  |  ------------------
  |  |  |  |   35|      0|# define RAND_POOL_FACTOR        256
  |  |  ------------------
  |  |   37|      0|                                  3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   37|      0|# define RAND_DRBG_STRENGTH             256
  |  |  ------------------
  ------------------
   34|      1|    pool->alloc_len = min_len < min_alloc_size ? min_alloc_size : min_len;
  ------------------
  |  Branch (34:23): [True: 0, False: 1]
  ------------------
   35|      1|    if (pool->alloc_len > pool->max_len)
  ------------------
  |  Branch (35:9): [True: 0, False: 1]
  ------------------
   36|      0|        pool->alloc_len = pool->max_len;
   37|       |
   38|      1|    if (secure)
  ------------------
  |  Branch (38:9): [True: 1, False: 0]
  ------------------
   39|      1|        pool->buffer = OPENSSL_secure_zalloc(pool->alloc_len);
  ------------------
  |  |  117|      1|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      0|    else
   41|      0|        pool->buffer = OPENSSL_zalloc(pool->alloc_len);
  ------------------
  |  |   99|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   42|       |
   43|      1|    if (pool->buffer == NULL)
  ------------------
  |  Branch (43:9): [True: 0, False: 1]
  ------------------
   44|      0|        goto err;
   45|       |
   46|      1|    pool->entropy_requested = entropy_requested;
   47|      1|    pool->secure = secure;
   48|      1|    return pool;
   49|       |
   50|      0|err:
   51|      0|    OPENSSL_free(pool);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|      0|    return NULL;
   53|      1|}
ossl_rand_pool_free:
   89|      1|{
   90|      1|    if (pool == NULL)
  ------------------
  |  Branch (90:9): [True: 0, False: 1]
  ------------------
   91|      0|        return;
   92|       |
   93|       |    /*
   94|       |     * Although it would be advisable from a cryptographical viewpoint,
   95|       |     * we are not allowed to clear attached buffers, since they are passed
   96|       |     * to ossl_rand_pool_attach() as `const unsigned char*`.
   97|       |     * (see corresponding comment in ossl_rand_pool_attach()).
   98|       |     */
   99|      1|    if (!pool->attached) {
  ------------------
  |  Branch (99:9): [True: 1, False: 0]
  ------------------
  100|      1|        if (pool->secure)
  ------------------
  |  Branch (100:13): [True: 1, False: 0]
  ------------------
  101|      1|            OPENSSL_secure_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  121|      1|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|      0|        else
  103|      0|            OPENSSL_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  105|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|      1|    }
  105|       |
  106|      1|    OPENSSL_free(pool);
  ------------------
  |  |  107|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  107|      1|}
ossl_rand_pool_buffer:
  113|      1|{
  114|      1|    return pool->buffer;
  115|      1|}
ossl_rand_pool_length:
  129|      1|{
  130|      1|    return pool->len;
  131|      1|}
ossl_rand_pool_entropy_available:
  175|      1|{
  176|      1|    if (pool->entropy < pool->entropy_requested)
  ------------------
  |  Branch (176:9): [True: 0, False: 1]
  ------------------
  177|      0|        return 0;
  178|       |
  179|      1|    if (pool->len < pool->min_len)
  ------------------
  |  Branch (179:9): [True: 0, False: 1]
  ------------------
  180|      0|        return 0;
  181|       |
  182|      1|    return pool->entropy;
  183|      1|}
ossl_rand_pool_entropy_needed:
  191|      1|{
  192|      1|    if (pool->entropy < pool->entropy_requested)
  ------------------
  |  Branch (192:9): [True: 0, False: 1]
  ------------------
  193|      0|        return pool->entropy_requested - pool->entropy;
  194|       |
  195|      1|    return 0;
  196|      1|}
ossl_rand_pool_bytes_needed:
  239|      1|{
  240|      1|    size_t bytes_needed;
  241|      1|    size_t entropy_needed = ossl_rand_pool_entropy_needed(pool);
  242|       |
  243|      1|    if (entropy_factor < 1) {
  ------------------
  |  Branch (243:9): [True: 0, False: 1]
  ------------------
  244|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ARGUMENT_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  245|      0|        return 0;
  246|      0|    }
  247|       |
  248|      1|    bytes_needed = ENTROPY_TO_BYTES(entropy_needed, entropy_factor);
  ------------------
  |  |  163|      1|    (((bits) * (entropy_factor) + 7) / 8)
  ------------------
  249|       |
  250|      1|    if (bytes_needed > pool->max_len - pool->len) {
  ------------------
  |  Branch (250:9): [True: 0, False: 1]
  ------------------
  251|       |        /* not enough space left */
  252|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  253|      0|        return 0;
  254|      0|    }
  255|       |
  256|      1|    if (pool->len < pool->min_len &&
  ------------------
  |  Branch (256:9): [True: 1, False: 0]
  ------------------
  257|      1|        bytes_needed < pool->min_len - pool->len)
  ------------------
  |  Branch (257:9): [True: 1, False: 0]
  ------------------
  258|       |        /* to meet the min_len requirement */
  259|      1|        bytes_needed = pool->min_len - pool->len;
  260|       |
  261|       |    /*
  262|       |     * Make sure the buffer is large enough for the requested amount
  263|       |     * of data. This guarantees that existing code patterns where
  264|       |     * ossl_rand_pool_add_begin, ossl_rand_pool_add_end or ossl_rand_pool_add
  265|       |     * are used to collect entropy data without any error handling
  266|       |     * whatsoever, continue to be valid.
  267|       |     * Furthermore if the allocation here fails once, make sure that
  268|       |     * we don't fall back to a less secure or even blocking random source,
  269|       |     * as that could happen by the existing code patterns.
  270|       |     * This is not a concern for additional data, therefore that
  271|       |     * is not needed if rand_pool_grow fails in other places.
  272|       |     */
  273|      1|    if (!rand_pool_grow(pool, bytes_needed)) {
  ------------------
  |  Branch (273:9): [True: 0, False: 1]
  ------------------
  274|       |        /* persistent error for this pool */
  275|      0|        pool->max_len = pool->len = 0;
  276|      0|        return 0;
  277|      0|    }
  278|       |
  279|      1|    return bytes_needed;
  280|      1|}
ossl_rand_pool_add_begin:
  353|      1|{
  354|      1|    if (len == 0)
  ------------------
  |  Branch (354:9): [True: 0, False: 1]
  ------------------
  355|      0|        return NULL;
  356|       |
  357|      1|    if (len > pool->max_len - pool->len) {
  ------------------
  |  Branch (357:9): [True: 0, False: 1]
  ------------------
  358|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  359|      0|        return NULL;
  360|      0|    }
  361|       |
  362|      1|    if (pool->buffer == NULL) {
  ------------------
  |  Branch (362:9): [True: 0, False: 1]
  ------------------
  363|      0|        ERR_raise(ERR_LIB_RAND, 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  364|      0|        return NULL;
  365|      0|    }
  366|       |
  367|       |    /*
  368|       |     * As long as the allocation request stays within the limits given
  369|       |     * by ossl_rand_pool_bytes_needed this rand_pool_grow below is guaranteed
  370|       |     * to succeed, thus no allocation happens.
  371|       |     * We have that only for cases when a pool is used to collect
  372|       |     * additional data. Then the buffer might need to grow here,
  373|       |     * and of course the caller is responsible to check the return
  374|       |     * value of this function.
  375|       |     */
  376|      1|    if (!rand_pool_grow(pool, len))
  ------------------
  |  Branch (376:9): [True: 0, False: 1]
  ------------------
  377|      0|        return NULL;
  378|       |
  379|      1|    return pool->buffer + pool->len;
  380|      1|}
ossl_rand_pool_add_end:
  392|      1|{
  393|      1|    if (len > pool->alloc_len - pool->len) {
  ------------------
  |  Branch (393:9): [True: 0, False: 1]
  ------------------
  394|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  395|      0|        return 0;
  396|      0|    }
  397|       |
  398|      1|    if (len > 0) {
  ------------------
  |  Branch (398:9): [True: 1, False: 0]
  ------------------
  399|      1|        pool->len += len;
  400|      1|        pool->entropy += entropy;
  401|      1|    }
  402|       |
  403|      1|    return 1;
  404|      1|}
rand_pool.c:rand_pool_grow:
  200|      2|{
  201|      2|    if (len > pool->alloc_len - pool->len) {
  ------------------
  |  Branch (201:9): [True: 0, False: 2]
  ------------------
  202|      0|        unsigned char *p;
  203|      0|        const size_t limit = pool->max_len / 2;
  204|      0|        size_t newlen = pool->alloc_len;
  205|       |
  206|      0|        if (pool->attached || len > pool->max_len - pool->len) {
  ------------------
  |  Branch (206:13): [True: 0, False: 0]
  |  Branch (206:31): [True: 0, False: 0]
  ------------------
  207|      0|            ERR_raise(ERR_LIB_RAND, 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  208|      0|            return 0;
  209|      0|        }
  210|       |
  211|      0|        do
  212|      0|            newlen = newlen < limit ? newlen * 2 : pool->max_len;
  ------------------
  |  Branch (212:22): [True: 0, False: 0]
  ------------------
  213|      0|        while (len > newlen - pool->len);
  ------------------
  |  Branch (213:16): [True: 0, False: 0]
  ------------------
  214|       |
  215|      0|        if (pool->secure)
  ------------------
  |  Branch (215:13): [True: 0, False: 0]
  ------------------
  216|      0|            p = OPENSSL_secure_zalloc(newlen);
  ------------------
  |  |  117|      0|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  217|      0|        else
  218|      0|            p = OPENSSL_zalloc(newlen);
  ------------------
  |  |   99|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  219|      0|        if (p == NULL)
  ------------------
  |  Branch (219:13): [True: 0, False: 0]
  ------------------
  220|      0|            return 0;
  221|      0|        memcpy(p, pool->buffer, pool->len);
  222|      0|        if (pool->secure)
  ------------------
  |  Branch (222:13): [True: 0, False: 0]
  ------------------
  223|      0|            OPENSSL_secure_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  121|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  224|      0|        else
  225|      0|            OPENSSL_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  105|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  226|      0|        pool->buffer = p;
  227|      0|        pool->alloc_len = newlen;
  228|      0|    }
  229|      2|    return 1;
  230|      2|}

rsa_ameth.c:rsa_pub_decode:
   77|  4.53k|{
   78|  4.53k|    const unsigned char *p;
   79|  4.53k|    int pklen;
   80|  4.53k|    X509_ALGOR *alg;
   81|  4.53k|    RSA *rsa = NULL;
   82|       |
   83|  4.53k|    if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &alg, pubkey))
  ------------------
  |  Branch (83:9): [True: 0, False: 4.53k]
  ------------------
   84|      0|        return 0;
   85|  4.53k|    if ((rsa = d2i_RSAPublicKey(NULL, &p, pklen)) == NULL)
  ------------------
  |  Branch (85:9): [True: 244, False: 4.29k]
  ------------------
   86|    244|        return 0;
   87|  4.29k|    if (!ossl_rsa_param_decode(rsa, alg)) {
  ------------------
  |  Branch (87:9): [True: 294, False: 3.99k]
  ------------------
   88|    294|        RSA_free(rsa);
   89|    294|        return 0;
   90|    294|    }
   91|       |
   92|  3.99k|    RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK);
  ------------------
  |  |  117|  3.99k|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
   93|  3.99k|    switch (pkey->ameth->pkey_id) {
   94|    609|    case EVP_PKEY_RSA:
  ------------------
  |  |   59|    609|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|    609|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (94:5): [True: 609, False: 3.38k]
  ------------------
   95|    609|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSA);
  ------------------
  |  |  118|    609|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
   96|    609|        break;
   97|  3.38k|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   61|  3.38k|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|  3.38k|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (97:5): [True: 3.38k, False: 609]
  ------------------
   98|  3.38k|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSASSAPSS);
  ------------------
  |  |  119|  3.38k|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
   99|  3.38k|        break;
  100|      0|    default:
  ------------------
  |  Branch (100:5): [True: 0, False: 3.99k]
  ------------------
  101|       |        /* Leave the type bits zero */
  102|      0|        break;
  103|  3.99k|    }
  104|       |
  105|  3.99k|    if (!EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa)) {
  ------------------
  |  Branch (105:9): [True: 0, False: 3.99k]
  ------------------
  106|      0|        RSA_free(rsa);
  107|      0|        return 0;
  108|      0|    }
  109|  3.99k|    return 1;
  110|  3.99k|}
rsa_ameth.c:int_rsa_free:
  201|  4.53k|{
  202|  4.53k|    RSA_free(pkey->pkey.rsa);
  203|  4.53k|}

rsa_asn1.c:rsa_cb:
   30|  13.4k|{
   31|  13.4k|    if (operation == ASN1_OP_NEW_PRE) {
  ------------------
  |  |  742|  13.4k|# define ASN1_OP_NEW_PRE         0
  ------------------
  |  Branch (31:9): [True: 4.49k, False: 8.99k]
  ------------------
   32|  4.49k|        *pval = (ASN1_VALUE *)RSA_new();
   33|  4.49k|        if (*pval != NULL)
  ------------------
  |  Branch (33:13): [True: 4.49k, False: 0]
  ------------------
   34|  4.49k|            return 2;
   35|      0|        return 0;
   36|  8.99k|    } else if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  8.99k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (36:16): [True: 205, False: 8.78k]
  ------------------
   37|    205|        RSA_free((RSA *)*pval);
   38|    205|        *pval = NULL;
   39|    205|        return 2;
   40|  8.78k|    } else if (operation == ASN1_OP_D2I_POST) {
  ------------------
  |  |  747|  8.78k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (40:16): [True: 4.29k, False: 4.49k]
  ------------------
   41|  4.29k|        if (((RSA *)*pval)->version != RSA_ASN1_VERSION_MULTI) {
  ------------------
  |  |   60|  4.29k|#  define RSA_ASN1_VERSION_MULTI          1
  ------------------
  |  Branch (41:13): [True: 4.29k, False: 0]
  ------------------
   42|       |            /* not a multi-prime key, skip */
   43|  4.29k|            return 1;
   44|  4.29k|        }
   45|      0|        return (ossl_rsa_multip_calc_product((RSA *)*pval) == 1) ? 2 : 0;
  ------------------
  |  Branch (45:16): [True: 0, False: 0]
  ------------------
   46|  4.29k|    }
   47|  4.49k|    return 1;
   48|  13.4k|}
rsa_asn1.c:rsa_pss_cb:
   79|  4.85k|{
   80|  4.85k|    if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  4.85k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (80:9): [True: 810, False: 4.04k]
  ------------------
   81|    810|        RSA_PSS_PARAMS *pss = (RSA_PSS_PARAMS *)*pval;
   82|    810|        X509_ALGOR_free(pss->maskHash);
   83|    810|    }
   84|  4.85k|    return 1;
   85|  4.85k|}

ossl_rsa_todata:
  125|  3.99k|{
  126|  3.99k|    int ret = 0;
  127|  3.99k|    const BIGNUM *rsa_d = NULL, *rsa_n = NULL, *rsa_e = NULL;
  128|  3.99k|    STACK_OF(BIGNUM_const) *factors = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|  3.99k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  129|  3.99k|    STACK_OF(BIGNUM_const) *exps = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|  3.99k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  130|  3.99k|    STACK_OF(BIGNUM_const) *coeffs = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|  3.99k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  131|       |
  132|  3.99k|    if (rsa == NULL || factors == NULL || exps == NULL || coeffs == NULL)
  ------------------
  |  Branch (132:9): [True: 0, False: 3.99k]
  |  Branch (132:24): [True: 0, False: 3.99k]
  |  Branch (132:43): [True: 0, False: 3.99k]
  |  Branch (132:59): [True: 0, False: 3.99k]
  ------------------
  133|      0|        goto err;
  134|       |
  135|  3.99k|    RSA_get0_key(rsa, &rsa_n, &rsa_e, &rsa_d);
  136|  3.99k|    ossl_rsa_get0_all_params(rsa, factors, exps, coeffs);
  137|       |
  138|  3.99k|    if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_N, rsa_n)
  ------------------
  |  |  414|  3.99k|# define OSSL_PKEY_PARAM_RSA_N "n"
  ------------------
  |  Branch (138:9): [True: 0, False: 3.99k]
  ------------------
  139|  3.99k|        || !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_E, rsa_e))
  ------------------
  |  |  389|  3.99k|# define OSSL_PKEY_PARAM_RSA_E "e"
  ------------------
  |  Branch (139:12): [True: 0, False: 3.99k]
  ------------------
  140|      0|        goto err;
  141|       |
  142|       |    /* Check private key data integrity */
  143|  3.99k|    if (include_private && rsa_d != NULL) {
  ------------------
  |  Branch (143:9): [True: 3.99k, False: 0]
  |  Branch (143:28): [True: 0, False: 3.99k]
  ------------------
  144|      0|        int numprimes = sk_BIGNUM_const_num(factors);
  145|      0|        int numexps = sk_BIGNUM_const_num(exps);
  146|      0|        int numcoeffs = sk_BIGNUM_const_num(coeffs);
  147|       |
  148|       |        /*
  149|       |         * It's permissible to have zero primes, i.e. no CRT params.
  150|       |         * Otherwise, there must be at least two, as many exponents,
  151|       |         * and one coefficient less.
  152|       |         */
  153|      0|        if (numprimes != 0
  ------------------
  |  Branch (153:13): [True: 0, False: 0]
  ------------------
  154|      0|            && (numprimes < 2 || numexps < 2 || numcoeffs < 1))
  ------------------
  |  Branch (154:17): [True: 0, False: 0]
  |  Branch (154:34): [True: 0, False: 0]
  |  Branch (154:49): [True: 0, False: 0]
  ------------------
  155|      0|            goto err;
  156|       |
  157|      0|        if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_D,
  ------------------
  |  |  386|      0|# define OSSL_PKEY_PARAM_RSA_D "d"
  ------------------
  |  Branch (157:13): [True: 0, False: 0]
  ------------------
  158|      0|                                     rsa_d)
  159|      0|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (159:16): [True: 0, False: 0]
  ------------------
  160|      0|                                                  ossl_rsa_mp_factor_names,
  161|      0|                                                  factors)
  162|      0|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (162:16): [True: 0, False: 0]
  ------------------
  163|      0|                                                  ossl_rsa_mp_exp_names, exps)
  164|      0|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (164:16): [True: 0, False: 0]
  ------------------
  165|      0|                                                  ossl_rsa_mp_coeff_names,
  166|      0|                                                  coeffs))
  167|      0|        goto err;
  168|      0|    }
  169|       |
  170|       |#if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
  171|       |    /* The acvp test results are not meant for export so check for bld == NULL */
  172|       |    if (bld == NULL)
  173|       |        ossl_rsa_acvp_test_get_params(rsa, params);
  174|       |#endif
  175|  3.99k|    ret = 1;
  176|  3.99k| err:
  177|  3.99k|    sk_BIGNUM_const_free(factors);
  178|  3.99k|    sk_BIGNUM_const_free(exps);
  179|  3.99k|    sk_BIGNUM_const_free(coeffs);
  180|  3.99k|    return ret;
  181|  3.99k|}
ossl_rsa_pss_params_30_todata:
  185|  3.38k|{
  186|  3.38k|    if (!ossl_rsa_pss_params_30_is_unrestricted(pss)) {
  ------------------
  |  Branch (186:9): [True: 809, False: 2.58k]
  ------------------
  187|    809|        int hashalg_nid = ossl_rsa_pss_params_30_hashalg(pss);
  188|    809|        int maskgenalg_nid = ossl_rsa_pss_params_30_maskgenalg(pss);
  189|    809|        int maskgenhashalg_nid = ossl_rsa_pss_params_30_maskgenhashalg(pss);
  190|    809|        int saltlen = ossl_rsa_pss_params_30_saltlen(pss);
  191|    809|        int default_hashalg_nid = ossl_rsa_pss_params_30_hashalg(NULL);
  192|    809|        int default_maskgenalg_nid = ossl_rsa_pss_params_30_maskgenalg(NULL);
  193|    809|        int default_maskgenhashalg_nid =
  194|    809|                ossl_rsa_pss_params_30_maskgenhashalg(NULL);
  195|    809|        const char *mdname =
  196|    809|            (hashalg_nid == default_hashalg_nid
  ------------------
  |  Branch (196:14): [True: 809, False: 0]
  ------------------
  197|    809|             ? NULL : ossl_rsa_oaeppss_nid2name(hashalg_nid));
  198|    809|        const char *mgfname =
  199|    809|            (maskgenalg_nid == default_maskgenalg_nid
  ------------------
  |  Branch (199:14): [True: 809, False: 0]
  ------------------
  200|    809|             ? NULL : ossl_rsa_oaeppss_nid2name(maskgenalg_nid));
  201|    809|        const char *mgf1mdname =
  202|    809|            (maskgenhashalg_nid == default_maskgenhashalg_nid
  ------------------
  |  Branch (202:14): [True: 809, False: 0]
  ------------------
  203|    809|             ? NULL : ossl_rsa_oaeppss_nid2name(maskgenhashalg_nid));
  204|    809|        const char *key_md = OSSL_PKEY_PARAM_RSA_DIGEST;
  ------------------
  |  |  387|    809|# define OSSL_PKEY_PARAM_RSA_DIGEST OSSL_PKEY_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  322|    809|# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|    809|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|    809|        const char *key_mgf = OSSL_PKEY_PARAM_RSA_MASKGENFUNC;
  ------------------
  |  |  412|    809|# define OSSL_PKEY_PARAM_RSA_MASKGENFUNC OSSL_PKEY_PARAM_MASKGENFUNC
  |  |  ------------------
  |  |  |  |  367|    809|# define OSSL_PKEY_PARAM_MASKGENFUNC "mgf"
  |  |  ------------------
  ------------------
  206|    809|        const char *key_mgf1_md = OSSL_PKEY_PARAM_RSA_MGF1_DIGEST;
  ------------------
  |  |  413|    809|# define OSSL_PKEY_PARAM_RSA_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
  |  |  ------------------
  |  |  |  |  369|    809|# define OSSL_PKEY_PARAM_MGF1_DIGEST "mgf1-digest"
  |  |  ------------------
  ------------------
  207|    809|        const char *key_saltlen = OSSL_PKEY_PARAM_RSA_PSS_SALTLEN;
  ------------------
  |  |  416|    809|# define OSSL_PKEY_PARAM_RSA_PSS_SALTLEN "saltlen"
  ------------------
  208|       |
  209|       |        /*
  210|       |         * To ensure that the key isn't seen as unrestricted by the recipient,
  211|       |         * we make sure that at least one PSS-related parameter is passed, even
  212|       |         * if it has a default value; saltlen.
  213|       |         */
  214|    809|        if ((mdname != NULL
  ------------------
  |  Branch (214:14): [True: 0, False: 809]
  ------------------
  215|    809|             && !ossl_param_build_set_utf8_string(bld, params, key_md, mdname))
  ------------------
  |  Branch (215:17): [True: 0, False: 0]
  ------------------
  216|    809|            || (mgfname != NULL
  ------------------
  |  Branch (216:17): [True: 0, False: 809]
  ------------------
  217|    809|                && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (217:20): [True: 0, False: 0]
  ------------------
  218|      0|                                                     key_mgf, mgfname))
  219|    809|            || (mgf1mdname != NULL
  ------------------
  |  Branch (219:17): [True: 0, False: 809]
  ------------------
  220|    809|                && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (220:20): [True: 0, False: 0]
  ------------------
  221|      0|                                                     key_mgf1_md, mgf1mdname))
  222|    809|            || (!ossl_param_build_set_int(bld, params, key_saltlen, saltlen)))
  ------------------
  |  Branch (222:16): [True: 0, False: 809]
  ------------------
  223|      0|            return 0;
  224|    809|    }
  225|  3.38k|    return 1;
  226|  3.38k|}
ossl_rsa_is_foreign:
  332|  3.99k|{
  333|  3.99k|#ifndef FIPS_MODULE
  334|  3.99k|    if (rsa->engine != NULL || RSA_get_method(rsa) != RSA_PKCS1_OpenSSL())
  ------------------
  |  Branch (334:9): [True: 0, False: 3.99k]
  |  Branch (334:32): [True: 0, False: 3.99k]
  ------------------
  335|      0|        return 1;
  336|  3.99k|#endif
  337|  3.99k|    return 0;
  338|  3.99k|}
ossl_rsa_pss_decode:
  444|    810|{
  445|    810|    RSA_PSS_PARAMS *pss;
  446|       |
  447|    810|    pss = ASN1_TYPE_unpack_sequence(ASN1_ITEM_rptr(RSA_PSS_PARAMS),
  ------------------
  |  |  426|    810|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  448|    810|                                    alg->parameter);
  449|       |
  450|    810|    if (pss == NULL)
  ------------------
  |  Branch (450:9): [True: 1, False: 809]
  ------------------
  451|      1|        return NULL;
  452|       |
  453|    809|    if (pss->maskGenAlgorithm != NULL) {
  ------------------
  |  Branch (453:9): [True: 0, False: 809]
  ------------------
  454|      0|        pss->maskHash = ossl_x509_algor_mgf1_decode(pss->maskGenAlgorithm);
  455|      0|        if (pss->maskHash == NULL) {
  ------------------
  |  Branch (455:13): [True: 0, False: 0]
  ------------------
  456|      0|            RSA_PSS_PARAMS_free(pss);
  457|      0|            return NULL;
  458|      0|        }
  459|      0|    }
  460|       |
  461|    809|    return pss;
  462|    809|}
ossl_rsa_pss_get_param_unverified:
  506|    809|{
  507|    809|    RSA_PSS_PARAMS_30 pss_params;
  508|       |
  509|       |    /* Get the defaults from the ONE place */
  510|    809|    (void)ossl_rsa_pss_params_30_set_defaults(&pss_params);
  511|       |
  512|    809|    if (pss == NULL)
  ------------------
  |  Branch (512:9): [True: 0, False: 809]
  ------------------
  513|      0|        return 0;
  514|    809|    *pmd = ossl_x509_algor_get_md(pss->hashAlgorithm);
  515|    809|    if (*pmd == NULL)
  ------------------
  |  Branch (515:9): [True: 0, False: 809]
  ------------------
  516|      0|        return 0;
  517|    809|    *pmgf1md = ossl_x509_algor_get_md(pss->maskHash);
  518|    809|    if (*pmgf1md == NULL)
  ------------------
  |  Branch (518:9): [True: 0, False: 809]
  ------------------
  519|      0|        return 0;
  520|    809|    if (pss->saltLength)
  ------------------
  |  Branch (520:9): [True: 0, False: 809]
  ------------------
  521|      0|        *psaltlen = ASN1_INTEGER_get(pss->saltLength);
  522|    809|    else
  523|    809|        *psaltlen = ossl_rsa_pss_params_30_saltlen(&pss_params);
  524|    809|    if (pss->trailerField)
  ------------------
  |  Branch (524:9): [True: 0, False: 809]
  ------------------
  525|      0|        *ptrailerField = ASN1_INTEGER_get(pss->trailerField);
  526|    809|    else
  527|    809|        *ptrailerField = ossl_rsa_pss_params_30_trailerfield(&pss_params);
  528|       |
  529|    809|    return 1;
  530|    809|}
ossl_rsa_param_decode:
  533|  4.29k|{
  534|  4.29k|    RSA_PSS_PARAMS *pss;
  535|  4.29k|    const ASN1_OBJECT *algoid;
  536|  4.29k|    const void *algp;
  537|  4.29k|    int algptype;
  538|       |
  539|  4.29k|    X509_ALGOR_get0(&algoid, &algptype, &algp, alg);
  540|  4.29k|    if (OBJ_obj2nid(algoid) != EVP_PKEY_RSA_PSS)
  ------------------
  |  |   61|  4.29k|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|  4.29k|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (540:9): [True: 609, False: 3.68k]
  ------------------
  541|    609|        return 1;
  542|  3.68k|    if (algptype == V_ASN1_UNDEF)
  ------------------
  |  |   60|  3.68k|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (542:9): [True: 2.58k, False: 1.10k]
  ------------------
  543|  2.58k|        return 1;
  544|  1.10k|    if (algptype != V_ASN1_SEQUENCE) {
  ------------------
  |  |   74|  1.10k|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (544:9): [True: 293, False: 810]
  ------------------
  545|    293|        ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS);
  ------------------
  |  |  401|    293|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    293|    (ERR_new(),                                                 \
  |  |  |  |  404|    293|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    293|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    293|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    293|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    293|     ERR_set_error)
  |  |  ------------------
  ------------------
  546|    293|        return 0;
  547|    293|    }
  548|    810|    if ((pss = ossl_rsa_pss_decode(alg)) == NULL
  ------------------
  |  Branch (548:9): [True: 1, False: 809]
  ------------------
  549|    810|        || !ossl_rsa_set0_pss_params(rsa, pss)) {
  ------------------
  |  Branch (549:12): [True: 0, False: 809]
  ------------------
  550|      1|        RSA_PSS_PARAMS_free(pss);
  551|      1|        return 0;
  552|      1|    }
  553|    809|    if (!ossl_rsa_sync_to_pss_params_30(rsa))
  ------------------
  |  Branch (553:9): [True: 0, False: 809]
  ------------------
  554|      0|        return 0;
  555|    809|    return 1;
  556|    809|}
rsa_backend.c:ossl_rsa_sync_to_pss_params_30:
  465|    809|{
  466|    809|    const RSA_PSS_PARAMS *legacy_pss = NULL;
  467|    809|    RSA_PSS_PARAMS_30 *pss = NULL;
  468|       |
  469|    809|    if (rsa != NULL
  ------------------
  |  Branch (469:9): [True: 809, False: 0]
  ------------------
  470|    809|        && (legacy_pss = RSA_get0_pss_params(rsa)) != NULL
  ------------------
  |  Branch (470:12): [True: 809, False: 0]
  ------------------
  471|    809|        && (pss = ossl_rsa_get0_pss_params_30(rsa)) != NULL) {
  ------------------
  |  Branch (471:12): [True: 809, False: 0]
  ------------------
  472|    809|        const EVP_MD *md = NULL, *mgf1md = NULL;
  473|    809|        int md_nid, mgf1md_nid, saltlen, trailerField;
  474|    809|        RSA_PSS_PARAMS_30 pss_params;
  475|       |
  476|       |        /*
  477|       |         * We don't care about the validity of the fields here, we just
  478|       |         * want to synchronise values.  Verifying here makes it impossible
  479|       |         * to even read a key with invalid values, making it hard to test
  480|       |         * a bad situation.
  481|       |         *
  482|       |         * Other routines use ossl_rsa_pss_get_param(), so the values will
  483|       |         * be checked, eventually.
  484|       |         */
  485|    809|        if (!ossl_rsa_pss_get_param_unverified(legacy_pss, &md, &mgf1md,
  ------------------
  |  Branch (485:13): [True: 0, False: 809]
  ------------------
  486|    809|                                               &saltlen, &trailerField))
  487|      0|            return 0;
  488|    809|        md_nid = EVP_MD_get_type(md);
  489|    809|        mgf1md_nid = EVP_MD_get_type(mgf1md);
  490|    809|        if (!ossl_rsa_pss_params_30_set_defaults(&pss_params)
  ------------------
  |  Branch (490:13): [True: 0, False: 809]
  ------------------
  491|    809|            || !ossl_rsa_pss_params_30_set_hashalg(&pss_params, md_nid)
  ------------------
  |  Branch (491:16): [True: 0, False: 809]
  ------------------
  492|    809|            || !ossl_rsa_pss_params_30_set_maskgenhashalg(&pss_params,
  ------------------
  |  Branch (492:16): [True: 0, False: 809]
  ------------------
  493|    809|                                                          mgf1md_nid)
  494|    809|            || !ossl_rsa_pss_params_30_set_saltlen(&pss_params, saltlen)
  ------------------
  |  Branch (494:16): [True: 0, False: 809]
  ------------------
  495|    809|            || !ossl_rsa_pss_params_30_set_trailerfield(&pss_params,
  ------------------
  |  Branch (495:16): [True: 0, False: 809]
  ------------------
  496|    809|                                                        trailerField))
  497|      0|            return 0;
  498|    809|        *pss = pss_params;
  499|    809|    }
  500|    809|    return 1;
  501|    809|}

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

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|  4.49k|{
   36|  4.49k|    return rsa_new_intern(NULL, NULL);
   37|  4.49k|}
RSA_get_method:
   40|  3.99k|{
   41|  3.99k|    return rsa->meth;
   42|  3.99k|}
RSA_free:
  137|  13.5k|{
  138|  13.5k|    int i;
  139|       |
  140|  13.5k|    if (r == NULL)
  ------------------
  |  Branch (140:9): [True: 5.09k, False: 8.49k]
  ------------------
  141|  5.09k|        return;
  142|       |
  143|  8.49k|    CRYPTO_DOWN_REF(&r->references, &i);
  144|  8.49k|    REF_PRINT_COUNT("RSA", r);
  ------------------
  |  |  289|  8.49k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  8.49k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  8.49k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  8.49k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|  8.49k|    if (i > 0)
  ------------------
  |  Branch (145:9): [True: 3.99k, False: 4.49k]
  ------------------
  146|  3.99k|        return;
  147|  4.49k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|  4.49k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 4.49k]
  |  |  ------------------
  ------------------
  148|       |
  149|  4.49k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (149:9): [True: 4.49k, False: 0]
  |  Branch (149:28): [True: 4.49k, False: 0]
  ------------------
  150|  4.49k|        r->meth->finish(r);
  151|  4.49k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  152|  4.49k|    ENGINE_finish(r->engine);
  153|  4.49k|#endif
  154|       |
  155|  4.49k|#ifndef FIPS_MODULE
  156|  4.49k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data);
  ------------------
  |  |  227|  4.49k|# define CRYPTO_EX_INDEX_RSA              9
  ------------------
  157|  4.49k|#endif
  158|       |
  159|  4.49k|    CRYPTO_THREAD_lock_free(r->lock);
  160|  4.49k|    CRYPTO_FREE_REF(&r->references);
  161|       |
  162|  4.49k|    BN_free(r->n);
  163|  4.49k|    BN_free(r->e);
  164|  4.49k|    BN_clear_free(r->d);
  165|  4.49k|    BN_clear_free(r->p);
  166|  4.49k|    BN_clear_free(r->q);
  167|  4.49k|    BN_clear_free(r->dmp1);
  168|  4.49k|    BN_clear_free(r->dmq1);
  169|  4.49k|    BN_clear_free(r->iqmp);
  170|       |
  171|       |#if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
  172|       |    ossl_rsa_acvp_test_free(r->acvp_test);
  173|       |#endif
  174|       |
  175|  4.49k|#ifndef FIPS_MODULE
  176|  4.49k|    RSA_PSS_PARAMS_free(r->pss);
  177|  4.49k|    sk_RSA_PRIME_INFO_pop_free(r->prime_infos, ossl_rsa_multip_info_free);
  178|  4.49k|#endif
  179|  4.49k|    BN_BLINDING_free(r->blinding);
  180|  4.49k|    BN_BLINDING_free(r->mt_blinding);
  181|  4.49k|    OPENSSL_free(r);
  ------------------
  |  |  107|  4.49k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  4.49k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  4.49k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  182|  4.49k|}
RSA_up_ref:
  185|  3.99k|{
  186|  3.99k|    int i;
  187|       |
  188|  3.99k|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (188:9): [True: 0, False: 3.99k]
  ------------------
  189|      0|        return 0;
  190|       |
  191|  3.99k|    REF_PRINT_COUNT("RSA", r);
  ------------------
  |  |  289|  3.99k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  3.99k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  3.99k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  3.99k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|  3.99k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|  3.99k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 3.99k]
  |  |  ------------------
  ------------------
  193|  3.99k|    return i > 1 ? 1 : 0;
  ------------------
  |  Branch (193:12): [True: 3.99k, False: 0]
  ------------------
  194|  3.99k|}
ossl_rsa_set0_libctx:
  202|  3.99k|{
  203|  3.99k|    r->libctx = libctx;
  204|  3.99k|}
ossl_ifc_ffc_compute_security_bits:
  318|  3.99k|{
  319|  3.99k|    uint64_t x;
  320|  3.99k|    uint32_t lx;
  321|  3.99k|    uint16_t y, cap;
  322|       |
  323|       |    /*
  324|       |     * Look for common values as listed in standards.
  325|       |     * These values are not exactly equal to the results from the formulae in
  326|       |     * the standards but are defined to be canonical.
  327|       |     */
  328|  3.99k|    switch (n) {
  ------------------
  |  Branch (328:13): [True: 3.98k, False: 16]
  ------------------
  329|      1|    case 2048:      /* SP 800-56B rev 2 Appendix D and FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (329:5): [True: 1, False: 3.99k]
  ------------------
  330|      1|        return 112;
  331|      1|    case 3072:      /* SP 800-56B rev 2 Appendix D and FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (331:5): [True: 1, False: 3.99k]
  ------------------
  332|      1|        return 128;
  333|      1|    case 4096:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (333:5): [True: 1, False: 3.99k]
  ------------------
  334|      1|        return 152;
  335|      1|    case 6144:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (335:5): [True: 1, False: 3.99k]
  ------------------
  336|      1|        return 176;
  337|      1|    case 7680:      /* FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (337:5): [True: 1, False: 3.99k]
  ------------------
  338|      1|        return 192;
  339|     10|    case 8192:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (339:5): [True: 10, False: 3.98k]
  ------------------
  340|     10|        return 200;
  341|      1|    case 15360:     /* FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (341:5): [True: 1, False: 3.99k]
  ------------------
  342|      1|        return 256;
  343|  3.99k|    }
  344|       |
  345|       |    /*
  346|       |     * The first incorrect result (i.e. not accurate or off by one low) occurs
  347|       |     * for n = 699668.  The true value here is 1200.  Instead of using this n
  348|       |     * as the check threshold, the smallest n such that the correct result is
  349|       |     * 1200 is used instead.
  350|       |     */
  351|  3.98k|    if (n >= 687737)
  ------------------
  |  Branch (351:9): [True: 5, False: 3.97k]
  ------------------
  352|      5|        return 1200;
  353|  3.97k|    if (n < 8)
  ------------------
  |  Branch (353:9): [True: 838, False: 3.13k]
  ------------------
  354|    838|        return 0;
  355|       |
  356|       |    /*
  357|       |     * To ensure that the output is non-decreasing with respect to n,
  358|       |     * a cap needs to be applied to the two values where the function over
  359|       |     * estimates the strength (according to the above fast path).
  360|       |     */
  361|  3.13k|    if (n <= 7680)
  ------------------
  |  Branch (361:9): [True: 3.07k, False: 60]
  ------------------
  362|  3.07k|        cap = 192;
  363|     60|    else if (n <= 15360)
  ------------------
  |  Branch (363:14): [True: 42, False: 18]
  ------------------
  364|     42|        cap = 256;
  365|     18|    else
  366|     18|        cap = 1200;
  367|       |
  368|  3.13k|    x = n * (uint64_t)log_2;
  369|  3.13k|    lx = ilog_e(x);
  370|  3.13k|    y = (uint16_t)((mul2(c1_923, icbrt64(mul2(mul2(x, lx), lx))) - c4_690)
  371|  3.13k|                   / log_2);
  372|  3.13k|    y = (y + 4) & ~7;
  373|  3.13k|    if (y > cap)
  ------------------
  |  Branch (373:9): [True: 9, False: 3.13k]
  ------------------
  374|      9|        y = cap;
  375|  3.13k|    return y;
  376|  3.97k|}
RSA_security_bits:
  381|  3.99k|{
  382|  3.99k|    int bits = BN_num_bits(rsa->n);
  383|       |
  384|  3.99k|#ifndef FIPS_MODULE
  385|  3.99k|    if (rsa->version == RSA_ASN1_VERSION_MULTI) {
  ------------------
  |  |   60|  3.99k|#  define RSA_ASN1_VERSION_MULTI          1
  ------------------
  |  Branch (385:9): [True: 0, False: 3.99k]
  ------------------
  386|       |        /* This ought to mean that we have private key at hand. */
  387|      0|        int ex_primes = sk_RSA_PRIME_INFO_num(rsa->prime_infos);
  388|       |
  389|      0|        if (ex_primes <= 0 || (ex_primes + 2) > ossl_rsa_multip_cap(bits))
  ------------------
  |  Branch (389:13): [True: 0, False: 0]
  |  Branch (389:31): [True: 0, False: 0]
  ------------------
  390|      0|            return 0;
  391|      0|    }
  392|  3.99k|#endif
  393|  3.99k|    return ossl_ifc_ffc_compute_security_bits(bits);
  394|  3.99k|}
RSA_get0_key:
  551|  3.99k|{
  552|  3.99k|    if (n != NULL)
  ------------------
  |  Branch (552:9): [True: 3.99k, False: 0]
  ------------------
  553|  3.99k|        *n = r->n;
  554|  3.99k|    if (e != NULL)
  ------------------
  |  Branch (554:9): [True: 3.99k, False: 0]
  ------------------
  555|  3.99k|        *e = r->e;
  556|  3.99k|    if (d != NULL)
  ------------------
  |  Branch (556:9): [True: 3.99k, False: 0]
  ------------------
  557|  3.99k|        *d = r->d;
  558|  3.99k|}
RSA_get0_n:
  641|  3.99k|{
  642|  3.99k|    return r->n;
  643|  3.99k|}
RSA_get0_p:
  656|  3.99k|{
  657|  3.99k|    return r->p;
  658|  3.99k|}
RSA_get0_pss_params:
  681|    809|{
  682|       |#ifdef FIPS_MODULE
  683|       |    return NULL;
  684|       |#else
  685|    809|    return r->pss;
  686|    809|#endif
  687|    809|}
ossl_rsa_set0_pss_params:
  691|    809|{
  692|       |#ifdef FIPS_MODULE
  693|       |    return 0;
  694|       |#else
  695|    809|    RSA_PSS_PARAMS_free(r->pss);
  696|    809|    r->pss = pss;
  697|    809|    return 1;
  698|    809|#endif
  699|    809|}
ossl_rsa_get0_pss_params_30:
  703|  4.80k|{
  704|  4.80k|    return &r->pss_params;
  705|  4.80k|}
RSA_clear_flags:
  708|  3.99k|{
  709|  3.99k|    r->flags &= ~flags;
  710|  3.99k|}
RSA_test_flags:
  713|  11.9k|{
  714|  11.9k|    return r->flags & flags;
  715|  11.9k|}
RSA_set_flags:
  718|  3.99k|{
  719|  3.99k|    r->flags |= flags;
  720|  3.99k|}
ossl_rsa_get0_all_params:
  846|  3.99k|{
  847|  3.99k|#ifndef FIPS_MODULE
  848|  3.99k|    RSA_PRIME_INFO *pinfo;
  849|  3.99k|    int i, pnum;
  850|  3.99k|#endif
  851|       |
  852|  3.99k|    if (r == NULL)
  ------------------
  |  Branch (852:9): [True: 0, False: 3.99k]
  ------------------
  853|      0|        return 0;
  854|       |
  855|       |    /* If |p| is NULL, there are no CRT parameters */
  856|  3.99k|    if (RSA_get0_p(r) == NULL)
  ------------------
  |  Branch (856:9): [True: 3.99k, False: 0]
  ------------------
  857|  3.99k|        return 1;
  858|       |
  859|      0|    sk_BIGNUM_const_push(primes, RSA_get0_p(r));
  860|      0|    sk_BIGNUM_const_push(primes, RSA_get0_q(r));
  861|      0|    sk_BIGNUM_const_push(exps, RSA_get0_dmp1(r));
  862|      0|    sk_BIGNUM_const_push(exps, RSA_get0_dmq1(r));
  863|      0|    sk_BIGNUM_const_push(coeffs, RSA_get0_iqmp(r));
  864|       |
  865|      0|#ifndef FIPS_MODULE
  866|      0|    pnum = RSA_get_multi_prime_extra_count(r);
  867|      0|    for (i = 0; i < pnum; i++) {
  ------------------
  |  Branch (867:17): [True: 0, False: 0]
  ------------------
  868|      0|        pinfo = sk_RSA_PRIME_INFO_value(r->prime_infos, i);
  869|      0|        sk_BIGNUM_const_push(primes, pinfo->r);
  870|      0|        sk_BIGNUM_const_push(exps, pinfo->d);
  871|      0|        sk_BIGNUM_const_push(coeffs, pinfo->t);
  872|      0|    }
  873|      0|#endif
  874|       |
  875|      0|    return 1;
  876|  3.99k|}
rsa_lib.c:rsa_new_intern:
   76|  4.49k|{
   77|  4.49k|    RSA *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   99|  4.49k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  4.49k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  4.49k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   78|       |
   79|  4.49k|    if (ret == NULL)
  ------------------
  |  Branch (79:9): [True: 0, False: 4.49k]
  ------------------
   80|      0|        return NULL;
   81|       |
   82|  4.49k|    ret->lock = CRYPTO_THREAD_lock_new();
   83|  4.49k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (83:9): [True: 0, False: 4.49k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   85|      0|        OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   86|      0|        return NULL;
   87|      0|    }
   88|       |
   89|  4.49k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 4.49k]
  ------------------
   90|      0|        CRYPTO_THREAD_lock_free(ret->lock);
   91|      0|        OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|      0|        return NULL;
   93|      0|    }
   94|       |
   95|  4.49k|    ret->libctx = libctx;
   96|  4.49k|    ret->meth = RSA_get_default_method();
   97|  4.49k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   98|  4.49k|    ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |  477|  4.49k|#  define RSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
   99|  4.49k|    if (engine) {
  ------------------
  |  Branch (99:9): [True: 0, False: 4.49k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  102|      0|            goto err;
  103|      0|        }
  104|      0|        ret->engine = engine;
  105|  4.49k|    } else {
  106|  4.49k|        ret->engine = ENGINE_get_default_RSA();
  107|  4.49k|    }
  108|  4.49k|    if (ret->engine) {
  ------------------
  |  Branch (108:9): [True: 0, False: 4.49k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  112|      0|            goto err;
  113|      0|        }
  114|      0|    }
  115|  4.49k|#endif
  116|       |
  117|  4.49k|    ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |  477|  4.49k|#  define RSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
  118|  4.49k|#ifndef FIPS_MODULE
  119|  4.49k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data)) {
  ------------------
  |  |  227|  4.49k|# define CRYPTO_EX_INDEX_RSA              9
  ------------------
  |  Branch (119:9): [True: 0, False: 4.49k]
  ------------------
  120|      0|        goto err;
  121|      0|    }
  122|  4.49k|#endif
  123|       |
  124|  4.49k|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (124:9): [True: 4.49k, False: 0]
  |  Branch (124:38): [True: 0, False: 4.49k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        goto err;
  127|      0|    }
  128|       |
  129|  4.49k|    return ret;
  130|       |
  131|      0| err:
  132|      0|    RSA_free(ret);
  133|      0|    return NULL;
  134|  4.49k|}
rsa_lib.c:ilog_e:
  275|  3.13k|{
  276|  3.13k|    uint32_t i, r = 0;
  277|       |
  278|       |    /*
  279|       |     * Scale down the value into the range 1 .. 2.
  280|       |     *
  281|       |     * If fractional numbers need to be processed, another loop needs
  282|       |     * to go here that checks v < scale and if so multiplies it by 2 and
  283|       |     * reduces r by scale.  This also means making r signed.
  284|       |     */
  285|  17.9k|    while (v >= 2 * scale) {
  ------------------
  |  Branch (285:12): [True: 14.7k, False: 3.13k]
  ------------------
  286|  14.7k|        v >>= 1;
  287|  14.7k|        r += scale;
  288|  14.7k|    }
  289|  59.6k|    for (i = scale / 2; i != 0; i /= 2) {
  ------------------
  |  Branch (289:25): [True: 56.5k, False: 3.13k]
  ------------------
  290|  56.5k|        v = mul2(v, v);
  291|  56.5k|        if (v >= 2 * scale) {
  ------------------
  |  Branch (291:13): [True: 27.9k, False: 28.5k]
  ------------------
  292|  27.9k|            v >>= 1;
  293|  27.9k|            r += i;
  294|  27.9k|        }
  295|  56.5k|    }
  296|  3.13k|    r = (r * (uint64_t)scale) / log_e;
  297|  3.13k|    return r;
  298|  3.13k|}
rsa_lib.c:mul2:
  239|  65.9k|{
  240|  65.9k|    return a * b / scale;
  241|  65.9k|}
rsa_lib.c:icbrt64:
  251|  3.13k|{
  252|  3.13k|    uint64_t r = 0;
  253|  3.13k|    uint64_t b;
  254|  3.13k|    int s;
  255|       |
  256|  72.1k|    for (s = 63; s >= 0; s -= 3) {
  ------------------
  |  Branch (256:18): [True: 69.0k, False: 3.13k]
  ------------------
  257|  69.0k|        r <<= 1;
  258|  69.0k|        b = 3 * r * (r + 1) + 1;
  259|  69.0k|        if ((x >> s) >= b) {
  ------------------
  |  Branch (259:13): [True: 18.2k, False: 50.7k]
  ------------------
  260|  18.2k|            x -= b << s;
  261|  18.2k|            r++;
  262|  18.2k|        }
  263|  69.0k|    }
  264|  3.13k|    return r * cbrt_scale;
  265|  3.13k|}

RSA_get_default_method:
   85|  4.49k|{
   86|  4.49k|    return default_RSA_meth;
   87|  4.49k|}
RSA_PKCS1_OpenSSL:
   90|  3.99k|{
   91|  3.99k|    return &rsa_pkcs1_ossl_meth;
   92|  3.99k|}
rsa_ossl.c:rsa_ossl_init:
 1127|  4.49k|{
 1128|  4.49k|    rsa->flags |= RSA_FLAG_CACHE_PUBLIC | RSA_FLAG_CACHE_PRIVATE;
  ------------------
  |  |   65|  4.49k|#  define RSA_FLAG_CACHE_PUBLIC           0x0002
  ------------------
                  rsa->flags |= RSA_FLAG_CACHE_PUBLIC | RSA_FLAG_CACHE_PRIVATE;
  ------------------
  |  |   66|  4.49k|#  define RSA_FLAG_CACHE_PRIVATE          0x0004
  ------------------
 1129|  4.49k|    return 1;
 1130|  4.49k|}
rsa_ossl.c:rsa_ossl_finish:
 1133|  4.49k|{
 1134|  4.49k|#ifndef FIPS_MODULE
 1135|  4.49k|    int i;
 1136|  4.49k|    RSA_PRIME_INFO *pinfo;
 1137|       |
 1138|  4.49k|    for (i = 0; i < sk_RSA_PRIME_INFO_num(rsa->prime_infos); i++) {
  ------------------
  |  Branch (1138:17): [True: 0, False: 4.49k]
  ------------------
 1139|      0|        pinfo = sk_RSA_PRIME_INFO_value(rsa->prime_infos, i);
 1140|      0|        BN_MONT_CTX_free(pinfo->m);
 1141|      0|    }
 1142|  4.49k|#endif
 1143|       |
 1144|  4.49k|    BN_MONT_CTX_free(rsa->_method_mod_n);
 1145|  4.49k|    BN_MONT_CTX_free(rsa->_method_mod_p);
 1146|  4.49k|    BN_MONT_CTX_free(rsa->_method_mod_q);
 1147|  4.49k|    return 1;
 1148|  4.49k|}

ossl_rsa_pss_params_30_set_defaults:
  305|  1.61k|{
  306|  1.61k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (306:9): [True: 0, False: 1.61k]
  ------------------
  307|      0|        return 0;
  308|  1.61k|    *rsa_pss_params = default_RSASSA_PSS_params;
  309|  1.61k|    return 1;
  310|  1.61k|}
ossl_rsa_pss_params_30_is_unrestricted:
  313|  3.38k|{
  314|  3.38k|    static RSA_PSS_PARAMS_30 pss_params_cmp = { 0, };
  315|       |
  316|  3.38k|    return rsa_pss_params == NULL
  ------------------
  |  Branch (316:12): [True: 0, False: 3.38k]
  ------------------
  317|  3.38k|        || memcmp(rsa_pss_params, &pss_params_cmp,
  ------------------
  |  Branch (317:12): [True: 2.58k, False: 809]
  ------------------
  318|  3.38k|                  sizeof(*rsa_pss_params)) == 0;
  319|  3.38k|}
ossl_rsa_pss_params_30_set_hashalg:
  330|    809|{
  331|    809|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (331:9): [True: 0, False: 809]
  ------------------
  332|      0|        return 0;
  333|    809|    rsa_pss_params->hash_algorithm_nid = hashalg_nid;
  334|    809|    return 1;
  335|    809|}
ossl_rsa_pss_params_30_set_maskgenhashalg:
  339|    809|{
  340|    809|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 809]
  ------------------
  341|      0|        return 0;
  342|    809|    rsa_pss_params->mask_gen.hash_algorithm_nid = maskgenhashalg_nid;
  343|    809|    return 1;
  344|    809|}
ossl_rsa_pss_params_30_set_saltlen:
  348|    809|{
  349|    809|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (349:9): [True: 0, False: 809]
  ------------------
  350|      0|        return 0;
  351|    809|    rsa_pss_params->salt_len = saltlen;
  352|    809|    return 1;
  353|    809|}
ossl_rsa_pss_params_30_set_trailerfield:
  357|    809|{
  358|    809|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (358:9): [True: 0, False: 809]
  ------------------
  359|      0|        return 0;
  360|    809|    rsa_pss_params->trailer_field = trailerfield;
  361|    809|    return 1;
  362|    809|}
ossl_rsa_pss_params_30_hashalg:
  365|  1.61k|{
  366|  1.61k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (366:9): [True: 809, False: 809]
  ------------------
  367|    809|        return default_RSASSA_PSS_params.hash_algorithm_nid;
  368|    809|    return rsa_pss_params->hash_algorithm_nid;
  369|  1.61k|}
ossl_rsa_pss_params_30_maskgenalg:
  372|  1.61k|{
  373|  1.61k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (373:9): [True: 809, False: 809]
  ------------------
  374|    809|        return default_RSASSA_PSS_params.mask_gen.algorithm_nid;
  375|    809|    return rsa_pss_params->mask_gen.algorithm_nid;
  376|  1.61k|}
ossl_rsa_pss_params_30_maskgenhashalg:
  379|  1.61k|{
  380|  1.61k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (380:9): [True: 809, False: 809]
  ------------------
  381|    809|        return default_RSASSA_PSS_params.hash_algorithm_nid;
  382|    809|    return rsa_pss_params->mask_gen.hash_algorithm_nid;
  383|  1.61k|}
ossl_rsa_pss_params_30_saltlen:
  386|  1.61k|{
  387|  1.61k|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (387:9): [True: 0, False: 1.61k]
  ------------------
  388|      0|        return default_RSASSA_PSS_params.salt_len;
  389|  1.61k|    return rsa_pss_params->salt_len;
  390|  1.61k|}
ossl_rsa_pss_params_30_trailerfield:
  393|    809|{
  394|    809|    if (rsa_pss_params == NULL)
  ------------------
  |  Branch (394:9): [True: 0, False: 809]
  ------------------
  395|      0|        return default_RSASSA_PSS_params.trailer_field;
  396|    809|    return rsa_pss_params->trailer_field;
  397|    809|}

ossl_self_test_set_callback_new:
   37|      2|{
   38|      2|    SELF_TEST_CB *stcb;
   39|       |
   40|      2|    stcb = OPENSSL_zalloc(sizeof(*stcb));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   41|      2|    return stcb;
   42|      2|}
ossl_self_test_set_callback_free:
   45|      2|{
   46|      2|    OPENSSL_free(stcb);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   47|      2|}

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

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

ossl_sa_new:
   59|      8|{
   60|      8|    OPENSSL_SA *res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |   99|      8|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|       |
   62|      8|    return res;
   63|      8|}
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);
  ------------------
  |  |  107|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|      8|    }
  116|      8|}
ossl_sa_doall_arg:
  146|  1.75k|{
  147|  1.75k|    if (sa != NULL)
  ------------------
  |  Branch (147:9): [True: 1.75k, False: 0]
  ------------------
  148|  1.75k|        sa_doall(sa, NULL, leaf, arg);
  149|  1.75k|}
ossl_sa_get:
  157|  20.7k|{
  158|  20.7k|    int level;
  159|  20.7k|    void **p, *r = NULL;
  160|       |
  161|  20.7k|    if (sa == NULL || sa->nelem == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 20.7k]
  |  Branch (161:23): [True: 5, False: 20.7k]
  ------------------
  162|      5|        return NULL;
  163|       |
  164|  20.7k|    if (n <= sa->top) {
  ------------------
  |  Branch (164:9): [True: 20.5k, False: 170]
  ------------------
  165|  20.5k|        p = sa->nodes;
  166|  81.9k|        for (level = sa->levels - 1; p != NULL && level > 0; level--)
  ------------------
  |  Branch (166:38): [True: 81.8k, False: 196]
  |  Branch (166:51): [True: 61.4k, False: 20.3k]
  ------------------
  167|  61.4k|            p = (void **)p[(n >> (OPENSSL_SA_BLOCK_BITS * level))
  ------------------
  |  |   34|  61.4k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
  168|  61.4k|                           & SA_BLOCK_MASK];
  ------------------
  |  |   46|  61.4k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  61.4k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  61.4k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  20.5k|        r = p == NULL ? NULL : p[n & SA_BLOCK_MASK];
  ------------------
  |  |   46|  20.3k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  20.3k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  20.3k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (169:13): [True: 196, False: 20.3k]
  ------------------
  170|  20.5k|    }
  171|  20.7k|    return r;
  172|  20.7k|}
ossl_sa_set:
  180|    384|{
  181|    384|    int i, level = 1;
  182|    384|    ossl_uintmax_t n = posn;
  183|    384|    void **p;
  184|       |
  185|    384|    if (sa == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 384]
  ------------------
  186|      0|        return 0;
  187|       |
  188|  1.46k|    for (level = 1; level < SA_BLOCK_MAX_LEVELS; level++)
  ------------------
  |  |   47|  1.46k|#define SA_BLOCK_MAX_LEVELS     (((int)sizeof(ossl_uintmax_t) * 8 \
  |  |   48|  1.46k|                                  + OPENSSL_SA_BLOCK_BITS - 1) \
  |  |  ------------------
  |  |  |  |   34|  1.46k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  |  |   49|  1.46k|                                 / OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  1.46k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (188:21): [True: 1.46k, False: 0]
  ------------------
  189|  1.46k|        if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0)
  ------------------
  |  |   34|  1.46k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
  |  Branch (189:13): [True: 384, False: 1.07k]
  ------------------
  190|    384|            break;
  191|       |
  192|    390|    for (;sa->levels < level; sa->levels++) {
  ------------------
  |  Branch (192:11): [True: 6, False: 384]
  ------------------
  193|      6|        p = alloc_node();
  194|      6|        if (p == NULL)
  ------------------
  |  Branch (194:13): [True: 0, False: 6]
  ------------------
  195|      0|            return 0;
  196|      6|        p[0] = sa->nodes;
  197|      6|        sa->nodes = p;
  198|      6|    }
  199|    384|    if (sa->top < posn)
  ------------------
  |  Branch (199:9): [True: 87, False: 297]
  ------------------
  200|     87|        sa->top = posn;
  201|       |
  202|    384|    p = sa->nodes;
  203|  1.48k|    for (level = sa->levels - 1; level > 0; level--) {
  ------------------
  |  Branch (203:34): [True: 1.10k, False: 384]
  ------------------
  204|  1.10k|        i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   34|  1.10k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
                      i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   46|  1.10k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  1.10k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.10k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|  1.10k|        if (p[i] == NULL && (p[i] = alloc_node()) == NULL)
  ------------------
  |  Branch (205:13): [True: 373, False: 731]
  |  Branch (205:29): [True: 0, False: 373]
  ------------------
  206|      0|            return 0;
  207|  1.10k|        p = p[i];
  208|  1.10k|    }
  209|    384|    p += posn & SA_BLOCK_MASK;
  ------------------
  |  |   46|    384|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|    384|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    384|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|    384|    if (val == NULL && *p != NULL)
  ------------------
  |  Branch (210:9): [True: 192, False: 192]
  |  Branch (210:24): [True: 192, False: 0]
  ------------------
  211|    192|        sa->nelem--;
  212|    192|    else if (val != NULL && *p == NULL)
  ------------------
  |  Branch (212:14): [True: 192, False: 0]
  |  Branch (212:29): [True: 192, False: 0]
  ------------------
  213|    192|        sa->nelem++;
  214|    384|    *p = val;
  215|    384|    return 1;
  216|    384|}
sparse_array.c:sa_doall:
   67|  1.76k|{
   68|  1.76k|    int i[SA_BLOCK_MAX_LEVELS];
   69|  1.76k|    void *nodes[SA_BLOCK_MAX_LEVELS];
   70|  1.76k|    ossl_uintmax_t idx = 0;
   71|  1.76k|    int l = 0;
   72|       |
   73|  1.76k|    i[0] = 0;
   74|  1.76k|    nodes[0] = sa->nodes;
   75|  4.30M|    while (l >= 0) {
  ------------------
  |  Branch (75:12): [True: 4.30M, False: 1.76k]
  ------------------
   76|  4.30M|        const int n = i[l];
   77|  4.30M|        void ** const p = nodes[l];
   78|       |
   79|  4.30M|        if (n >= SA_BLOCK_MAX) {
  ------------------
  |  |   45|  4.30M|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  4.30M|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (79:13): [True: 253k, False: 4.05M]
  ------------------
   80|   253k|            if (p != NULL && node != NULL)
  ------------------
  |  Branch (80:17): [True: 253k, False: 12]
  |  Branch (80:30): [True: 379, False: 252k]
  ------------------
   81|    379|                (*node)(p);
   82|   253k|            l--;
   83|   253k|            idx >>= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|   253k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   84|  4.05M|        } else {
   85|  4.05M|            i[l] = n + 1;
   86|  4.05M|            if (p != NULL && p[n] != NULL) {
  ------------------
  |  Branch (86:17): [True: 4.05M, False: 192]
  |  Branch (86:30): [True: 381k, False: 3.67M]
  ------------------
   87|   381k|                idx = (idx & ~SA_BLOCK_MASK) | n;
  ------------------
  |  |   46|   381k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|   381k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   381k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|   381k|                if (l < sa->levels - 1) {
  ------------------
  |  Branch (88:21): [True: 251k, False: 129k]
  ------------------
   89|   251k|                    i[++l] = 0;
   90|   251k|                    nodes[l] = p[n];
   91|   251k|                    idx <<= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|   251k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   92|   251k|                } else if (leaf != NULL) {
  ------------------
  |  Branch (92:28): [True: 129k, False: 0]
  ------------------
   93|   129k|                    (*leaf)(idx, p[n], arg);
   94|   129k|                }
   95|   381k|            }
   96|  4.05M|        }
   97|  4.30M|    }
   98|  1.76k|}
sparse_array.c:sa_free_node:
  101|    379|{
  102|    379|    OPENSSL_free(p);
  ------------------
  |  |  107|    379|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    379|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    379|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|    379|}
sparse_array.c:alloc_node:
  175|    379|{
  176|    379|    return OPENSSL_zalloc(SA_BLOCK_MAX * sizeof(void *));
  ------------------
  |  |   99|    379|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    379|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    379|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|    379|}

OPENSSL_sk_set_cmp_func:
   37|  1.44k|{
   38|  1.44k|    OPENSSL_sk_compfunc old = sk->comp;
   39|       |
   40|  1.44k|    if (sk->comp != c)
  ------------------
  |  Branch (40:9): [True: 1.44k, False: 0]
  ------------------
   41|  1.44k|        sk->sorted = 0;
   42|  1.44k|    sk->comp = c;
   43|       |
   44|  1.44k|    return old;
   45|  1.44k|}
OPENSSL_sk_dup:
   48|  1.75k|{
   49|  1.75k|    OPENSSL_STACK *ret;
   50|       |
   51|  1.75k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |   97|  1.75k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.75k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.75k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (51:9): [True: 0, False: 1.75k]
  ------------------
   52|      0|        goto err;
   53|       |
   54|  1.75k|    if (sk == NULL) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.75k]
  ------------------
   55|      0|        ret->num = 0;
   56|      0|        ret->sorted = 0;
   57|      0|        ret->comp = NULL;
   58|  1.75k|    } else {
   59|       |        /* direct structure assignment */
   60|  1.75k|        *ret = *sk;
   61|  1.75k|    }
   62|       |
   63|  1.75k|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (63:9): [True: 0, False: 1.75k]
  |  Branch (63:23): [True: 0, False: 1.75k]
  ------------------
   64|       |        /* postpone |ret->data| allocation */
   65|      0|        ret->data = NULL;
   66|      0|        ret->num_alloc = 0;
   67|      0|        return ret;
   68|      0|    }
   69|       |
   70|       |    /* duplicate |sk->data| content */
   71|  1.75k|    ret->data = OPENSSL_malloc(sizeof(*ret->data) * sk->num_alloc);
  ------------------
  |  |   97|  1.75k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.75k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.75k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   72|  1.75k|    if (ret->data == NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 1.75k]
  ------------------
   73|      0|        goto err;
   74|  1.75k|    memcpy(ret->data, sk->data, sizeof(void *) * sk->num);
   75|  1.75k|    return ret;
   76|       |
   77|      0| err:
   78|      0|    OPENSSL_sk_free(ret);
   79|      0|    return NULL;
   80|  1.75k|}
OPENSSL_sk_deep_copy:
   85|   109k|{
   86|   109k|    OPENSSL_STACK *ret;
   87|   109k|    int i;
   88|       |
   89|   109k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |   97|   109k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   109k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   109k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (89:9): [True: 0, False: 109k]
  ------------------
   90|      0|        goto err;
   91|       |
   92|   109k|    if (sk == NULL) {
  ------------------
  |  Branch (92:9): [True: 1, False: 109k]
  ------------------
   93|      1|        ret->num = 0;
   94|      1|        ret->sorted = 0;
   95|      1|        ret->comp = NULL;
   96|   109k|    } else {
   97|       |        /* direct structure assignment */
   98|   109k|        *ret = *sk;
   99|   109k|    }
  100|       |
  101|   109k|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (101:9): [True: 1, False: 109k]
  |  Branch (101:23): [True: 0, False: 109k]
  ------------------
  102|       |        /* postpone |ret| data allocation */
  103|      1|        ret->data = NULL;
  104|      1|        ret->num_alloc = 0;
  105|      1|        return ret;
  106|      1|    }
  107|       |
  108|   109k|    ret->num_alloc = sk->num > min_nodes ? sk->num : min_nodes;
  ------------------
  |  Branch (108:22): [True: 40.5k, False: 68.7k]
  ------------------
  109|   109k|    ret->data = OPENSSL_zalloc(sizeof(*ret->data) * ret->num_alloc);
  ------------------
  |  |   99|   109k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   109k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   109k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  110|   109k|    if (ret->data == NULL)
  ------------------
  |  Branch (110:9): [True: 0, False: 109k]
  ------------------
  111|      0|        goto err;
  112|       |
  113|   469k|    for (i = 0; i < ret->num; ++i) {
  ------------------
  |  Branch (113:17): [True: 360k, False: 109k]
  ------------------
  114|   360k|        if (sk->data[i] == NULL)
  ------------------
  |  Branch (114:13): [True: 0, False: 360k]
  ------------------
  115|      0|            continue;
  116|   360k|        if ((ret->data[i] = copy_func(sk->data[i])) == NULL) {
  ------------------
  |  Branch (116:13): [True: 0, False: 360k]
  ------------------
  117|      0|            while (--i >= 0)
  ------------------
  |  Branch (117:20): [True: 0, False: 0]
  ------------------
  118|      0|                if (ret->data[i] != NULL)
  ------------------
  |  Branch (118:21): [True: 0, False: 0]
  ------------------
  119|      0|                    free_func((void *)ret->data[i]);
  120|      0|            goto err;
  121|      0|        }
  122|   360k|    }
  123|   109k|    return ret;
  124|       |
  125|      0| err:
  126|      0|    OPENSSL_sk_free(ret);
  127|      0|    return NULL;
  128|   109k|}
OPENSSL_sk_new_null:
  131|  3.57M|{
  132|  3.57M|    return OPENSSL_sk_new_reserve(NULL, 0);
  133|  3.57M|}
OPENSSL_sk_new:
  136|     63|{
  137|     63|    return OPENSSL_sk_new_reserve(c, 0);
  138|     63|}
OPENSSL_sk_new_reserve:
  227|  3.57M|{
  228|  3.57M|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |   99|  3.57M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.57M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.57M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  229|       |
  230|  3.57M|    if (st == NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 3.57M]
  ------------------
  231|      0|        return NULL;
  232|       |
  233|  3.57M|    st->comp = c;
  234|       |
  235|  3.57M|    if (n <= 0)
  ------------------
  |  Branch (235:9): [True: 3.57M, False: 0]
  ------------------
  236|  3.57M|        return st;
  237|       |
  238|      0|    if (!sk_reserve(st, n, 1)) {
  ------------------
  |  Branch (238:9): [True: 0, False: 0]
  ------------------
  239|      0|        OPENSSL_sk_free(st);
  240|      0|        return NULL;
  241|      0|    }
  242|       |
  243|      0|    return st;
  244|      0|}
OPENSSL_sk_insert:
  259|  7.15M|{
  260|  7.15M|    if (st == NULL) {
  ------------------
  |  Branch (260:9): [True: 0, False: 7.15M]
  ------------------
  261|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  262|      0|        return 0;
  263|      0|    }
  264|  7.15M|    if (st->num == max_nodes) {
  ------------------
  |  Branch (264:9): [True: 0, False: 7.15M]
  ------------------
  265|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  266|      0|        return 0;
  267|      0|    }
  268|       |
  269|  7.15M|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (269:9): [True: 0, False: 7.15M]
  ------------------
  270|      0|        return 0;
  271|       |
  272|  7.15M|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (272:9): [True: 7.15M, False: 0]
  |  Branch (272:29): [True: 0, False: 0]
  ------------------
  273|  7.15M|        st->data[st->num] = data;
  274|  7.15M|    } else {
  275|      0|        memmove(&st->data[loc + 1], &st->data[loc],
  276|      0|                sizeof(st->data[0]) * (st->num - loc));
  277|      0|        st->data[loc] = data;
  278|      0|    }
  279|  7.15M|    st->num++;
  280|  7.15M|    st->sorted = 0;
  281|  7.15M|    return st->num;
  282|  7.15M|}
OPENSSL_sk_delete:
  310|      2|{
  311|      2|    if (st == NULL || loc < 0 || loc >= st->num)
  ------------------
  |  Branch (311:9): [True: 0, False: 2]
  |  Branch (311:23): [True: 0, False: 2]
  |  Branch (311:34): [True: 0, False: 2]
  ------------------
  312|      0|        return NULL;
  313|       |
  314|      2|    return internal_delete(st, loc);
  315|      2|}
OPENSSL_sk_push:
  398|  7.15M|{
  399|  7.15M|    if (st == NULL)
  ------------------
  |  Branch (399:9): [True: 0, False: 7.15M]
  ------------------
  400|      0|        return -1;
  401|  7.15M|    return OPENSSL_sk_insert(st, data, st->num);
  402|  7.15M|}
OPENSSL_sk_pop_free:
  432|   892k|{
  433|   892k|    int i;
  434|       |
  435|   892k|    if (st == NULL)
  ------------------
  |  Branch (435:9): [True: 337k, False: 555k]
  ------------------
  436|   337k|        return;
  437|  6.01M|    for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (437:17): [True: 5.45M, False: 555k]
  ------------------
  438|  5.45M|        if (st->data[i] != NULL)
  ------------------
  |  Branch (438:13): [True: 5.45M, False: 600]
  ------------------
  439|  5.45M|            func((char *)st->data[i]);
  440|   555k|    OPENSSL_sk_free(st);
  441|   555k|}
OPENSSL_sk_free:
  444|  4.60M|{
  445|  4.60M|    if (st == NULL)
  ------------------
  |  Branch (445:9): [True: 913k, False: 3.68M]
  ------------------
  446|   913k|        return;
  447|  3.68M|    OPENSSL_free(st->data);
  ------------------
  |  |  107|  3.68M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.68M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.68M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  448|  3.68M|    OPENSSL_free(st);
  ------------------
  |  |  107|  3.68M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.68M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.68M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  449|  3.68M|}
OPENSSL_sk_num:
  452|  25.0M|{
  453|  25.0M|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (453:12): [True: 1.42M, False: 23.6M]
  ------------------
  454|  25.0M|}
OPENSSL_sk_value:
  457|  17.9M|{
  458|  17.9M|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (458:9): [True: 0, False: 17.9M]
  |  Branch (458:23): [True: 0, False: 17.9M]
  |  Branch (458:32): [True: 0, False: 17.9M]
  ------------------
  459|      0|        return NULL;
  460|  17.9M|    return (void *)st->data[i];
  461|  17.9M|}
OPENSSL_sk_set:
  464|   804k|{
  465|   804k|    if (st == NULL) {
  ------------------
  |  Branch (465:9): [True: 0, False: 804k]
  ------------------
  466|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  467|      0|        return NULL;
  468|      0|    }
  469|   804k|    if (i < 0 || i >= st->num) {
  ------------------
  |  Branch (469:9): [True: 0, False: 804k]
  |  Branch (469:18): [True: 0, False: 804k]
  ------------------
  470|      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),     \
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  300|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  471|      0|                       "i=%d", i);
  472|      0|        return NULL;
  473|      0|    }
  474|   804k|    st->data[i] = data;
  475|   804k|    st->sorted = 0;
  476|   804k|    return (void *)st->data[i];
  477|   804k|}
OPENSSL_sk_sort:
  480|     61|{
  481|     61|    if (st != NULL && !st->sorted && st->comp != NULL) {
  ------------------
  |  Branch (481:9): [True: 61, False: 0]
  |  Branch (481:23): [True: 61, False: 0]
  |  Branch (481:38): [True: 61, False: 0]
  ------------------
  482|     61|        if (st->num > 1)
  ------------------
  |  Branch (482:13): [True: 55, False: 6]
  ------------------
  483|     55|            qsort(st->data, st->num, sizeof(void *), st->comp);
  484|     61|        st->sorted = 1; /* empty or single-element stack is considered sorted */
  485|     61|    }
  486|     61|}
stack.c:sk_reserve:
  178|  7.15M|{
  179|  7.15M|    const void **tmpdata;
  180|  7.15M|    int num_alloc;
  181|       |
  182|       |    /* Check to see the reservation isn't exceeding the hard limit */
  183|  7.15M|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (183:9): [True: 0, False: 7.15M]
  ------------------
  184|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  185|      0|        return 0;
  186|      0|    }
  187|       |
  188|       |    /* Figure out the new size */
  189|  7.15M|    num_alloc = st->num + n;
  190|  7.15M|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (190:9): [True: 77.4k, False: 7.07M]
  ------------------
  191|  77.4k|        num_alloc = min_nodes;
  192|       |
  193|       |    /* If |st->data| allocation was postponed */
  194|  7.15M|    if (st->data == NULL) {
  ------------------
  |  Branch (194:9): [True: 58.2k, False: 7.09M]
  ------------------
  195|       |        /*
  196|       |         * At this point, |st->num_alloc| and |st->num| are 0;
  197|       |         * so |num_alloc| value is |n| or |min_nodes| if greater than |n|.
  198|       |         */
  199|  58.2k|        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL)
  ------------------
  |  |   99|  58.2k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  58.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  58.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (199:13): [True: 0, False: 58.2k]
  ------------------
  200|      0|            return 0;
  201|  58.2k|        st->num_alloc = num_alloc;
  202|  58.2k|        return 1;
  203|  58.2k|    }
  204|       |
  205|  7.09M|    if (!exact) {
  ------------------
  |  Branch (205:9): [True: 7.09M, False: 0]
  ------------------
  206|  7.09M|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (206:13): [True: 7.06M, False: 25.6k]
  ------------------
  207|  7.06M|            return 1;
  208|  25.6k|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  209|  25.6k|        if (num_alloc == 0) {
  ------------------
  |  Branch (209:13): [True: 0, False: 25.6k]
  ------------------
  210|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  211|      0|            return 0;
  212|      0|        }
  213|  25.6k|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (213:16): [True: 0, False: 0]
  ------------------
  214|      0|        return 1;
  215|      0|    }
  216|       |
  217|  25.6k|    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
  ------------------
  |  |  101|  25.6k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  25.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  25.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  218|  25.6k|    if (tmpdata == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 25.6k]
  ------------------
  219|      0|        return 0;
  220|       |
  221|  25.6k|    st->data = tmpdata;
  222|  25.6k|    st->num_alloc = num_alloc;
  223|  25.6k|    return 1;
  224|  25.6k|}
stack.c:compute_growth:
  160|  25.6k|{
  161|  25.6k|    int err = 0;
  162|       |
  163|  51.2k|    while (current < target) {
  ------------------
  |  Branch (163:12): [True: 25.6k, False: 25.6k]
  ------------------
  164|  25.6k|        if (current >= max_nodes)
  ------------------
  |  Branch (164:13): [True: 0, False: 25.6k]
  ------------------
  165|      0|            return 0;
  166|       |
  167|  25.6k|        current = safe_muldiv_int(current, 8, 5, &err);
  168|  25.6k|        if (err != 0)
  ------------------
  |  Branch (168:13): [True: 0, False: 25.6k]
  ------------------
  169|      0|            return 0;
  170|  25.6k|        if (current >= max_nodes)
  ------------------
  |  Branch (170:13): [True: 0, False: 25.6k]
  ------------------
  171|      0|            current = max_nodes;
  172|  25.6k|    }
  173|  25.6k|    return current;
  174|  25.6k|}
stack.c:internal_delete:
  285|      2|{
  286|      2|    const void *ret = st->data[loc];
  287|       |
  288|      2|    if (loc != st->num - 1)
  ------------------
  |  Branch (288:9): [True: 0, False: 2]
  ------------------
  289|      0|        memmove(&st->data[loc], &st->data[loc + 1],
  290|      0|                sizeof(st->data[0]) * (st->num - loc - 1));
  291|      2|    st->num--;
  292|       |
  293|      2|    return (void *)ret;
  294|      2|}

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_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|      2|{
   98|      2|    pthread_mutex_t *mutex;
   99|       |
  100|      2|    if ((mutex = OPENSSL_zalloc(sizeof(*mutex))) == NULL)
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (100:9): [True: 0, False: 2]
  ------------------
  101|      0|        return NULL;
  102|      2|    if (pthread_mutex_init(mutex, NULL) != 0) {
  ------------------
  |  Branch (102:9): [True: 0, False: 2]
  ------------------
  103|      0|        OPENSSL_free(mutex);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|      0|        return NULL;
  105|      0|    }
  106|      2|    return (CRYPTO_MUTEX *)mutex;
  107|      2|}
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);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  152|      2|    *mutex = NULL;
  153|      2|}
ossl_crypto_condvar_new:
  156|      2|{
  157|      2|    pthread_cond_t *cv_p;
  158|       |
  159|      2|    if ((cv_p = OPENSSL_zalloc(sizeof(*cv_p))) == NULL)
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (159:9): [True: 0, False: 2]
  ------------------
  160|      0|        return NULL;
  161|      2|    if (pthread_cond_init(cv_p, NULL) != 0) {
  ------------------
  |  Branch (161:9): [True: 0, False: 2]
  ------------------
  162|      0|        OPENSSL_free(cv_p);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|      0|        return NULL;
  164|      0|    }
  165|      2|    return (CRYPTO_CONDVAR *) cv_p;
  166|      2|}
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);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|      2|    *cv_p = NULL;
  231|      2|}

ossl_threads_ctx_new:
  128|      2|{
  129|      2|    struct openssl_threads_st *t = OPENSSL_zalloc(sizeof(*t));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|       |
  131|      2|    if (t == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 2]
  ------------------
  132|      0|        return NULL;
  133|       |
  134|      2|    t->lock = ossl_crypto_mutex_new();
  135|      2|    t->cond_finished = ossl_crypto_condvar_new();
  136|       |
  137|      2|    if (t->lock == NULL || t->cond_finished == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 2]
  |  Branch (137:28): [True: 0, False: 2]
  ------------------
  138|      0|        goto fail;
  139|       |
  140|      2|    return t;
  141|       |
  142|      0|fail:
  143|      0|    ossl_threads_ctx_free((void *)t);
  144|      0|    return NULL;
  145|      2|}
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);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  157|      2|}

CRYPTO_THREAD_lock_new:
   46|   181k|{
   47|   181k|# ifdef USE_RWLOCK
   48|   181k|    CRYPTO_RWLOCK *lock;
   49|       |
   50|   181k|    if ((lock = CRYPTO_zalloc(sizeof(pthread_rwlock_t), NULL, 0)) == NULL)
  ------------------
  |  Branch (50:9): [True: 0, False: 181k]
  ------------------
   51|       |        /* Don't set error, to avoid recursion blowup. */
   52|      0|        return NULL;
   53|       |
   54|   181k|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (54:9): [True: 0, False: 181k]
  ------------------
   55|      0|        OPENSSL_free(lock);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|      0|        return NULL;
   57|      0|    }
   58|       |# else
   59|       |    pthread_mutexattr_t attr;
   60|       |    CRYPTO_RWLOCK *lock;
   61|       |
   62|       |    if ((lock = CRYPTO_zalloc(sizeof(pthread_mutex_t), NULL, 0)) == NULL)
   63|       |        /* Don't set error, to avoid recursion blowup. */
   64|       |        return NULL;
   65|       |
   66|       |    /*
   67|       |     * We don't use recursive mutexes, but try to catch errors if we do.
   68|       |     */
   69|       |    pthread_mutexattr_init(&attr);
   70|       |#  if !defined (__TANDEM) && !defined (_SPT_MODEL_)
   71|       |#   if !defined(NDEBUG) && !defined(OPENSSL_NO_MUTEX_ERRORCHECK)
   72|       |    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
   73|       |#   endif
   74|       |#  else
   75|       |    /* The SPT Thread Library does not define MUTEX attributes. */
   76|       |#  endif
   77|       |
   78|       |    if (pthread_mutex_init(lock, &attr) != 0) {
   79|       |        pthread_mutexattr_destroy(&attr);
   80|       |        OPENSSL_free(lock);
   81|       |        return NULL;
   82|       |    }
   83|       |
   84|       |    pthread_mutexattr_destroy(&attr);
   85|       |# endif
   86|       |
   87|   181k|    return lock;
   88|   181k|}
CRYPTO_THREAD_read_lock:
   91|  2.52M|{
   92|  2.52M|# ifdef USE_RWLOCK
   93|  2.52M|    if (pthread_rwlock_rdlock(lock) != 0)
  ------------------
  |  Branch (93:9): [True: 0, False: 2.52M]
  ------------------
   94|      0|        return 0;
   95|       |# else
   96|       |    if (pthread_mutex_lock(lock) != 0) {
   97|       |        assert(errno != EDEADLK && errno != EBUSY);
   98|       |        return 0;
   99|       |    }
  100|       |# endif
  101|       |
  102|  2.52M|    return 1;
  103|  2.52M|}
CRYPTO_THREAD_write_lock:
  106|  4.66k|{
  107|  4.66k|# ifdef USE_RWLOCK
  108|  4.66k|    if (pthread_rwlock_wrlock(lock) != 0)
  ------------------
  |  Branch (108:9): [True: 0, False: 4.66k]
  ------------------
  109|      0|        return 0;
  110|       |# else
  111|       |    if (pthread_mutex_lock(lock) != 0) {
  112|       |        assert(errno != EDEADLK && errno != EBUSY);
  113|       |        return 0;
  114|       |    }
  115|       |# endif
  116|       |
  117|  4.66k|    return 1;
  118|  4.66k|}
CRYPTO_THREAD_unlock:
  121|  2.52M|{
  122|  2.52M|# ifdef USE_RWLOCK
  123|  2.52M|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (123:9): [True: 0, False: 2.52M]
  ------------------
  124|      0|        return 0;
  125|       |# else
  126|       |    if (pthread_mutex_unlock(lock) != 0) {
  127|       |        assert(errno != EPERM);
  128|       |        return 0;
  129|       |    }
  130|       |# endif
  131|       |
  132|  2.52M|    return 1;
  133|  2.52M|}
CRYPTO_THREAD_lock_free:
  136|   181k|{
  137|   181k|    if (lock == NULL)
  ------------------
  |  Branch (137:9): [True: 13, False: 181k]
  ------------------
  138|     13|        return;
  139|       |
  140|   181k|# ifdef USE_RWLOCK
  141|   181k|    pthread_rwlock_destroy(lock);
  142|       |# else
  143|       |    pthread_mutex_destroy(lock);
  144|       |# endif
  145|   181k|    OPENSSL_free(lock);
  ------------------
  |  |  107|   181k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   181k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   181k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  146|       |
  147|   181k|    return;
  148|   181k|}
CRYPTO_THREAD_run_once:
  151|  13.6M|{
  152|  13.6M|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (152:9): [True: 0, False: 13.6M]
  ------------------
  153|      0|        return 0;
  154|       |
  155|  13.6M|    return 1;
  156|  13.6M|}
CRYPTO_THREAD_init_local:
  159|     12|{
  160|     12|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (160:9): [True: 0, False: 12]
  ------------------
  161|      0|        return 0;
  162|       |
  163|     12|    return 1;
  164|     12|}
CRYPTO_THREAD_get_local:
  167|  6.80M|{
  168|  6.80M|    return pthread_getspecific(*key);
  169|  6.80M|}
CRYPTO_THREAD_set_local:
  172|     18|{
  173|     18|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (173:9): [True: 0, False: 18]
  ------------------
  174|      0|        return 0;
  175|       |
  176|     18|    return 1;
  177|     18|}
CRYPTO_THREAD_cleanup_local:
  180|     12|{
  181|     12|    if (pthread_key_delete(*key) != 0)
  ------------------
  |  Branch (181:9): [True: 0, False: 12]
  ------------------
  182|      0|        return 0;
  183|       |
  184|     12|    return 1;
  185|     12|}
CRYPTO_atomic_add:
  198|  3.51k|{
  199|  3.51k|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  200|  3.51k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (200:9): [Folded - Ignored]
  ------------------
  201|  3.51k|        *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);
  202|  3.51k|        return 1;
  203|  3.51k|    }
  204|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  205|       |    /* This will work for all future Solaris versions. */
  206|       |    if (ret != NULL) {
  207|       |        *ret = atomic_add_int_nv((volatile unsigned int *)val, amount);
  208|       |        return 1;
  209|       |    }
  210|       |# endif
  211|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (211:9): [True: 0, False: 0]
  |  Branch (211:25): [True: 0, False: 0]
  ------------------
  212|      0|        return 0;
  213|       |
  214|      0|    *val += amount;
  215|      0|    *ret  = *val;
  216|       |
  217|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (217:9): [True: 0, False: 0]
  ------------------
  218|      0|        return 0;
  219|       |
  220|      0|    return 1;
  221|      0|}
CRYPTO_atomic_or:
  225|      4|{
  226|      4|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  227|      4|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (227:9): [Folded - Ignored]
  ------------------
  228|      4|        *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
  229|      4|        return 1;
  230|      4|    }
  231|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  232|       |    /* This will work for all future Solaris versions. */
  233|       |    if (ret != NULL) {
  234|       |        *ret = atomic_or_64_nv(val, op);
  235|       |        return 1;
  236|       |    }
  237|       |# endif
  238|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (238:9): [True: 0, False: 0]
  |  Branch (238:25): [True: 0, False: 0]
  ------------------
  239|      0|        return 0;
  240|      0|    *val |= op;
  241|      0|    *ret  = *val;
  242|       |
  243|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (243:9): [True: 0, False: 0]
  ------------------
  244|      0|        return 0;
  245|       |
  246|      0|    return 1;
  247|      0|}
CRYPTO_atomic_load:
  250|  6.91M|{
  251|  6.91M|# if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE) && !defined(BROKEN_CLANG_ATOMICS)
  252|  6.91M|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (252:9): [Folded - Ignored]
  ------------------
  253|  6.91M|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
  254|  6.91M|        return 1;
  255|  6.91M|    }
  256|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  257|       |    /* This will work for all future Solaris versions. */
  258|       |    if (ret != NULL) {
  259|       |        *ret = atomic_or_64_nv(val, 0);
  260|       |        return 1;
  261|       |    }
  262|       |# endif
  263|      0|    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (263:9): [True: 0, False: 0]
  |  Branch (263:25): [True: 0, False: 0]
  ------------------
  264|      0|        return 0;
  265|      0|    *ret  = *val;
  266|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (266:9): [True: 0, False: 0]
  ------------------
  267|      0|        return 0;
  268|       |
  269|      0|    return 1;
  270|      0|}
openssl_get_fork_id:
  303|  7.62k|{
  304|  7.62k|    return getpid();
  305|  7.62k|}

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

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|}

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|   118k|{
  180|   118k|    if (!cache)
  ------------------
  |  Branch (180:9): [True: 118k, False: 0]
  ------------------
  181|   118k|        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);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  185|      0|}

DIST_POINT_set_dpname:
  491|  4.71k|{
  492|  4.71k|    int i;
  493|  4.71k|    STACK_OF(X509_NAME_ENTRY) *frag;
  ------------------
  |  |   31|  4.71k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  494|  4.71k|    X509_NAME_ENTRY *ne;
  495|       |
  496|  4.71k|    if (dpn == NULL || dpn->type != 1)
  ------------------
  |  Branch (496:9): [True: 1.28k, False: 3.43k]
  |  Branch (496:24): [True: 238, False: 3.19k]
  ------------------
  497|  1.52k|        return 1;
  498|  3.19k|    frag = dpn->name.relativename;
  499|  3.19k|    X509_NAME_free(dpn->dpname); /* just in case it was already set */
  500|  3.19k|    dpn->dpname = X509_NAME_dup(iname);
  501|  3.19k|    if (dpn->dpname == NULL)
  ------------------
  |  Branch (501:9): [True: 579, False: 2.61k]
  ------------------
  502|    579|        return 0;
  503|  5.81k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(frag); i++) {
  ------------------
  |  |  196|  5.81k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (503:17): [True: 3.23k, False: 2.58k]
  ------------------
  504|  3.23k|        ne = sk_X509_NAME_ENTRY_value(frag, i);
  ------------------
  |  |  197|  3.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)))
  ------------------
  505|  3.23k|        if (!X509_NAME_add_entry(dpn->dpname, ne, -1, i ? 0 : 1))
  ------------------
  |  Branch (505:13): [True: 34, False: 3.19k]
  |  Branch (505:55): [True: 1.40k, False: 1.83k]
  ------------------
  506|     34|            goto err;
  507|  3.23k|    }
  508|       |    /* generate cached encoding of name */
  509|  2.58k|    if (i2d_X509_NAME(dpn->dpname, NULL) >= 0)
  ------------------
  |  Branch (509:9): [True: 1.29k, False: 1.29k]
  ------------------
  510|  1.29k|        return 1;
  511|       |
  512|  1.32k| err:
  513|  1.32k|    X509_NAME_free(dpn->dpname);
  514|  1.32k|    dpn->dpname = NULL;
  515|  1.32k|    return 0;
  516|  2.58k|}
v3_crld.c:dpn_cb:
  302|  39.0k|{
  303|  39.0k|    DIST_POINT_NAME *dpn = (DIST_POINT_NAME *)*pval;
  304|       |
  305|  39.0k|    switch (operation) {
  ------------------
  |  Branch (305:13): [True: 25.1k, False: 13.8k]
  ------------------
  306|  6.93k|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  743|  6.93k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (306:5): [True: 6.93k, False: 32.1k]
  ------------------
  307|  6.93k|        dpn->dpname = NULL;
  308|  6.93k|        break;
  309|       |
  310|  6.93k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  6.93k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (310:5): [True: 6.93k, False: 32.1k]
  ------------------
  311|  6.93k|        X509_NAME_free(dpn->dpname);
  312|  6.93k|        break;
  313|  39.0k|    }
  314|  39.0k|    return 1;
  315|  39.0k|}

X509V3_EXT_get_nid:
   53|  21.7k|{
   54|  21.7k|    X509V3_EXT_METHOD tmp;
   55|  21.7k|    const X509V3_EXT_METHOD *t = &tmp, *const *ret;
   56|  21.7k|    int idx;
   57|       |
   58|  21.7k|    if (nid < 0)
  ------------------
  |  Branch (58:9): [True: 0, False: 21.7k]
  ------------------
   59|      0|        return NULL;
   60|  21.7k|    tmp.ext_nid = nid;
   61|  21.7k|    ret = OBJ_bsearch_ext(&t, standard_exts, STANDARD_EXTENSION_COUNT);
  ------------------
  |  |   79|  21.7k|#define STANDARD_EXTENSION_COUNT OSSL_NELEM(standard_exts)
  |  |  ------------------
  |  |  |  |   14|  21.7k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
   62|  21.7k|    if (ret)
  ------------------
  |  Branch (62:9): [True: 21.7k, False: 0]
  ------------------
   63|  21.7k|        return *ret;
   64|      0|    if (!ext_list)
  ------------------
  |  Branch (64:9): [True: 0, False: 0]
  ------------------
   65|      0|        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|      0|}
X509V3_EXT_get:
   74|  21.7k|{
   75|  21.7k|    int nid;
   76|  21.7k|    if ((nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext))) == NID_undef)
  ------------------
  |  |   18|  21.7k|#define NID_undef                       0
  ------------------
  |  Branch (76:9): [True: 0, False: 21.7k]
  ------------------
   77|      0|        return NULL;
   78|  21.7k|    return X509V3_EXT_get_nid(nid);
   79|  21.7k|}
X509V3_EXT_d2i:
  131|  21.7k|{
  132|  21.7k|    const X509V3_EXT_METHOD *method;
  133|  21.7k|    const unsigned char *p;
  134|  21.7k|    ASN1_STRING *extvalue;
  135|  21.7k|    int extlen;
  136|       |
  137|  21.7k|    if ((method = X509V3_EXT_get(ext)) == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 21.7k]
  ------------------
  138|      0|        return NULL;
  139|  21.7k|    extvalue = X509_EXTENSION_get_data(ext);
  140|  21.7k|    p = ASN1_STRING_get0_data(extvalue);
  141|  21.7k|    extlen = ASN1_STRING_length(extvalue);
  142|  21.7k|    if (method->it)
  ------------------
  |  Branch (142:9): [True: 21.7k, False: 0]
  ------------------
  143|  21.7k|        return ASN1_item_d2i(NULL, &p, extlen, ASN1_ITEM_ptr(method->it));
  ------------------
  |  |  421|  21.7k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  144|      0|    return method->d2i(NULL, &p, extlen);
  145|  21.7k|}
X509V3_get_d2i:
  165|  88.9k|{
  166|  88.9k|    int lastpos, i;
  167|  88.9k|    X509_EXTENSION *ex, *found_ex = NULL;
  168|       |
  169|  88.9k|    if (!x) {
  ------------------
  |  Branch (169:9): [True: 15.2k, False: 73.7k]
  ------------------
  170|  15.2k|        if (idx)
  ------------------
  |  Branch (170:13): [True: 0, False: 15.2k]
  ------------------
  171|      0|            *idx = -1;
  172|  15.2k|        if (crit)
  ------------------
  |  Branch (172:13): [True: 15.2k, False: 0]
  ------------------
  173|  15.2k|            *crit = -1;
  174|  15.2k|        return NULL;
  175|  15.2k|    }
  176|  73.7k|    if (idx)
  ------------------
  |  Branch (176:9): [True: 0, False: 73.7k]
  ------------------
  177|      0|        lastpos = *idx + 1;
  178|  73.7k|    else
  179|  73.7k|        lastpos = 0;
  180|  73.7k|    if (lastpos < 0)
  ------------------
  |  Branch (180:9): [True: 0, False: 73.7k]
  ------------------
  181|      0|        lastpos = 0;
  182|   165k|    for (i = lastpos; i < sk_X509_EXTENSION_num(x); i++) {
  ------------------
  |  |  227|   165k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (182:23): [True: 92.5k, False: 73.3k]
  ------------------
  183|  92.5k|        ex = sk_X509_EXTENSION_value(x, i);
  ------------------
  |  |  228|  92.5k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  184|  92.5k|        if (OBJ_obj2nid(X509_EXTENSION_get_object(ex)) == nid) {
  ------------------
  |  Branch (184:13): [True: 22.4k, False: 70.0k]
  ------------------
  185|  22.4k|            if (idx) {
  ------------------
  |  Branch (185:17): [True: 0, False: 22.4k]
  ------------------
  186|      0|                *idx = i;
  187|      0|                found_ex = ex;
  188|      0|                break;
  189|  22.4k|            } else if (found_ex) {
  ------------------
  |  Branch (189:24): [True: 380, False: 22.1k]
  ------------------
  190|       |                /* Found more than one */
  191|    380|                if (crit)
  ------------------
  |  Branch (191:21): [True: 380, False: 0]
  ------------------
  192|    380|                    *crit = -2;
  193|    380|                return NULL;
  194|    380|            }
  195|  22.1k|            found_ex = ex;
  196|  22.1k|        }
  197|  92.5k|    }
  198|  73.3k|    if (found_ex) {
  ------------------
  |  Branch (198:9): [True: 21.7k, False: 51.6k]
  ------------------
  199|       |        /* Found it */
  200|  21.7k|        if (crit)
  ------------------
  |  Branch (200:13): [True: 21.7k, False: 0]
  ------------------
  201|  21.7k|            *crit = X509_EXTENSION_get_critical(found_ex);
  202|  21.7k|        return X509V3_EXT_d2i(found_ex);
  203|  21.7k|    }
  204|       |
  205|       |    /* Extension not found */
  206|  51.6k|    if (idx)
  ------------------
  |  Branch (206:9): [True: 0, False: 51.6k]
  ------------------
  207|      0|        *idx = -1;
  208|  51.6k|    if (crit)
  ------------------
  |  Branch (208:9): [True: 51.6k, False: 0]
  ------------------
  209|  51.6k|        *crit = -1;
  210|  51.6k|    return NULL;
  211|  73.3k|}
v3_lib.c:ext_cmp:
   41|   113k|{
   42|   113k|    return ((*a)->ext_nid - (*b)->ext_nid);
   43|   113k|}

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

X509_get_default_cert_area:
   21|      1|{
   22|      1|    return X509_CERT_AREA;
  ------------------
  |  |   84|      1|#  define X509_CERT_AREA          OPENSSLDIR
  ------------------
   23|      1|}

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

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

X509_EXTENSION_get_object:
  221|   137k|{
  222|   137k|    if (ex == NULL)
  ------------------
  |  Branch (222:9): [True: 0, False: 137k]
  ------------------
  223|      0|        return NULL;
  224|   137k|    return ex->object;
  225|   137k|}
X509_EXTENSION_get_data:
  228|  21.7k|{
  229|  21.7k|    if (ex == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 21.7k]
  ------------------
  230|      0|        return NULL;
  231|  21.7k|    return &ex->value;
  232|  21.7k|}
X509_EXTENSION_get_critical:
  235|  46.1k|{
  236|  46.1k|    if (ex == NULL)
  ------------------
  |  Branch (236:9): [True: 0, False: 46.1k]
  ------------------
  237|      0|        return 0;
  238|  46.1k|    if (ex->critical > 0)
  ------------------
  |  Branch (238:9): [True: 5.60k, False: 40.5k]
  ------------------
  239|  5.60k|        return 1;
  240|  40.5k|    return 0;
  241|  46.1k|}

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

X509_NAME_add_entry:
  190|  3.23k|{
  191|  3.23k|    X509_NAME_ENTRY *new_name = NULL;
  192|  3.23k|    int n, i, inc;
  193|  3.23k|    STACK_OF(X509_NAME_ENTRY) *sk;
  ------------------
  |  |   31|  3.23k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  194|       |
  195|  3.23k|    if (name == NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 3.23k]
  ------------------
  196|      0|        return 0;
  197|  3.23k|    sk = name->entries;
  198|  3.23k|    n = sk_X509_NAME_ENTRY_num(sk);
  ------------------
  |  |  196|  3.23k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  199|  3.23k|    if (loc > n)
  ------------------
  |  Branch (199:9): [True: 0, False: 3.23k]
  ------------------
  200|      0|        loc = n;
  201|  3.23k|    else if (loc < 0)
  ------------------
  |  Branch (201:14): [True: 3.23k, False: 0]
  ------------------
  202|  3.23k|        loc = n;
  203|  3.23k|    inc = (set == 0);
  204|  3.23k|    name->modified = 1;
  205|       |
  206|  3.23k|    if (set == -1) {
  ------------------
  |  Branch (206:9): [True: 0, False: 3.23k]
  ------------------
  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;
  ------------------
  |  |  197|      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|  3.23k|    } else {                    /* if (set >= 0) */
  214|       |
  215|  3.23k|        if (loc >= n) {
  ------------------
  |  Branch (215:13): [True: 3.23k, False: 0]
  ------------------
  216|  3.23k|            if (loc != 0)
  ------------------
  |  Branch (216:17): [True: 1.79k, False: 1.43k]
  ------------------
  217|  1.79k|                set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set + 1;
  ------------------
  |  |  197|  1.79k|#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|  1.43k|            else
  219|  1.43k|                set = 0;
  220|  3.23k|        } else
  221|      0|            set = sk_X509_NAME_ENTRY_value(sk, loc)->set;
  ------------------
  |  |  197|      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|  3.23k|    }
  223|       |
  224|  3.23k|    if ((new_name = X509_NAME_ENTRY_dup(ne)) == NULL)
  ------------------
  |  Branch (224:9): [True: 34, False: 3.19k]
  ------------------
  225|     34|        goto err;
  226|  3.19k|    new_name->set = set;
  227|  3.19k|    if (!sk_X509_NAME_ENTRY_insert(sk, new_name, loc)) {
  ------------------
  |  |  211|  3.19k|#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: 3.19k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|        goto err;
  230|      0|    }
  231|  3.19k|    if (inc) {
  ------------------
  |  Branch (231:9): [True: 1.40k, False: 1.79k]
  ------------------
  232|  1.40k|        n = sk_X509_NAME_ENTRY_num(sk);
  ------------------
  |  |  196|  1.40k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  233|  1.40k|        for (i = loc + 1; i < n; i++)
  ------------------
  |  Branch (233:27): [True: 0, False: 1.40k]
  ------------------
  234|      0|            sk_X509_NAME_ENTRY_value(sk, i)->set += 1;
  ------------------
  |  |  197|      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.40k|    }
  236|  3.19k|    return 1;
  237|     34| err:
  238|     34|    X509_NAME_ENTRY_free(new_name);
  239|     34|    return 0;
  240|  3.19k|}

X509_CRL_digest:
  575|  20.3k|{
  576|  20.3k|    if (type == NULL) {
  ------------------
  |  Branch (576:9): [True: 0, False: 20.3k]
  ------------------
  577|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  578|      0|        return 0;
  579|      0|    }
  580|  20.3k|    if (EVP_MD_is_a(type, SN_sha1)
  ------------------
  |  | 2306|  20.3k|#define SN_sha1         "SHA1"
  ------------------
  |  Branch (580:9): [True: 20.3k, False: 0]
  ------------------
  581|  20.3k|            && (data->flags & EXFLAG_SET) != 0
  ------------------
  |  |  651|  20.3k|# define EXFLAG_SET              0x100
  ------------------
  |  Branch (581:16): [True: 0, False: 20.3k]
  ------------------
  582|  20.3k|            && (data->flags & EXFLAG_NO_FINGERPRINT) == 0) {
  ------------------
  |  |  663|      0|# define EXFLAG_NO_FINGERPRINT   0x100000
  ------------------
  |  Branch (582:16): [True: 0, False: 0]
  ------------------
  583|       |        /* Asking for SHA1; always computed in CRL d2i. */
  584|      0|        if (len != NULL)
  ------------------
  |  Branch (584:13): [True: 0, False: 0]
  ------------------
  585|      0|            *len = sizeof(data->sha1_hash);
  586|      0|        memcpy(md, data->sha1_hash, sizeof(data->sha1_hash));
  587|      0|        return 1;
  588|      0|    }
  589|  20.3k|    return
  590|  20.3k|        ossl_asn1_item_digest_ex(ASN1_ITEM_rptr(X509_CRL), type, (char *)data,
  ------------------
  |  |  426|  20.3k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  591|  20.3k|                                 md, len, data->libctx, data->propq);
  592|  20.3k|}

x_crl.c:crl_inf_cb:
   49|   123k|{
   50|   123k|    X509_CRL_INFO *a = (X509_CRL_INFO *)*pval;
   51|       |
   52|   123k|    if (!a || !a->revoked)
  ------------------
  |  Branch (52:9): [True: 0, False: 123k]
  |  Branch (52:15): [True: 121k, False: 2.90k]
  ------------------
   53|   121k|        return 1;
   54|  2.90k|    switch (operation) {
  ------------------
  |  Branch (54:13): [True: 1.46k, False: 1.44k]
  ------------------
   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.44k|    case ASN1_OP_D2I_POST:
  ------------------
  |  |  747|  1.44k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (59:5): [True: 1.44k, False: 1.46k]
  ------------------
   60|  1.44k|        (void)sk_X509_REVOKED_set_cmp_func(a->revoked, X509_REVOKED_cmp);
  ------------------
  |  |  129|  1.44k|#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.44k|        break;
   62|  2.90k|    }
   63|  2.90k|    return 1;
   64|  2.90k|}
x_crl.c:crl_cb:
  160|   185k|{
  161|   185k|    X509_CRL *crl = (X509_CRL *)*pval;
  162|   185k|    STACK_OF(X509_EXTENSION) *exts;
  ------------------
  |  |   31|   185k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  163|   185k|    X509_EXTENSION *ext;
  164|   185k|    int idx, i;
  165|       |
  166|   185k|    switch (operation) {
  ------------------
  |  Branch (166:13): [True: 103k, False: 82.5k]
  ------------------
  167|  20.7k|    case ASN1_OP_D2I_PRE:
  ------------------
  |  |  746|  20.7k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (167:5): [True: 20.7k, False: 164k]
  ------------------
  168|  20.7k|        if (crl->meth->crl_free) {
  ------------------
  |  Branch (168:13): [True: 0, False: 20.7k]
  ------------------
  169|      0|            if (!crl->meth->crl_free(crl))
  ------------------
  |  Branch (169:17): [True: 0, False: 0]
  ------------------
  170|      0|                return 0;
  171|      0|        }
  172|  20.7k|        AUTHORITY_KEYID_free(crl->akid);
  173|  20.7k|        ISSUING_DIST_POINT_free(crl->idp);
  174|  20.7k|        ASN1_INTEGER_free(crl->crl_number);
  175|  20.7k|        ASN1_INTEGER_free(crl->base_crl_number);
  176|  20.7k|        sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
  ------------------
  |  |  278|  20.7k|#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|  41.4k|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  743|  41.4k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (179:5): [True: 20.7k, False: 164k]
  ------------------
  180|  41.4k|        crl->idp = NULL;
  181|  41.4k|        crl->akid = NULL;
  182|  41.4k|        crl->flags = 0;
  183|  41.4k|        crl->idp_flags = 0;
  184|  41.4k|        crl->idp_reasons = CRLDP_ALL_REASONS;
  ------------------
  |  |  301|  41.4k|# define CRLDP_ALL_REASONS       0x807f
  ------------------
  185|  41.4k|        crl->meth = default_crl_method;
  186|  41.4k|        crl->meth_data = NULL;
  187|  41.4k|        crl->issuers = NULL;
  188|  41.4k|        crl->crl_number = NULL;
  189|  41.4k|        crl->base_crl_number = NULL;
  190|  41.4k|        break;
  191|       |
  192|  20.3k|    case ASN1_OP_D2I_POST:
  ------------------
  |  |  747|  20.3k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (192:5): [True: 20.3k, False: 165k]
  ------------------
  193|  20.3k|        if (!X509_CRL_digest(crl, EVP_sha1(), crl->sha1_hash, NULL))
  ------------------
  |  Branch (193:13): [True: 0, False: 20.3k]
  ------------------
  194|      0|            crl->flags |= EXFLAG_NO_FINGERPRINT;
  ------------------
  |  |  663|      0|# define EXFLAG_NO_FINGERPRINT   0x100000
  ------------------
  195|  20.3k|        crl->idp = X509_CRL_get_ext_d2i(crl,
  196|  20.3k|                                        NID_issuing_distribution_point, &i,
  ------------------
  |  | 2694|  20.3k|#define NID_issuing_distribution_point          770
  ------------------
  197|  20.3k|                                        NULL);
  198|  20.3k|        if (crl->idp != NULL) {
  ------------------
  |  Branch (198:13): [True: 4.71k, False: 15.5k]
  ------------------
  199|  4.71k|            if (!setup_idp(crl, crl->idp))
  ------------------
  |  Branch (199:17): [True: 1.90k, False: 2.81k]
  ------------------
  200|  1.90k|                crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  649|  1.90k|# define EXFLAG_INVALID          0x80
  ------------------
  201|  4.71k|        }
  202|  15.5k|        else if (i != -1) {
  ------------------
  |  Branch (202:18): [True: 6.99k, False: 8.59k]
  ------------------
  203|  6.99k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  649|  6.99k|# define EXFLAG_INVALID          0x80
  ------------------
  204|  6.99k|        }
  205|       |
  206|  20.3k|        crl->akid = X509_CRL_get_ext_d2i(crl,
  207|  20.3k|                                         NID_authority_key_identifier, &i,
  ------------------
  |  | 2729|  20.3k|#define NID_authority_key_identifier            90
  ------------------
  208|  20.3k|                                         NULL);
  209|  20.3k|        if (crl->akid == NULL && i != -1)
  ------------------
  |  Branch (209:13): [True: 20.2k, False: 67]
  |  Branch (209:34): [True: 4.33k, False: 15.9k]
  ------------------
  210|  4.33k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  649|  4.33k|# define EXFLAG_INVALID          0x80
  ------------------
  211|       |
  212|  20.3k|        crl->crl_number = X509_CRL_get_ext_d2i(crl,
  213|  20.3k|                                               NID_crl_number, &i, NULL);
  ------------------
  |  | 2674|  20.3k|#define NID_crl_number          88
  ------------------
  214|  20.3k|        if (crl->crl_number == NULL && i != -1)
  ------------------
  |  Branch (214:13): [True: 19.8k, False: 502]
  |  Branch (214:40): [True: 882, False: 18.9k]
  ------------------
  215|    882|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  649|    882|# define EXFLAG_INVALID          0x80
  ------------------
  216|       |
  217|  20.3k|        crl->base_crl_number = X509_CRL_get_ext_d2i(crl,
  218|  20.3k|                                                    NID_delta_crl, &i,
  ------------------
  |  | 2689|  20.3k|#define NID_delta_crl           140
  ------------------
  219|  20.3k|                                                    NULL);
  220|  20.3k|        if (crl->base_crl_number == NULL && i != -1)
  ------------------
  |  Branch (220:13): [True: 19.6k, False: 641]
  |  Branch (220:45): [True: 1.12k, False: 18.5k]
  ------------------
  221|  1.12k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  649|  1.12k|# define EXFLAG_INVALID          0x80
  ------------------
  222|       |        /* Delta CRLs must have CRL number */
  223|  20.3k|        if (crl->base_crl_number && !crl->crl_number)
  ------------------
  |  Branch (223:13): [True: 641, False: 19.6k]
  |  Branch (223:37): [True: 205, False: 436]
  ------------------
  224|    205|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  649|    205|# 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|  20.3k|        exts = crl->crl.extensions;
  234|       |
  235|  41.7k|        for (idx = 0; idx < sk_X509_EXTENSION_num(exts); idx++) {
  ------------------
  |  |  227|  41.7k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (235:23): [True: 21.7k, False: 20.0k]
  ------------------
  236|  21.7k|            int nid;
  237|  21.7k|            ext = sk_X509_EXTENSION_value(exts, idx);
  ------------------
  |  |  228|  21.7k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  238|  21.7k|            nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext));
  239|  21.7k|            if (nid == NID_freshest_crl)
  ------------------
  |  | 2769|  21.7k|#define NID_freshest_crl                857
  ------------------
  |  Branch (239:17): [True: 556, False: 21.1k]
  ------------------
  240|    556|                crl->flags |= EXFLAG_FRESHEST;
  ------------------
  |  |  656|    556|# define EXFLAG_FRESHEST         0x1000
  ------------------
  241|  21.7k|            if (X509_EXTENSION_get_critical(ext)) {
  ------------------
  |  Branch (241:17): [True: 1.17k, False: 20.5k]
  ------------------
  242|       |                /* We handle IDP and deltas */
  243|  1.17k|                if ((nid == NID_issuing_distribution_point)
  ------------------
  |  | 2694|  1.17k|#define NID_issuing_distribution_point          770
  ------------------
  |  Branch (243:21): [True: 378, False: 796]
  ------------------
  244|  1.17k|                    || (nid == NID_authority_key_identifier)
  ------------------
  |  | 2729|    796|#define NID_authority_key_identifier            90
  ------------------
  |  Branch (244:24): [True: 377, False: 419]
  ------------------
  245|  1.17k|                    || (nid == NID_delta_crl))
  ------------------
  |  | 2689|    419|#define NID_delta_crl           140
  ------------------
  |  Branch (245:24): [True: 196, False: 223]
  ------------------
  246|    951|                    continue;
  247|    223|                crl->flags |= EXFLAG_CRITICAL;
  ------------------
  |  |  652|    223|# define EXFLAG_CRITICAL         0x200
  ------------------
  248|    223|                break;
  249|  1.17k|            }
  250|  21.7k|        }
  251|       |
  252|  20.3k|        if (!crl_set_issuers(crl))
  ------------------
  |  Branch (252:13): [True: 0, False: 20.3k]
  ------------------
  253|      0|            return 0;
  254|       |
  255|  20.3k|        if (crl->meth->crl_init) {
  ------------------
  |  Branch (255:13): [True: 0, False: 20.3k]
  ------------------
  256|      0|            if (crl->meth->crl_init(crl) == 0)
  ------------------
  |  Branch (256:17): [True: 0, False: 0]
  ------------------
  257|      0|                return 0;
  258|      0|        }
  259|       |
  260|  20.3k|        crl->flags |= EXFLAG_SET;
  ------------------
  |  |  651|  20.3k|# define EXFLAG_SET              0x100
  ------------------
  261|  20.3k|        break;
  262|       |
  263|  20.7k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  20.7k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (263:5): [True: 20.7k, False: 164k]
  ------------------
  264|  20.7k|        if (crl->meth != NULL && crl->meth->crl_free != NULL) {
  ------------------
  |  Branch (264:13): [True: 20.7k, False: 0]
  |  Branch (264:34): [True: 0, False: 20.7k]
  ------------------
  265|      0|            if (!crl->meth->crl_free(crl))
  ------------------
  |  Branch (265:17): [True: 0, False: 0]
  ------------------
  266|      0|                return 0;
  267|      0|        }
  268|  20.7k|        AUTHORITY_KEYID_free(crl->akid);
  269|  20.7k|        ISSUING_DIST_POINT_free(crl->idp);
  270|  20.7k|        ASN1_INTEGER_free(crl->crl_number);
  271|  20.7k|        ASN1_INTEGER_free(crl->base_crl_number);
  272|  20.7k|        sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
  ------------------
  |  |  278|  20.7k|#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|  20.7k|        OPENSSL_free(crl->propq);
  ------------------
  |  |  107|  20.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  20.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  20.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  274|  20.7k|        break;
  275|      0|    case ASN1_OP_DUP_POST:
  ------------------
  |  |  757|      0|# define ASN1_OP_DUP_POST        15
  ------------------
  |  Branch (275:5): [True: 0, False: 185k]
  ------------------
  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|   185k|    }
  284|   185k|    return 1;
  285|   185k|}
x_crl.c:setup_idp:
  290|  4.71k|{
  291|  4.71k|    int idp_only = 0;
  292|       |
  293|       |    /* Set various flags according to IDP */
  294|  4.71k|    crl->idp_flags |= IDP_PRESENT;
  ------------------
  |  |  593|  4.71k|# define IDP_PRESENT     0x1
  ------------------
  295|  4.71k|    if (idp->onlyuser > 0) {
  ------------------
  |  Branch (295:9): [True: 236, False: 4.47k]
  ------------------
  296|    236|        idp_only++;
  297|    236|        crl->idp_flags |= IDP_ONLYUSER;
  ------------------
  |  |  597|    236|# define IDP_ONLYUSER    0x4
  ------------------
  298|    236|    }
  299|  4.71k|    if (idp->onlyCA > 0) {
  ------------------
  |  Branch (299:9): [True: 200, False: 4.51k]
  ------------------
  300|    200|        idp_only++;
  301|    200|        crl->idp_flags |= IDP_ONLYCA;
  ------------------
  |  |  599|    200|# define IDP_ONLYCA      0x8
  ------------------
  302|    200|    }
  303|  4.71k|    if (idp->onlyattr > 0) {
  ------------------
  |  Branch (303:9): [True: 214, False: 4.50k]
  ------------------
  304|    214|        idp_only++;
  305|    214|        crl->idp_flags |= IDP_ONLYATTR;
  ------------------
  |  |  601|    214|# define IDP_ONLYATTR    0x10
  ------------------
  306|    214|    }
  307|       |
  308|  4.71k|    if (idp_only > 1)
  ------------------
  |  Branch (308:9): [True: 235, False: 4.47k]
  ------------------
  309|    235|        crl->idp_flags |= IDP_INVALID;
  ------------------
  |  |  595|    235|# define IDP_INVALID     0x2
  ------------------
  310|       |
  311|  4.71k|    if (idp->indirectCRL > 0)
  ------------------
  |  Branch (311:9): [True: 194, False: 4.52k]
  ------------------
  312|    194|        crl->idp_flags |= IDP_INDIRECT;
  ------------------
  |  |  603|    194|# define IDP_INDIRECT    0x20
  ------------------
  313|       |
  314|  4.71k|    if (idp->onlysomereasons) {
  ------------------
  |  Branch (314:9): [True: 571, False: 4.14k]
  ------------------
  315|    571|        crl->idp_flags |= IDP_REASONS;
  ------------------
  |  |  605|    571|# define IDP_REASONS     0x40
  ------------------
  316|    571|        if (idp->onlysomereasons->length > 0)
  ------------------
  |  Branch (316:13): [True: 370, False: 201]
  ------------------
  317|    370|            crl->idp_reasons = idp->onlysomereasons->data[0];
  318|    571|        if (idp->onlysomereasons->length > 1)
  ------------------
  |  Branch (318:13): [True: 200, False: 371]
  ------------------
  319|    200|            crl->idp_reasons |= (idp->onlysomereasons->data[1] << 8);
  320|    571|        crl->idp_reasons &= CRLDP_ALL_REASONS;
  ------------------
  |  |  301|    571|# define CRLDP_ALL_REASONS       0x807f
  ------------------
  321|    571|    }
  322|       |
  323|  4.71k|    return DIST_POINT_set_dpname(idp->distpoint, X509_CRL_get_issuer(crl));
  324|  4.71k|}
x_crl.c:crl_set_issuers:
   83|  20.3k|{
   84|       |
   85|  20.3k|    int i, j;
   86|  20.3k|    GENERAL_NAMES *gens, *gtmp;
   87|  20.3k|    STACK_OF(X509_REVOKED) *revoked;
  ------------------
  |  |   31|  20.3k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   88|       |
   89|  20.3k|    revoked = X509_CRL_get_REVOKED(crl);
   90|       |
   91|  20.3k|    gens = NULL;
   92|  23.5k|    for (i = 0; i < sk_X509_REVOKED_num(revoked); i++) {
  ------------------
  |  |  105|  23.5k|#define sk_X509_REVOKED_num(sk) OPENSSL_sk_num(ossl_check_const_X509_REVOKED_sk_type(sk))
  ------------------
  |  Branch (92:17): [True: 4.08k, False: 19.4k]
  ------------------
   93|  4.08k|        X509_REVOKED *rev = sk_X509_REVOKED_value(revoked, i);
  ------------------
  |  |  106|  4.08k|#define sk_X509_REVOKED_value(sk, idx) ((X509_REVOKED *)OPENSSL_sk_value(ossl_check_const_X509_REVOKED_sk_type(sk), (idx)))
  ------------------
   94|  4.08k|        STACK_OF(X509_EXTENSION) *exts;
  ------------------
  |  |   31|  4.08k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   95|  4.08k|        ASN1_ENUMERATED *reason;
   96|  4.08k|        X509_EXTENSION *ext;
   97|       |
   98|  4.08k|        gtmp = X509_REVOKED_get_ext_d2i(rev,
   99|  4.08k|                                        NID_certificate_issuer, &j, NULL);
  ------------------
  |  | 2699|  4.08k|#define NID_certificate_issuer          771
  ------------------
  100|  4.08k|        if (gtmp == NULL && j != -1) {
  ------------------
  |  Branch (100:13): [True: 3.66k, False: 421]
  |  Branch (100:29): [True: 467, False: 3.19k]
  ------------------
  101|    467|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  649|    467|# define EXFLAG_INVALID          0x80
  ------------------
  102|    467|            return 1;
  103|    467|        }
  104|       |
  105|  3.61k|        if (gtmp != NULL) {
  ------------------
  |  Branch (105:13): [True: 421, False: 3.19k]
  ------------------
  106|    421|            if (crl->issuers == NULL) {
  ------------------
  |  Branch (106:17): [True: 78, False: 343]
  ------------------
  107|     78|                crl->issuers = sk_GENERAL_NAMES_new_null();
  ------------------
  |  |  267|     78|#define sk_GENERAL_NAMES_new_null() ((STACK_OF(GENERAL_NAMES) *)OPENSSL_sk_new_null())
  ------------------
  108|     78|                if (crl->issuers == NULL) {
  ------------------
  |  Branch (108:21): [True: 0, False: 78]
  ------------------
  109|      0|                    GENERAL_NAMES_free(gtmp);
  110|      0|                    return 0;
  111|      0|                }
  112|     78|            }
  113|    421|            if (!sk_GENERAL_NAMES_push(crl->issuers, gtmp)) {
  ------------------
  |  |  274|    421|#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: 421]
  ------------------
  114|      0|                GENERAL_NAMES_free(gtmp);
  115|      0|                return 0;
  116|      0|            }
  117|    421|            gens = gtmp;
  118|    421|        }
  119|  3.61k|        rev->issuer = gens;
  120|       |
  121|  3.61k|        reason = X509_REVOKED_get_ext_d2i(rev, NID_crl_reason, &j, NULL);
  ------------------
  |  | 2679|  3.61k|#define NID_crl_reason          141
  ------------------
  122|  3.61k|        if (reason == NULL && j != -1) {
  ------------------
  |  Branch (122:13): [True: 2.05k, False: 1.56k]
  |  Branch (122:31): [True: 392, False: 1.66k]
  ------------------
  123|    392|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  649|    392|# define EXFLAG_INVALID          0x80
  ------------------
  124|    392|            return 1;
  125|    392|        }
  126|       |
  127|  3.22k|        if (reason != NULL) {
  ------------------
  |  Branch (127:13): [True: 1.56k, False: 1.66k]
  ------------------
  128|  1.56k|            rev->reason = ASN1_ENUMERATED_get(reason);
  129|  1.56k|            ASN1_ENUMERATED_free(reason);
  130|  1.56k|        } else
  131|  1.66k|            rev->reason = CRL_REASON_NONE;
  ------------------
  |  |  303|  1.66k|# define CRL_REASON_NONE                         -1
  ------------------
  132|       |
  133|       |        /* Check for critical CRL entry extensions */
  134|       |
  135|  3.22k|        exts = rev->extensions;
  136|       |
  137|  4.34k|        for (j = 0; j < sk_X509_EXTENSION_num(exts); j++) {
  ------------------
  |  |  227|  4.34k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (137:21): [True: 2.68k, False: 1.66k]
  ------------------
  138|  2.68k|            ext = sk_X509_EXTENSION_value(exts, j);
  ------------------
  |  |  228|  2.68k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  139|  2.68k|            if (X509_EXTENSION_get_critical(ext)) {
  ------------------
  |  Branch (139:17): [True: 1.98k, False: 698]
  ------------------
  140|  1.98k|                if (OBJ_obj2nid(X509_EXTENSION_get_object(ext))
  ------------------
  |  Branch (140:21): [True: 420, False: 1.56k]
  ------------------
  141|  1.98k|                    == NID_certificate_issuer)
  ------------------
  |  | 2699|  1.98k|#define NID_certificate_issuer          771
  ------------------
  142|    420|                    continue;
  143|  1.56k|                crl->flags |= EXFLAG_CRITICAL;
  ------------------
  |  |  652|  1.56k|# define EXFLAG_CRITICAL         0x200
  ------------------
  144|  1.56k|                break;
  145|  1.98k|            }
  146|  2.68k|        }
  147|       |
  148|  3.22k|    }
  149|       |
  150|  19.4k|    return 1;
  151|       |
  152|  20.3k|}

x_name.c:x509_name_ex_new:
   91|   284k|{
   92|   284k|    X509_NAME *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   99|   284k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   284k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   284k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|       |
   94|   284k|    if (ret == NULL)
  ------------------
  |  Branch (94:9): [True: 0, False: 284k]
  ------------------
   95|      0|        return 0;
   96|   284k|    if ((ret->entries = sk_X509_NAME_ENTRY_new_null()) == NULL) {
  ------------------
  |  |  199|   284k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (96:9): [True: 0, False: 284k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   98|      0|        goto err;
   99|      0|    }
  100|   284k|    if ((ret->bytes = BUF_MEM_new()) == NULL) {
  ------------------
  |  Branch (100:9): [True: 0, False: 284k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  102|      0|        goto err;
  103|      0|    }
  104|   284k|    ret->modified = 1;
  105|   284k|    *val = (ASN1_VALUE *)ret;
  106|   284k|    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);
  ------------------
  |  |  202|      0|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  111|      0|        OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|      0|    }
  113|      0|    return 0;
  114|   284k|}
x_name.c:x509_name_ex_free:
  117|   284k|{
  118|   284k|    X509_NAME *a;
  119|       |
  120|   284k|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 284k]
  |  Branch (120:25): [True: 0, False: 284k]
  ------------------
  121|      0|        return;
  122|   284k|    a = (X509_NAME *)*pval;
  123|       |
  124|   284k|    BUF_MEM_free(a->bytes);
  125|   284k|    sk_X509_NAME_ENTRY_pop_free(a->entries, X509_NAME_ENTRY_free);
  ------------------
  |  |  210|   284k|#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|   284k|    OPENSSL_free(a->canon_enc);
  ------------------
  |  |  107|   284k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   284k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   284k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  127|   284k|    OPENSSL_free(a);
  ------------------
  |  |  107|   284k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   284k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   284k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  128|   284k|    *pval = NULL;
  129|   284k|}
x_name.c:x509_name_ex_d2i:
  145|   144k|{
  146|   144k|    const unsigned char *p = *in, *q;
  147|   144k|    union {
  148|   144k|        STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
  149|   144k|        ASN1_VALUE *a;
  150|   144k|    } intname = {
  151|   144k|        NULL
  152|   144k|    };
  153|   144k|    union {
  154|   144k|        X509_NAME *x;
  155|   144k|        ASN1_VALUE *a;
  156|   144k|    } nm = {
  157|   144k|        NULL
  158|   144k|    };
  159|   144k|    int i, j, ret;
  160|   144k|    STACK_OF(X509_NAME_ENTRY) *entries;
  ------------------
  |  |   31|   144k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  161|   144k|    X509_NAME_ENTRY *entry;
  162|       |
  163|   144k|    if (len > X509_NAME_MAX)
  ------------------
  |  |   24|   144k|#define X509_NAME_MAX (1024 * 1024)
  ------------------
  |  Branch (163:9): [True: 0, False: 144k]
  ------------------
  164|      0|        len = X509_NAME_MAX;
  ------------------
  |  |   24|      0|#define X509_NAME_MAX (1024 * 1024)
  ------------------
  165|   144k|    q = p;
  166|       |
  167|       |    /* Get internal representation of Name */
  168|   144k|    ret = ASN1_item_ex_d2i(&intname.a,
  169|   144k|                           &p, len, ASN1_ITEM_rptr(X509_NAME_INTERNAL),
  ------------------
  |  |  426|   144k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  170|   144k|                           tag, aclass, opt, ctx);
  171|       |
  172|   144k|    if (ret <= 0)
  ------------------
  |  Branch (172:9): [True: 782, False: 143k]
  ------------------
  173|    782|        return ret;
  174|       |
  175|   143k|    if (*val)
  ------------------
  |  Branch (175:9): [True: 140k, False: 2.81k]
  ------------------
  176|   140k|        x509_name_ex_free(val, NULL);
  177|   143k|    if (!x509_name_ex_new(&nm.a, NULL))
  ------------------
  |  Branch (177:9): [True: 0, False: 143k]
  ------------------
  178|      0|        goto err;
  179|       |    /* We've decoded it: now cache encoding */
  180|   143k|    if (!BUF_MEM_grow(nm.x->bytes, p - q))
  ------------------
  |  Branch (180:9): [True: 0, False: 143k]
  ------------------
  181|      0|        goto err;
  182|   143k|    memcpy(nm.x->bytes->data, q, p - q);
  183|       |
  184|       |    /* Convert internal representation to X509_NAME structure */
  185|  3.20M|    for (i = 0; i < sk_STACK_OF_X509_NAME_ENTRY_num(intname.s); i++) {
  ------------------
  |  Branch (185:17): [True: 3.06M, False: 143k]
  ------------------
  186|  3.06M|        entries = sk_STACK_OF_X509_NAME_ENTRY_value(intname.s, i);
  187|  3.86M|        for (j = 0; j < sk_X509_NAME_ENTRY_num(entries); j++) {
  ------------------
  |  |  196|  3.86M|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (187:21): [True: 804k, False: 3.06M]
  ------------------
  188|   804k|            entry = sk_X509_NAME_ENTRY_value(entries, j);
  ------------------
  |  |  197|   804k|#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|   804k|            entry->set = i;
  190|   804k|            if (!sk_X509_NAME_ENTRY_push(nm.x->entries, entry))
  ------------------
  |  |  206|   804k|#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: 804k]
  ------------------
  191|      0|                goto err;
  192|   804k|            (void)sk_X509_NAME_ENTRY_set(entries, j, NULL);
  ------------------
  |  |  212|   804k|#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|   804k|        }
  194|  3.06M|    }
  195|   143k|    ret = x509_name_canon(nm.x);
  196|   143k|    if (!ret)
  ------------------
  |  Branch (196:9): [True: 366, False: 142k]
  ------------------
  197|    366|        goto err;
  198|   142k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  199|   142k|                                         local_sk_X509_NAME_ENTRY_free);
  200|   142k|    nm.x->modified = 0;
  201|   142k|    *val = nm.a;
  202|   142k|    *in = p;
  203|   142k|    return ret;
  204|       |
  205|    366| err:
  206|    366|    if (nm.x != NULL)
  ------------------
  |  Branch (206:9): [True: 366, False: 0]
  ------------------
  207|    366|        X509_NAME_free(nm.x);
  208|    366|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  209|    366|                                         local_sk_X509_NAME_ENTRY_pop_free);
  210|    366|    ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|    366|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    366|    (ERR_new(),                                                 \
  |  |  |  |  404|    366|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    366|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    366|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    366|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    366|     ERR_set_error)
  |  |  ------------------
  ------------------
  211|    366|    return 0;
  212|   143k|}
x_name.c:x509_name_canon:
  311|   145k|{
  312|   145k|    unsigned char *p;
  313|   145k|    STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname;
  ------------------
  |  |   31|   145k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  314|   145k|    STACK_OF(X509_NAME_ENTRY) *entries = NULL;
  ------------------
  |  |   31|   145k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  315|   145k|    X509_NAME_ENTRY *entry, *tmpentry = NULL;
  316|   145k|    int i, set = -1, ret = 0, len;
  317|       |
  318|   145k|    OPENSSL_free(a->canon_enc);
  ------------------
  |  |  107|   145k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   145k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   145k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  319|   145k|    a->canon_enc = NULL;
  320|       |    /* Special case: empty X509_NAME => null encoding */
  321|   145k|    if (sk_X509_NAME_ENTRY_num(a->entries) == 0) {
  ------------------
  |  |  196|   145k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (321:9): [True: 141k, False: 3.39k]
  ------------------
  322|   141k|        a->canon_enclen = 0;
  323|   141k|        return 1;
  324|   141k|    }
  325|  3.39k|    intname = sk_STACK_OF_X509_NAME_ENTRY_new_null();
  326|  3.39k|    if (intname == NULL) {
  ------------------
  |  Branch (326:9): [True: 0, False: 3.39k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  328|      0|        goto err;
  329|      0|    }
  330|  1.20M|    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
  ------------------
  |  |  196|  1.20M|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (330:17): [True: 1.20M, False: 1.73k]
  ------------------
  331|  1.20M|        entry = sk_X509_NAME_ENTRY_value(a->entries, i);
  ------------------
  |  |  197|  1.20M|#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|  1.20M|        if (entry->set != set) {
  ------------------
  |  Branch (332:13): [True: 10.1k, False: 1.19M]
  ------------------
  333|  10.1k|            entries = sk_X509_NAME_ENTRY_new_null();
  ------------------
  |  |  199|  10.1k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  334|  10.1k|            if (entries == NULL)
  ------------------
  |  Branch (334:17): [True: 0, False: 10.1k]
  ------------------
  335|      0|                goto err;
  336|  10.1k|            if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries)) {
  ------------------
  |  Branch (336:17): [True: 0, False: 10.1k]
  ------------------
  337|      0|                sk_X509_NAME_ENTRY_free(entries);
  ------------------
  |  |  202|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  339|      0|                goto err;
  340|      0|            }
  341|  10.1k|            set = entry->set;
  342|  10.1k|        }
  343|  1.20M|        tmpentry = X509_NAME_ENTRY_new();
  344|  1.20M|        if (tmpentry == NULL) {
  ------------------
  |  Branch (344:13): [True: 0, False: 1.20M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  346|      0|            goto err;
  347|      0|        }
  348|  1.20M|        tmpentry->object = OBJ_dup(entry->object);
  349|  1.20M|        if (tmpentry->object == NULL) {
  ------------------
  |  Branch (349:13): [True: 0, False: 1.20M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  351|      0|            goto err;
  352|      0|        }
  353|  1.20M|        if (!asn1_string_canon(tmpentry->value, entry->value))
  ------------------
  |  Branch (353:13): [True: 1.65k, False: 1.20M]
  ------------------
  354|  1.65k|            goto err;
  355|  1.20M|        if (!sk_X509_NAME_ENTRY_push(entries, tmpentry)) {
  ------------------
  |  |  206|  1.20M|#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: 1.20M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  357|      0|            goto err;
  358|      0|        }
  359|  1.20M|        tmpentry = NULL;
  360|  1.20M|    }
  361|       |
  362|       |    /* Finally generate encoding */
  363|  1.73k|    len = i2d_name_canon(intname, NULL);
  364|  1.73k|    if (len < 0)
  ------------------
  |  Branch (364:9): [True: 0, False: 1.73k]
  ------------------
  365|      0|        goto err;
  366|  1.73k|    a->canon_enclen = len;
  367|       |
  368|  1.73k|    p = OPENSSL_malloc(a->canon_enclen);
  ------------------
  |  |   97|  1.73k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.73k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.73k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  369|  1.73k|    if (p == NULL)
  ------------------
  |  Branch (369:9): [True: 0, False: 1.73k]
  ------------------
  370|      0|        goto err;
  371|       |
  372|  1.73k|    a->canon_enc = p;
  373|       |
  374|  1.73k|    i2d_name_canon(intname, &p);
  375|       |
  376|  1.73k|    ret = 1;
  377|       |
  378|  3.39k| err:
  379|  3.39k|    X509_NAME_ENTRY_free(tmpentry);
  380|  3.39k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
  381|  3.39k|                                         local_sk_X509_NAME_ENTRY_pop_free);
  382|  3.39k|    return ret;
  383|  1.73k|}
x_name.c:asn1_string_canon:
  393|  1.20M|{
  394|  1.20M|    unsigned char *to, *from;
  395|  1.20M|    int len, i;
  396|       |
  397|       |    /* If type not in bitmask just copy string across */
  398|  1.20M|    if (!(ASN1_tag2bit(in->type) & ASN1_MASK_CANON)) {
  ------------------
  |  |  388|  1.20M|        (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  117|  1.20M|# define B_ASN1_UTF8STRING       0x2000
  |  |  ------------------
  |  |                       (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  115|  1.20M|# define B_ASN1_BMPSTRING        0x0800
  |  |  ------------------
  |  |                       (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  112|  1.20M|# define B_ASN1_UNIVERSALSTRING  0x0100
  |  |  ------------------
  |  |  389|  1.20M|        | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  103|  1.20M|# define B_ASN1_PRINTABLESTRING  0x0002
  |  |  ------------------
  |  |                       | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  104|  1.20M|# define B_ASN1_T61STRING        0x0004
  |  |  ------------------
  |  |                       | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  107|  1.20M|# define B_ASN1_IA5STRING        0x0010
  |  |  ------------------
  |  |  390|  1.20M|        | B_ASN1_VISIBLESTRING)
  |  |  ------------------
  |  |  |  |  110|  1.20M|# define B_ASN1_VISIBLESTRING    0x0040
  |  |  ------------------
  ------------------
  |  Branch (398:9): [True: 563k, False: 644k]
  ------------------
  399|   563k|        if (!ASN1_STRING_copy(out, in))
  ------------------
  |  Branch (399:13): [True: 0, False: 563k]
  ------------------
  400|      0|            return 0;
  401|   563k|        return 1;
  402|   563k|    }
  403|       |
  404|   644k|    out->type = V_ASN1_UTF8STRING;
  ------------------
  |  |   73|   644k|# define V_ASN1_UTF8STRING               12
  ------------------
  405|   644k|    out->length = ASN1_STRING_to_UTF8(&out->data, in);
  406|   644k|    if (out->length == -1)
  ------------------
  |  Branch (406:9): [True: 1.65k, False: 642k]
  ------------------
  407|  1.65k|        return 0;
  408|       |
  409|   642k|    to = out->data;
  410|   642k|    from = to;
  411|       |
  412|   642k|    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|   643k|    while (len > 0 && ossl_isspace(*from)) {
  ------------------
  |  |   82|  1.50k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  1.50k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 488, False: 1.01k]
  |  |  ------------------
  ------------------
  |  Branch (422:12): [True: 1.50k, False: 641k]
  ------------------
  423|    488|        from++;
  424|    488|        len--;
  425|    488|    }
  426|       |
  427|   642k|    to = from + len;
  428|       |
  429|       |    /* Ignore trailing spaces */
  430|   643k|    while (len > 0 && ossl_isspace(to[-1])) {
  ------------------
  |  |   82|  1.22k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  1.22k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 203, False: 1.01k]
  |  |  ------------------
  ------------------
  |  Branch (430:12): [True: 1.22k, False: 641k]
  ------------------
  431|    203|        to--;
  432|    203|        len--;
  433|    203|    }
  434|       |
  435|   642k|    to = out->data;
  436|       |
  437|   642k|    i = 0;
  438|  17.4M|    while (i < len) {
  ------------------
  |  Branch (438:12): [True: 16.7M, False: 642k]
  ------------------
  439|       |        /* If not ASCII set just copy across */
  440|  16.7M|        if (!ossl_isascii(*from)) {
  ------------------
  |  |   75|  16.7M|# define ossl_isascii(c)        (((c) & ~127) == 0)
  ------------------
  |  Branch (440:13): [True: 15.3M, False: 1.42M]
  ------------------
  441|  15.3M|            *to++ = *from++;
  442|  15.3M|            i++;
  443|  15.3M|        }
  444|       |        /* Collapse multiple spaces */
  445|  1.42M|        else if (ossl_isspace(*from)) {
  ------------------
  |  |   82|  1.42M|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  1.42M|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 109k, False: 1.31M]
  |  |  ------------------
  ------------------
  446|       |            /* Copy one space across */
  447|   109k|            *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|   115k|            do {
  454|   115k|                from++;
  455|   115k|                i++;
  456|   115k|            }
  457|   115k|            while (ossl_isspace(*from));
  ------------------
  |  |   82|   115k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|   115k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 6.90k, False: 109k]
  |  |  ------------------
  ------------------
  458|  1.31M|        } else {
  459|  1.31M|            *to++ = ossl_tolower(*from);
  460|  1.31M|            from++;
  461|  1.31M|            i++;
  462|  1.31M|        }
  463|  16.7M|    }
  464|       |
  465|   642k|    out->length = to - out->data;
  466|       |
  467|   642k|    return 1;
  468|       |
  469|   644k|}
x_name.c:i2d_name_canon:
  473|  3.46k|{
  474|  3.46k|    int i, len, ltmp;
  475|  3.46k|    const ASN1_VALUE *v;
  476|  3.46k|    STACK_OF(ASN1_VALUE) *intname = (STACK_OF(ASN1_VALUE) *)_intname;
  ------------------
  |  |   31|  3.46k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  477|       |
  478|  3.46k|    len = 0;
  479|  19.2k|    for (i = 0; i < sk_ASN1_VALUE_num(intname); i++) {
  ------------------
  |  |  898|  19.2k|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (479:17): [True: 15.7k, False: 3.46k]
  ------------------
  480|  15.7k|        v = sk_ASN1_VALUE_value(intname, i);
  ------------------
  |  |  899|  15.7k|#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
  ------------------
  481|  15.7k|        ltmp = ASN1_item_ex_i2d(&v, in,
  482|  15.7k|                                ASN1_ITEM_rptr(X509_NAME_ENTRIES), -1, -1);
  ------------------
  |  |  426|  15.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  483|  15.7k|        if (ltmp < 0)
  ------------------
  |  Branch (483:13): [True: 0, False: 15.7k]
  ------------------
  484|      0|            return ltmp;
  485|  15.7k|        len += ltmp;
  486|  15.7k|    }
  487|  3.46k|    return len;
  488|  3.46k|}
x_name.c:local_sk_X509_NAME_ENTRY_free:
  132|  3.06M|{
  133|  3.06M|    sk_X509_NAME_ENTRY_free(ne);
  ------------------
  |  |  202|  3.06M|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  134|  3.06M|}
x_name.c:local_sk_X509_NAME_ENTRY_pop_free:
  137|  11.5k|{
  138|  11.5k|    sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free);
  ------------------
  |  |  210|  11.5k|#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|  11.5k|}
x_name.c:x509_name_ex_i2d:
  216|  13.0k|{
  217|  13.0k|    int ret;
  218|  13.0k|    X509_NAME *a = (X509_NAME *)*val;
  219|       |
  220|  13.0k|    if (a->modified) {
  ------------------
  |  Branch (220:9): [True: 1.79k, False: 11.2k]
  ------------------
  221|  1.79k|        ret = x509_name_encode(a);
  222|  1.79k|        if (ret < 0)
  ------------------
  |  Branch (222:13): [True: 0, False: 1.79k]
  ------------------
  223|      0|            return ret;
  224|  1.79k|        ret = x509_name_canon(a);
  225|  1.79k|        if (!ret)
  ------------------
  |  Branch (225:13): [True: 1.29k, False: 509]
  ------------------
  226|  1.29k|            return -1;
  227|  1.79k|    }
  228|  11.7k|    ret = a->bytes->length;
  229|  11.7k|    if (out != NULL) {
  ------------------
  |  Branch (229:9): [True: 3.70k, False: 8.08k]
  ------------------
  230|  3.70k|        memcpy(*out, a->bytes->data, ret);
  231|  3.70k|        *out += ret;
  232|  3.70k|    }
  233|  11.7k|    return ret;
  234|  13.0k|}
x_name.c:x509_name_encode:
  237|  1.79k|{
  238|  1.79k|    union {
  239|  1.79k|        STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
  240|  1.79k|        const ASN1_VALUE *a;
  241|  1.79k|    } intname = {
  242|  1.79k|        NULL
  243|  1.79k|    };
  244|  1.79k|    int len;
  245|  1.79k|    unsigned char *p;
  246|  1.79k|    STACK_OF(X509_NAME_ENTRY) *entries = NULL;
  ------------------
  |  |   31|  1.79k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  247|  1.79k|    X509_NAME_ENTRY *entry;
  248|  1.79k|    int i, set = -1;
  249|       |
  250|  1.79k|    intname.s = sk_STACK_OF_X509_NAME_ENTRY_new_null();
  251|  1.79k|    if (!intname.s)
  ------------------
  |  Branch (251:9): [True: 0, False: 1.79k]
  ------------------
  252|      0|        goto cerr;
  253|   405k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
  ------------------
  |  |  196|   405k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (253:17): [True: 404k, False: 1.79k]
  ------------------
  254|   404k|        entry = sk_X509_NAME_ENTRY_value(a->entries, i);
  ------------------
  |  |  197|   404k|#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|   404k|        if (entry->set != set) {
  ------------------
  |  Branch (255:13): [True: 5.21k, False: 398k]
  ------------------
  256|  5.21k|            entries = sk_X509_NAME_ENTRY_new_null();
  ------------------
  |  |  199|  5.21k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  257|  5.21k|            if (!entries)
  ------------------
  |  Branch (257:17): [True: 0, False: 5.21k]
  ------------------
  258|      0|                goto cerr;
  259|  5.21k|            if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname.s, entries)) {
  ------------------
  |  Branch (259:17): [True: 0, False: 5.21k]
  ------------------
  260|      0|                sk_X509_NAME_ENTRY_free(entries);
  ------------------
  |  |  202|      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|  5.21k|            set = entry->set;
  264|  5.21k|        }
  265|   404k|        if (!sk_X509_NAME_ENTRY_push(entries, entry))
  ------------------
  |  |  206|   404k|#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: 404k]
  ------------------
  266|      0|            goto cerr;
  267|   404k|    }
  268|  1.79k|    len = ASN1_item_ex_i2d(&intname.a, NULL,
  269|  1.79k|                           ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1);
  ------------------
  |  |  426|  1.79k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  270|  1.79k|    if (!BUF_MEM_grow(a->bytes, len)) {
  ------------------
  |  Branch (270:9): [True: 0, False: 1.79k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        goto err;
  273|      0|    }
  274|  1.79k|    p = (unsigned char *)a->bytes->data;
  275|  1.79k|    ASN1_item_ex_i2d(&intname.a,
  276|  1.79k|                     &p, ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1);
  ------------------
  |  |  426|  1.79k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  277|  1.79k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  278|  1.79k|                                         local_sk_X509_NAME_ENTRY_free);
  279|  1.79k|    a->modified = 0;
  280|  1.79k|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|}

ossl_d2i_X509_PUBKEY_INTERNAL:
   71|  54.6k|{
   72|  54.6k|    X509_PUBKEY *xpub = OPENSSL_zalloc(sizeof(*xpub));
  ------------------
  |  |   99|  54.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  54.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  54.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|       |
   74|  54.6k|    if (xpub == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 54.6k]
  ------------------
   75|      0|        return NULL;
   76|  54.6k|    return (X509_PUBKEY *)ASN1_item_d2i_ex((ASN1_VALUE **)&xpub, pp, len,
   77|  54.6k|                                           ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
  ------------------
  |  |  426|  54.6k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   78|  54.6k|                                           libctx, propq);
   79|  54.6k|}
ossl_X509_PUBKEY_INTERNAL_free:
   82|   109k|{
   83|   109k|    ASN1_item_free((ASN1_VALUE *)xpub, ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL));
  ------------------
  |  |  426|   109k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   84|   109k|}
X509_PUBKEY_get0:
  456|  54.4k|{
  457|  54.4k|    if (key == NULL) {
  ------------------
  |  Branch (457:9): [True: 0, False: 54.4k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  459|      0|        return NULL;
  460|      0|    }
  461|       |
  462|  54.4k|    if (key->pkey == NULL) {
  ------------------
  |  Branch (462:9): [True: 24.3k, False: 30.0k]
  ------------------
  463|       |        /* We failed to decode the key when we loaded it, or it was never set */
  464|  24.3k|        ERR_raise(ERR_LIB_EVP, EVP_R_DECODE_ERROR);
  ------------------
  |  |  401|  24.3k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  24.3k|    (ERR_new(),                                                 \
  |  |  |  |  404|  24.3k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|  24.3k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|  24.3k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|  24.3k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  24.3k|     ERR_set_error)
  |  |  ------------------
  ------------------
  465|  24.3k|        return NULL;
  466|  24.3k|    }
  467|       |
  468|  30.0k|    return key->pkey;
  469|  54.4k|}
X509_PUBKEY_get:
  472|  54.4k|{
  473|  54.4k|    EVP_PKEY *ret = X509_PUBKEY_get0(key);
  474|       |
  475|  54.4k|    if (ret != NULL && !EVP_PKEY_up_ref(ret)) {
  ------------------
  |  Branch (475:9): [True: 30.0k, False: 24.3k]
  |  Branch (475:24): [True: 0, False: 30.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  477|      0|        ret = NULL;
  478|      0|    }
  479|  54.4k|    return ret;
  480|  54.4k|}
ossl_d2i_PUBKEY_legacy:
  536|  54.6k|{
  537|  54.6k|    return d2i_PUBKEY_int(a, pp, length, NULL, NULL, 1, d2i_X509_PUBKEY);
  538|  54.6k|}
d2i_RSA_PUBKEY:
  606|  4.54k|{
  607|  4.54k|    EVP_PKEY *pkey;
  608|  4.54k|    RSA *key = NULL;
  609|  4.54k|    const unsigned char *q;
  610|       |
  611|  4.54k|    q = *pp;
  612|  4.54k|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  613|  4.54k|    if (pkey == NULL)
  ------------------
  |  Branch (613:9): [True: 544, False: 3.99k]
  ------------------
  614|    544|        return NULL;
  615|  3.99k|    key = EVP_PKEY_get1_RSA(pkey);
  616|  3.99k|    EVP_PKEY_free(pkey);
  617|  3.99k|    if (key == NULL)
  ------------------
  |  Branch (617:9): [True: 0, False: 3.99k]
  ------------------
  618|      0|        return NULL;
  619|  3.99k|    *pp = q;
  620|  3.99k|    if (a != NULL) {
  ------------------
  |  Branch (620:9): [True: 0, False: 3.99k]
  ------------------
  621|      0|        RSA_free(*a);
  622|      0|        *a = key;
  623|      0|    }
  624|  3.99k|    return key;
  625|  3.99k|}
ossl_d2i_DH_PUBKEY:
  647|  2.94k|{
  648|  2.94k|    EVP_PKEY *pkey;
  649|  2.94k|    DH *key = NULL;
  650|  2.94k|    const unsigned char *q;
  651|       |
  652|  2.94k|    q = *pp;
  653|  2.94k|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  654|  2.94k|    if (pkey == NULL)
  ------------------
  |  Branch (654:9): [True: 851, False: 2.09k]
  ------------------
  655|    851|        return NULL;
  656|  2.09k|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_DH)
  ------------------
  |  |   67|  2.09k|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|  2.09k|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
  |  Branch (656:9): [True: 2.09k, False: 0]
  ------------------
  657|  2.09k|        key = EVP_PKEY_get1_DH(pkey);
  658|  2.09k|    EVP_PKEY_free(pkey);
  659|  2.09k|    if (key == NULL)
  ------------------
  |  Branch (659:9): [True: 0, False: 2.09k]
  ------------------
  660|      0|        return NULL;
  661|  2.09k|    *pp = q;
  662|  2.09k|    if (a != NULL) {
  ------------------
  |  Branch (662:9): [True: 0, False: 2.09k]
  ------------------
  663|      0|        DH_free(*a);
  664|      0|        *a = key;
  665|      0|    }
  666|  2.09k|    return key;
  667|  2.09k|}
ossl_d2i_DHx_PUBKEY:
  688|  4.62k|{
  689|  4.62k|    EVP_PKEY *pkey;
  690|  4.62k|    DH *key = NULL;
  691|  4.62k|    const unsigned char *q;
  692|       |
  693|  4.62k|    q = *pp;
  694|  4.62k|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  695|  4.62k|    if (pkey == NULL)
  ------------------
  |  Branch (695:9): [True: 2.08k, False: 2.53k]
  ------------------
  696|  2.08k|        return NULL;
  697|  2.53k|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_DHX)
  ------------------
  |  |   68|  2.53k|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5295|  2.53k|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (697:9): [True: 2.53k, False: 0]
  ------------------
  698|  2.53k|        key = EVP_PKEY_get1_DH(pkey);
  699|  2.53k|    EVP_PKEY_free(pkey);
  700|  2.53k|    if (key == NULL)
  ------------------
  |  Branch (700:9): [True: 0, False: 2.53k]
  ------------------
  701|      0|        return NULL;
  702|  2.53k|    *pp = q;
  703|  2.53k|    if (a != NULL) {
  ------------------
  |  Branch (703:9): [True: 0, False: 2.53k]
  ------------------
  704|      0|        DH_free(*a);
  705|      0|        *a = key;
  706|      0|    }
  707|  2.53k|    return key;
  708|  2.53k|}
d2i_DSA_PUBKEY:
  731|  5.37k|{
  732|  5.37k|    EVP_PKEY *pkey;
  733|  5.37k|    DSA *key = NULL;
  734|  5.37k|    const unsigned char *q;
  735|       |
  736|  5.37k|    q = *pp;
  737|  5.37k|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  738|  5.37k|    if (pkey == NULL)
  ------------------
  |  Branch (738:9): [True: 2.78k, False: 2.58k]
  ------------------
  739|  2.78k|        return NULL;
  740|  2.58k|    key = EVP_PKEY_get1_DSA(pkey);
  741|  2.58k|    EVP_PKEY_free(pkey);
  742|  2.58k|    if (key == NULL)
  ------------------
  |  Branch (742:9): [True: 0, False: 2.58k]
  ------------------
  743|      0|        return NULL;
  744|  2.58k|    *pp = q;
  745|  2.58k|    if (a != NULL) {
  ------------------
  |  Branch (745:9): [True: 0, False: 2.58k]
  ------------------
  746|      0|        DSA_free(*a);
  747|      0|        *a = key;
  748|      0|    }
  749|  2.58k|    return key;
  750|  2.58k|}
ossl_d2i_DSA_PUBKEY:
  754|  5.37k|{
  755|  5.37k|    DSA *key = NULL;
  756|  5.37k|    const unsigned char *data;
  757|  5.37k|    const BIGNUM *p, *q, *g;
  758|       |
  759|  5.37k|    data = *pp;
  760|  5.37k|    key = d2i_DSA_PUBKEY(NULL, &data, length);
  761|  5.37k|    if (key == NULL)
  ------------------
  |  Branch (761:9): [True: 2.78k, False: 2.58k]
  ------------------
  762|  2.78k|        return NULL;
  763|  2.58k|    DSA_get0_pqg(key, &p, &q, &g);
  764|  2.58k|    if (p == NULL || q == NULL || g == NULL) {
  ------------------
  |  Branch (764:9): [True: 406, False: 2.17k]
  |  Branch (764:22): [True: 0, False: 2.17k]
  |  Branch (764:35): [True: 0, False: 2.17k]
  ------------------
  765|    406|        DSA_free(key);
  766|    406|        return NULL;
  767|    406|    }
  768|  2.17k|    *pp = data;
  769|  2.17k|    if (a != NULL) {
  ------------------
  |  Branch (769:9): [True: 0, False: 2.17k]
  ------------------
  770|      0|        DSA_free(*a);
  771|      0|        *a = key;
  772|      0|    }
  773|  2.17k|    return key;
  774|  2.58k|}
d2i_EC_PUBKEY:
  797|  34.5k|{
  798|  34.5k|    EVP_PKEY *pkey;
  799|  34.5k|    EC_KEY *key = NULL;
  800|  34.5k|    const unsigned char *q;
  801|  34.5k|    int type;
  802|       |
  803|  34.5k|    q = *pp;
  804|  34.5k|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  805|  34.5k|    if (pkey == NULL)
  ------------------
  |  Branch (805:9): [True: 16.0k, False: 18.4k]
  ------------------
  806|  16.0k|        return NULL;
  807|  18.4k|    type = EVP_PKEY_get_id(pkey);
  808|  18.4k|    if (type == EVP_PKEY_EC || type == EVP_PKEY_SM2)
  ------------------
  |  |   69|  18.4k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  36.9k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
                  if (type == EVP_PKEY_EC || type == EVP_PKEY_SM2)
  ------------------
  |  |   70|      1|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1228|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (808:9): [True: 18.4k, False: 1]
  |  Branch (808:32): [True: 1, False: 0]
  ------------------
  809|  18.4k|        key = EVP_PKEY_get1_EC_KEY(pkey);
  810|  18.4k|    EVP_PKEY_free(pkey);
  811|  18.4k|    if (key == NULL)
  ------------------
  |  Branch (811:9): [True: 0, False: 18.4k]
  ------------------
  812|      0|        return NULL;
  813|  18.4k|    *pp = q;
  814|  18.4k|    if (a != NULL) {
  ------------------
  |  Branch (814:9): [True: 0, False: 18.4k]
  ------------------
  815|      0|        EC_KEY_free(*a);
  816|      0|        *a = key;
  817|      0|    }
  818|  18.4k|    return key;
  819|  18.4k|}
ossl_d2i_ED25519_PUBKEY:
  842|  1.46k|{
  843|  1.46k|    EVP_PKEY *pkey;
  844|  1.46k|    ECX_KEY *key = NULL;
  845|  1.46k|    const unsigned char *q;
  846|       |
  847|  1.46k|    q = *pp;
  848|  1.46k|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  849|  1.46k|    if (pkey == NULL)
  ------------------
  |  Branch (849:9): [True: 1.45k, False: 6]
  ------------------
  850|  1.45k|        return NULL;
  851|      6|    key = ossl_evp_pkey_get1_ED25519(pkey);
  852|      6|    EVP_PKEY_free(pkey);
  853|      6|    if (key == NULL)
  ------------------
  |  Branch (853:9): [True: 0, False: 6]
  ------------------
  854|      0|        return NULL;
  855|      6|    *pp = q;
  856|      6|    if (a != NULL) {
  ------------------
  |  Branch (856:9): [True: 0, False: 6]
  ------------------
  857|      0|        ossl_ecx_key_free(*a);
  858|      0|        *a = key;
  859|      0|    }
  860|      6|    return key;
  861|      6|}
ossl_d2i_ED448_PUBKEY:
  883|    562|{
  884|    562|    EVP_PKEY *pkey;
  885|    562|    ECX_KEY *key = NULL;
  886|    562|    const unsigned char *q;
  887|       |
  888|    562|    q = *pp;
  889|    562|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  890|    562|    if (pkey == NULL)
  ------------------
  |  Branch (890:9): [True: 257, False: 305]
  ------------------
  891|    257|        return NULL;
  892|    305|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_ED448)
  ------------------
  |  |   81|    305|# define EVP_PKEY_ED448 NID_ED448
  |  |  ------------------
  |  |  |  | 5504|    305|#define NID_ED448               1088
  |  |  ------------------
  ------------------
  |  Branch (892:9): [True: 305, False: 0]
  ------------------
  893|    305|        key = ossl_evp_pkey_get1_ED448(pkey);
  894|    305|    EVP_PKEY_free(pkey);
  895|    305|    if (key == NULL)
  ------------------
  |  Branch (895:9): [True: 0, False: 305]
  ------------------
  896|      0|        return NULL;
  897|    305|    *pp = q;
  898|    305|    if (a != NULL) {
  ------------------
  |  Branch (898:9): [True: 0, False: 305]
  ------------------
  899|      0|        ossl_ecx_key_free(*a);
  900|      0|        *a = key;
  901|      0|    }
  902|    305|    return key;
  903|    305|}
ossl_d2i_X25519_PUBKEY:
  925|    240|{
  926|    240|    EVP_PKEY *pkey;
  927|    240|    ECX_KEY *key = NULL;
  928|    240|    const unsigned char *q;
  929|       |
  930|    240|    q = *pp;
  931|    240|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  932|    240|    if (pkey == NULL)
  ------------------
  |  Branch (932:9): [True: 234, False: 6]
  ------------------
  933|    234|        return NULL;
  934|      6|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_X25519)
  ------------------
  |  |   78|      6|# define EVP_PKEY_X25519 NID_X25519
  |  |  ------------------
  |  |  |  | 5492|      6|#define NID_X25519              1034
  |  |  ------------------
  ------------------
  |  Branch (934:9): [True: 6, False: 0]
  ------------------
  935|      6|        key = ossl_evp_pkey_get1_X25519(pkey);
  936|      6|    EVP_PKEY_free(pkey);
  937|      6|    if (key == NULL)
  ------------------
  |  Branch (937:9): [True: 0, False: 6]
  ------------------
  938|      0|        return NULL;
  939|      6|    *pp = q;
  940|      6|    if (a != NULL) {
  ------------------
  |  Branch (940:9): [True: 0, False: 6]
  ------------------
  941|      0|        ossl_ecx_key_free(*a);
  942|      0|        *a = key;
  943|      0|    }
  944|      6|    return key;
  945|      6|}
ossl_d2i_X448_PUBKEY:
  967|    396|{
  968|    396|    EVP_PKEY *pkey;
  969|    396|    ECX_KEY *key = NULL;
  970|    396|    const unsigned char *q;
  971|       |
  972|    396|    q = *pp;
  973|    396|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  974|    396|    if (pkey == NULL)
  ------------------
  |  Branch (974:9): [True: 326, False: 70]
  ------------------
  975|    326|        return NULL;
  976|     70|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_X448)
  ------------------
  |  |   80|     70|# define EVP_PKEY_X448 NID_X448
  |  |  ------------------
  |  |  |  | 5496|     70|#define NID_X448                1035
  |  |  ------------------
  ------------------
  |  Branch (976:9): [True: 70, False: 0]
  ------------------
  977|     70|        key = ossl_evp_pkey_get1_X448(pkey);
  978|     70|    EVP_PKEY_free(pkey);
  979|     70|    if (key == NULL)
  ------------------
  |  Branch (979:9): [True: 0, False: 70]
  ------------------
  980|      0|        return NULL;
  981|     70|    *pp = q;
  982|     70|    if (a != NULL) {
  ------------------
  |  Branch (982:9): [True: 0, False: 70]
  ------------------
  983|      0|        ossl_ecx_key_free(*a);
  984|      0|        *a = key;
  985|      0|    }
  986|     70|    return key;
  987|     70|}
X509_PUBKEY_get0_param:
 1031|   108k|{
 1032|   108k|    if (ppkalg)
  ------------------
  |  Branch (1032:9): [True: 0, False: 108k]
  ------------------
 1033|      0|        *ppkalg = pub->algor->algorithm;
 1034|   108k|    if (pk) {
  ------------------
  |  Branch (1034:9): [True: 54.4k, False: 54.4k]
  ------------------
 1035|  54.4k|        *pk = pub->public_key->data;
 1036|  54.4k|        *ppklen = pub->public_key->length;
 1037|  54.4k|    }
 1038|   108k|    if (pa)
  ------------------
  |  Branch (1038:9): [True: 108k, False: 0]
  ------------------
 1039|   108k|        *pa = pub->algor;
 1040|   108k|    return 1;
 1041|   108k|}
ossl_x509_PUBKEY_get0_libctx:
 1073|  34.3k|{
 1074|  34.3k|    if (plibctx)
  ------------------
  |  Branch (1074:9): [True: 34.3k, False: 0]
  ------------------
 1075|  34.3k|        *plibctx = key->libctx;
 1076|  34.3k|    if (ppropq)
  ------------------
  |  Branch (1076:9): [True: 34.3k, False: 0]
  ------------------
 1077|  34.3k|        *ppropq = key->propq;
 1078|  34.3k|    return 1;
 1079|  34.3k|}
x_pubkey.c:x509_pubkey_ex_new_ex:
  113|  59.1k|{
  114|  59.1k|    X509_PUBKEY *ret;
  115|       |
  116|  59.1k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |   99|  59.1k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  59.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  59.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (116:9): [True: 0, False: 59.1k]
  ------------------
  117|      0|        return 0;
  118|  59.1k|    if (!x509_pubkey_ex_populate((ASN1_VALUE **)&ret, NULL)
  ------------------
  |  Branch (118:9): [True: 0, False: 59.1k]
  ------------------
  119|  59.1k|        || !x509_pubkey_set0_libctx(ret, libctx, propq)) {
  ------------------
  |  Branch (119:12): [True: 0, False: 59.1k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  123|  59.1k|    } else {
  124|  59.1k|        *pval = (ASN1_VALUE *)ret;
  125|  59.1k|    }
  126|       |
  127|  59.1k|    return ret != NULL;
  128|  59.1k|}
x_pubkey.c:x509_pubkey_ex_populate:
  101|   172k|{
  102|   172k|    X509_PUBKEY *pubkey = (X509_PUBKEY *)*pval;
  103|       |
  104|   172k|    return (pubkey->algor != NULL
  ------------------
  |  Branch (104:13): [True: 58.9k, False: 113k]
  ------------------
  105|   172k|            || (pubkey->algor = X509_ALGOR_new()) != NULL)
  ------------------
  |  Branch (105:16): [True: 113k, False: 0]
  ------------------
  106|   172k|        && (pubkey->public_key != NULL
  ------------------
  |  Branch (106:13): [True: 58.9k, False: 113k]
  ------------------
  107|   172k|            || (pubkey->public_key = ASN1_BIT_STRING_new()) != NULL);
  ------------------
  |  Branch (107:16): [True: 113k, False: 0]
  ------------------
  108|   172k|}
x_pubkey.c:x509_pubkey_ex_d2i_ex:
  135|   113k|{
  136|   113k|    const unsigned char *in_saved = *in;
  137|   113k|    size_t publen;
  138|   113k|    X509_PUBKEY *pubkey;
  139|   113k|    int ret;
  140|   113k|    OSSL_DECODER_CTX *dctx = NULL;
  141|   113k|    unsigned char *tmpbuf = NULL;
  142|       |
  143|   113k|    if (*pval == NULL && !x509_pubkey_ex_new_ex(pval, it, libctx, propq))
  ------------------
  |  Branch (143:9): [True: 0, False: 113k]
  |  Branch (143:26): [True: 0, False: 0]
  ------------------
  144|      0|        return 0;
  145|   113k|    if (!x509_pubkey_ex_populate(pval, NULL)) {
  ------------------
  |  Branch (145:9): [True: 0, False: 113k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|   113k|    if ((ret = ASN1_item_ex_d2i(pval, in, len,
  ------------------
  |  Branch (151:9): [True: 364, False: 113k]
  ------------------
  152|   113k|                                ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
  ------------------
  |  |  426|   113k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  153|   113k|                                tag, aclass, opt, ctx)) <= 0)
  154|    364|        return ret;
  155|       |
  156|   113k|    publen = *in - in_saved;
  157|   113k|    if (!ossl_assert(publen > 0)) {
  ------------------
  |  |   52|   113k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   113k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (157:9): [True: 0, False: 113k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  159|      0|        return 0;
  160|      0|    }
  161|       |
  162|   113k|    pubkey = (X509_PUBKEY *)*pval;
  163|   113k|    EVP_PKEY_free(pubkey->pkey);
  164|   113k|    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|   113k|    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|   113k|    if ((ret = x509_pubkey_decode(&pubkey->pkey, pubkey)) == -1) {
  ------------------
  |  Branch (177:9): [True: 0, False: 113k]
  ------------------
  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|   113k|    if (ret <= 0 && !pubkey->flag_force_legacy) {
  ------------------
  |  Branch (184:9): [True: 83.2k, False: 30.0k]
  |  Branch (184:21): [True: 58.8k, False: 24.3k]
  ------------------
  185|  58.8k|        const unsigned char *p;
  186|  58.8k|        char txtoidname[OSSL_MAX_NAME_SIZE];
  187|  58.8k|        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|  58.8k|        if (aclass != V_ASN1_UNIVERSAL) {
  ------------------
  |  |   47|  58.8k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (193:13): [True: 0, False: 58.8k]
  ------------------
  194|      0|            tmpbuf = OPENSSL_memdup(in_saved, publen);
  ------------------
  |  |  109|      0|        CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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|  58.8k|        p = in_saved;
  201|       |
  202|  58.8k|        if (OBJ_obj2txt(txtoidname, sizeof(txtoidname),
  ------------------
  |  Branch (202:13): [True: 1, False: 58.8k]
  ------------------
  203|  58.8k|                        pubkey->algor->algorithm, 0) <= 0) {
  204|      1|            ERR_clear_last_mark();
  205|      1|            goto end;
  206|      1|        }
  207|  58.8k|        if ((dctx =
  ------------------
  |  Branch (207:13): [True: 58.8k, False: 0]
  ------------------
  208|  58.8k|             OSSL_DECODER_CTX_new_for_pkey(&pubkey->pkey,
  209|  58.8k|                                           "DER", "SubjectPublicKeyInfo",
  210|  58.8k|                                           txtoidname, EVP_PKEY_PUBLIC_KEY,
  ------------------
  |  |   89|  58.8k|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |   87|  58.8k|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  ------------------
  |  |  |  |  |  |  549|  58.8k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  544|  58.8k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  550|  58.8k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  545|  58.8k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  543|  58.8k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  211|  58.8k|                                           pubkey->libctx,
  212|  58.8k|                                           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|  58.8k|            if (OSSL_DECODER_from_data(dctx, &p, &slen)) {
  ------------------
  |  Branch (217:17): [True: 29.6k, False: 29.1k]
  ------------------
  218|  29.6k|                if (slen != 0) {
  ------------------
  |  Branch (218:21): [True: 0, False: 29.6k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  225|      0|                    goto end;
  226|      0|                }
  227|  29.6k|            }
  228|  58.8k|    }
  229|       |
  230|   113k|    ERR_pop_to_mark();
  231|   113k|    ret = 1;
  232|   113k| end:
  233|   113k|    OSSL_DECODER_CTX_free(dctx);
  234|   113k|    OPENSSL_free(tmpbuf);
  ------------------
  |  |  107|   113k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   113k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   113k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  235|   113k|    return ret;
  236|   113k|}
x_pubkey.c:x509_pubkey_set0_libctx:
   49|   113k|{
   50|   113k|    if (x != NULL) {
  ------------------
  |  Branch (50:9): [True: 113k, False: 0]
  ------------------
   51|   113k|        x->libctx = libctx;
   52|   113k|        OPENSSL_free(x->propq);
  ------------------
  |  |  107|   113k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   113k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   113k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   53|   113k|        x->propq = NULL;
   54|   113k|        if (propq != NULL) {
  ------------------
  |  Branch (54:13): [True: 0, False: 113k]
  ------------------
   55|      0|            x->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  111|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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|   113k|    }
   60|   113k|    return 1;
   61|   113k|}
x_pubkey.c:x509_pubkey_ex_free:
   87|   113k|{
   88|   113k|    X509_PUBKEY *pubkey;
   89|       |
   90|   113k|    if (pval != NULL && (pubkey = (X509_PUBKEY *)*pval) != NULL) {
  ------------------
  |  Branch (90:9): [True: 113k, False: 0]
  |  Branch (90:25): [True: 113k, False: 0]
  ------------------
   91|   113k|        X509_ALGOR_free(pubkey->algor);
   92|   113k|        ASN1_BIT_STRING_free(pubkey->public_key);
   93|   113k|        EVP_PKEY_free(pubkey->pkey);
   94|   113k|        OPENSSL_free(pubkey->propq);
  ------------------
  |  |  107|   113k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   113k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   113k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   95|   113k|        OPENSSL_free(pubkey);
  ------------------
  |  |  107|   113k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   113k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   113k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   96|   113k|        *pval = NULL;
   97|   113k|    }
   98|   113k|}
x_pubkey.c:x509_pubkey_decode:
  405|   113k|{
  406|   113k|    EVP_PKEY *pkey;
  407|   113k|    int nid;
  408|       |
  409|   113k|    nid = OBJ_obj2nid(key->algor->algorithm);
  410|   113k|    if (!key->flag_force_legacy) {
  ------------------
  |  Branch (410:9): [True: 58.8k, False: 54.4k]
  ------------------
  411|  58.8k|#ifndef OPENSSL_NO_ENGINE
  412|  58.8k|        ENGINE *e = NULL;
  413|       |
  414|  58.8k|        e = ENGINE_get_pkey_meth_engine(nid);
  415|  58.8k|        if (e == NULL)
  ------------------
  |  Branch (415:13): [True: 58.8k, False: 0]
  ------------------
  416|  58.8k|            return 0;
  417|      0|        ENGINE_finish(e);
  418|       |#else
  419|       |        return 0;
  420|       |#endif
  421|      0|    }
  422|       |
  423|  54.4k|    pkey = EVP_PKEY_new();
  424|  54.4k|    if (pkey == NULL) {
  ------------------
  |  Branch (424:9): [True: 0, False: 54.4k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  426|      0|        return -1;
  427|      0|    }
  428|       |
  429|  54.4k|    if (!EVP_PKEY_set_type(pkey, nid)) {
  ------------------
  |  Branch (429:9): [True: 0, False: 54.4k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  431|      0|        goto error;
  432|      0|    }
  433|       |
  434|  54.4k|    if (pkey->ameth->pub_decode) {
  ------------------
  |  Branch (434:9): [True: 54.4k, 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|  54.4k|        if (!pkey->ameth->pub_decode(pkey, key))
  ------------------
  |  Branch (440:13): [True: 24.3k, False: 30.0k]
  ------------------
  441|  24.3k|            goto error;
  442|  54.4k|    } 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  444|      0|        goto error;
  445|      0|    }
  446|       |
  447|  30.0k|    *ppkey = pkey;
  448|  30.0k|    return 1;
  449|       |
  450|  24.3k| error:
  451|  24.3k|    EVP_PKEY_free(pkey);
  452|  24.3k|    return 0;
  453|  54.4k|}
x_pubkey.c:d2i_PUBKEY_int:
  494|  54.6k|{
  495|  54.6k|    X509_PUBKEY *xpk, *xpk2 = NULL, **pxpk = NULL;
  496|  54.6k|    EVP_PKEY *pktmp = NULL;
  497|  54.6k|    const unsigned char *q;
  498|       |
  499|  54.6k|    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|  54.6k|    if (libctx != NULL || propq != NULL || force_legacy) {
  ------------------
  |  Branch (506:9): [True: 0, False: 54.6k]
  |  Branch (506:27): [True: 0, False: 54.6k]
  |  Branch (506:44): [True: 54.6k, False: 0]
  ------------------
  507|  54.6k|        xpk2 = OPENSSL_zalloc(sizeof(*xpk2));
  ------------------
  |  |   99|  54.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  54.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  54.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  508|  54.6k|        if (xpk2 == NULL)
  ------------------
  |  Branch (508:13): [True: 0, False: 54.6k]
  ------------------
  509|      0|            return NULL;
  510|  54.6k|        if (!x509_pubkey_set0_libctx(xpk2, libctx, propq))
  ------------------
  |  Branch (510:13): [True: 0, False: 54.6k]
  ------------------
  511|      0|            goto end;
  512|  54.6k|        xpk2->flag_force_legacy = !!force_legacy;
  513|  54.6k|        pxpk = &xpk2;
  514|  54.6k|    }
  515|  54.6k|    xpk = d2i_x509_pubkey(pxpk, &q, length);
  516|  54.6k|    if (xpk == NULL)
  ------------------
  |  Branch (516:9): [True: 249, False: 54.4k]
  ------------------
  517|    249|        goto end;
  518|  54.4k|    pktmp = X509_PUBKEY_get(xpk);
  519|  54.4k|    X509_PUBKEY_free(xpk);
  520|  54.4k|    xpk2 = NULL;                 /* We know that xpk == xpk2 */
  521|  54.4k|    if (pktmp == NULL)
  ------------------
  |  Branch (521:9): [True: 24.3k, False: 30.0k]
  ------------------
  522|  24.3k|        goto end;
  523|  30.0k|    *pp = q;
  524|  30.0k|    if (a != NULL) {
  ------------------
  |  Branch (524:9): [True: 0, False: 30.0k]
  ------------------
  525|      0|        EVP_PKEY_free(*a);
  526|      0|        *a = pktmp;
  527|      0|    }
  528|  54.6k| end:
  529|  54.6k|    X509_PUBKEY_free(xpk2);
  530|  54.6k|    return pktmp;
  531|  30.0k|}

ossl_x509_set0_libctx:
  147|    333|{
  148|    333|    if (x != NULL) {
  ------------------
  |  Branch (148:9): [True: 57, False: 276]
  ------------------
  149|     57|        x->libctx = libctx;
  150|     57|        OPENSSL_free(x->propq);
  ------------------
  |  |  107|     57|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     57|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     57|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  151|     57|        x->propq = NULL;
  152|     57|        if (propq != NULL) {
  ------------------
  |  Branch (152:13): [True: 0, False: 57]
  ------------------
  153|      0|            x->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  111|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|      0|            if (x->propq == NULL)
  ------------------
  |  Branch (154:17): [True: 0, False: 0]
  ------------------
  155|      0|                return 0;
  156|      0|        }
  157|     57|    }
  158|    333|    return 1;
  159|    333|}
x_x509.c:x509_cb:
   38|   351k|{
   39|   351k|    X509 *ret = (X509 *)*pval;
   40|       |
   41|   351k|    switch (operation) {
   42|       |
   43|  59.1k|    case ASN1_OP_D2I_PRE:
  ------------------
  |  |  746|  59.1k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (43:5): [True: 59.1k, False: 292k]
  ------------------
   44|  59.1k|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509, ret, &ret->ex_data);
  ------------------
  |  |  221|  59.1k|# define CRYPTO_EX_INDEX_X509             3
  ------------------
   45|  59.1k|        X509_CERT_AUX_free(ret->aux);
   46|  59.1k|        ASN1_OCTET_STRING_free(ret->skid);
   47|  59.1k|        AUTHORITY_KEYID_free(ret->akid);
   48|  59.1k|        CRL_DIST_POINTS_free(ret->crldp);
   49|  59.1k|        ossl_policy_cache_free(ret->policy_cache);
   50|  59.1k|        GENERAL_NAMES_free(ret->altname);
   51|  59.1k|        NAME_CONSTRAINTS_free(ret->nc);
   52|  59.1k|#ifndef OPENSSL_NO_RFC3779
   53|  59.1k|        sk_IPAddressFamily_pop_free(ret->rfc3779_addr, IPAddressFamily_free);
  ------------------
  |  | 1223|  59.1k|#define sk_IPAddressFamily_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_IPAddressFamily_sk_type(sk),ossl_check_IPAddressFamily_freefunc_type(freefunc))
  ------------------
   54|  59.1k|        ASIdentifiers_free(ret->rfc3779_asid);
   55|  59.1k|#endif
   56|  59.1k|        ASN1_OCTET_STRING_free(ret->distinguishing_id);
   57|       |
   58|       |        /* fall through */
   59|       |
   60|   118k|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  743|   118k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (60:5): [True: 59.1k, False: 292k]
  ------------------
   61|   118k|        ret->ex_cached = 0;
   62|   118k|        ret->ex_kusage = 0;
   63|   118k|        ret->ex_xkusage = 0;
   64|   118k|        ret->ex_nscert = 0;
   65|   118k|        ret->ex_flags = 0;
   66|   118k|        ret->ex_pathlen = -1;
   67|   118k|        ret->ex_pcpathlen = -1;
   68|   118k|        ret->skid = NULL;
   69|   118k|        ret->akid = NULL;
   70|   118k|        ret->policy_cache = NULL;
   71|   118k|        ret->altname = NULL;
   72|   118k|        ret->nc = NULL;
   73|   118k|#ifndef OPENSSL_NO_RFC3779
   74|   118k|        ret->rfc3779_addr = NULL;
   75|   118k|        ret->rfc3779_asid = NULL;
   76|   118k|#endif
   77|   118k|        ret->distinguishing_id = NULL;
   78|   118k|        ret->aux = NULL;
   79|   118k|        ret->crldp = NULL;
   80|   118k|        if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509, ret, &ret->ex_data))
  ------------------
  |  |  221|   118k|# define CRYPTO_EX_INDEX_X509             3
  ------------------
  |  Branch (80:13): [True: 0, False: 118k]
  ------------------
   81|      0|            return 0;
   82|   118k|        break;
   83|       |
   84|   118k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  59.1k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (84:5): [True: 59.1k, False: 292k]
  ------------------
   85|  59.1k|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509, ret, &ret->ex_data);
  ------------------
  |  |  221|  59.1k|# define CRYPTO_EX_INDEX_X509             3
  ------------------
   86|  59.1k|        X509_CERT_AUX_free(ret->aux);
   87|  59.1k|        ASN1_OCTET_STRING_free(ret->skid);
   88|  59.1k|        AUTHORITY_KEYID_free(ret->akid);
   89|  59.1k|        CRL_DIST_POINTS_free(ret->crldp);
   90|  59.1k|        ossl_policy_cache_free(ret->policy_cache);
   91|  59.1k|        GENERAL_NAMES_free(ret->altname);
   92|  59.1k|        NAME_CONSTRAINTS_free(ret->nc);
   93|  59.1k|#ifndef OPENSSL_NO_RFC3779
   94|  59.1k|        sk_IPAddressFamily_pop_free(ret->rfc3779_addr, IPAddressFamily_free);
  ------------------
  |  | 1223|  59.1k|#define sk_IPAddressFamily_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_IPAddressFamily_sk_type(sk),ossl_check_IPAddressFamily_freefunc_type(freefunc))
  ------------------
   95|  59.1k|        ASIdentifiers_free(ret->rfc3779_asid);
   96|  59.1k|#endif
   97|  59.1k|        ASN1_OCTET_STRING_free(ret->distinguishing_id);
   98|  59.1k|        OPENSSL_free(ret->propq);
  ------------------
  |  |  107|  59.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  59.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  59.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   99|  59.1k|        break;
  100|       |
  101|      0|    case ASN1_OP_DUP_POST:
  ------------------
  |  |  757|      0|# define ASN1_OP_DUP_POST        15
  ------------------
  |  Branch (101:5): [True: 0, False: 351k]
  ------------------
  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: 351k]
  ------------------
  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: 351k]
  ------------------
  118|      0|        {
  119|      0|            const char **propq = exarg;
  120|       |
  121|      0|            *propq = ret->propq;
  122|      0|        }
  123|      0|        break;
  124|       |
  125|   174k|    default:
  ------------------
  |  Branch (125:5): [True: 174k, False: 177k]
  ------------------
  126|   174k|        break;
  127|   351k|    }
  128|       |
  129|   351k|    return 1;
  130|   351k|}

FuzzerInitialize:
   21|      2|{
   22|      2|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  450|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
   23|      2|    ERR_clear_error();
   24|      2|    CRYPTO_free_ex_index(0, -1);
   25|      2|    return 1;
   26|      2|}
FuzzerTestOneInput:
   29|  8.56k|{
   30|  8.56k|    CMS_ContentInfo *cms;
   31|  8.56k|    BIO *in;
   32|       |
   33|  8.56k|    if (len == 0)
  ------------------
  |  Branch (33:9): [True: 0, False: 8.56k]
  ------------------
   34|      0|        return 0;
   35|       |
   36|  8.56k|    in = BIO_new(BIO_s_mem());
   37|  8.56k|    OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
  ------------------
  |  |  421|  8.56k|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (421:12): [True: 8.56k, False: 0]
  |  |  ------------------
  ------------------
   38|  8.56k|    cms = d2i_CMS_bio(in, NULL);
   39|  8.56k|    if (cms != NULL) {
  ------------------
  |  Branch (39:9): [True: 955, False: 7.60k]
  ------------------
   40|    955|        BIO *out = BIO_new(BIO_s_null());
   41|       |
   42|    955|        i2d_CMS_bio(out, cms);
   43|    955|        BIO_free(out);
   44|    955|        CMS_ContentInfo_free(cms);
   45|    955|    }
   46|       |
   47|  8.56k|    BIO_free(in);
   48|  8.56k|    ERR_clear_error();
   49|       |
   50|  8.56k|    return 0;
   51|  8.56k|}

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

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

SHA1_Update:
  155|  20.3k|{
  156|  20.3k|    const unsigned char *data = data_;
  157|  20.3k|    unsigned char *p;
  158|  20.3k|    HASH_LONG l;
  ------------------
  |  |   19|  20.3k|#define HASH_LONG               SHA_LONG
  |  |  ------------------
  |  |  |  |   34|  20.3k|#  define SHA_LONG unsigned int
  |  |  ------------------
  ------------------
  159|  20.3k|    size_t n;
  160|       |
  161|  20.3k|    if (len == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 20.3k]
  ------------------
  162|      0|        return 1;
  163|       |
  164|  20.3k|    l = (c->Nl + (((HASH_LONG) len) << 3)) & 0xffffffffUL;
  165|  20.3k|    if (l < c->Nl)              /* overflow */
  ------------------
  |  Branch (165:9): [True: 0, False: 20.3k]
  ------------------
  166|      0|        c->Nh++;
  167|  20.3k|    c->Nh += (HASH_LONG) (len >> 29); /* might cause compiler warning on
  168|       |                                       * 16-bit */
  169|  20.3k|    c->Nl = l;
  170|       |
  171|  20.3k|    n = c->num;
  172|  20.3k|    if (n != 0) {
  ------------------
  |  Branch (172:9): [True: 0, False: 20.3k]
  ------------------
  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|  20.3k|    n = len / HASH_CBLOCK;
  ------------------
  |  |   21|  20.3k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  20.3k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  20.3k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|  20.3k|    if (n > 0) {
  ------------------
  |  Branch (197:9): [True: 10.1k, False: 10.1k]
  ------------------
  198|  10.1k|        HASH_BLOCK_DATA_ORDER(c, data, n);
  ------------------
  |  |   35|  10.1k|#define HASH_BLOCK_DATA_ORDER           sha1_block_data_order
  ------------------
  199|  10.1k|        n *= HASH_CBLOCK;
  ------------------
  |  |   21|  10.1k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  10.1k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  10.1k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  200|  10.1k|        data += n;
  201|  10.1k|        len -= n;
  202|  10.1k|    }
  203|       |
  204|  20.3k|    if (len != 0) {
  ------------------
  |  Branch (204:9): [True: 17.9k, False: 2.40k]
  ------------------
  205|  17.9k|        p = (unsigned char *)c->data;
  206|  17.9k|        c->num = (unsigned int)len;
  207|  17.9k|        memcpy(p, data, len);
  208|  17.9k|    }
  209|  20.3k|    return 1;
  210|  20.3k|}
SHA1_Final:
  218|  20.3k|{
  219|  20.3k|    unsigned char *p = (unsigned char *)c->data;
  220|  20.3k|    size_t n = c->num;
  221|       |
  222|  20.3k|    p[n] = 0x80;                /* there is always room for one */
  223|  20.3k|    n++;
  224|       |
  225|  20.3k|    if (n > (HASH_CBLOCK - 8)) {
  ------------------
  |  |   21|  20.3k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  20.3k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  20.3k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (225:9): [True: 7.49k, False: 12.8k]
  ------------------
  226|  7.49k|        memset(p + n, 0, HASH_CBLOCK - n);
  ------------------
  |  |   21|  7.49k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  7.49k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  7.49k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|  7.49k|        n = 0;
  228|  7.49k|        HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   35|  7.49k|#define HASH_BLOCK_DATA_ORDER           sha1_block_data_order
  ------------------
  229|  7.49k|    }
  230|  20.3k|    memset(p + n, 0, HASH_CBLOCK - 8 - n);
  ------------------
  |  |   21|  20.3k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  20.3k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  20.3k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|       |
  232|  20.3k|    p += HASH_CBLOCK - 8;
  ------------------
  |  |   21|  20.3k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  20.3k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  20.3k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  233|  20.3k|# if   defined(DATA_ORDER_IS_BIG_ENDIAN)
  234|  20.3k|    (void)HOST_l2c(c->Nh, p);
  ------------------
  |  |  130|  20.3k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  131|  20.3k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  132|  20.3k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  133|  20.3k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  134|  20.3k|                         l)
  ------------------
  235|  20.3k|    (void)HOST_l2c(c->Nl, p);
  ------------------
  |  |  130|  20.3k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  131|  20.3k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  132|  20.3k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  133|  20.3k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  134|  20.3k|                         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|  20.3k|    p -= HASH_CBLOCK;
  ------------------
  |  |   21|  20.3k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  20.3k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  20.3k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  20.3k|    HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   35|  20.3k|#define HASH_BLOCK_DATA_ORDER           sha1_block_data_order
  ------------------
  242|  20.3k|    c->num = 0;
  243|  20.3k|    OPENSSL_cleanse(p, HASH_CBLOCK);
  ------------------
  |  |   21|  20.3k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  20.3k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  20.3k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|       |
  245|       |# ifndef HASH_MAKE_STRING
  246|       |#  error "HASH_MAKE_STRING must be defined!"
  247|       |# else
  248|  20.3k|    HASH_MAKE_STRING(c, md);
  ------------------
  |  |   22|  20.3k|#define HASH_MAKE_STRING(c,s)   do {    \
  |  |   23|  20.3k|        unsigned long ll;               \
  |  |   24|  20.3k|        ll=(c)->h0; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|  20.3k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|  20.3k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|  20.3k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|  20.3k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|  20.3k|                         l)
  |  |  ------------------
  |  |   25|  20.3k|        ll=(c)->h1; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|  20.3k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|  20.3k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|  20.3k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|  20.3k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|  20.3k|                         l)
  |  |  ------------------
  |  |   26|  20.3k|        ll=(c)->h2; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|  20.3k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|  20.3k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|  20.3k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|  20.3k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|  20.3k|                         l)
  |  |  ------------------
  |  |   27|  20.3k|        ll=(c)->h3; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|  20.3k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|  20.3k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|  20.3k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|  20.3k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|  20.3k|                         l)
  |  |  ------------------
  |  |   28|  20.3k|        ll=(c)->h4; (void)HOST_l2c(ll,(s));     \
  |  |  ------------------
  |  |  |  |  130|  20.3k|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|  20.3k|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|  20.3k|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|  20.3k|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|  20.3k|                         l)
  |  |  ------------------
  |  |   29|  20.3k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (29:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  249|  20.3k|# endif
  250|       |
  251|  20.3k|    return 1;
  252|  20.3k|}

property.c:ossl_sa_ALGORITHM_new:
   27|      8|    { \
   28|      8|        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
   29|      8|    } \
property.c:ossl_sa_ALGORITHM_doall_arg:
   56|  1.75k|    { \
   57|  1.75k|        ossl_sa_doall_arg((OPENSSL_SA *)sa, \
   58|  1.75k|                          (void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
   59|  1.75k|    } \
property.c:ossl_sa_ALGORITHM_set:
   68|    384|    { \
   69|    384|        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
   70|    384|    } \
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|  20.7k|    { \
   63|  20.7k|        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
   64|  20.7k|    } \

evp_fetch.c:ossl_assert_int:
   45|  62.1k|{
   46|  62.1k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 62.1k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  62.1k|    return expr;
   50|  62.1k|}
p_lib.c:ossl_assert_int:
   45|   500k|{
   46|   500k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 500k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   500k|    return expr;
   50|   500k|}
core_fetch.c:ossl_assert_int:
   45|  1.76k|{
   46|  1.76k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.76k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.76k|    return expr;
   50|  1.76k|}
core_namemap.c:ossl_assert_int:
   45|    220|{
   46|    220|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 220]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    220|    return expr;
   50|    220|}
provider_core.c:ossl_assert_int:
   45|  1.75k|{
   46|  1.75k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.75k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.75k|    return expr;
   50|  1.75k|}
defn_cache.c:ossl_assert_int:
   45|    440|{
   46|    440|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 440]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    440|    return expr;
   50|    440|}
property.c:ossl_assert_int:
   45|    225|{
   46|    225|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 225]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    225|    return expr;
   50|    225|}
x_pubkey.c:ossl_assert_int:
   45|   113k|{
   46|   113k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 113k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   113k|    return expr;
   50|   113k|}
bio_print.c:ossl_assert_int:
   45|  5.96M|{
   46|  5.96M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 5.96M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  5.96M|    return expr;
   50|  5.96M|}
decoder_lib.c:ossl_assert_int:
   45|   293k|{
   46|   293k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 293k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   293k|    return expr;
   50|   293k|}
decoder_meth.c:ossl_assert_int:
   45|   501k|{
   46|   501k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 501k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   501k|    return expr;
   50|   501k|}
packet.c:ossl_assert_int:
   45|   407k|{
   46|   407k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 407k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   407k|    return expr;
   50|   407k|}

bio_lib.c:CRYPTO_NEW_REF:
  268|   232k|{
  269|   232k|    refcnt->val = n;
  270|   232k|    return 1;
  271|   232k|}
bio_lib.c:CRYPTO_FREE_REF:
  273|   232k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|   232k|{
  275|   232k|}
bio_lib.c:CRYPTO_DOWN_REF:
   50|   341k|{
   51|   341k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|   341k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 232k, False: 109k]
  ------------------
   53|   232k|        atomic_thread_fence(memory_order_acquire);
   54|   341k|    return 1;
   55|   341k|}
bio_lib.c:CRYPTO_UP_REF:
   34|   109k|{
   35|   109k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|   109k|    return 1;
   37|   109k|}
digest.c:CRYPTO_NEW_REF:
  268|     27|{
  269|     27|    refcnt->val = n;
  270|     27|    return 1;
  271|     27|}
digest.c:CRYPTO_UP_REF:
   34|  40.6k|{
   35|  40.6k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  40.6k|    return 1;
   37|  40.6k|}
digest.c:CRYPTO_DOWN_REF:
   50|  40.6k|{
   51|  40.6k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  40.6k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 27, False: 40.6k]
  ------------------
   53|     27|        atomic_thread_fence(memory_order_acquire);
   54|  40.6k|    return 1;
   55|  40.6k|}
evp_lib.c:CRYPTO_FREE_REF:
  273|     27|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|     27|{
  275|     27|}
keymgmt_meth.c:CRYPTO_NEW_REF:
  268|     18|{
  269|     18|    refcnt->val = n;
  270|     18|    return 1;
  271|     18|}
keymgmt_meth.c:CRYPTO_UP_REF:
   34|   148k|{
   35|   148k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|   148k|    return 1;
   37|   148k|}
keymgmt_meth.c:CRYPTO_DOWN_REF:
   50|   148k|{
   51|   148k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|   148k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 18, False: 148k]
  ------------------
   53|     18|        atomic_thread_fence(memory_order_acquire);
   54|   148k|    return 1;
   55|   148k|}
keymgmt_meth.c:CRYPTO_FREE_REF:
  273|     18|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|     18|{
  275|     18|}
p_lib.c:CRYPTO_NEW_REF:
  268|  84.0k|{
  269|  84.0k|    refcnt->val = n;
  270|  84.0k|    return 1;
  271|  84.0k|}
p_lib.c:CRYPTO_FREE_REF:
  273|  84.0k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  84.0k|{
  275|  84.0k|}
p_lib.c:CRYPTO_UP_REF:
   34|  30.0k|{
   35|  30.0k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  30.0k|    return 1;
   37|  30.0k|}
p_lib.c:CRYPTO_DOWN_REF:
   50|   114k|{
   51|   114k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|   114k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 84.0k, False: 30.0k]
  ------------------
   53|  84.0k|        atomic_thread_fence(memory_order_acquire);
   54|   114k|    return 1;
   55|   114k|}
provider_core.c:CRYPTO_UP_REF:
   34|  1.97k|{
   35|  1.97k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  1.97k|    return 1;
   37|  1.97k|}
provider_core.c:CRYPTO_NEW_REF:
  268|      1|{
  269|      1|    refcnt->val = n;
  270|      1|    return 1;
  271|      1|}
provider_core.c:CRYPTO_DOWN_REF:
   50|  1.97k|{
   51|  1.97k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  1.97k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 1, False: 1.97k]
  ------------------
   53|      1|        atomic_thread_fence(memory_order_acquire);
   54|  1.97k|    return 1;
   55|  1.97k|}
provider_core.c:CRYPTO_FREE_REF:
  273|      1|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|      1|{
  275|      1|}
rsa_lib.c:CRYPTO_NEW_REF:
  268|  4.49k|{
  269|  4.49k|    refcnt->val = n;
  270|  4.49k|    return 1;
  271|  4.49k|}
rsa_lib.c:CRYPTO_DOWN_REF:
   50|  8.49k|{
   51|  8.49k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  8.49k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 4.49k, False: 3.99k]
  ------------------
   53|  4.49k|        atomic_thread_fence(memory_order_acquire);
   54|  8.49k|    return 1;
   55|  8.49k|}
rsa_lib.c:CRYPTO_FREE_REF:
  273|  4.49k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  4.49k|{
  275|  4.49k|}
rsa_lib.c:CRYPTO_UP_REF:
   34|  3.99k|{
   35|  3.99k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  3.99k|    return 1;
   37|  3.99k|}
tasn_utl.c:CRYPTO_NEW_REF:
  268|  79.9k|{
  269|  79.9k|    refcnt->val = n;
  270|  79.9k|    return 1;
  271|  79.9k|}
tasn_utl.c:CRYPTO_FREE_REF:
  273|  79.9k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  79.9k|{
  275|  79.9k|}
tasn_utl.c:CRYPTO_DOWN_REF:
   50|  79.9k|{
   51|  79.9k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  79.9k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 79.9k, False: 0]
  ------------------
   53|  79.9k|        atomic_thread_fence(memory_order_acquire);
   54|  79.9k|    return 1;
   55|  79.9k|}
ossl_core_bio.c:CRYPTO_UP_REF:
   34|   109k|{
   35|   109k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|   109k|    return 1;
   37|   109k|}
ossl_core_bio.c:CRYPTO_DOWN_REF:
   50|   218k|{
   51|   218k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|   218k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 109k, False: 109k]
  ------------------
   53|   109k|        atomic_thread_fence(memory_order_acquire);
   54|   218k|    return 1;
   55|   218k|}
ossl_core_bio.c:CRYPTO_FREE_REF:
  273|   109k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|   109k|{
  275|   109k|}
ossl_core_bio.c:CRYPTO_NEW_REF:
  268|   109k|{
  269|   109k|    refcnt->val = n;
  270|   109k|    return 1;
  271|   109k|}
dh_lib.c:CRYPTO_NEW_REF:
  268|  7.17k|{
  269|  7.17k|    refcnt->val = n;
  270|  7.17k|    return 1;
  271|  7.17k|}
dh_lib.c:CRYPTO_DOWN_REF:
   50|  11.8k|{
   51|  11.8k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  11.8k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 7.17k, False: 4.62k]
  ------------------
   53|  7.17k|        atomic_thread_fence(memory_order_acquire);
   54|  11.8k|    return 1;
   55|  11.8k|}
dh_lib.c:CRYPTO_FREE_REF:
  273|  7.17k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  7.17k|{
  275|  7.17k|}
dh_lib.c:CRYPTO_UP_REF:
   34|  4.62k|{
   35|  4.62k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  4.62k|    return 1;
   37|  4.62k|}
dsa_lib.c:CRYPTO_NEW_REF:
  268|  5.34k|{
  269|  5.34k|    refcnt->val = n;
  270|  5.34k|    return 1;
  271|  5.34k|}
dsa_lib.c:CRYPTO_DOWN_REF:
   50|  7.92k|{
   51|  7.92k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  7.92k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 5.34k, False: 2.58k]
  ------------------
   53|  5.34k|        atomic_thread_fence(memory_order_acquire);
   54|  7.92k|    return 1;
   55|  7.92k|}
dsa_lib.c:CRYPTO_FREE_REF:
  273|  5.34k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  5.34k|{
  275|  5.34k|}
dsa_lib.c:CRYPTO_UP_REF:
   34|  2.58k|{
   35|  2.58k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  2.58k|    return 1;
   37|  2.58k|}
ec_key.c:CRYPTO_DOWN_REF:
   50|  52.8k|{
   51|  52.8k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  52.8k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 34.3k, False: 18.4k]
  ------------------
   53|  34.3k|        atomic_thread_fence(memory_order_acquire);
   54|  52.8k|    return 1;
   55|  52.8k|}
ec_key.c:CRYPTO_FREE_REF:
  273|  34.3k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  34.3k|{
  275|  34.3k|}
ec_key.c:CRYPTO_UP_REF:
   34|  18.4k|{
   35|  18.4k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  18.4k|    return 1;
   37|  18.4k|}
ec_kmeth.c:CRYPTO_NEW_REF:
  268|  34.3k|{
  269|  34.3k|    refcnt->val = n;
  270|  34.3k|    return 1;
  271|  34.3k|}
ecx_key.c:CRYPTO_NEW_REF:
  268|    387|{
  269|    387|    refcnt->val = n;
  270|    387|    return 1;
  271|    387|}
ecx_key.c:CRYPTO_FREE_REF:
  273|    387|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|    387|{
  275|    387|}
ecx_key.c:CRYPTO_DOWN_REF:
   50|    774|{
   51|    774|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|    774|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 387, False: 387]
  ------------------
   53|    387|        atomic_thread_fence(memory_order_acquire);
   54|    774|    return 1;
   55|    774|}
ecx_key.c:CRYPTO_UP_REF:
   34|    387|{
   35|    387|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|    387|    return 1;
   37|    387|}
decoder_meth.c:CRYPTO_UP_REF:
   34|   271k|{
   35|   271k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|   271k|    return 1;
   37|   271k|}
decoder_meth.c:CRYPTO_DOWN_REF:
   50|   271k|{
   51|   271k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|   271k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 40, False: 271k]
  ------------------
   53|     40|        atomic_thread_fence(memory_order_acquire);
   54|   271k|    return 1;
   55|   271k|}
decoder_meth.c:CRYPTO_FREE_REF:
  273|     40|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|     40|{
  275|     40|}
decoder_meth.c:CRYPTO_NEW_REF:
  268|     40|{
  269|     40|    refcnt->val = n;
  270|     40|    return 1;
  271|     40|}
evp_enc.c:CRYPTO_NEW_REF:
  268|    130|{
  269|    130|    refcnt->val = n;
  270|    130|    return 1;
  271|    130|}
evp_enc.c:CRYPTO_UP_REF:
   34|  23.0k|{
   35|  23.0k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  23.0k|    return 1;
   37|  23.0k|}
evp_enc.c:CRYPTO_FREE_REF:
  273|    130|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|    130|{
  275|    130|}
evp_enc.c:CRYPTO_DOWN_REF:
   50|  23.1k|{
   51|  23.1k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  23.1k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 130, False: 23.0k]
  ------------------
   53|    130|        atomic_thread_fence(memory_order_acquire);
   54|  23.1k|    return 1;
   55|  23.1k|}
evp_rand.c:CRYPTO_UP_REF:
   34|     15|{
   35|     15|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|     15|    return 1;
   37|     15|}
evp_rand.c:CRYPTO_NEW_REF:
  268|      8|{
  269|      8|    refcnt->val = n;
  270|      8|    return 1;
  271|      8|}
evp_rand.c:CRYPTO_FREE_REF:
  273|      8|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|      8|{
  275|      8|}
evp_rand.c:CRYPTO_DOWN_REF:
   50|     23|{
   51|     23|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|     23|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 8, False: 15]
  ------------------
   53|      8|        atomic_thread_fence(memory_order_acquire);
   54|     23|    return 1;
   55|     23|}

stack.c:safe_muldiv_int:
  322|  25.6k|    {                                                                        \
  323|  25.6k|        int e2 = 0;                                                          \
  324|  25.6k|        type q, r, x, y;                                                     \
  325|  25.6k|                                                                             \
  326|  25.6k|        if (c == 0) {                                                        \
  ------------------
  |  Branch (326:13): [True: 0, False: 25.6k]
  ------------------
  327|      0|            *err |= 1;                                                       \
  328|      0|            return a == 0 || b == 0 ? 0 : max;                               \
  ------------------
  |  Branch (328:20): [True: 0, False: 0]
  |  Branch (328:30): [True: 0, False: 0]
  ------------------
  329|      0|        }                                                                    \
  330|  25.6k|        x = safe_mul_ ## type_name(a, b, &e2);                               \
  331|  25.6k|        if (!e2)                                                             \
  ------------------
  |  Branch (331:13): [True: 25.6k, False: 0]
  ------------------
  332|  25.6k|            return safe_div_ ## type_name(x, c, err);                        \
  333|  25.6k|        if (b > a) {                                                         \
  ------------------
  |  Branch (333:13): [True: 0, False: 0]
  ------------------
  334|      0|            x = b;                                                           \
  335|      0|            b = a;                                                           \
  336|      0|            a = x;                                                           \
  337|      0|        }                                                                    \
  338|      0|        q = safe_div_ ## type_name(a, c, err);                               \
  339|      0|        r = safe_mod_ ## type_name(a, c, err);                               \
  340|      0|        x = safe_mul_ ## type_name(r, b, err);                               \
  341|      0|        y = safe_mul_ ## type_name(q, b, err);                               \
  342|      0|        q = safe_div_ ## type_name(x, c, err);                               \
  343|      0|        return safe_add_ ## type_name(y, q, err);                            \
  344|  25.6k|    }
stack.c:safe_mul_int:
  136|  25.6k|    {                                                                        \
  137|  25.6k|        type r;                                                              \
  138|  25.6k|                                                                             \
  139|  25.6k|        if (!__builtin_mul_overflow(a, b, &r))                               \
  ------------------
  |  Branch (139:13): [True: 25.6k, False: 0]
  ------------------
  140|  25.6k|            return r;                                                        \
  141|  25.6k|        *err |= 1;                                                           \
  142|      0|        return (a < 0) ^ (b < 0) ? min : max;                                \
  ------------------
  |  Branch (142:16): [True: 0, False: 0]
  ------------------
  143|  25.6k|    }
stack.c:safe_div_int:
  199|  25.6k|    {                                                                        \
  200|  25.6k|        if (b == 0) {                                                        \
  ------------------
  |  Branch (200:13): [True: 0, False: 25.6k]
  ------------------
  201|      0|            *err |= 1;                                                       \
  202|      0|            return a < 0 ? min : max;                                        \
  ------------------
  |  Branch (202:20): [True: 0, False: 0]
  ------------------
  203|      0|        }                                                                    \
  204|  25.6k|        if (b == -1 && a == min) {                                           \
  ------------------
  |  Branch (204:13): [True: 0, False: 25.6k]
  |  Branch (204:24): [True: 0, False: 0]
  ------------------
  205|      0|            *err |= 1;                                                       \
  206|      0|            return max;                                                      \
  207|      0|        }                                                                    \
  208|  25.6k|        return a / b;                                                        \
  209|  25.6k|    }

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_add_all_ciphers_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \
init.c:ossl_init_add_all_digests_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \
init.c:ossl_init_config_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \
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|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \
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|    }                                           \
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|    }                                           \

a_utf8.c:is_unicode_surrogate:
   22|  4.66k|{
   23|  4.66k|    return value >= SURROGATE_MIN && value <= SURROGATE_MAX;
  ------------------
  |  Branch (23:12): [True: 1.13k, False: 3.52k]
  |  Branch (23:38): [True: 81, False: 1.05k]
  ------------------
   24|  4.66k|}
a_mbstr.c:is_unicode_valid:
   27|  9.11M|{
   28|  9.11M|    return value <= UNICODE_MAX && !is_unicode_surrogate(value);
  ------------------
  |  Branch (28:12): [True: 9.11M, False: 50]
  |  Branch (28:36): [True: 9.11M, False: 11]
  ------------------
   29|  9.11M|}
a_mbstr.c:is_unicode_surrogate:
   22|  9.11M|{
   23|  9.11M|    return value >= SURROGATE_MIN && value <= SURROGATE_MAX;
  ------------------
  |  Branch (23:12): [True: 1.40k, False: 9.11M]
  |  Branch (23:38): [True: 11, False: 1.39k]
  ------------------
   24|  9.11M|}

OTHERNAME_it:
  166|  5.97k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  5.97k|        { \
  |  |   96|  5.97k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  5.97k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  5.97k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  5.97k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  5.97k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  5.97k|                tname##_seq_tt,\
  170|  5.97k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  5.97k|                NULL,\
  172|  5.97k|                sizeof(stname),\
  173|  5.97k|                #tname \
  174|  5.97k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  5.97k|                }; \
  |  |  103|  5.97k|        return &local_it; \
  |  |  104|  5.97k|        }
  ------------------
EDIPARTYNAME_it:
  166|  3.03k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  3.03k|        { \
  |  |   96|  3.03k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  3.03k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  3.03k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  3.03k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  3.03k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  3.03k|                tname##_seq_tt,\
  170|  3.03k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  3.03k|                NULL,\
  172|  3.03k|                sizeof(stname),\
  173|  3.03k|                #tname \
  174|  3.03k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.03k|                }; \
  |  |  103|  3.03k|        return &local_it; \
  |  |  104|  3.03k|        }
  ------------------
GENERAL_NAME_it:
  320|  13.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  13.8k|        { \
  |  |   96|  13.8k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  13.8k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  13.8k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  13.8k|                offsetof(stname,selname) ,\
  323|  13.8k|                tname##_ch_tt,\
  324|  13.8k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  13.8k|                NULL,\
  326|  13.8k|                sizeof(stname),\
  327|  13.8k|                #stname \
  328|  13.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.8k|                }; \
  |  |  103|  13.8k|        return &local_it; \
  |  |  104|  13.8k|        }
  ------------------
GENERAL_NAMES_it:
  113|   119k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   119k|        { \
  |  |   96|   119k|                static const ASN1_ITEM local_it = {
  ------------------
  114|   119k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|   119k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|   119k|                -1,\
  116|   119k|                &tname##_item_tt,\
  117|   119k|                0,\
  118|   119k|                NULL,\
  119|   119k|                0,\
  120|   119k|                #tname \
  121|   119k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   119k|                }; \
  |  |  103|   119k|        return &local_it; \
  |  |  104|   119k|        }
  ------------------
GENERAL_NAMES_free:
  816|   118k|        { \
  817|   118k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   118k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   118k|        }
X509_ATTRIBUTE_it:
  166|  12.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.8k|        { \
  |  |   96|  12.8k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.8k|                tname##_seq_tt,\
  170|  12.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.8k|                NULL,\
  172|  12.8k|                sizeof(stname),\
  173|  12.8k|                #tname \
  174|  12.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.8k|                }; \
  |  |  103|  12.8k|        return &local_it; \
  |  |  104|  12.8k|        }
  ------------------
X509_REVOKED_it:
  166|  29.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  29.6k|        { \
  |  |   96|  29.6k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  29.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  29.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  29.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  29.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  29.6k|                tname##_seq_tt,\
  170|  29.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  29.6k|                NULL,\
  172|  29.6k|                sizeof(stname),\
  173|  29.6k|                #tname \
  174|  29.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  29.6k|                }; \
  |  |  103|  29.6k|        return &local_it; \
  |  |  104|  29.6k|        }
  ------------------
X509_CRL_INFO_it:
  247|   123k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   123k|        { \
  |  |   96|   123k|                static const ASN1_ITEM local_it = {
  ------------------
  248|   123k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   123k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|   123k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   123k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|   123k|                tname##_seq_tt,\
  251|   123k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|   123k|                &tname##_aux,\
  253|   123k|                sizeof(stname),\
  254|   123k|                #tname \
  255|   123k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   123k|                }; \
  |  |  103|   123k|        return &local_it; \
  |  |  104|   123k|        }
  ------------------
X509_CRL_it:
  247|  62.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  62.6k|        { \
  |  |   96|  62.6k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  62.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  62.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  62.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  62.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  62.6k|                tname##_seq_tt,\
  251|  62.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  62.6k|                &tname##_aux,\
  253|  62.6k|                sizeof(stname),\
  254|  62.6k|                #tname \
  255|  62.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  62.6k|                }; \
  |  |  103|  62.6k|        return &local_it; \
  |  |  104|  62.6k|        }
  ------------------
X509_EXTENSION_it:
  166|   135k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   135k|        { \
  |  |   96|   135k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   135k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   135k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   135k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   135k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   135k|                tname##_seq_tt,\
  170|   135k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   135k|                NULL,\
  172|   135k|                sizeof(stname),\
  173|   135k|                #tname \
  174|   135k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   135k|                }; \
  |  |  103|   135k|        return &local_it; \
  |  |  104|   135k|        }
  ------------------
X509_NAME_ENTRY_it:
  166|  7.69M|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  7.69M|        { \
  |  |   96|  7.69M|                static const ASN1_ITEM local_it = {
  ------------------
  167|  7.69M|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  7.69M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  7.69M|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  7.69M|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  7.69M|                tname##_seq_tt,\
  170|  7.69M|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  7.69M|                NULL,\
  172|  7.69M|                sizeof(stname),\
  173|  7.69M|                #tname \
  174|  7.69M|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  7.69M|                }; \
  |  |  103|  7.69M|        return &local_it; \
  |  |  104|  7.69M|        }
  ------------------
X509_NAME_ENTRY_new:
  812|  1.20M|        { \
  813|  1.20M|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  1.20M|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  1.20M|        } \
X509_NAME_ENTRY_free:
  816|  2.01M|        { \
  817|  2.01M|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  2.01M|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  2.01M|        }
X509_NAME_ENTRY_dup:
  855|  3.23k|        { \
  856|  3.23k|        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
  ------------------
  |  |  426|  3.23k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  857|  3.23k|        }
X509_NAME_it:
  775|   445k|        ASN1_ITEM_start(sname) \
  ------------------
  |  |   95|   445k|        { \
  |  |   96|   445k|                static const ASN1_ITEM local_it = {
  ------------------
  776|   445k|                ASN1_ITYPE_EXTERN, \
  ------------------
  |  |   84|   445k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  777|   445k|                tag, \
  778|   445k|                NULL, \
  779|   445k|                0, \
  780|   445k|                &fptrs, \
  781|   445k|                0, \
  782|   445k|                #sname \
  783|   445k|        ASN1_ITEM_end(sname)
  ------------------
  |  |  102|   445k|                }; \
  |  |  103|   445k|        return &local_it; \
  |  |  104|   445k|        }
  ------------------
i2d_X509_NAME:
  830|  2.58k|        { \
  831|  2.58k|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  2.58k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|  2.58k|        }
X509_NAME_free:
  816|  11.8k|        { \
  817|  11.8k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  11.8k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  11.8k|        }
X509_NAME_dup:
  855|  3.19k|        { \
  856|  3.19k|        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
  ------------------
  |  |  426|  3.19k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  857|  3.19k|        }
x_name.c:X509_NAME_INTERNAL_it:
  124|   147k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|   147k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|   147k|        { \
  |  |  |  |   96|   147k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  125|   147k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|   147k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  126|   147k|                -1,\
  127|   147k|                &tname##_item_tt,\
  128|   147k|                0,\
  129|   147k|                NULL,\
  130|   147k|                0,\
  131|   147k|                #tname \
  132|   147k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   147k|                }; \
  |  |  103|   147k|        return &local_it; \
  |  |  104|   147k|        }
  ------------------
x_name.c:X509_NAME_ENTRIES_it:
  124|  3.09M|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  3.09M|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  3.09M|        { \
  |  |  |  |   96|  3.09M|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  125|  3.09M|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  3.09M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  126|  3.09M|                -1,\
  127|  3.09M|                &tname##_item_tt,\
  128|  3.09M|                0,\
  129|  3.09M|                NULL,\
  130|  3.09M|                0,\
  131|  3.09M|                #tname \
  132|  3.09M|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.09M|                }; \
  |  |  103|  3.09M|        return &local_it; \
  |  |  104|  3.09M|        }
  ------------------
X509_PUBKEY_it:
  775|   341k|        ASN1_ITEM_start(sname) \
  ------------------
  |  |   95|   341k|        { \
  |  |   96|   341k|                static const ASN1_ITEM local_it = {
  ------------------
  776|   341k|                ASN1_ITYPE_EXTERN, \
  ------------------
  |  |   84|   341k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  777|   341k|                tag, \
  778|   341k|                NULL, \
  779|   341k|                0, \
  780|   341k|                &fptrs, \
  781|   341k|                0, \
  782|   341k|                #sname \
  783|   341k|        ASN1_ITEM_end(sname)
  ------------------
  |  |  102|   341k|                }; \
  |  |  103|   341k|        return &local_it; \
  |  |  104|   341k|        }
  ------------------
d2i_X509_PUBKEY:
  826|  54.6k|        { \
  827|  54.6k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  54.6k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  54.6k|        } \
X509_PUBKEY_free:
  816|   109k|        { \
  817|   109k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   109k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   109k|        }
x_pubkey.c:X509_PUBKEY_INTERNAL_it:
  178|   277k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|   277k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|   277k|        { \
  |  |  |  |   96|   277k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|   277k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   277k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|   277k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   277k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|   277k|                tname##_seq_tt,\
  182|   277k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|   277k|                NULL,\
  184|   277k|                sizeof(stname),\
  185|   277k|                #stname \
  186|   277k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   277k|                }; \
  |  |  103|   277k|        return &local_it; \
  |  |  104|   277k|        }
  ------------------
X509_CINF_it:
  247|   177k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   177k|        { \
  |  |   96|   177k|                static const ASN1_ITEM local_it = {
  ------------------
  248|   177k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   177k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|   177k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   177k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|   177k|                tname##_seq_tt,\
  251|   177k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|   177k|                &tname##_aux,\
  253|   177k|                sizeof(stname),\
  254|   177k|                #tname \
  255|   177k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   177k|                }; \
  |  |  103|   177k|        return &local_it; \
  |  |  104|   177k|        }
  ------------------
X509_it:
  247|   239k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   239k|        { \
  |  |   96|   239k|                static const ASN1_ITEM local_it = {
  ------------------
  248|   239k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   239k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|   239k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   239k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|   239k|                tname##_seq_tt,\
  251|   239k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|   239k|                &tname##_aux,\
  253|   239k|                sizeof(stname),\
  254|   239k|                #tname \
  255|   239k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   239k|                }; \
  |  |  103|   239k|        return &local_it; \
  |  |  104|   239k|        }
  ------------------
X509_free:
  816|  3.10k|        { \
  817|  3.10k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  3.10k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  3.10k|        }
X509_CERT_AUX_it:
  166|   118k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   118k|        { \
  |  |   96|   118k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   118k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   118k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   118k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   118k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   118k|                tname##_seq_tt,\
  170|   118k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   118k|                NULL,\
  172|   118k|                sizeof(stname),\
  173|   118k|                #tname \
  174|   118k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   118k|                }; \
  |  |  103|   118k|        return &local_it; \
  |  |  104|   118k|        }
  ------------------
X509_CERT_AUX_free:
  816|   118k|        { \
  817|   118k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   118k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   118k|        }
ASN1_TIME_it:
  770|   530k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   530k|        { \
  |  |   96|   530k|                static const ASN1_ITEM local_it = {
  ------------------
  771|   530k|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|   530k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|   530k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   530k|                }; \
  |  |  103|   530k|        return &local_it; \
  |  |  104|   530k|        }
  ------------------
ASN1_OCTET_STRING_it:
  764|   226k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   226k|        { \
  |  |   96|   226k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   226k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   226k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   226k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   226k|                }; \
  |  |  103|   226k|        return &local_it; \
  |  |  104|   226k|        }
  ------------------
ASN1_INTEGER_it:
  764|   599k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   599k|        { \
  |  |   96|   599k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   599k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   599k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   599k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   599k|                }; \
  |  |  103|   599k|        return &local_it; \
  |  |  104|   599k|        }
  ------------------
d2i_ASN1_INTEGER:
  826|  8.89k|        { \
  827|  8.89k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  8.89k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  8.89k|        } \
ASN1_ENUMERATED_it:
  764|  1.93k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.93k|        { \
  |  |   96|  1.93k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  1.93k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  1.93k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  1.93k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.93k|                }; \
  |  |  103|  1.93k|        return &local_it; \
  |  |  104|  1.93k|        }
  ------------------
ASN1_BIT_STRING_it:
  764|  1.04M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.04M|        { \
  |  |   96|  1.04M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  1.04M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  1.04M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  1.04M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.04M|                }; \
  |  |  103|  1.04M|        return &local_it; \
  |  |  104|  1.04M|        }
  ------------------
ASN1_IA5STRING_it:
  764|  9.30k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  9.30k|        { \
  |  |   96|  9.30k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  9.30k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  9.30k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  9.30k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  9.30k|                }; \
  |  |  103|  9.30k|        return &local_it; \
  |  |  104|  9.30k|        }
  ------------------
ASN1_GENERALIZEDTIME_it:
  764|  8.37k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  8.37k|        { \
  |  |   96|  8.37k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  8.37k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  8.37k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  8.37k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  8.37k|                }; \
  |  |  103|  8.37k|        return &local_it; \
  |  |  104|  8.37k|        }
  ------------------
ASN1_NULL_it:
  764|      6|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|      6|        { \
  |  |   96|      6|                static const ASN1_ITEM local_it = {
  ------------------
  765|      6|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|      6|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|      6|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|      6|                }; \
  |  |  103|      6|        return &local_it; \
  |  |  104|      6|        }
  ------------------
ASN1_OBJECT_it:
  764|  13.0M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  13.0M|        { \
  |  |   96|  13.0M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  13.0M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  13.0M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  13.0M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  13.0M|                }; \
  |  |  103|  13.0M|        return &local_it; \
  |  |  104|  13.0M|        }
  ------------------
ASN1_ANY_it:
  764|  7.73M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  7.73M|        { \
  |  |   96|  7.73M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  7.73M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  7.73M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  7.73M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  7.73M|                }; \
  |  |  103|  7.73M|        return &local_it; \
  |  |  104|  7.73M|        }
  ------------------
ASN1_SEQUENCE_it:
  764|  1.05M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.05M|        { \
  |  |   96|  1.05M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  1.05M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  1.05M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  1.05M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.05M|                }; \
  |  |  103|  1.05M|        return &local_it; \
  |  |  104|  1.05M|        }
  ------------------
ASN1_TYPE_new:
  812|   768k|        { \
  813|   768k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   768k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|   768k|        } \
ASN1_TYPE_free:
  816|  3.71k|        { \
  817|  3.71k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  3.71k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  3.71k|        }
ASN1_PRINTABLE_it:
  770|  11.7M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  11.7M|        { \
  |  |   96|  11.7M|                static const ASN1_ITEM local_it = {
  ------------------
  771|  11.7M|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|  11.7M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|  11.7M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  11.7M|                }; \
  |  |  103|  11.7M|        return &local_it; \
  |  |  104|  11.7M|        }
  ------------------
DIRECTORYSTRING_it:
  770|  4.47k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  4.47k|        { \
  |  |   96|  4.47k|                static const ASN1_ITEM local_it = {
  ------------------
  771|  4.47k|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|  4.47k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|  4.47k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  4.47k|                }; \
  |  |  103|  4.47k|        return &local_it; \
  |  |  104|  4.47k|        }
  ------------------
ASN1_BOOLEAN_it:
  764|   125k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   125k|        { \
  |  |   96|   125k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   125k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   125k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   125k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   125k|                }; \
  |  |  103|   125k|        return &local_it; \
  |  |  104|   125k|        }
  ------------------
ASN1_FBOOLEAN_it:
  764|   164k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   164k|        { \
  |  |   96|   164k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   164k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   164k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   164k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   164k|                }; \
  |  |  103|   164k|        return &local_it; \
  |  |  104|   164k|        }
  ------------------
ASN1_OCTET_STRING_NDEF_it:
  764|  27.5k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  27.5k|        { \
  |  |   96|  27.5k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  27.5k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  27.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  27.5k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  27.5k|                }; \
  |  |  103|  27.5k|        return &local_it; \
  |  |  104|  27.5k|        }
  ------------------
X509_ALGOR_it:
  166|  1.09M|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.09M|        { \
  |  |   96|  1.09M|                static const ASN1_ITEM local_it = {
  ------------------
  167|  1.09M|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.09M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  1.09M|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.09M|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  1.09M|                tname##_seq_tt,\
  170|  1.09M|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  1.09M|                NULL,\
  172|  1.09M|                sizeof(stname),\
  173|  1.09M|                #tname \
  174|  1.09M|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.09M|                }; \
  |  |  103|  1.09M|        return &local_it; \
  |  |  104|  1.09M|        }
  ------------------
X509_ALGOR_new:
  812|   113k|        { \
  813|   113k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   113k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|   113k|        } \
X509_ALGOR_free:
  816|   114k|        { \
  817|   114k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   114k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   114k|        }
X509_VAL_it:
  166|   177k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   177k|        { \
  |  |   96|   177k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   177k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   177k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   177k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   177k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   177k|                tname##_seq_tt,\
  170|   177k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   177k|                NULL,\
  172|   177k|                sizeof(stname),\
  173|   177k|                #tname \
  174|   177k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   177k|                }; \
  |  |  103|   177k|        return &local_it; \
  |  |  104|   177k|        }
  ------------------
CMS_IssuerAndSerialNumber_it:
  166|  12.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.4k|        { \
  |  |   96|  12.4k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.4k|                tname##_seq_tt,\
  170|  12.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.4k|                NULL,\
  172|  12.4k|                sizeof(stname),\
  173|  12.4k|                #tname \
  174|  12.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.4k|                }; \
  |  |  103|  12.4k|        return &local_it; \
  |  |  104|  12.4k|        }
  ------------------
CMS_CertificateChoices_it:
  320|   937k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   937k|        { \
  |  |   96|   937k|                static const ASN1_ITEM local_it = {
  ------------------
  321|   937k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|   937k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|   937k|                offsetof(stname,selname) ,\
  323|   937k|                tname##_ch_tt,\
  324|   937k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|   937k|                NULL,\
  326|   937k|                sizeof(stname),\
  327|   937k|                #stname \
  328|   937k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   937k|                }; \
  |  |  103|   937k|        return &local_it; \
  |  |  104|   937k|        }
  ------------------
CMS_SignerInfo_it:
  247|  10.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  10.8k|        { \
  |  |   96|  10.8k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  10.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  10.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  10.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  10.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  10.8k|                tname##_seq_tt,\
  251|  10.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  10.8k|                &tname##_aux,\
  253|  10.8k|                sizeof(stname),\
  254|  10.8k|                #tname \
  255|  10.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  10.8k|                }; \
  |  |  103|  10.8k|        return &local_it; \
  |  |  104|  10.8k|        }
  ------------------
CMS_RevocationInfoChoice_it:
  320|  48.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  48.5k|        { \
  |  |   96|  48.5k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  48.5k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  48.5k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  48.5k|                offsetof(stname,selname) ,\
  323|  48.5k|                tname##_ch_tt,\
  324|  48.5k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  48.5k|                NULL,\
  326|  48.5k|                sizeof(stname),\
  327|  48.5k|                #stname \
  328|  48.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  48.5k|                }; \
  |  |  103|  48.5k|        return &local_it; \
  |  |  104|  48.5k|        }
  ------------------
CMS_SignedData_it:
  218|  2.99k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.99k|        { \
  |  |   96|  2.99k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  2.99k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  2.99k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  2.99k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  2.99k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  2.99k|                tname##_seq_tt,\
  222|  2.99k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  2.99k|                NULL,\
  224|  2.99k|                sizeof(tname),\
  225|  2.99k|                #tname \
  226|  2.99k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.99k|                }; \
  |  |  103|  2.99k|        return &local_it; \
  |  |  104|  2.99k|        }
  ------------------
CMS_KeyTransRecipientInfo_it:
  166|  12.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.2k|        { \
  |  |   96|  12.2k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.2k|                tname##_seq_tt,\
  170|  12.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.2k|                NULL,\
  172|  12.2k|                sizeof(stname),\
  173|  12.2k|                #tname \
  174|  12.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.2k|                }; \
  |  |  103|  12.2k|        return &local_it; \
  |  |  104|  12.2k|        }
  ------------------
CMS_OtherKeyAttribute_it:
  166|  8.36k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  8.36k|        { \
  |  |   96|  8.36k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  8.36k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  8.36k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  8.36k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  8.36k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  8.36k|                tname##_seq_tt,\
  170|  8.36k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  8.36k|                NULL,\
  172|  8.36k|                sizeof(stname),\
  173|  8.36k|                #tname \
  174|  8.36k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  8.36k|                }; \
  |  |  103|  8.36k|        return &local_it; \
  |  |  104|  8.36k|        }
  ------------------
CMS_RecipientKeyIdentifier_it:
  166|  3.81k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  3.81k|        { \
  |  |   96|  3.81k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  3.81k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  3.81k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  3.81k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  3.81k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  3.81k|                tname##_seq_tt,\
  170|  3.81k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  3.81k|                NULL,\
  172|  3.81k|                sizeof(stname),\
  173|  3.81k|                #tname \
  174|  3.81k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.81k|                }; \
  |  |  103|  3.81k|        return &local_it; \
  |  |  104|  3.81k|        }
  ------------------
CMS_RecipientEncryptedKey_it:
  247|  7.03k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  7.03k|        { \
  |  |   96|  7.03k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  7.03k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  7.03k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  7.03k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  7.03k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  7.03k|                tname##_seq_tt,\
  251|  7.03k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  7.03k|                &tname##_aux,\
  253|  7.03k|                sizeof(stname),\
  254|  7.03k|                #tname \
  255|  7.03k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  7.03k|                }; \
  |  |  103|  7.03k|        return &local_it; \
  |  |  104|  7.03k|        }
  ------------------
CMS_OriginatorPublicKey_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|        }
  ------------------
CMS_KeyAgreeRecipientInfo_it:
  247|  17.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  17.2k|        { \
  |  |   96|  17.2k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  17.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  17.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  17.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  17.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  17.2k|                tname##_seq_tt,\
  251|  17.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  17.2k|                &tname##_aux,\
  253|  17.2k|                sizeof(stname),\
  254|  17.2k|                #tname \
  255|  17.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  17.2k|                }; \
  |  |  103|  17.2k|        return &local_it; \
  |  |  104|  17.2k|        }
  ------------------
CMS_KEKRecipientInfo_it:
  166|  5.27k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  5.27k|        { \
  |  |   96|  5.27k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  5.27k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  5.27k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  5.27k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  5.27k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  5.27k|                tname##_seq_tt,\
  170|  5.27k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  5.27k|                NULL,\
  172|  5.27k|                sizeof(stname),\
  173|  5.27k|                #tname \
  174|  5.27k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  5.27k|                }; \
  |  |  103|  5.27k|        return &local_it; \
  |  |  104|  5.27k|        }
  ------------------
CMS_PasswordRecipientInfo_it:
  166|  7.47k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  7.47k|        { \
  |  |   96|  7.47k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  7.47k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  7.47k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  7.47k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  7.47k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  7.47k|                tname##_seq_tt,\
  170|  7.47k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  7.47k|                NULL,\
  172|  7.47k|                sizeof(stname),\
  173|  7.47k|                #tname \
  174|  7.47k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  7.47k|                }; \
  |  |  103|  7.47k|        return &local_it; \
  |  |  104|  7.47k|        }
  ------------------
CMS_RecipientInfo_it:
  344|  44.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  44.6k|        { \
  |  |   96|  44.6k|                static const ASN1_ITEM local_it = {
  ------------------
  345|  44.6k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  44.6k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  346|  44.6k|                offsetof(stname,selname) ,\
  347|  44.6k|                tname##_ch_tt,\
  348|  44.6k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  349|  44.6k|                &tname##_aux,\
  350|  44.6k|                sizeof(stname),\
  351|  44.6k|                #stname \
  352|  44.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  44.6k|                }; \
  |  |  103|  44.6k|        return &local_it; \
  |  |  104|  44.6k|        }
  ------------------
CMS_EnvelopedData_it:
  218|  3.74k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  3.74k|        { \
  |  |   96|  3.74k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  3.74k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  3.74k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  3.74k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  3.74k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  3.74k|                tname##_seq_tt,\
  222|  3.74k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  3.74k|                NULL,\
  224|  3.74k|                sizeof(tname),\
  225|  3.74k|                #tname \
  226|  3.74k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.74k|                }; \
  |  |  103|  3.74k|        return &local_it; \
  |  |  104|  3.74k|        }
  ------------------
CMS_DigestedData_it:
  218|    255|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    255|        { \
  |  |   96|    255|                static const ASN1_ITEM local_it = {
  ------------------
  219|    255|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|    255|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|    255|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    255|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|    255|                tname##_seq_tt,\
  222|    255|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|    255|                NULL,\
  224|    255|                sizeof(tname),\
  225|    255|                #tname \
  226|    255|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    255|                }; \
  |  |  103|    255|        return &local_it; \
  |  |  104|    255|        }
  ------------------
CMS_EncryptedData_it:
  218|    871|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    871|        { \
  |  |   96|    871|                static const ASN1_ITEM local_it = {
  ------------------
  219|    871|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|    871|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|    871|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    871|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|    871|                tname##_seq_tt,\
  222|    871|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|    871|                NULL,\
  224|    871|                sizeof(tname),\
  225|    871|                #tname \
  226|    871|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    871|                }; \
  |  |  103|    871|        return &local_it; \
  |  |  104|    871|        }
  ------------------
CMS_AuthEnvelopedData_it:
  218|     21|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     21|        { \
  |  |   96|     21|                static const ASN1_ITEM local_it = {
  ------------------
  219|     21|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|     21|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|     21|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     21|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|     21|                tname##_seq_tt,\
  222|     21|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|     21|                NULL,\
  224|     21|                sizeof(tname),\
  225|     21|                #tname \
  226|     21|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     21|                }; \
  |  |  103|     21|        return &local_it; \
  |  |  104|     21|        }
  ------------------
CMS_CompressedData_it:
  218|      9|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      9|        { \
  |  |   96|      9|                static const ASN1_ITEM local_it = {
  ------------------
  219|      9|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|      9|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|      9|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      9|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|      9|                tname##_seq_tt,\
  222|      9|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|      9|                NULL,\
  224|      9|                sizeof(tname),\
  225|      9|                #tname \
  226|      9|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      9|                }; \
  |  |  103|      9|        return &local_it; \
  |  |  104|      9|        }
  ------------------
CMS_ContentInfo_it:
  270|  10.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  10.4k|        { \
  |  |   96|  10.4k|                static const ASN1_ITEM local_it = {
  ------------------
  271|  10.4k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  10.4k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  272|  10.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  10.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  273|  10.4k|                tname##_seq_tt,\
  274|  10.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  275|  10.4k|                &tname##_aux,\
  276|  10.4k|                sizeof(stname),\
  277|  10.4k|                #stname \
  278|  10.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  10.4k|                }; \
  |  |  103|  10.4k|        return &local_it; \
  |  |  104|  10.4k|        }
  ------------------
cms_asn1.c:CMS_OtherCertificateFormat_it:
  178|    610|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    610|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    610|        { \
  |  |  |  |   96|    610|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|    610|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    610|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|    610|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    610|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|    610|                tname##_seq_tt,\
  182|    610|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|    610|                NULL,\
  184|    610|                sizeof(stname),\
  185|    610|                #stname \
  186|    610|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    610|                }; \
  |  |  103|    610|        return &local_it; \
  |  |  104|    610|        }
  ------------------
cms_asn1.c:CMS_SignerIdentifier_it:
  332|  21.7k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  21.7k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  21.7k|        { \
  |  |  |  |   96|  21.7k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  21.7k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  21.7k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  21.7k|                offsetof(stname,selname) ,\
  335|  21.7k|                tname##_ch_tt,\
  336|  21.7k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  21.7k|                NULL,\
  338|  21.7k|                sizeof(stname),\
  339|  21.7k|                #stname \
  340|  21.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  21.7k|                }; \
  |  |  103|  21.7k|        return &local_it; \
  |  |  104|  21.7k|        }
  ------------------
cms_asn1.c:CMS_OtherRevocationInfoFormat_it:
  178|    724|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    724|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    724|        { \
  |  |  |  |   96|    724|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|    724|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    724|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|    724|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    724|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|    724|                tname##_seq_tt,\
  182|    724|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|    724|                NULL,\
  184|    724|                sizeof(stname),\
  185|    724|                #stname \
  186|    724|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    724|                }; \
  |  |  103|    724|        return &local_it; \
  |  |  104|    724|        }
  ------------------
cms_asn1.c:CMS_EncapsulatedContentInfo_it:
  229|  14.0k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  14.0k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  14.0k|        { \
  |  |  |  |   96|  14.0k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  230|  14.0k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  14.0k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  231|  14.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  14.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  232|  14.0k|                tname##_seq_tt,\
  233|  14.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  234|  14.0k|                NULL,\
  235|  14.0k|                sizeof(tname),\
  236|  14.0k|                #tname \
  237|  14.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  14.0k|                }; \
  |  |  103|  14.0k|        return &local_it; \
  |  |  104|  14.0k|        }
  ------------------
cms_asn1.c:CMS_KeyAgreeRecipientIdentifier_it:
  332|  5.03k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  5.03k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  5.03k|        { \
  |  |  |  |   96|  5.03k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  5.03k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  5.03k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  5.03k|                offsetof(stname,selname) ,\
  335|  5.03k|                tname##_ch_tt,\
  336|  5.03k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  5.03k|                NULL,\
  338|  5.03k|                sizeof(stname),\
  339|  5.03k|                #stname \
  340|  5.03k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  5.03k|                }; \
  |  |  103|  5.03k|        return &local_it; \
  |  |  104|  5.03k|        }
  ------------------
cms_asn1.c:CMS_OriginatorIdentifierOrKey_it:
  332|  17.7k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  17.7k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  17.7k|        { \
  |  |  |  |   96|  17.7k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  17.7k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  17.7k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  17.7k|                offsetof(stname,selname) ,\
  335|  17.7k|                tname##_ch_tt,\
  336|  17.7k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  17.7k|                NULL,\
  338|  17.7k|                sizeof(stname),\
  339|  17.7k|                #stname \
  340|  17.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  17.7k|                }; \
  |  |  103|  17.7k|        return &local_it; \
  |  |  104|  17.7k|        }
  ------------------
cms_asn1.c:CMS_KEKIdentifier_it:
  178|  1.83k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  1.83k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  1.83k|        { \
  |  |  |  |   96|  1.83k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  1.83k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.83k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  1.83k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.83k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  1.83k|                tname##_seq_tt,\
  182|  1.83k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  1.83k|                NULL,\
  184|  1.83k|                sizeof(stname),\
  185|  1.83k|                #stname \
  186|  1.83k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.83k|                }; \
  |  |  103|  1.83k|        return &local_it; \
  |  |  104|  1.83k|        }
  ------------------
cms_asn1.c:CMS_OtherRecipientInfo_it:
  178|  18.2k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  18.2k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  18.2k|        { \
  |  |  |  |   96|  18.2k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  18.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  18.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  18.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  18.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  18.2k|                tname##_seq_tt,\
  182|  18.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  18.2k|                NULL,\
  184|  18.2k|                sizeof(stname),\
  185|  18.2k|                #stname \
  186|  18.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  18.2k|                }; \
  |  |  103|  18.2k|        return &local_it; \
  |  |  104|  18.2k|        }
  ------------------
cms_asn1.c:CMS_OriginatorInfo_it:
  178|  26.3k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  26.3k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  26.3k|        { \
  |  |  |  |   96|  26.3k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  26.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  26.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  26.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  26.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  26.3k|                tname##_seq_tt,\
  182|  26.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  26.3k|                NULL,\
  184|  26.3k|                sizeof(stname),\
  185|  26.3k|                #stname \
  186|  26.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  26.3k|                }; \
  |  |  103|  26.3k|        return &local_it; \
  |  |  104|  26.3k|        }
  ------------------
cms_asn1.c:CMS_EncryptedContentInfo_it:
  229|  5.52k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  5.52k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  5.52k|        { \
  |  |  |  |   96|  5.52k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  230|  5.52k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  5.52k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  231|  5.52k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  5.52k|# define V_ASN1_SEQUENCE                 16
  ------------------
  232|  5.52k|                tname##_seq_tt,\
  233|  5.52k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  234|  5.52k|                NULL,\
  235|  5.52k|                sizeof(tname),\
  236|  5.52k|                #tname \
  237|  5.52k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  5.52k|                }; \
  |  |  103|  5.52k|        return &local_it; \
  |  |  104|  5.52k|        }
  ------------------
cms_asn1.c:CMS_ContentInfo_adb:
  463|  35.1k|        { \
  464|  35.1k|        static const ASN1_ADB internal_adb = \
  465|  35.1k|                {\
  466|  35.1k|                flags,\
  467|  35.1k|                offsetof(name, field),\
  468|  35.1k|                adb_cb,\
  469|  35.1k|                name##_adbtbl,\
  470|  35.1k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  35.1k|                def,\
  472|  35.1k|                none\
  473|  35.1k|                }; \
  474|  35.1k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  35.1k|        } \
cms_asn1.c:CMS_AuthenticatedData_it:
  229|  9.39k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  9.39k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  9.39k|        { \
  |  |  |  |   96|  9.39k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  230|  9.39k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  9.39k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  231|  9.39k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  9.39k|# define V_ASN1_SEQUENCE                 16
  ------------------
  232|  9.39k|                tname##_seq_tt,\
  233|  9.39k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  234|  9.39k|                NULL,\
  235|  9.39k|                sizeof(tname),\
  236|  9.39k|                #tname \
  237|  9.39k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  9.39k|                }; \
  |  |  103|  9.39k|        return &local_it; \
  |  |  104|  9.39k|        }
  ------------------
DHparams_it:
  247|  2.90k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.90k|        { \
  |  |   96|  2.90k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  2.90k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  2.90k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  2.90k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  2.90k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  2.90k|                tname##_seq_tt,\
  251|  2.90k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  2.90k|                &tname##_aux,\
  253|  2.90k|                sizeof(stname),\
  254|  2.90k|                #tname \
  255|  2.90k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.90k|                }; \
  |  |  103|  2.90k|        return &local_it; \
  |  |  104|  2.90k|        }
  ------------------
d2i_DHparams:
  826|  2.90k|        { \
  827|  2.90k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  2.90k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  2.90k|        } \
d2i_int_dhx:
  826|  4.27k|        { \
  827|  4.27k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  4.27k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  4.27k|        } \
dh_asn1.c:DHxparams_it:
  178|  4.27k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  4.27k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  4.27k|        { \
  |  |  |  |   96|  4.27k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  4.27k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  4.27k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  4.27k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  4.27k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  4.27k|                tname##_seq_tt,\
  182|  4.27k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  4.27k|                NULL,\
  184|  4.27k|                sizeof(stname),\
  185|  4.27k|                #stname \
  186|  4.27k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  4.27k|                }; \
  |  |  103|  4.27k|        return &local_it; \
  |  |  104|  4.27k|        }
  ------------------
dh_asn1.c:DHvparams_it:
  178|  13.0k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  13.0k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  13.0k|        { \
  |  |  |  |   96|  13.0k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  13.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  13.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  13.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  13.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  13.0k|                tname##_seq_tt,\
  182|  13.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  13.0k|                NULL,\
  184|  13.0k|                sizeof(stname),\
  185|  13.0k|                #stname \
  186|  13.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.0k|                }; \
  |  |  103|  13.0k|        return &local_it; \
  |  |  104|  13.0k|        }
  ------------------
d2i_DSAparams:
  826|  3.81k|        { \
  827|  3.81k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  3.81k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  3.81k|        } \
d2i_DSAPublicKey:
  826|    158|        { \
  827|    158|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|    158|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|    158|        } \
dsa_asn1.c:DSAparams_it:
  258|  3.81k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  3.81k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  3.81k|        { \
  |  |  |  |   96|  3.81k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|  3.81k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  3.81k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|  3.81k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  3.81k|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|  3.81k|                tname##_seq_tt,\
  262|  3.81k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|  3.81k|                &tname##_aux,\
  264|  3.81k|                sizeof(stname),\
  265|  3.81k|                #stname \
  266|  3.81k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.81k|                }; \
  |  |  103|  3.81k|        return &local_it; \
  |  |  104|  3.81k|        }
  ------------------
dsa_asn1.c:DSAPublicKey_it:
  258|    158|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    158|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    158|        { \
  |  |  |  |   96|    158|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|    158|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    158|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|    158|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    158|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|    158|                tname##_seq_tt,\
  262|    158|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|    158|                &tname##_aux,\
  264|    158|                sizeof(stname),\
  265|    158|                #stname \
  266|    158|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    158|                }; \
  |  |  103|    158|        return &local_it; \
  |  |  104|    158|        }
  ------------------
ECPARAMETERS_it:
  166|  11.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.1k|        { \
  |  |   96|  11.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.1k|                tname##_seq_tt,\
  170|  11.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.1k|                NULL,\
  172|  11.1k|                sizeof(stname),\
  173|  11.1k|                #tname \
  174|  11.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.1k|                }; \
  |  |  103|  11.1k|        return &local_it; \
  |  |  104|  11.1k|        }
  ------------------
ECPKPARAMETERS_it:
  320|  11.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.1k|        { \
  |  |   96|  11.1k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  11.1k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  11.1k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  11.1k|                offsetof(stname,selname) ,\
  323|  11.1k|                tname##_ch_tt,\
  324|  11.1k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  11.1k|                NULL,\
  326|  11.1k|                sizeof(stname),\
  327|  11.1k|                #stname \
  328|  11.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.1k|                }; \
  |  |  103|  11.1k|        return &local_it; \
  |  |  104|  11.1k|        }
  ------------------
d2i_ECPKPARAMETERS:
  826|  5.57k|        { \
  827|  5.57k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  5.57k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  5.57k|        } \
ECPKPARAMETERS_free:
  816|  5.57k|        { \
  817|  5.57k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  5.57k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  5.57k|        }
ec_asn1.c:X9_62_PENTANOMIAL_it:
  178|      6|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|      6|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|      6|        { \
  |  |  |  |   96|      6|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|      6|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      6|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|      6|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      6|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|      6|                tname##_seq_tt,\
  182|      6|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|      6|                NULL,\
  184|      6|                sizeof(stname),\
  185|      6|                #stname \
  186|      6|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      6|                }; \
  |  |  103|      6|        return &local_it; \
  |  |  104|      6|        }
  ------------------
ec_asn1.c:X9_62_CHARACTERISTIC_TWO_it:
  178|  2.86k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  2.86k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  2.86k|        { \
  |  |  |  |   96|  2.86k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  2.86k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  2.86k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  2.86k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  2.86k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  2.86k|                tname##_seq_tt,\
  182|  2.86k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  2.86k|                NULL,\
  184|  2.86k|                sizeof(stname),\
  185|  2.86k|                #stname \
  186|  2.86k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.86k|                }; \
  |  |  103|  2.86k|        return &local_it; \
  |  |  104|  2.86k|        }
  ------------------
ec_asn1.c:X9_62_CHARACTERISTIC_TWO_adb:
  463|  4.15k|        { \
  464|  4.15k|        static const ASN1_ADB internal_adb = \
  465|  4.15k|                {\
  466|  4.15k|                flags,\
  467|  4.15k|                offsetof(name, field),\
  468|  4.15k|                adb_cb,\
  469|  4.15k|                name##_adbtbl,\
  470|  4.15k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  4.15k|                def,\
  472|  4.15k|                none\
  473|  4.15k|                }; \
  474|  4.15k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  4.15k|        } \
ec_asn1.c:X9_62_FIELDID_it:
  178|  15.6k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  15.6k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  15.6k|        { \
  |  |  |  |   96|  15.6k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  15.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  15.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  15.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  15.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  15.6k|                tname##_seq_tt,\
  182|  15.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  15.6k|                NULL,\
  184|  15.6k|                sizeof(stname),\
  185|  15.6k|                #stname \
  186|  15.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  15.6k|                }; \
  |  |  103|  15.6k|        return &local_it; \
  |  |  104|  15.6k|        }
  ------------------
ec_asn1.c:X9_62_FIELDID_adb:
  463|  17.6k|        { \
  464|  17.6k|        static const ASN1_ADB internal_adb = \
  465|  17.6k|                {\
  466|  17.6k|                flags,\
  467|  17.6k|                offsetof(name, field),\
  468|  17.6k|                adb_cb,\
  469|  17.6k|                name##_adbtbl,\
  470|  17.6k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  17.6k|                def,\
  472|  17.6k|                none\
  473|  17.6k|                }; \
  474|  17.6k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  17.6k|        } \
ec_asn1.c:X9_62_CURVE_it:
  178|  11.1k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  11.1k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  11.1k|        { \
  |  |  |  |   96|  11.1k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  11.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  11.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  11.1k|                tname##_seq_tt,\
  182|  11.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  11.1k|                NULL,\
  184|  11.1k|                sizeof(stname),\
  185|  11.1k|                #stname \
  186|  11.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.1k|                }; \
  |  |  103|  11.1k|        return &local_it; \
  |  |  104|  11.1k|        }
  ------------------
RSAPublicKey_it:
  247|  4.54k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  4.54k|        { \
  |  |   96|  4.54k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  4.54k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  4.54k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  4.54k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  4.54k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  4.54k|                tname##_seq_tt,\
  251|  4.54k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  4.54k|                &tname##_aux,\
  253|  4.54k|                sizeof(stname),\
  254|  4.54k|                #tname \
  255|  4.54k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  4.54k|                }; \
  |  |  103|  4.54k|        return &local_it; \
  |  |  104|  4.54k|        }
  ------------------
RSA_PSS_PARAMS_it:
  247|  6.11k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  6.11k|        { \
  |  |   96|  6.11k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  6.11k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  6.11k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  6.11k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  6.11k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  6.11k|                tname##_seq_tt,\
  251|  6.11k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  6.11k|                &tname##_aux,\
  253|  6.11k|                sizeof(stname),\
  254|  6.11k|                #tname \
  255|  6.11k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  6.11k|                }; \
  |  |  103|  6.11k|        return &local_it; \
  |  |  104|  6.11k|        }
  ------------------
RSA_PSS_PARAMS_free:
  816|  5.30k|        { \
  817|  5.30k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  5.30k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  5.30k|        }
d2i_RSAPublicKey:
  826|  4.54k|        { \
  827|  4.54k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  4.54k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  4.54k|        } \
AUTHORITY_KEYID_it:
  166|   164k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   164k|        { \
  |  |   96|   164k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   164k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   164k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   164k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   164k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   164k|                tname##_seq_tt,\
  170|   164k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   164k|                NULL,\
  172|   164k|                sizeof(stname),\
  173|   164k|                #tname \
  174|   164k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   164k|                }; \
  |  |  103|   164k|        return &local_it; \
  |  |  104|   164k|        }
  ------------------
AUTHORITY_KEYID_free:
  816|   159k|        { \
  817|   159k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   159k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   159k|        }
ASIdentifiers_it:
  166|   118k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   118k|        { \
  |  |   96|   118k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   118k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   118k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   118k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   118k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   118k|                tname##_seq_tt,\
  170|   118k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   118k|                NULL,\
  172|   118k|                sizeof(stname),\
  173|   118k|                #tname \
  174|   118k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   118k|                }; \
  |  |  103|   118k|        return &local_it; \
  |  |  104|   118k|        }
  ------------------
ASIdentifiers_free:
  816|   118k|        { \
  817|   118k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   118k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   118k|        }
DIST_POINT_NAME_it:
  344|  43.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  43.5k|        { \
  |  |   96|  43.5k|                static const ASN1_ITEM local_it = {
  ------------------
  345|  43.5k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  43.5k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  346|  43.5k|                offsetof(stname,selname) ,\
  347|  43.5k|                tname##_ch_tt,\
  348|  43.5k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  349|  43.5k|                &tname##_aux,\
  350|  43.5k|                sizeof(stname),\
  351|  43.5k|                #stname \
  352|  43.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  43.5k|                }; \
  |  |  103|  43.5k|        return &local_it; \
  |  |  104|  43.5k|        }
  ------------------
CRL_DIST_POINTS_it:
  113|   118k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   118k|        { \
  |  |   96|   118k|                static const ASN1_ITEM local_it = {
  ------------------
  114|   118k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|   118k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|   118k|                -1,\
  116|   118k|                &tname##_item_tt,\
  117|   118k|                0,\
  118|   118k|                NULL,\
  119|   118k|                0,\
  120|   118k|                #tname \
  121|   118k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   118k|                }; \
  |  |  103|   118k|        return &local_it; \
  |  |  104|   118k|        }
  ------------------
CRL_DIST_POINTS_free:
  816|   118k|        { \
  817|   118k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   118k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   118k|        }
ISSUING_DIST_POINT_it:
  166|  53.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  53.1k|        { \
  |  |   96|  53.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  53.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  53.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  53.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  53.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  53.1k|                tname##_seq_tt,\
  170|  53.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  53.1k|                NULL,\
  172|  53.1k|                sizeof(stname),\
  173|  53.1k|                #tname \
  174|  53.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  53.1k|                }; \
  |  |  103|  53.1k|        return &local_it; \
  |  |  104|  53.1k|        }
  ------------------
ISSUING_DIST_POINT_free:
  816|  41.4k|        { \
  817|  41.4k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  41.4k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  41.4k|        }
NAME_CONSTRAINTS_it:
  166|   118k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   118k|        { \
  |  |   96|   118k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   118k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   118k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   118k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   118k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   118k|                tname##_seq_tt,\
  170|   118k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   118k|                NULL,\
  172|   118k|                sizeof(stname),\
  173|   118k|                #tname \
  174|   118k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   118k|                }; \
  |  |  103|   118k|        return &local_it; \
  |  |  104|   118k|        }
  ------------------
NAME_CONSTRAINTS_free:
  816|   118k|        { \
  817|   118k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   118k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   118k|        }

digest.c:OSSL_FUNC_digest_newctx:
   51|     27|    {                                                                   \
   52|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     27|    }
digest.c:OSSL_FUNC_digest_init:
   51|     27|    {                                                                   \
   52|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     27|    }
digest.c:OSSL_FUNC_digest_update:
   51|     27|    {                                                                   \
   52|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     27|    }
digest.c:OSSL_FUNC_digest_final:
   51|     27|    {                                                                   \
   52|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     27|    }
digest.c:OSSL_FUNC_digest_freectx:
   51|     27|    {                                                                   \
   52|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     27|    }
digest.c:OSSL_FUNC_digest_dupctx:
   51|     27|    {                                                                   \
   52|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     27|    }
digest.c:OSSL_FUNC_digest_get_params:
   51|     27|    {                                                                   \
   52|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     27|    }
digest.c:OSSL_FUNC_digest_set_ctx_params:
   51|      7|    {                                                                   \
   52|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      7|    }
digest.c:OSSL_FUNC_digest_gettable_params:
   51|     27|    {                                                                   \
   52|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     27|    }
digest.c:OSSL_FUNC_digest_settable_ctx_params:
   51|      7|    {                                                                   \
   52|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      7|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_new:
   51|     18|    {                                                                   \
   52|     18|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     18|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_init:
   51|     15|    {                                                                   \
   52|     15|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     15|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_set_template:
   51|      5|    {                                                                   \
   52|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      5|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_set_params:
   51|     15|    {                                                                   \
   52|     15|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     15|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_settable_params:
   51|     15|    {                                                                   \
   52|     15|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     15|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen:
   51|     15|    {                                                                   \
   52|     15|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     15|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_cleanup:
   51|     15|    {                                                                   \
   52|     15|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     15|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_free:
   51|     18|    {                                                                   \
   52|     18|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     18|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_load:
   51|     11|    {                                                                   \
   52|     11|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     11|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_get_params:
   51|     15|    {                                                                   \
   52|     15|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     15|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gettable_params:
   51|     15|    {                                                                   \
   52|     15|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     15|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_set_params:
   51|     12|    {                                                                   \
   52|     12|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     12|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_settable_params:
   51|     12|    {                                                                   \
   52|     12|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     12|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_query_operation_name:
   51|      4|    {                                                                   \
   52|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      4|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_has:
   51|     18|    {                                                                   \
   52|     18|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     18|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_dup:
   51|     11|    {                                                                   \
   52|     11|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     11|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_validate:
   51|     11|    {                                                                   \
   52|     11|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     11|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_match:
   51|     15|    {                                                                   \
   52|     15|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     15|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_import:
   51|     15|    {                                                                   \
   52|     15|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     15|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_import_types:
   51|     15|    {                                                                   \
   52|     15|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     15|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_export:
   51|     15|    {                                                                   \
   52|     15|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     15|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_export_types:
   51|     15|    {                                                                   \
   52|     15|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     15|    }
provider_core.c:OSSL_FUNC_provider_teardown:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
provider_core.c:OSSL_FUNC_provider_gettable_params:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
provider_core.c:OSSL_FUNC_provider_get_params:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
provider_core.c:OSSL_FUNC_provider_get_capabilities:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
provider_core.c:OSSL_FUNC_provider_query_operation:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
defltprov.c:OSSL_FUNC_core_gettable_params:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
defltprov.c:OSSL_FUNC_core_get_params:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
defltprov.c:OSSL_FUNC_core_get_libctx:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
bio_prov.c:OSSL_FUNC_BIO_new_file:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
bio_prov.c:OSSL_FUNC_BIO_new_membuf:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
bio_prov.c:OSSL_FUNC_BIO_read_ex:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
bio_prov.c:OSSL_FUNC_BIO_write_ex:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
bio_prov.c:OSSL_FUNC_BIO_gets:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
bio_prov.c:OSSL_FUNC_BIO_puts:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
bio_prov.c:OSSL_FUNC_BIO_ctrl:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
bio_prov.c:OSSL_FUNC_BIO_up_ref:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
bio_prov.c:OSSL_FUNC_BIO_free:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
bio_prov.c:OSSL_FUNC_BIO_vprintf:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
provider_seeding.c:OSSL_FUNC_get_entropy:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_entropy:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
provider_seeding.c:OSSL_FUNC_get_nonce:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
provider_seeding.c:OSSL_FUNC_cleanup_nonce:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
drbg.c:OSSL_FUNC_rand_enable_locking:
   51|      2|    {                                                                   \
   52|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      2|    }
drbg.c:OSSL_FUNC_rand_lock:
   51|      2|    {                                                                   \
   52|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      2|    }
drbg.c:OSSL_FUNC_rand_unlock:
   51|      2|    {                                                                   \
   52|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      2|    }
drbg.c:OSSL_FUNC_rand_get_ctx_params:
   51|      2|    {                                                                   \
   52|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      2|    }
drbg.c:OSSL_FUNC_rand_get_seed:
   51|      2|    {                                                                   \
   52|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      2|    }
drbg.c:OSSL_FUNC_rand_clear_seed:
   51|      2|    {                                                                   \
   52|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      2|    }
decoder_meth.c:OSSL_FUNC_decoder_newctx:
   51|     40|    {                                                                   \
   52|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     40|    }
decoder_meth.c:OSSL_FUNC_decoder_freectx:
   51|     40|    {                                                                   \
   52|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     40|    }
decoder_meth.c:OSSL_FUNC_decoder_set_ctx_params:
   51|     37|    {                                                                   \
   52|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     37|    }
decoder_meth.c:OSSL_FUNC_decoder_settable_ctx_params:
   51|     37|    {                                                                   \
   52|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     37|    }
decoder_meth.c:OSSL_FUNC_decoder_does_selection:
   51|     37|    {                                                                   \
   52|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     37|    }
decoder_meth.c:OSSL_FUNC_decoder_decode:
   51|     40|    {                                                                   \
   52|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     40|    }
decoder_meth.c:OSSL_FUNC_decoder_export_object:
   51|     37|    {                                                                   \
   52|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|     37|    }
evp_enc.c:OSSL_FUNC_cipher_newctx:
   51|    130|    {                                                                   \
   52|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    130|    }
evp_enc.c:OSSL_FUNC_cipher_encrypt_init:
   51|    130|    {                                                                   \
   52|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    130|    }
evp_enc.c:OSSL_FUNC_cipher_decrypt_init:
   51|    130|    {                                                                   \
   52|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    130|    }
evp_enc.c:OSSL_FUNC_cipher_update:
   51|    130|    {                                                                   \
   52|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    130|    }
evp_enc.c:OSSL_FUNC_cipher_final:
   51|    130|    {                                                                   \
   52|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    130|    }
evp_enc.c:OSSL_FUNC_cipher_cipher:
   51|    118|    {                                                                   \
   52|    118|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    118|    }
evp_enc.c:OSSL_FUNC_cipher_freectx:
   51|    130|    {                                                                   \
   52|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    130|    }
evp_enc.c:OSSL_FUNC_cipher_dupctx:
   51|    129|    {                                                                   \
   52|    129|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    129|    }
evp_enc.c:OSSL_FUNC_cipher_get_params:
   51|    130|    {                                                                   \
   52|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    130|    }
evp_enc.c:OSSL_FUNC_cipher_get_ctx_params:
   51|    130|    {                                                                   \
   52|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    130|    }
evp_enc.c:OSSL_FUNC_cipher_set_ctx_params:
   51|    130|    {                                                                   \
   52|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    130|    }
evp_enc.c:OSSL_FUNC_cipher_gettable_params:
   51|    130|    {                                                                   \
   52|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    130|    }
evp_enc.c:OSSL_FUNC_cipher_gettable_ctx_params:
   51|    130|    {                                                                   \
   52|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    130|    }
evp_enc.c:OSSL_FUNC_cipher_settable_ctx_params:
   51|    130|    {                                                                   \
   52|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|    130|    }
evp_rand.c:OSSL_FUNC_rand_newctx:
   51|      5|    {                                                                   \
   52|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      5|    }
evp_rand.c:OSSL_FUNC_rand_freectx:
   51|      5|    {                                                                   \
   52|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      5|    }
evp_rand.c:OSSL_FUNC_rand_instantiate:
   51|      5|    {                                                                   \
   52|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      5|    }
evp_rand.c:OSSL_FUNC_rand_uninstantiate:
   51|      5|    {                                                                   \
   52|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      5|    }
evp_rand.c:OSSL_FUNC_rand_generate:
   51|      5|    {                                                                   \
   52|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      5|    }
evp_rand.c:OSSL_FUNC_rand_reseed:
   51|      5|    {                                                                   \
   52|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      5|    }
evp_rand.c:OSSL_FUNC_rand_nonce:
   51|      1|    {                                                                   \
   52|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      1|    }
evp_rand.c:OSSL_FUNC_rand_enable_locking:
   51|      5|    {                                                                   \
   52|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      5|    }
evp_rand.c:OSSL_FUNC_rand_lock:
   51|      5|    {                                                                   \
   52|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      5|    }
evp_rand.c:OSSL_FUNC_rand_unlock:
   51|      5|    {                                                                   \
   52|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      5|    }
evp_rand.c:OSSL_FUNC_rand_gettable_ctx_params:
   51|      5|    {                                                                   \
   52|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      5|    }
evp_rand.c:OSSL_FUNC_rand_settable_ctx_params:
   51|      4|    {                                                                   \
   52|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      4|    }
evp_rand.c:OSSL_FUNC_rand_get_ctx_params:
   51|      5|    {                                                                   \
   52|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      5|    }
evp_rand.c:OSSL_FUNC_rand_set_ctx_params:
   51|      4|    {                                                                   \
   52|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      4|    }
evp_rand.c:OSSL_FUNC_rand_verify_zeroization:
   51|      5|    {                                                                   \
   52|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   53|      5|    }

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

err.c:ossl_check_ERR_STRING_DATA_lh_type:
  162|  8.63k|    { \
  163|  8.63k|        return (OPENSSL_LHASH *)lh; \
  164|  8.63k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_hashfunc_type:
  172|      2|    { \
  173|      2|        return (OPENSSL_LH_HASHFUNC)hfn; \
  174|      2|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_compfunc_type:
  167|      2|    { \
  168|      2|        return (OPENSSL_LH_COMPFUNC)cmp; \
  169|      2|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  147|  8.49k|    { \
  148|  8.49k|        return ptr; \
  149|  8.49k|    } \
err.c:ossl_check_const_ERR_STRING_DATA_lh_plain_type:
  152|    136|    { \
  153|    136|        return ptr; \
  154|    136|    } \
core_namemap.c:lh_NAMENUM_ENTRY_num_items:
  246|  29.8k|    { \
  247|  29.8k|        return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
  248|  29.8k|    } \
core_namemap.c:lh_NAMENUM_ENTRY_doall_DOALL_NAMES_DATA:
  289|  29.8k|    { \
  290|  29.8k|        OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, \
  291|  29.8k|                             (OPENSSL_LH_DOALL_FUNCARG)fn, (void *)arg); \
  292|  29.8k|    } \
core_namemap.c:lh_NAMENUM_ENTRY_retrieve:
  236|   302k|    { \
  237|   302k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  238|   302k|    } \
core_namemap.c:lh_NAMENUM_ENTRY_insert:
  226|    405|    { \
  227|    405|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  228|    405|    } \
core_namemap.c:lh_NAMENUM_ENTRY_error:
  241|    405|    { \
  242|    405|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  243|    405|    } \
core_namemap.c:lh_NAMENUM_ENTRY_new:
  210|      2|    { \
  211|      2|        return (LHASH_OF(type) *) \
  212|      2|            OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
  213|      2|    } \
core_namemap.c:lh_NAMENUM_ENTRY_doall:
  261|      2|    { \
  262|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  263|      2|    } \
core_namemap.c:lh_NAMENUM_ENTRY_free:
  216|      2|    { \
  217|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  218|      2|    } \
o_names.c:lh_OBJ_NAME_new:
  210|      1|    { \
  211|      1|        return (LHASH_OF(type) *) \
  212|      1|            OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
  213|      1|    } \
o_names.c:lh_OBJ_NAME_retrieve:
  236|    651|    { \
  237|    651|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  238|    651|    } \
o_names.c:lh_OBJ_NAME_insert:
  226|    424|    { \
  227|    424|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  228|    424|    } \
o_names.c:lh_OBJ_NAME_error:
  241|    242|    { \
  242|    242|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  243|    242|    } \
o_names.c:lh_OBJ_NAME_delete:
  231|    242|    { \
  232|    242|        return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
  233|    242|    } \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL:
  289|      2|    { \
  290|      2|        OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, \
  291|      2|                             (OPENSSL_LH_DOALL_FUNCARG)fn, (void *)arg); \
  292|      2|    } \
o_names.c:lh_OBJ_NAME_get_down_load:
  251|      4|    { \
  252|      4|        return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
  253|      4|    } \
o_names.c:lh_OBJ_NAME_set_down_load:
  256|      7|    { \
  257|      7|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
  258|      7|    } \
o_names.c:lh_OBJ_NAME_doall:
  261|      4|    { \
  262|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  263|      4|    } \
o_names.c:lh_OBJ_NAME_free:
  216|      1|    { \
  217|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  218|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall:
  261|      2|    { \
  262|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  263|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_free:
  216|      2|    { \
  217|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  218|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_new:
  210|      2|    { \
  211|      2|        return (LHASH_OF(type) *) \
  212|      2|            OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
  213|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_retrieve:
  236|    236|    { \
  237|    236|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  238|    236|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_insert:
  226|     16|    { \
  227|     16|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  228|     16|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_error:
  241|     16|    { \
  242|     16|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  243|     16|    } \
property.c:lh_QUERY_doall:
  261|    220|    { \
  262|    220|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  263|    220|    } \
property.c:lh_QUERY_free:
  216|    192|    { \
  217|    192|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  218|    192|    } \
property.c:lh_QUERY_new:
  210|    192|    { \
  211|    192|        return (LHASH_OF(type) *) \
  212|    192|            OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
  213|    192|    } \
property.c:lh_QUERY_num_items:
  246|     28|    { \
  247|     28|        return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
  248|     28|    } \
property.c:lh_QUERY_flush:
  221|     28|    { \
  222|     28|        OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \
  223|     28|    } \
property.c:lh_QUERY_retrieve:
  236|  20.3k|    { \
  237|  20.3k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  238|  20.3k|    } \
property.c:lh_QUERY_insert:
  226|      5|    { \
  227|      5|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  228|      5|    } \
property.c:lh_QUERY_error:
  241|      5|    { \
  242|      5|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  243|      5|    } \
property_string.c:lh_PROPERTY_STRING_doall:
  261|      4|    { \
  262|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  263|      4|    } \
property_string.c:lh_PROPERTY_STRING_free:
  216|      4|    { \
  217|      4|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  218|      4|    } \
property_string.c:lh_PROPERTY_STRING_new:
  210|      4|    { \
  211|      4|        return (LHASH_OF(type) *) \
  212|      4|            OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
  213|      4|    } \
property_string.c:lh_PROPERTY_STRING_retrieve:
  236|    676|    { \
  237|    676|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  238|    676|    } \
property_string.c:lh_PROPERTY_STRING_insert:
  226|     30|    { \
  227|     30|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  228|     30|    } \
property_string.c:lh_PROPERTY_STRING_error:
  241|     30|    { \
  242|     30|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  243|     30|    } \
store_register.c:lh_OSSL_STORE_LOADER_free:
  216|      2|    { \
  217|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  218|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_new:
  210|      2|    { \
  211|      2|        return (LHASH_OF(type) *) \
  212|      2|            OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
  213|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall:
  261|      2|    { \
  262|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  263|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_free:
  216|      2|    { \
  217|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  218|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_retrieve:
  236|  59.7k|    { \
  237|  59.7k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  238|  59.7k|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_insert:
  226|    868|    { \
  227|    868|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  228|    868|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_error:
  241|    868|    { \
  242|    868|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  243|    868|    } \

obj_dat.c:OBJ_bsearch_obj:
  129|  1.31M|      { \
  130|  1.31M|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  1.31M|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  1.31M|      } \
obj_dat.c:obj_cmp_BSEARCH_CMP_FN:
  123|  13.4M|      { \
  124|  13.4M|      type1 const *a = a_; \
  125|  13.4M|      type2 const *b = b_; \
  126|  13.4M|      return nm##_cmp(a,b); \
  127|  13.4M|      } \
ameth_lib.c:OBJ_bsearch_ameth:
  129|   110k|      { \
  130|   110k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|   110k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|   110k|      } \
ameth_lib.c:ameth_cmp_BSEARCH_CMP_FN:
  123|   211k|      { \
  124|   211k|      type1 const *a = a_; \
  125|   211k|      type2 const *b = b_; \
  126|   211k|      return nm##_cmp(a,b); \
  127|   211k|      } \
v3_lib.c:OBJ_bsearch_ext:
  129|  21.7k|      { \
  130|  21.7k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  21.7k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  21.7k|      } \
v3_lib.c:ext_cmp_BSEARCH_CMP_FN:
  123|   113k|      { \
  124|   113k|      type1 const *a = a_; \
  125|   113k|      type2 const *b = b_; \
  126|   113k|      return nm##_cmp(a,b); \
  127|   113k|      } \

cms_lib.c:sk_CMS_CertificateChoices_num:
   70|   115k|    { \
   71|   115k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|   115k|    } \
cms_lib.c:sk_CMS_CertificateChoices_value:
   74|   114k|    { \
   75|   114k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|   114k|    } \
cms_sd.c:ossl_check_const_CMS_SignerInfo_sk_type:
   44|  3.29k|    { \
   45|  3.29k|        return (const OPENSSL_STACK *)sk; \
   46|  3.29k|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_sk_type:
   48|  84.0k|    { \
   49|  84.0k|        return (OPENSSL_STACK *)sk; \
   50|  84.0k|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_freefunc_type:
   60|  84.0k|    { \
   61|  84.0k|        return (OPENSSL_sk_freefunc)fr; \
   62|  84.0k|    }
ex_data.c:sk_EX_CALLBACK_pop_free:
  127|     36|    { \
  128|     36|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|     36|    } \
ex_data.c:sk_EX_CALLBACK_num:
   70|   972k|    { \
   71|   972k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|   972k|    } \
ex_data.c:ossl_check_void_sk_type:
   48|   486k|    { \
   49|   486k|        return (OPENSSL_STACK *)sk; \
   50|   486k|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_new_null:
   82|      2|    { \
   83|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_free:
   94|      2|    { \
   95|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_push:
  111|      2|    { \
  112|      2|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_num:
   70|      5|    { \
   71|      5|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      5|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_value:
   74|      2|    { \
   75|      2|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_delete:
  102|      2|    { \
  103|      2|        return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
  104|      2|    } \
provider_conf.c:sk_OSSL_PROVIDER_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
provider_core.c:sk_INFOPAIR_pop_free:
  127|      1|    { \
  128|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_new:
   78|      2|    { \
   79|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   80|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_new_null:
   82|      2|    { \
   83|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_value:
   74|  5.26k|    { \
   75|  5.26k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  5.26k|    } \
provider_core.c:sk_INFOPAIR_deep_copy:
  165|      1|    { \
  166|      1|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  167|      1|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  168|      1|                                            (OPENSSL_sk_freefunc)freefunc); \
  169|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_push:
  111|      1|    { \
  112|      1|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_dup:
  159|  1.75k|    { \
  160|  1.75k|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  161|  1.75k|    } \
provider_core.c:sk_OSSL_PROVIDER_num:
   70|  1.75k|    { \
   71|  1.75k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  1.75k|    } \
provider_core.c:sk_OSSL_PROVIDER_free:
   94|  1.75k|    { \
   95|  1.75k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|  1.75k|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_num:
   70|      1|    { \
   71|      1|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      1|    } \
o_names.c:sk_NAME_FUNCS_pop_free:
  127|      1|    { \
  128|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      1|    } \
obj_xref.c:sk_nid_triple_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
obj_xref.c:sk_nid_triple_free:
   94|      2|    { \
   95|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      2|    } \
property.c:sk_IMPLEMENTATION_pop_free:
  127|    192|    { \
  128|    192|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|    192|    } \
property.c:sk_IMPLEMENTATION_new_null:
   82|    192|    { \
   83|    192|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|    192|    } \
property.c:sk_IMPLEMENTATION_num:
   70|   129k|    { \
   71|   129k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|   129k|    } \
property.c:sk_IMPLEMENTATION_value:
   74|   154k|    { \
   75|   154k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|   154k|    } \
property.c:sk_IMPLEMENTATION_push:
  111|    220|    { \
  112|    220|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|    220|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_new:
   78|     61|    { \
   79|     61|        return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   80|     61|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_push:
  111|    213|    { \
  112|    213|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|    213|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_num:
   70|     61|    { \
   71|     61|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|     61|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_sort:
  151|     61|    { \
  152|     61|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  153|     61|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_value:
   74|    213|    { \
   75|    213|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|    213|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_pop_free:
  127|     61|    { \
  128|     61|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|     61|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_sk_type:
   48|     34|    { \
   49|     34|        return (OPENSSL_STACK *)sk; \
   50|     34|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_type:
   40|     30|    { \
   41|     30|        return ptr; \
   42|     30|    } \
property_string.c:ossl_check_const_OPENSSL_CSTRING_sk_type:
   44|    157|    { \
   45|    157|        return (const OPENSSL_STACK *)sk; \
   46|    157|    } \
rsa_backend.c:sk_BIGNUM_const_new_null:
   82|  11.9k|    { \
   83|  11.9k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|  11.9k|    } \
rsa_backend.c:sk_BIGNUM_const_free:
   94|  11.9k|    { \
   95|  11.9k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|  11.9k|    } \
rsa_lib.c:sk_RSA_PRIME_INFO_pop_free:
  127|  4.49k|    { \
  128|  4.49k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|  4.49k|    } \
rsa_ossl.c:sk_RSA_PRIME_INFO_num:
   70|  4.49k|    { \
   71|  4.49k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  4.49k|    } \
x509name.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   44|  6.43k|    { \
   45|  6.43k|        return (const OPENSSL_STACK *)sk; \
   46|  6.43k|    } \
x509name.c:ossl_check_X509_NAME_ENTRY_sk_type:
   48|  3.19k|    { \
   49|  3.19k|        return (OPENSSL_STACK *)sk; \
   50|  3.19k|    } \
x509name.c:ossl_check_X509_NAME_ENTRY_type:
   40|  3.19k|    { \
   41|  3.19k|        return ptr; \
   42|  3.19k|    } \
x_crl.c:ossl_check_GENERAL_NAMES_sk_type:
   48|  41.9k|    { \
   49|  41.9k|        return (OPENSSL_STACK *)sk; \
   50|  41.9k|    } \
x_crl.c:ossl_check_GENERAL_NAMES_freefunc_type:
   60|  41.4k|    { \
   61|  41.4k|        return (OPENSSL_sk_freefunc)fr; \
   62|  41.4k|    }
x_crl.c:ossl_check_const_X509_EXTENSION_sk_type:
   44|  70.5k|    { \
   45|  70.5k|        return (const OPENSSL_STACK *)sk; \
   46|  70.5k|    } \
x_crl.c:ossl_check_const_X509_REVOKED_sk_type:
   44|  27.6k|    { \
   45|  27.6k|        return (const OPENSSL_STACK *)sk; \
   46|  27.6k|    } \
x_crl.c:ossl_check_GENERAL_NAMES_type:
   40|    421|    { \
   41|    421|        return ptr; \
   42|    421|    } \
x_crl.c:ossl_check_X509_REVOKED_compfunc_type:
   52|  1.44k|    { \
   53|  1.44k|        return (OPENSSL_sk_compfunc)cmp; \
   54|  1.44k|    } \
x_crl.c:ossl_check_X509_REVOKED_sk_type:
   48|  1.44k|    { \
   49|  1.44k|        return (OPENSSL_STACK *)sk; \
   50|  1.44k|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_sk_type:
   48|  6.58M|    { \
   49|  6.58M|        return (OPENSSL_STACK *)sk; \
   50|  6.58M|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_freefunc_type:
   60|   296k|    { \
   61|   296k|        return (OPENSSL_sk_freefunc)fr; \
   62|   296k|    }
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_num:
   70|  3.20M|    { \
   71|  3.20M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  3.20M|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_value:
   74|  3.06M|    { \
   75|  3.06M|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  3.06M|    } \
x_name.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   44|  8.04M|    { \
   45|  8.04M|        return (const OPENSSL_STACK *)sk; \
   46|  8.04M|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_type:
   40|  3.21M|    { \
   41|  3.21M|        return ptr; \
   42|  3.21M|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_new_null:
   82|  5.18k|    { \
   83|  5.18k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|  5.18k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_push:
  111|  15.3k|    { \
  112|  15.3k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|  15.3k|    } \
x_name.c:ossl_check_const_ASN1_VALUE_sk_type:
   44|  34.9k|    { \
   45|  34.9k|        return (const OPENSSL_STACK *)sk; \
   46|  34.9k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_pop_free:
  127|   148k|    { \
  128|   148k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|   148k|    } \
x_x509.c:ossl_check_IPAddressFamily_sk_type:
   48|   118k|    { \
   49|   118k|        return (OPENSSL_STACK *)sk; \
   50|   118k|    } \
x_x509.c:ossl_check_IPAddressFamily_freefunc_type:
   60|   118k|    { \
   61|   118k|        return (OPENSSL_sk_freefunc)fr; \
   62|   118k|    }
tasn_dec.c:ossl_check_const_ASN1_VALUE_sk_type:
   44|  5.39k|    { \
   45|  5.39k|        return (const OPENSSL_STACK *)sk; \
   46|  5.39k|    } \
tasn_dec.c:ossl_check_ASN1_VALUE_sk_type:
   48|  4.71M|    { \
   49|  4.71M|        return (OPENSSL_STACK *)sk; \
   50|  4.71M|    } \
tasn_dec.c:ossl_check_ASN1_VALUE_type:
   40|  4.71M|    { \
   41|  4.71M|        return ptr; \
   42|  4.71M|    } \
tasn_enc.c:sk_const_ASN1_VALUE_num:
   70|  13.2M|    { \
   71|  13.2M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  13.2M|    } \
tasn_enc.c:sk_const_ASN1_VALUE_value:
   74|  10.8M|    { \
   75|  10.8M|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  10.8M|    } \
tasn_fre.c:ossl_check_const_ASN1_VALUE_sk_type:
   44|  2.17M|    { \
   45|  2.17M|        return (const OPENSSL_STACK *)sk; \
   46|  2.17M|    } \
tasn_fre.c:ossl_check_ASN1_VALUE_sk_type:
   48|   477k|    { \
   49|   477k|        return (OPENSSL_STACK *)sk; \
   50|   477k|    } \
cms_env.c:ossl_check_const_CMS_RecipientInfo_sk_type:
   44|  4.60k|    { \
   45|  4.60k|        return (const OPENSSL_STACK *)sk; \
   46|  4.60k|    } \
conf_mod.c:sk_CONF_MODULE_num:
   70|      4|    { \
   71|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      4|    } \
conf_mod.c:sk_CONF_MODULE_free:
   94|      2|    { \
   95|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      2|    } \
conf_mod.c:sk_CONF_IMODULE_num:
   70|      2|    { \
   71|      2|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      2|    } \
conf_mod.c:sk_CONF_IMODULE_free:
   94|      4|    { \
   95|      4|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      4|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_new_null:
   82|     14|    { \
   83|     14|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|     14|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_push:
  111|     75|    { \
  112|     75|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|     75|    } \
decoder_lib.c:sk_OSSL_DECODER_new_null:
   82|     14|    { \
   83|     14|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|     14|    } \
decoder_lib.c:sk_OSSL_DECODER_push:
  111|    560|    { \
  112|    560|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|    560|    } \
decoder_lib.c:sk_OSSL_DECODER_num:
   70|     14|    { \
   71|     14|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|     14|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_num:
   70|   109k|    { \
   71|   109k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|   109k|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_value:
   74|   356k|    { \
   75|   356k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|   356k|    } \
decoder_lib.c:sk_OSSL_DECODER_value:
   74|  6.00k|    { \
   75|  6.00k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  6.00k|    } \
decoder_lib.c:sk_OSSL_DECODER_pop_free:
  127|     14|    { \
  128|     14|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|     14|    } \
decoder_meth.c:sk_OSSL_DECODER_INSTANCE_pop_free:
  127|  59.7k|    { \
  128|  59.7k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|  59.7k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_new_null:
   82|    868|    { \
   83|    868|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|    868|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_push:
  111|     15|    { \
  112|     15|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|     15|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_num:
   70|  47.0k|    { \
   71|  47.0k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  47.0k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_value:
   74|  29.9k|    { \
   75|  29.9k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  29.9k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_pop_free:
  127|  55.4k|    { \
  128|  55.4k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|  55.4k|    } \
decoder_pkey.c:sk_OSSL_DECODER_INSTANCE_deep_copy:
  165|  54.6k|    { \
  166|  54.6k|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  167|  54.6k|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  168|  54.6k|                                            (OPENSSL_sk_freefunc)freefunc); \
  169|  54.6k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_deep_copy:
  165|  54.6k|    { \
  166|  54.6k|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  167|  54.6k|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  168|  54.6k|                                            (OPENSSL_sk_freefunc)freefunc); \
  169|  54.6k|    } \
evp_pbe.c:sk_EVP_PBE_CTL_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
keymgmt_lib.c:sk_OP_CACHE_ELEM_pop_free:
  127|  84.0k|    { \
  128|  84.0k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|  84.0k|    } \
v3_crld.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   44|  9.04k|    { \
   45|  9.04k|        return (const OPENSSL_STACK *)sk; \
   46|  9.04k|    } \
v3_lib.c:ossl_check_const_X509_EXTENSION_sk_type:
   44|   258k|    { \
   45|   258k|        return (const OPENSSL_STACK *)sk; \
   46|   258k|    } \

ossl_prov_bio_from_dispatch:
   27|      1|{
   28|     48|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (28:12): [True: 47, False: 1]
  ------------------
   29|     47|        switch (fns->function_id) {
  ------------------
  |  Branch (29:17): [True: 37, False: 10]
  ------------------
   30|      1|        case OSSL_FUNC_BIO_NEW_FILE:
  ------------------
  |  |  148|      1|#define OSSL_FUNC_BIO_NEW_FILE                40
  ------------------
  |  Branch (30:9): [True: 1, False: 46]
  ------------------
   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:
  ------------------
  |  |  149|      1|#define OSSL_FUNC_BIO_NEW_MEMBUF              41
  ------------------
  |  Branch (34:9): [True: 1, False: 46]
  ------------------
   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:
  ------------------
  |  |  150|      1|#define OSSL_FUNC_BIO_READ_EX                 42
  ------------------
  |  Branch (38:9): [True: 1, False: 46]
  ------------------
   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:
  ------------------
  |  |  151|      1|#define OSSL_FUNC_BIO_WRITE_EX                43
  ------------------
  |  Branch (42:9): [True: 1, False: 46]
  ------------------
   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:
  ------------------
  |  |  157|      1|#define OSSL_FUNC_BIO_GETS                    49
  ------------------
  |  Branch (46:9): [True: 1, False: 46]
  ------------------
   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:
  ------------------
  |  |  156|      1|#define OSSL_FUNC_BIO_PUTS                    48
  ------------------
  |  Branch (50:9): [True: 1, False: 46]
  ------------------
   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:
  ------------------
  |  |  158|      1|#define OSSL_FUNC_BIO_CTRL                    50
  ------------------
  |  Branch (54:9): [True: 1, False: 46]
  ------------------
   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:
  ------------------
  |  |  152|      1|#define OSSL_FUNC_BIO_UP_REF                  44
  ------------------
  |  Branch (58:9): [True: 1, False: 46]
  ------------------
   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:
  ------------------
  |  |  153|      1|#define OSSL_FUNC_BIO_FREE                    45
  ------------------
  |  Branch (62:9): [True: 1, False: 46]
  ------------------
   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:
  ------------------
  |  |  154|      1|#define OSSL_FUNC_BIO_VPRINTF                 46
  ------------------
  |  Branch (66:9): [True: 1, False: 46]
  ------------------
   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|     47|        }
   71|     47|    }
   72|       |
   73|      1|    return 1;
   74|      1|}
ossl_prov_bio_read_ex:
   92|  1.38M|{
   93|  1.38M|    if (c_bio_read_ex == NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 1.38M]
  ------------------
   94|      0|        return 0;
   95|  1.38M|    return c_bio_read_ex(bio, data, data_len, bytes_read);
   96|  1.38M|}
ossl_prov_bio_up_ref:
  128|   109k|{
  129|   109k|    if (c_bio_up_ref == NULL)
  ------------------
  |  Branch (129:9): [True: 0, False: 109k]
  ------------------
  130|      0|        return 0;
  131|   109k|    return c_bio_up_ref(bio);
  132|   109k|}
ossl_prov_bio_free:
  135|   109k|{
  136|   109k|    if (c_bio_free == NULL)
  ------------------
  |  Branch (136:9): [True: 0, False: 109k]
  ------------------
  137|      0|        return 0;
  138|   109k|    return c_bio_free(bio);
  139|   109k|}
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|   109k|{
  228|   109k|    BIO *outbio;
  229|   109k|    BIO_METHOD *corebiometh = ossl_prov_ctx_get0_core_bio_method(provctx);
  230|       |
  231|   109k|    if (corebiometh == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 109k]
  ------------------
  232|      0|        return NULL;
  233|       |
  234|   109k|    if ((outbio = BIO_new(corebiometh)) == NULL)
  ------------------
  |  Branch (234:9): [True: 0, False: 109k]
  ------------------
  235|      0|        return NULL;
  236|   109k|    if (!ossl_prov_bio_up_ref(corebio)) {
  ------------------
  |  Branch (236:9): [True: 0, False: 109k]
  ------------------
  237|      0|        BIO_free(outbio);
  238|      0|        return NULL;
  239|      0|    }
  240|   109k|    BIO_set_data(outbio, corebio);
  241|   109k|    return outbio;
  242|   109k|}
bio_prov.c:bio_core_read_ex:
  166|  1.38M|{
  167|  1.38M|    return ossl_prov_bio_read_ex(BIO_get_data(bio), data, data_len, bytes_read);
  168|  1.38M|}
bio_prov.c:bio_core_new:
  192|   109k|{
  193|   109k|    BIO_set_init(bio, 1);
  194|       |
  195|   109k|    return 1;
  196|   109k|}
bio_prov.c:bio_core_free:
  199|   109k|{
  200|   109k|    BIO_set_init(bio, 0);
  201|   109k|    ossl_prov_bio_free(BIO_get_data(bio));
  202|       |
  203|   109k|    return 1;
  204|   109k|}

ossl_prov_ctx_new:
   15|      1|{
   16|      1|    return OPENSSL_zalloc(sizeof(PROV_CTX));
  ------------------
  |  |   99|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   17|      1|}
ossl_prov_ctx_free:
   20|      1|{
   21|      1|    OPENSSL_free(ctx);
  ------------------
  |  |  107|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   22|      1|}
ossl_prov_ctx_set0_libctx:
   25|      1|{
   26|      1|    if (ctx != NULL)
  ------------------
  |  Branch (26:9): [True: 1, False: 0]
  ------------------
   27|      1|        ctx->libctx = libctx;
   28|      1|}
ossl_prov_ctx_set0_handle:
   31|      1|{
   32|      1|    if (ctx != NULL)
  ------------------
  |  Branch (32:9): [True: 1, False: 0]
  ------------------
   33|      1|        ctx->handle = handle;
   34|      1|}
ossl_prov_ctx_set0_core_bio_method:
   37|      1|{
   38|      1|    if (ctx != NULL)
  ------------------
  |  Branch (38:9): [True: 1, False: 0]
  ------------------
   39|      1|        ctx->corebiometh = corebiometh;
   40|      1|}
ossl_prov_ctx_get0_libctx:
   43|  84.2k|{
   44|  84.2k|    if (ctx == NULL)
  ------------------
  |  Branch (44:9): [True: 0, False: 84.2k]
  ------------------
   45|      0|        return NULL;
   46|  84.2k|    return ctx->libctx;
   47|  84.2k|}
ossl_prov_ctx_get0_core_bio_method:
   57|   109k|{
   58|   109k|    if (ctx == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 109k]
  ------------------
   59|      0|        return NULL;
   60|   109k|    return ctx->corebiometh;
   61|   109k|}

ossl_err_load_PROV_strings:
  230|      2|{
  231|      2|#ifndef OPENSSL_NO_ERR
  232|      2|    if (ERR_reason_error_string(PROV_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (232:9): [True: 2, False: 0]
  ------------------
  233|      2|        ERR_load_strings_const(PROV_str_reasons);
  234|      2|#endif
  235|      2|    return 1;
  236|      2|}

ossl_prov_seeding_from_dispatch:
   19|      1|{
   20|     48|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (20:12): [True: 47, False: 1]
  ------------------
   21|       |        /*
   22|       |         * We do not support the scenario of an application linked against
   23|       |         * multiple versions of libcrypto (e.g. one static and one dynamic), but
   24|       |         * sharing a single fips.so. We do a simple sanity check here.
   25|       |         */
   26|     47|#define set_func(c, f) \
   27|     47|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
   28|     47|        switch (fns->function_id) {
  ------------------
  |  Branch (28:17): [True: 43, False: 4]
  ------------------
   29|      1|        case OSSL_FUNC_GET_ENTROPY:
  ------------------
  |  |  184|      1|#define OSSL_FUNC_GET_ENTROPY                101
  ------------------
  |  Branch (29:9): [True: 1, False: 46]
  ------------------
   30|      1|            set_func(c_get_entropy, OSSL_FUNC_get_entropy(fns));
  ------------------
  |  |   27|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (27:14): [True: 1, False: 0]
  |  |  |  Branch (27:41): [True: 0, False: 0]
  |  |  |  Branch (27:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   31|      1|            break;
   32|      1|        case OSSL_FUNC_CLEANUP_ENTROPY:
  ------------------
  |  |  185|      1|#define OSSL_FUNC_CLEANUP_ENTROPY            102
  ------------------
  |  Branch (32:9): [True: 1, False: 46]
  ------------------
   33|      1|            set_func(c_cleanup_entropy, OSSL_FUNC_cleanup_entropy(fns));
  ------------------
  |  |   27|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (27:14): [True: 1, False: 0]
  |  |  |  Branch (27:41): [True: 0, False: 0]
  |  |  |  Branch (27:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   34|      1|            break;
   35|      1|        case OSSL_FUNC_GET_NONCE:
  ------------------
  |  |  186|      1|#define OSSL_FUNC_GET_NONCE                  103
  ------------------
  |  Branch (35:9): [True: 1, False: 46]
  ------------------
   36|      1|            set_func(c_get_nonce, OSSL_FUNC_get_nonce(fns));
  ------------------
  |  |   27|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (27:14): [True: 1, False: 0]
  |  |  |  Branch (27:41): [True: 0, False: 0]
  |  |  |  Branch (27:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   37|      1|            break;
   38|      1|        case OSSL_FUNC_CLEANUP_NONCE:
  ------------------
  |  |  187|      1|#define OSSL_FUNC_CLEANUP_NONCE              104
  ------------------
  |  Branch (38:9): [True: 1, False: 46]
  ------------------
   39|      1|            set_func(c_cleanup_nonce, OSSL_FUNC_cleanup_nonce(fns));
  ------------------
  |  |   27|      1|    do { if (c == NULL) c = f; else if (c != f) return 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (27:14): [True: 1, False: 0]
  |  |  |  Branch (27:41): [True: 0, False: 0]
  |  |  |  Branch (27:68): [Folded - Ignored]
  |  |  ------------------
  ------------------
   40|      1|            break;
   41|     47|        }
   42|     47|#undef set_func
   43|     47|    }
   44|      1|    return 1;
   45|      1|}

ossl_prov_cache_exported_algorithms:
  342|      1|{
  343|      1|    int i, j;
  344|       |
  345|      1|    if (out[0].algorithm_names == NULL) {
  ------------------
  |  Branch (345:9): [True: 1, False: 0]
  ------------------
  346|    131|        for (i = j = 0; in[i].alg.algorithm_names != NULL; ++i) {
  ------------------
  |  Branch (346:25): [True: 130, False: 1]
  ------------------
  347|    130|            if (in[i].capable == NULL || in[i].capable())
  ------------------
  |  Branch (347:17): [True: 126, False: 4]
  |  Branch (347:42): [True: 4, False: 0]
  ------------------
  348|    130|                out[j++] = in[i].alg;
  349|    130|        }
  350|      1|        out[j++] = in[i].alg;
  351|      1|    }
  352|      1|}

ossl_default_provider_init:
  578|      1|{
  579|      1|    OSSL_FUNC_core_get_libctx_fn *c_get_libctx = NULL;
  580|      1|    BIO_METHOD *corebiometh;
  581|       |
  582|      1|    if (!ossl_prov_bio_from_dispatch(in)
  ------------------
  |  Branch (582:9): [True: 0, False: 1]
  ------------------
  583|      1|            || !ossl_prov_seeding_from_dispatch(in))
  ------------------
  |  Branch (583:16): [True: 0, False: 1]
  ------------------
  584|      0|        return 0;
  585|     48|    for (; in->function_id != 0; in++) {
  ------------------
  |  Branch (585:12): [True: 47, False: 1]
  ------------------
  586|     47|        switch (in->function_id) {
  587|      1|        case OSSL_FUNC_CORE_GETTABLE_PARAMS:
  ------------------
  |  |   63|      1|# define OSSL_FUNC_CORE_GETTABLE_PARAMS        1
  ------------------
  |  Branch (587:9): [True: 1, False: 46]
  ------------------
  588|      1|            c_gettable_params = OSSL_FUNC_core_gettable_params(in);
  589|      1|            break;
  590|      1|        case OSSL_FUNC_CORE_GET_PARAMS:
  ------------------
  |  |   66|      1|# define OSSL_FUNC_CORE_GET_PARAMS             2
  ------------------
  |  Branch (590:9): [True: 1, False: 46]
  ------------------
  591|      1|            c_get_params = OSSL_FUNC_core_get_params(in);
  592|      1|            break;
  593|      1|        case OSSL_FUNC_CORE_GET_LIBCTX:
  ------------------
  |  |   73|      1|# define OSSL_FUNC_CORE_GET_LIBCTX             4
  ------------------
  |  Branch (593:9): [True: 1, False: 46]
  ------------------
  594|      1|            c_get_libctx = OSSL_FUNC_core_get_libctx(in);
  595|      1|            break;
  596|     44|        default:
  ------------------
  |  Branch (596:9): [True: 44, False: 3]
  ------------------
  597|       |            /* Just ignore anything we don't understand */
  598|     44|            break;
  599|     47|        }
  600|     47|    }
  601|       |
  602|      1|    if (c_get_libctx == NULL)
  ------------------
  |  Branch (602:9): [True: 0, False: 1]
  ------------------
  603|      0|        return 0;
  604|       |
  605|       |    /*
  606|       |     * We want to make sure that all calls from this provider that requires
  607|       |     * a library context use the same context as the one used to call our
  608|       |     * functions.  We do that by passing it along in the provider context.
  609|       |     *
  610|       |     * This only works for built-in providers.  Most providers should
  611|       |     * create their own library context.
  612|       |     */
  613|      1|    if ((*provctx = ossl_prov_ctx_new()) == NULL
  ------------------
  |  Branch (613:9): [True: 0, False: 1]
  ------------------
  614|      1|            || (corebiometh = ossl_bio_prov_init_bio_method()) == NULL) {
  ------------------
  |  Branch (614:16): [True: 0, False: 1]
  ------------------
  615|      0|        ossl_prov_ctx_free(*provctx);
  616|      0|        *provctx = NULL;
  617|      0|        return 0;
  618|      0|    }
  619|      1|    ossl_prov_ctx_set0_libctx(*provctx,
  620|      1|                                       (OSSL_LIB_CTX *)c_get_libctx(handle));
  621|      1|    ossl_prov_ctx_set0_handle(*provctx, handle);
  622|      1|    ossl_prov_ctx_set0_core_bio_method(*provctx, corebiometh);
  623|       |
  624|      1|    *out = deflt_dispatch_table;
  625|      1|    ossl_prov_cache_exported_algorithms(deflt_ciphers, exported_ciphers);
  626|       |
  627|      1|    return 1;
  628|      1|}
defltprov.c:deflt_teardown:
  556|      1|{
  557|      1|    BIO_meth_free(ossl_prov_ctx_get0_core_bio_method(provctx));
  558|      1|    ossl_prov_ctx_free(provctx);
  559|      1|}
defltprov.c:deflt_query:
  521|  1.75k|{
  522|  1.75k|    *no_cache = 0;
  523|  1.75k|    switch (operation_id) {
  ------------------
  |  Branch (523:13): [True: 0, False: 1.75k]
  ------------------
  524|      1|    case OSSL_OP_DIGEST:
  ------------------
  |  |  254|      1|# define OSSL_OP_DIGEST                              1
  ------------------
  |  Branch (524:5): [True: 1, False: 1.75k]
  ------------------
  525|      1|        return deflt_digests;
  526|      2|    case OSSL_OP_CIPHER:
  ------------------
  |  |  255|      2|# define OSSL_OP_CIPHER                              2   /* Symmetric Ciphers */
  ------------------
  |  Branch (526:5): [True: 2, False: 1.75k]
  ------------------
  527|      2|        return exported_ciphers;
  528|      0|    case OSSL_OP_MAC:
  ------------------
  |  |  256|      0|# define OSSL_OP_MAC                                 3
  ------------------
  |  Branch (528:5): [True: 0, False: 1.75k]
  ------------------
  529|      0|        return deflt_macs;
  530|      0|    case OSSL_OP_KDF:
  ------------------
  |  |  257|      0|# define OSSL_OP_KDF                                 4
  ------------------
  |  Branch (530:5): [True: 0, False: 1.75k]
  ------------------
  531|      0|        return deflt_kdfs;
  532|      2|    case OSSL_OP_RAND:
  ------------------
  |  |  258|      2|# define OSSL_OP_RAND                                5
  ------------------
  |  Branch (532:5): [True: 2, False: 1.75k]
  ------------------
  533|      2|        return deflt_rands;
  534|    868|    case OSSL_OP_KEYMGMT:
  ------------------
  |  |  259|    868|# define OSSL_OP_KEYMGMT                            10
  ------------------
  |  Branch (534:5): [True: 868, False: 887]
  ------------------
  535|    868|        return deflt_keymgmt;
  536|      0|    case OSSL_OP_KEYEXCH:
  ------------------
  |  |  260|      0|# define OSSL_OP_KEYEXCH                            11
  ------------------
  |  Branch (536:5): [True: 0, False: 1.75k]
  ------------------
  537|      0|        return deflt_keyexch;
  538|      0|    case OSSL_OP_SIGNATURE:
  ------------------
  |  |  261|      0|# define OSSL_OP_SIGNATURE                          12
  ------------------
  |  Branch (538:5): [True: 0, False: 1.75k]
  ------------------
  539|      0|        return deflt_signature;
  540|      0|    case OSSL_OP_ASYM_CIPHER:
  ------------------
  |  |  262|      0|# define OSSL_OP_ASYM_CIPHER                        13
  ------------------
  |  Branch (540:5): [True: 0, False: 1.75k]
  ------------------
  541|      0|        return deflt_asym_cipher;
  542|      0|    case OSSL_OP_KEM:
  ------------------
  |  |  263|      0|# define OSSL_OP_KEM                                14
  ------------------
  |  Branch (542:5): [True: 0, False: 1.75k]
  ------------------
  543|      0|        return deflt_asym_kem;
  544|      0|    case OSSL_OP_ENCODER:
  ------------------
  |  |  265|      0|# define OSSL_OP_ENCODER                            20
  ------------------
  |  Branch (544:5): [True: 0, False: 1.75k]
  ------------------
  545|      0|        return deflt_encoder;
  546|    882|    case OSSL_OP_DECODER:
  ------------------
  |  |  266|    882|# define OSSL_OP_DECODER                            21
  ------------------
  |  Branch (546:5): [True: 882, False: 873]
  ------------------
  547|    882|        return deflt_decoder;
  548|      0|    case OSSL_OP_STORE:
  ------------------
  |  |  267|      0|# define OSSL_OP_STORE                              22
  ------------------
  |  Branch (548:5): [True: 0, False: 1.75k]
  ------------------
  549|      0|        return deflt_store;
  550|  1.75k|    }
  551|      0|    return NULL;
  552|  1.75k|}

cipher_aes.c:aes_freectx:
   27|      5|{
   28|      5|    PROV_AES_CTX *ctx = (PROV_AES_CTX *)vctx;
   29|       |
   30|      5|    ossl_cipher_generic_reset_ctx((PROV_CIPHER_CTX *)vctx);
   31|      5|    OPENSSL_clear_free(ctx,  sizeof(*ctx));
  ------------------
  |  |  105|      5|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   32|      5|}

cipher_aes_cbc_hmac_sha.c:aes_128_cbc_hmac_sha1_get_params:
  398|      1|static int nm##_##kbits##_##sub##_get_params(OSSL_PARAM params[])              \
  399|      1|{                                                                              \
  400|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,           \
  ------------------
  |  |  300|      1|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  401|      1|                                          flags, kbits, blkbits, ivbits);      \
  402|      1|}                                                                              \
cipher_aes_cbc_hmac_sha.c:aes_gettable_ctx_params:
  305|      4|{
  306|      4|    return cipher_aes_known_gettable_ctx_params;
  307|      4|}
cipher_aes_cbc_hmac_sha.c:aes_256_cbc_hmac_sha1_get_params:
  398|      1|static int nm##_##kbits##_##sub##_get_params(OSSL_PARAM params[])              \
  399|      1|{                                                                              \
  400|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,           \
  ------------------
  |  |  300|      1|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  401|      1|                                          flags, kbits, blkbits, ivbits);      \
  402|      1|}                                                                              \
cipher_aes_cbc_hmac_sha.c:aes_128_cbc_hmac_sha256_get_params:
  398|      1|static int nm##_##kbits##_##sub##_get_params(OSSL_PARAM params[])              \
  399|      1|{                                                                              \
  400|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,           \
  ------------------
  |  |  300|      1|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  401|      1|                                          flags, kbits, blkbits, ivbits);      \
  402|      1|}                                                                              \
cipher_aes_cbc_hmac_sha.c:aes_256_cbc_hmac_sha256_get_params:
  398|      1|static int nm##_##kbits##_##sub##_get_params(OSSL_PARAM params[])              \
  399|      1|{                                                                              \
  400|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,           \
  ------------------
  |  |  300|      1|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  401|      1|                                          flags, kbits, blkbits, ivbits);      \
  402|      1|}                                                                              \

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

ossl_cipher_capable_aes_cbc_hmac_sha256:
   41|      2|{
   42|      2|    return AESNI_CBC_HMAC_SHA_CAPABLE
  ------------------
  |  |  162|      4|#  define AESNI_CBC_HMAC_SHA_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (162: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|}

cipher_aes_gcm_siv.c:ossl_aes_128_gcm_siv_get_params:
  294|      1|static int ossl_##alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])                                \
  295|      1|{                                                                                                       \
  296|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                             \
  297|      1|                                          flags, kbits, blkbits, ivbits);                               \
  298|      1|}                                                                                                       \
cipher_aes_gcm_siv.c:ossl_aes_gcm_siv_gettable_ctx_params:
  218|      3|{
  219|      3|    return aes_gcm_siv_known_gettable_ctx_params;
  220|      3|}
cipher_aes_gcm_siv.c:ossl_aes_192_gcm_siv_get_params:
  294|      1|static int ossl_##alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])                                \
  295|      1|{                                                                                                       \
  296|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                             \
  297|      1|                                          flags, kbits, blkbits, ivbits);                               \
  298|      1|}                                                                                                       \
cipher_aes_gcm_siv.c:ossl_aes_256_gcm_siv_get_params:
  294|      1|static int ossl_##alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])                                \
  295|      1|{                                                                                                       \
  296|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                             \
  297|      1|                                          flags, kbits, blkbits, ivbits);                               \
  298|      1|}                                                                                                       \

ossl_prov_cipher_hw_aes_ecb:
  133|      3|const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_##mode(size_t keybits)           \
  134|      3|{                                                                              \
  135|      3|    PROV_CIPHER_HW_select(mode)                                                \
  ------------------
  |  |   82|      3|#define PROV_CIPHER_HW_select(mode)                                            \
  |  |   83|      3|if (AESNI_CAPABLE)                                                             \
  |  |  ------------------
  |  |  |  |  180|      3|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:27): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   84|      3|    return &aesni_##mode;
  ------------------
  136|      3|    return &aes_##mode;                                                        \
  137|      3|}
ossl_prov_cipher_hw_aes_ctr:
  133|      2|const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_##mode(size_t keybits)           \
  134|      2|{                                                                              \
  135|      2|    PROV_CIPHER_HW_select(mode)                                                \
  ------------------
  |  |   82|      2|#define PROV_CIPHER_HW_select(mode)                                            \
  |  |   83|      2|if (AESNI_CAPABLE)                                                             \
  |  |  ------------------
  |  |  |  |  180|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (180:27): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   84|      2|    return &aesni_##mode;
  ------------------
  136|      2|    return &aes_##mode;                                                        \
  137|      2|}

cipher_aes_hw.c:cipher_hw_aesni_initkey:
   23|  15.2k|{
   24|  15.2k|    int ret;
   25|  15.2k|    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
   26|  15.2k|    AES_KEY *ks = &adat->ks.ks;
   27|       |
   28|  15.2k|    dat->ks = ks;
   29|       |
   30|  15.2k|    if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  299|  30.5k|# define         EVP_CIPH_ECB_MODE               0x1
  ------------------
                  if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  300|  7.62k|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (30:10): [True: 7.63k, False: 7.62k]
  |  Branch (30:44): [True: 0, False: 7.62k]
  ------------------
   31|  15.2k|        && !dat->enc) {
  ------------------
  |  Branch (31:12): [True: 0, False: 7.63k]
  ------------------
   32|      0|        ret = aesni_set_decrypt_key(key, keylen * 8, ks);
   33|      0|        dat->block = (block128_f) aesni_decrypt;
   34|      0|        dat->stream.cbc = dat->mode == EVP_CIPH_CBC_MODE ?
  ------------------
  |  |  300|      0|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (34:27): [True: 0, False: 0]
  ------------------
   35|      0|            (cbc128_f) aesni_cbc_encrypt : NULL;
   36|  15.2k|    } else {
   37|  15.2k|        ret = aesni_set_encrypt_key(key, keylen * 8, ks);
   38|  15.2k|        dat->block = (block128_f) aesni_encrypt;
   39|  15.2k|        if (dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  300|  15.2k|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (39:13): [True: 0, False: 15.2k]
  ------------------
   40|      0|            dat->stream.cbc = (cbc128_f) aesni_cbc_encrypt;
   41|  15.2k|        else if (dat->mode == EVP_CIPH_CTR_MODE)
  ------------------
  |  |  303|  15.2k|# define         EVP_CIPH_CTR_MODE               0x5
  ------------------
  |  Branch (41:18): [True: 7.62k, False: 7.63k]
  ------------------
   42|  7.62k|            dat->stream.ctr = (ctr128_f) aesni_ctr32_encrypt_blocks;
   43|  7.63k|        else
   44|  7.63k|            dat->stream.cbc = NULL;
   45|  15.2k|    }
   46|       |
   47|  15.2k|    if (ret < 0) {
  ------------------
  |  Branch (47:9): [True: 0, False: 15.2k]
  ------------------
   48|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   49|      0|        return 0;
   50|      0|    }
   51|       |
   52|  15.2k|    return 1;
   53|  15.2k|}
cipher_aes_hw.c:cipher_hw_aesni_ecb:
   67|  7.64k|{
   68|  7.64k|    if (len < ctx->blocksize)
  ------------------
  |  Branch (68:9): [True: 0, False: 7.64k]
  ------------------
   69|      0|        return 1;
   70|       |
   71|  7.64k|    aesni_ecb_encrypt(in, out, len, ctx->ks, ctx->enc);
   72|       |
   73|  7.64k|    return 1;
   74|  7.64k|}

cipher_aes_ocb.c:aes_256_ocb_get_params:
  519|      1|static int aes_##kbits##_##mode##_get_params(OSSL_PARAM params[])              \
  520|      1|{                                                                              \
  521|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  522|      1|                                          flags, kbits, blkbits, ivbits);      \
  523|      1|}                                                                              \
cipher_aes_ocb.c:cipher_ocb_gettable_ctx_params:
  479|      3|{
  480|      3|    return cipher_ocb_known_gettable_ctx_params;
  481|      3|}
cipher_aes_ocb.c:aes_192_ocb_get_params:
  519|      1|static int aes_##kbits##_##mode##_get_params(OSSL_PARAM params[])              \
  520|      1|{                                                                              \
  521|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  522|      1|                                          flags, kbits, blkbits, ivbits);      \
  523|      1|}                                                                              \
cipher_aes_ocb.c:aes_128_ocb_get_params:
  519|      1|static int aes_##kbits##_##mode##_get_params(OSSL_PARAM params[])              \
  520|      1|{                                                                              \
  521|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  522|      1|                                          flags, kbits, blkbits, ivbits);      \
  523|      1|}                                                                              \

cipher_aes_siv.c:aes_128_siv_get_params:
  269|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
  270|      1|{                                                                              \
  271|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  272|      1|                                          flags, 2*kbits, blkbits, ivbits);    \
  273|      1|}                                                                              \
cipher_aes_siv.c:aes_siv_gettable_ctx_params:
  195|      3|{
  196|      3|    return aes_siv_known_gettable_ctx_params;
  197|      3|}
cipher_aes_siv.c:aes_192_siv_get_params:
  269|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
  270|      1|{                                                                              \
  271|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  272|      1|                                          flags, 2*kbits, blkbits, ivbits);    \
  273|      1|}                                                                              \
cipher_aes_siv.c:aes_256_siv_get_params:
  269|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
  270|      1|{                                                                              \
  271|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  272|      1|                                          flags, 2*kbits, blkbits, ivbits);    \
  273|      1|}                                                                              \

cipher_aes_wrp.c:aes_256_wrap_get_params:
  286|      1|    {                                                                          \
  287|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  288|      1|                                              flags, kbits, blkbits, ivbits);  \
  289|      1|    }                                                                          \
cipher_aes_wrp.c:aes_192_wrap_get_params:
  286|      1|    {                                                                          \
  287|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  288|      1|                                              flags, kbits, blkbits, ivbits);  \
  289|      1|    }                                                                          \
cipher_aes_wrp.c:aes_128_wrap_get_params:
  286|      1|    {                                                                          \
  287|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  288|      1|                                              flags, kbits, blkbits, ivbits);  \
  289|      1|    }                                                                          \
cipher_aes_wrp.c:aes_256_wrappad_get_params:
  286|      1|    {                                                                          \
  287|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  288|      1|                                              flags, kbits, blkbits, ivbits);  \
  289|      1|    }                                                                          \
cipher_aes_wrp.c:aes_192_wrappad_get_params:
  286|      1|    {                                                                          \
  287|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  288|      1|                                              flags, kbits, blkbits, ivbits);  \
  289|      1|    }                                                                          \
cipher_aes_wrp.c:aes_128_wrappad_get_params:
  286|      1|    {                                                                          \
  287|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  288|      1|                                              flags, kbits, blkbits, ivbits);  \
  289|      1|    }                                                                          \
cipher_aes_wrp.c:aes_256_wrapinv_get_params:
  286|      1|    {                                                                          \
  287|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  288|      1|                                              flags, kbits, blkbits, ivbits);  \
  289|      1|    }                                                                          \
cipher_aes_wrp.c:aes_192_wrapinv_get_params:
  286|      1|    {                                                                          \
  287|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  288|      1|                                              flags, kbits, blkbits, ivbits);  \
  289|      1|    }                                                                          \
cipher_aes_wrp.c:aes_128_wrapinv_get_params:
  286|      1|    {                                                                          \
  287|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  288|      1|                                              flags, kbits, blkbits, ivbits);  \
  289|      1|    }                                                                          \
cipher_aes_wrp.c:aes_256_wrappadinv_get_params:
  286|      1|    {                                                                          \
  287|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  288|      1|                                              flags, kbits, blkbits, ivbits);  \
  289|      1|    }                                                                          \
cipher_aes_wrp.c:aes_192_wrappadinv_get_params:
  286|      1|    {                                                                          \
  287|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  288|      1|                                              flags, kbits, blkbits, ivbits);  \
  289|      1|    }                                                                          \
cipher_aes_wrp.c:aes_128_wrappadinv_get_params:
  286|      1|    {                                                                          \
  287|      1|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,\
  288|      1|                                              flags, kbits, blkbits, ivbits);  \
  289|      1|    }                                                                          \

cipher_aes_xts.c:aes_256_xts_get_params:
  255|      1|static int aes_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])            \
  256|      1|{                                                                              \
  257|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  258|      1|                                     flags, 2 * kbits, AES_XTS_BLOCK_BITS,     \
  ------------------
  |  |   25|      1|#define AES_XTS_BLOCK_BITS 8
  ------------------
  259|      1|                                     AES_XTS_IV_BITS);                         \
  ------------------
  |  |   24|      1|#define AES_XTS_IV_BITS 128
  ------------------
  260|      1|}                                                                              \
cipher_aes_xts.c:aes_128_xts_get_params:
  255|      1|static int aes_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])            \
  256|      1|{                                                                              \
  257|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  258|      1|                                     flags, 2 * kbits, AES_XTS_BLOCK_BITS,     \
  ------------------
  |  |   25|      1|#define AES_XTS_BLOCK_BITS 8
  ------------------
  259|      1|                                     AES_XTS_IV_BITS);                         \
  ------------------
  |  |   24|      1|#define AES_XTS_IV_BITS 128
  ------------------
  260|      1|}                                                                              \

cipher_chacha20.c:chacha20_get_params:
   88|      1|{
   89|      1|    return ossl_cipher_generic_get_params(params, 0, CHACHA20_FLAGS,
  ------------------
  |  |   20|      1|#define CHACHA20_FLAGS (PROV_CIPHER_FLAG_CUSTOM_IV)
  |  |  ------------------
  |  |  |  |   40|      1|# define PROV_CIPHER_FLAG_CUSTOM_IV        0x0002
  |  |  ------------------
  ------------------
   90|      1|                                          CHACHA20_KEYLEN * 8,
  ------------------
  |  |   17|      1|#define CHACHA20_KEYLEN (CHACHA_KEY_SIZE)
  |  |  ------------------
  |  |  |  |   39|      1|#define CHACHA_KEY_SIZE         32
  |  |  ------------------
  ------------------
   91|      1|                                          CHACHA20_BLKLEN * 8,
  ------------------
  |  |   18|      1|#define CHACHA20_BLKLEN (1)
  ------------------
   92|      1|                                          CHACHA20_IVLEN * 8);
  ------------------
  |  |   19|      1|#define CHACHA20_IVLEN (CHACHA_CTR_SIZE)
  |  |  ------------------
  |  |  |  |   40|      1|#define CHACHA_CTR_SIZE         16
  |  |  ------------------
  ------------------
   93|      1|}
cipher_chacha20.c:chacha20_gettable_ctx_params:
  120|      1|{
  121|      1|    return chacha20_known_gettable_ctx_params;
  122|      1|}

cipher_chacha20_poly1305.c:chacha20_poly1305_get_params:
   92|      1|{
   93|      1|    return ossl_cipher_generic_get_params(params, 0, CHACHA20_POLY1305_FLAGS,
  ------------------
  |  |   21|      1|#define CHACHA20_POLY1305_FLAGS (PROV_CIPHER_FLAG_AEAD                         \
  |  |  ------------------
  |  |  |  |   39|      1|# define PROV_CIPHER_FLAG_AEAD             0x0001
  |  |  ------------------
  |  |   22|      1|                                 | PROV_CIPHER_FLAG_CUSTOM_IV)
  |  |  ------------------
  |  |  |  |   40|      1|# define PROV_CIPHER_FLAG_CUSTOM_IV        0x0002
  |  |  ------------------
  ------------------
   94|      1|                                          CHACHA20_POLY1305_KEYLEN * 8,
  ------------------
  |  |   17|      1|#define CHACHA20_POLY1305_KEYLEN CHACHA_KEY_SIZE
  |  |  ------------------
  |  |  |  |   39|      1|#define CHACHA_KEY_SIZE         32
  |  |  ------------------
  ------------------
   95|      1|                                          CHACHA20_POLY1305_BLKLEN * 8,
  ------------------
  |  |   18|      1|#define CHACHA20_POLY1305_BLKLEN 1
  ------------------
   96|      1|                                          CHACHA20_POLY1305_IVLEN * 8);
  ------------------
  |  |   16|      1|#define CHACHA20_POLY1305_IVLEN 12
  ------------------
   97|      1|}
cipher_chacha20_poly1305.c:chacha20_poly1305_gettable_ctx_params:
  157|      1|{
  158|      1|    return chacha20_poly1305_known_gettable_ctx_params;
  159|      1|}

cipher_aes.c:aes_cts_256_cbc_get_params:
   16|      1|static int alg##_cts_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])      \
   17|      1|{                                                                              \
   18|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   19|      1|                                          flags, kbits, blkbits, ivbits);      \
   20|      1|}                                                                              \
cipher_aes.c:aes_cts_192_cbc_get_params:
   16|      1|static int alg##_cts_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])      \
   17|      1|{                                                                              \
   18|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   19|      1|                                          flags, kbits, blkbits, ivbits);      \
   20|      1|}                                                                              \
cipher_aes.c:aes_cts_128_cbc_get_params:
   16|      1|static int alg##_cts_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])      \
   17|      1|{                                                                              \
   18|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   19|      1|                                          flags, kbits, blkbits, ivbits);      \
   20|      1|}                                                                              \
cipher_camellia.c:camellia_cts_256_cbc_get_params:
   16|      1|static int alg##_cts_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])      \
   17|      1|{                                                                              \
   18|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   19|      1|                                          flags, kbits, blkbits, ivbits);      \
   20|      1|}                                                                              \
cipher_camellia.c:camellia_cts_192_cbc_get_params:
   16|      1|static int alg##_cts_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])      \
   17|      1|{                                                                              \
   18|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   19|      1|                                          flags, kbits, blkbits, ivbits);      \
   20|      1|}                                                                              \
cipher_camellia.c:camellia_cts_128_cbc_get_params:
   16|      1|static int alg##_cts_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])      \
   17|      1|{                                                                              \
   18|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   19|      1|                                          flags, kbits, blkbits, ivbits);      \
   20|      1|}                                                                              \

cipher_null.c:null_get_params:
  104|      1|{
  105|      1|    return ossl_cipher_generic_get_params(params, 0, 0, 0, 8, 0);
  106|      1|}
cipher_null.c:null_gettable_ctx_params:
  118|      1|{
  119|      1|    return null_known_gettable_ctx_params;
  120|      1|}

cipher_sm4_xts.c:sm4_128_xts_get_params:
  245|      1|static int sm4_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])            \
  246|      1|{                                                                              \
  247|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  248|      1|                                          flags, 2 * kbits, SM4_XTS_BLOCK_BITS,\
  ------------------
  |  |   20|      1|#define SM4_XTS_BLOCK_BITS 8
  ------------------
  249|      1|                                          SM4_XTS_IV_BITS);                    \
  ------------------
  |  |   19|      1|#define SM4_XTS_IV_BITS 128
  ------------------
  250|      1|}                                                                              \

cipher_tdes.c:tdes_ede3_ecb_get_params:
   41|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   42|      1|{                                                                              \
   43|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   44|      1|                                          flags, kbits, blkbits, ivbits);      \
   45|      1|}                                                                              \
cipher_tdes.c:tdes_ede3_cbc_get_params:
   41|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   42|      1|{                                                                              \
   43|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   44|      1|                                          flags, kbits, blkbits, ivbits);      \
   45|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede3_ofb_get_params:
   41|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   42|      1|{                                                                              \
   43|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   44|      1|                                          flags, kbits, blkbits, ivbits);      \
   45|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb_get_params:
   41|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   42|      1|{                                                                              \
   43|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   44|      1|                                          flags, kbits, blkbits, ivbits);      \
   45|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb1_get_params:
   41|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   42|      1|{                                                                              \
   43|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   44|      1|                                          flags, kbits, blkbits, ivbits);      \
   45|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb8_get_params:
   41|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   42|      1|{                                                                              \
   43|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   44|      1|                                          flags, kbits, blkbits, ivbits);      \
   45|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede2_ecb_get_params:
   41|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   42|      1|{                                                                              \
   43|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   44|      1|                                          flags, kbits, blkbits, ivbits);      \
   45|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede2_cbc_get_params:
   41|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   42|      1|{                                                                              \
   43|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   44|      1|                                          flags, kbits, blkbits, ivbits);      \
   45|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede2_ofb_get_params:
   41|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   42|      1|{                                                                              \
   43|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   44|      1|                                          flags, kbits, blkbits, ivbits);      \
   45|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede2_cfb_get_params:
   41|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   42|      1|{                                                                              \
   43|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   44|      1|                                          flags, kbits, blkbits, ivbits);      \
   45|      1|}                                                                              \

cipher_tdes_wrap.c:tdes_wrap_get_params:
  180|      1|static int tdes_wrap_get_params(OSSL_PARAM params[])                           \
  181|      1|{                                                                              \
  182|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_WRAP_MODE, flags,   \
  ------------------
  |  |  307|      1|# define         EVP_CIPH_WRAP_MODE              0x10002
  ------------------
  183|      1|                                          kbits, blkbits, ivbits);             \
  184|      1|}                                                                              \

ossl_cipher_generic_get_params:
   44|    130|{
   45|    130|    OSSL_PARAM *p;
   46|       |
   47|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_MODE);
  ------------------
  |  |  171|    130|# define OSSL_CIPHER_PARAM_MODE "mode"
  ------------------
   48|    130|    if (p != NULL && !OSSL_PARAM_set_uint(p, md)) {
  ------------------
  |  Branch (48:9): [True: 130, False: 0]
  |  Branch (48:22): [True: 0, False: 130]
  ------------------
   49|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   50|      0|        return 0;
   51|      0|    }
   52|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD);
  ------------------
  |  |  152|    130|# define OSSL_CIPHER_PARAM_AEAD "aead"
  ------------------
   53|    130|    if (p != NULL
  ------------------
  |  Branch (53:9): [True: 130, False: 0]
  ------------------
   54|    130|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_AEAD) != 0)) {
  ------------------
  |  |   39|    130|# define PROV_CIPHER_FLAG_AEAD             0x0001
  ------------------
  |  Branch (54:12): [True: 0, False: 130]
  ------------------
   55|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   56|      0|        return 0;
   57|      0|    }
   58|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_CUSTOM_IV);
  ------------------
  |  |  166|    130|# define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv"
  ------------------
   59|    130|    if (p != NULL
  ------------------
  |  Branch (59:9): [True: 130, False: 0]
  ------------------
   60|    130|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_CUSTOM_IV) != 0)) {
  ------------------
  |  |   40|    130|# define PROV_CIPHER_FLAG_CUSTOM_IV        0x0002
  ------------------
  |  Branch (60:12): [True: 0, False: 130]
  ------------------
   61|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   62|      0|        return 0;
   63|      0|    }
   64|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_CTS);
  ------------------
  |  |  164|    130|# define OSSL_CIPHER_PARAM_CTS "cts"
  ------------------
   65|    130|    if (p != NULL
  ------------------
  |  Branch (65:9): [True: 130, False: 0]
  ------------------
   66|    130|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_CTS) != 0)) {
  ------------------
  |  |   41|    130|# define PROV_CIPHER_FLAG_CTS              0x0004
  ------------------
  |  Branch (66:12): [True: 0, False: 130]
  ------------------
   67|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   68|      0|        return 0;
   69|      0|    }
   70|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK);
  ------------------
  |  |  178|    130|# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi"
  ------------------
   71|    130|    if (p != NULL
  ------------------
  |  Branch (71:9): [True: 130, False: 0]
  ------------------
   72|    130|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_TLS1_MULTIBLOCK) != 0)) {
  ------------------
  |  |   42|    130|# define PROV_CIPHER_FLAG_TLS1_MULTIBLOCK  0x0008
  ------------------
  |  Branch (72:12): [True: 0, False: 130]
  ------------------
   73|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   74|      0|        return 0;
   75|      0|    }
   76|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_HAS_RAND_KEY);
  ------------------
  |  |  167|    130|# define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey"
  ------------------
   77|    130|    if (p != NULL
  ------------------
  |  Branch (77:9): [True: 130, False: 0]
  ------------------
   78|    130|        && !OSSL_PARAM_set_int(p, (flags & PROV_CIPHER_FLAG_RAND_KEY) != 0)) {
  ------------------
  |  |   43|    130|# define PROV_CIPHER_FLAG_RAND_KEY         0x0010
  ------------------
  |  Branch (78:12): [True: 0, False: 130]
  ------------------
   79|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   80|      0|        return 0;
   81|      0|    }
   82|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  170|    130|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
   83|    130|    if (p != NULL && !OSSL_PARAM_set_size_t(p, kbits / 8)) {
  ------------------
  |  Branch (83:9): [True: 130, False: 0]
  |  Branch (83:22): [True: 0, False: 130]
  ------------------
   84|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   85|      0|        return 0;
   86|      0|    }
   87|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_BLOCK_SIZE);
  ------------------
  |  |  163|    130|# define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize"
  ------------------
   88|    130|    if (p != NULL && !OSSL_PARAM_set_size_t(p, blkbits / 8)) {
  ------------------
  |  Branch (88:9): [True: 130, False: 0]
  |  Branch (88:22): [True: 0, False: 130]
  ------------------
   89|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   90|      0|        return 0;
   91|      0|    }
   92|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  169|    130|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
   93|    130|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ivbits / 8)) {
  ------------------
  |  Branch (93:9): [True: 130, False: 0]
  |  Branch (93:22): [True: 0, False: 130]
  ------------------
   94|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   95|      0|        return 0;
   96|      0|    }
   97|    130|    return 1;
   98|    130|}
ossl_cipher_aead_gettable_ctx_params:
  157|     14|{
  158|     14|    return cipher_aead_known_gettable_ctx_params;
  159|     14|}
ossl_cipher_generic_reset_ctx:
  177|      5|{
  178|      5|    if (ctx != NULL && ctx->alloced) {
  ------------------
  |  Branch (178:9): [True: 5, False: 0]
  |  Branch (178:24): [True: 0, False: 5]
  ------------------
  179|      0|        OPENSSL_free(ctx->tlsmac);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  180|      0|        ctx->alloced = 0;
  181|      0|        ctx->tlsmac = NULL;
  182|      0|    }
  183|      5|}
ossl_cipher_generic_einit:
  227|  22.8k|{
  228|  22.8k|    return cipher_generic_init_internal((PROV_CIPHER_CTX *)vctx, key, keylen,
  229|  22.8k|                                        iv, ivlen, params, 1);
  230|  22.8k|}
ossl_cipher_generic_block_update:
  246|  7.64k|{
  247|  7.64k|    size_t outlint = 0;
  248|  7.64k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  249|  7.64k|    size_t blksz = ctx->blocksize;
  250|  7.64k|    size_t nextblocks;
  251|       |
  252|  7.64k|    if (ctx->tlsversion > 0) {
  ------------------
  |  Branch (252:9): [True: 0, False: 7.64k]
  ------------------
  253|       |        /*
  254|       |         * Each update call corresponds to a TLS record and is individually
  255|       |         * padded
  256|       |         */
  257|       |
  258|       |        /* Sanity check inputs */
  259|      0|        if (in == NULL
  ------------------
  |  Branch (259:13): [True: 0, False: 0]
  ------------------
  260|      0|                || in != out
  ------------------
  |  Branch (260:20): [True: 0, False: 0]
  ------------------
  261|      0|                || outsize < inl
  ------------------
  |  Branch (261:20): [True: 0, False: 0]
  ------------------
  262|      0|                || !ctx->pad) {
  ------------------
  |  Branch (262:20): [True: 0, False: 0]
  ------------------
  263|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  264|      0|            return 0;
  265|      0|        }
  266|       |
  267|      0|        if (ctx->enc) {
  ------------------
  |  Branch (267:13): [True: 0, False: 0]
  ------------------
  268|      0|            unsigned char padval;
  269|      0|            size_t padnum, loop;
  270|       |
  271|       |            /* Add padding */
  272|       |
  273|      0|            padnum = blksz - (inl % blksz);
  274|       |
  275|      0|            if (outsize < inl + padnum) {
  ------------------
  |  Branch (275:17): [True: 0, False: 0]
  ------------------
  276|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  277|      0|                return 0;
  278|      0|            }
  279|       |
  280|      0|            if (padnum > MAX_PADDING) {
  ------------------
  |  |  241|      0|#define MAX_PADDING 256
  ------------------
  |  Branch (280:17): [True: 0, False: 0]
  ------------------
  281|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  282|      0|                return 0;
  283|      0|            }
  284|      0|            padval = (unsigned char)(padnum - 1);
  285|      0|            if (ctx->tlsversion == SSL3_VERSION) {
  ------------------
  |  |   23|      0|# define SSL3_VERSION                    0x0300
  ------------------
  |  Branch (285:17): [True: 0, False: 0]
  ------------------
  286|      0|                if (padnum > 1)
  ------------------
  |  Branch (286:21): [True: 0, False: 0]
  ------------------
  287|      0|                    memset(out + inl, 0, padnum - 1);
  288|      0|                *(out + inl + padnum - 1) = padval;
  289|      0|            } else {
  290|       |                /* we need to add 'padnum' padding bytes of value padval */
  291|      0|                for (loop = inl; loop < inl + padnum; loop++)
  ------------------
  |  Branch (291:34): [True: 0, False: 0]
  ------------------
  292|      0|                    out[loop] = padval;
  293|      0|            }
  294|      0|            inl += padnum;
  295|      0|        }
  296|       |
  297|      0|        if ((inl % blksz) != 0) {
  ------------------
  |  Branch (297:13): [True: 0, False: 0]
  ------------------
  298|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  299|      0|            return 0;
  300|      0|        }
  301|       |
  302|       |
  303|       |        /* Shouldn't normally fail */
  304|      0|        if (!ctx->hw->cipher(ctx, out, in, inl)) {
  ------------------
  |  Branch (304:13): [True: 0, False: 0]
  ------------------
  305|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  306|      0|            return 0;
  307|      0|        }
  308|       |
  309|      0|        if (ctx->alloced) {
  ------------------
  |  Branch (309:13): [True: 0, False: 0]
  ------------------
  310|      0|            OPENSSL_free(ctx->tlsmac);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  311|      0|            ctx->alloced = 0;
  312|      0|            ctx->tlsmac = NULL;
  313|      0|        }
  314|       |
  315|       |        /* This only fails if padding is publicly invalid */
  316|      0|        *outl = inl;
  317|      0|        if (!ctx->enc
  ------------------
  |  Branch (317:13): [True: 0, False: 0]
  ------------------
  318|      0|            && !ossl_cipher_tlsunpadblock(ctx->libctx, ctx->tlsversion,
  ------------------
  |  Branch (318:16): [True: 0, False: 0]
  ------------------
  319|      0|                                          out, outl,
  320|      0|                                          blksz, &ctx->tlsmac, &ctx->alloced,
  321|      0|                                          ctx->tlsmacsize, 0)) {
  322|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  323|      0|            return 0;
  324|      0|        }
  325|      0|        return 1;
  326|      0|    }
  327|       |
  328|  7.64k|    if (ctx->bufsz != 0)
  ------------------
  |  Branch (328:9): [True: 0, False: 7.64k]
  ------------------
  329|      0|        nextblocks = ossl_cipher_fillblock(ctx->buf, &ctx->bufsz, blksz,
  330|      0|                                           &in, &inl);
  331|  7.64k|    else
  332|  7.64k|        nextblocks = inl & ~(blksz-1);
  333|       |
  334|       |    /*
  335|       |     * If we're decrypting and we end an update on a block boundary we hold
  336|       |     * the last block back in case this is the last update call and the last
  337|       |     * block is padded.
  338|       |     */
  339|  7.64k|    if (ctx->bufsz == blksz && (ctx->enc || inl > 0 || !ctx->pad)) {
  ------------------
  |  Branch (339:9): [True: 0, False: 7.64k]
  |  Branch (339:33): [True: 0, False: 0]
  |  Branch (339:45): [True: 0, False: 0]
  |  Branch (339:56): [True: 0, False: 0]
  ------------------
  340|      0|        if (outsize < blksz) {
  ------------------
  |  Branch (340:13): [True: 0, False: 0]
  ------------------
  341|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  342|      0|            return 0;
  343|      0|        }
  344|      0|        if (!ctx->hw->cipher(ctx, out, ctx->buf, blksz)) {
  ------------------
  |  Branch (344:13): [True: 0, False: 0]
  ------------------
  345|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  346|      0|            return 0;
  347|      0|        }
  348|      0|        ctx->bufsz = 0;
  349|      0|        outlint = blksz;
  350|      0|        out += blksz;
  351|      0|    }
  352|  7.64k|    if (nextblocks > 0) {
  ------------------
  |  Branch (352:9): [True: 7.64k, False: 0]
  ------------------
  353|  7.64k|        if (!ctx->enc && ctx->pad && nextblocks == inl) {
  ------------------
  |  Branch (353:13): [True: 0, False: 7.64k]
  |  Branch (353:26): [True: 0, False: 0]
  |  Branch (353:38): [True: 0, False: 0]
  ------------------
  354|      0|            if (!ossl_assert(inl >= blksz)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (354:17): [True: 0, False: 0]
  ------------------
  355|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  356|      0|                return 0;
  357|      0|            }
  358|      0|            nextblocks -= blksz;
  359|      0|        }
  360|  7.64k|        outlint += nextblocks;
  361|  7.64k|        if (outsize < outlint) {
  ------------------
  |  Branch (361:13): [True: 0, False: 7.64k]
  ------------------
  362|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  363|      0|            return 0;
  364|      0|        }
  365|  7.64k|    }
  366|  7.64k|    if (nextblocks > 0) {
  ------------------
  |  Branch (366:9): [True: 7.64k, False: 0]
  ------------------
  367|  7.64k|        if (!ctx->hw->cipher(ctx, out, in, nextblocks)) {
  ------------------
  |  Branch (367:13): [True: 0, False: 7.64k]
  ------------------
  368|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  369|      0|            return 0;
  370|      0|        }
  371|  7.64k|        in += nextblocks;
  372|  7.64k|        inl -= nextblocks;
  373|  7.64k|    }
  374|  7.64k|    if (inl != 0
  ------------------
  |  Branch (374:9): [True: 0, False: 7.64k]
  ------------------
  375|  7.64k|        && !ossl_cipher_trailingdata(ctx->buf, &ctx->bufsz, blksz, &in, &inl)) {
  ------------------
  |  Branch (375:12): [True: 0, False: 0]
  ------------------
  376|       |        /* ERR_raise already called */
  377|      0|        return 0;
  378|      0|    }
  379|       |
  380|  7.64k|    *outl = outlint;
  381|  7.64k|    return inl == 0;
  382|  7.64k|}
ossl_cipher_generic_stream_update:
  456|  7.62k|{
  457|  7.62k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  458|       |
  459|  7.62k|    if (inl == 0) {
  ------------------
  |  Branch (459:9): [True: 0, False: 7.62k]
  ------------------
  460|      0|        *outl = 0;
  461|      0|        return 1;
  462|      0|    }
  463|       |
  464|  7.62k|    if (outsize < inl) {
  ------------------
  |  Branch (464:9): [True: 0, False: 7.62k]
  ------------------
  465|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  466|      0|        return 0;
  467|      0|    }
  468|       |
  469|  7.62k|    if (!ctx->hw->cipher(ctx, out, in, inl)) {
  ------------------
  |  Branch (469:9): [True: 0, False: 7.62k]
  ------------------
  470|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  471|      0|        return 0;
  472|      0|    }
  473|       |
  474|  7.62k|    *outl = inl;
  475|  7.62k|    if (!ctx->enc && ctx->tlsversion > 0) {
  ------------------
  |  Branch (475:9): [True: 0, False: 7.62k]
  |  Branch (475:22): [True: 0, False: 0]
  ------------------
  476|       |        /*
  477|       |        * Remove any TLS padding. Only used by cipher_aes_cbc_hmac_sha1_hw.c and
  478|       |        * cipher_aes_cbc_hmac_sha256_hw.c
  479|       |        */
  480|      0|        if (ctx->removetlspad) {
  ------------------
  |  Branch (480:13): [True: 0, False: 0]
  ------------------
  481|       |            /*
  482|       |             * We should have already failed in the cipher() call above if this
  483|       |             * isn't true.
  484|       |             */
  485|      0|            if (!ossl_assert(*outl >= (size_t)(out[inl - 1] + 1)))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (485:17): [True: 0, False: 0]
  ------------------
  486|      0|                return 0;
  487|       |            /* The actual padding length */
  488|      0|            *outl -= out[inl - 1] + 1;
  489|      0|        }
  490|       |
  491|       |        /* TLS MAC and explicit IV if relevant. We should have already failed
  492|       |         * in the cipher() call above if *outl is too short.
  493|       |         */
  494|      0|        if (!ossl_assert(*outl >= ctx->removetlsfixed))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (494:13): [True: 0, False: 0]
  ------------------
  495|      0|            return 0;
  496|      0|        *outl -= ctx->removetlsfixed;
  497|       |
  498|       |        /* Extract the MAC if there is one */
  499|      0|        if (ctx->tlsmacsize > 0) {
  ------------------
  |  Branch (499:13): [True: 0, False: 0]
  ------------------
  500|      0|            if (*outl < ctx->tlsmacsize)
  ------------------
  |  Branch (500:17): [True: 0, False: 0]
  ------------------
  501|      0|                return 0;
  502|       |
  503|      0|            ctx->tlsmac = out + *outl - ctx->tlsmacsize;
  504|      0|            *outl -= ctx->tlsmacsize;
  505|      0|        }
  506|      0|    }
  507|       |
  508|  7.62k|    return 1;
  509|  7.62k|}
ossl_cipher_generic_get_ctx_params:
  544|      7|{
  545|      7|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  546|      7|    OSSL_PARAM *p;
  547|       |
  548|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  169|      7|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  549|      7|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->ivlen)) {
  ------------------
  |  Branch (549:9): [True: 2, False: 5]
  |  Branch (549:22): [True: 0, False: 2]
  ------------------
  550|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  551|      0|        return 0;
  552|      0|    }
  553|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_PADDING);
  ------------------
  |  |  173|      7|# define OSSL_CIPHER_PARAM_PADDING "padding"
  ------------------
  554|      7|    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->pad)) {
  ------------------
  |  Branch (554:9): [True: 0, False: 7]
  |  Branch (554:22): [True: 0, False: 0]
  ------------------
  555|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  556|      0|        return 0;
  557|      0|    }
  558|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IV);
  ------------------
  |  |  168|      7|# define OSSL_CIPHER_PARAM_IV "iv"
  ------------------
  559|      7|    if (p != NULL
  ------------------
  |  Branch (559:9): [True: 0, False: 7]
  ------------------
  560|      7|        && !OSSL_PARAM_set_octet_ptr(p, &ctx->oiv, ctx->ivlen)
  ------------------
  |  Branch (560:12): [True: 0, False: 0]
  ------------------
  561|      7|        && !OSSL_PARAM_set_octet_string(p, &ctx->oiv, ctx->ivlen)) {
  ------------------
  |  Branch (561:12): [True: 0, False: 0]
  ------------------
  562|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  563|      0|        return 0;
  564|      0|    }
  565|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_UPDATED_IV);
  ------------------
  |  |  190|      7|# define OSSL_CIPHER_PARAM_UPDATED_IV "updated-iv"
  ------------------
  566|      7|    if (p != NULL
  ------------------
  |  Branch (566:9): [True: 0, False: 7]
  ------------------
  567|      7|        && !OSSL_PARAM_set_octet_ptr(p, &ctx->iv, ctx->ivlen)
  ------------------
  |  Branch (567:12): [True: 0, False: 0]
  ------------------
  568|      7|        && !OSSL_PARAM_set_octet_string(p, &ctx->iv, ctx->ivlen)) {
  ------------------
  |  Branch (568:12): [True: 0, False: 0]
  ------------------
  569|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  570|      0|        return 0;
  571|      0|    }
  572|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_NUM);
  ------------------
  |  |  172|      7|# define OSSL_CIPHER_PARAM_NUM "num"
  ------------------
  573|      7|    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->num)) {
  ------------------
  |  Branch (573:9): [True: 0, False: 7]
  |  Branch (573:22): [True: 0, False: 0]
  ------------------
  574|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  575|      0|        return 0;
  576|      0|    }
  577|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  170|      7|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  578|      7|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->keylen)) {
  ------------------
  |  Branch (578:9): [True: 5, False: 2]
  |  Branch (578:22): [True: 0, False: 5]
  ------------------
  579|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  580|      0|        return 0;
  581|      0|    }
  582|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS_MAC);
  ------------------
  |  |  187|      7|# define OSSL_CIPHER_PARAM_TLS_MAC "tls-mac"
  ------------------
  583|      7|    if (p != NULL
  ------------------
  |  Branch (583:9): [True: 0, False: 7]
  ------------------
  584|      7|        && !OSSL_PARAM_set_octet_ptr(p, ctx->tlsmac, ctx->tlsmacsize)) {
  ------------------
  |  Branch (584:12): [True: 0, False: 0]
  ------------------
  585|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  586|      0|        return 0;
  587|      0|    }
  588|      7|    return 1;
  589|      7|}
ossl_cipher_generic_set_ctx_params:
  592|  22.8k|{
  593|  22.8k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  594|  22.8k|    const OSSL_PARAM *p;
  595|       |
  596|  22.8k|    if (params == NULL)
  ------------------
  |  Branch (596:9): [True: 22.8k, False: 0]
  ------------------
  597|  22.8k|        return 1;
  598|       |
  599|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_PADDING);
  ------------------
  |  |  173|      0|# define OSSL_CIPHER_PARAM_PADDING "padding"
  ------------------
  600|      0|    if (p != NULL) {
  ------------------
  |  Branch (600:9): [True: 0, False: 0]
  ------------------
  601|      0|        unsigned int pad;
  602|       |
  603|      0|        if (!OSSL_PARAM_get_uint(p, &pad)) {
  ------------------
  |  Branch (603:13): [True: 0, False: 0]
  ------------------
  604|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  605|      0|            return 0;
  606|      0|        }
  607|      0|        ctx->pad = pad ? 1 : 0;
  ------------------
  |  Branch (607:20): [True: 0, False: 0]
  ------------------
  608|      0|    }
  609|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_USE_BITS);
  ------------------
  |  |  191|      0|# define OSSL_CIPHER_PARAM_USE_BITS "use-bits"
  ------------------
  610|      0|    if (p != NULL) {
  ------------------
  |  Branch (610:9): [True: 0, False: 0]
  ------------------
  611|      0|        unsigned int bits;
  612|       |
  613|      0|        if (!OSSL_PARAM_get_uint(p, &bits)) {
  ------------------
  |  Branch (613:13): [True: 0, False: 0]
  ------------------
  614|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  615|      0|            return 0;
  616|      0|        }
  617|      0|        ctx->use_bits = bits ? 1 : 0;
  ------------------
  |  Branch (617:25): [True: 0, False: 0]
  ------------------
  618|      0|    }
  619|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_VERSION);
  ------------------
  |  |  189|      0|# define OSSL_CIPHER_PARAM_TLS_VERSION "tls-version"
  ------------------
  620|      0|    if (p != NULL) {
  ------------------
  |  Branch (620:9): [True: 0, False: 0]
  ------------------
  621|      0|        if (!OSSL_PARAM_get_uint(p, &ctx->tlsversion)) {
  ------------------
  |  Branch (621:13): [True: 0, False: 0]
  ------------------
  622|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  623|      0|            return 0;
  624|      0|        }
  625|      0|    }
  626|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_MAC_SIZE);
  ------------------
  |  |  188|      0|# define OSSL_CIPHER_PARAM_TLS_MAC_SIZE "tls-mac-size"
  ------------------
  627|      0|    if (p != NULL) {
  ------------------
  |  Branch (627:9): [True: 0, False: 0]
  ------------------
  628|      0|        if (!OSSL_PARAM_get_size_t(p, &ctx->tlsmacsize)) {
  ------------------
  |  Branch (628:13): [True: 0, False: 0]
  ------------------
  629|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  630|      0|            return 0;
  631|      0|        }
  632|      0|    }
  633|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_NUM);
  ------------------
  |  |  172|      0|# define OSSL_CIPHER_PARAM_NUM "num"
  ------------------
  634|      0|    if (p != NULL) {
  ------------------
  |  Branch (634:9): [True: 0, False: 0]
  ------------------
  635|      0|        unsigned int num;
  636|       |
  637|      0|        if (!OSSL_PARAM_get_uint(p, &num)) {
  ------------------
  |  Branch (637:13): [True: 0, False: 0]
  ------------------
  638|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  639|      0|            return 0;
  640|      0|        }
  641|      0|        ctx->num = num;
  642|      0|    }
  643|      0|    return 1;
  644|      0|}
ossl_cipher_generic_initiv:
  648|  7.62k|{
  649|  7.62k|    if (ivlen != ctx->ivlen
  ------------------
  |  Branch (649:9): [True: 0, False: 7.62k]
  ------------------
  650|  7.62k|        || ivlen > sizeof(ctx->iv)) {
  ------------------
  |  Branch (650:12): [True: 0, False: 7.62k]
  ------------------
  651|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  652|      0|        return 0;
  653|      0|    }
  654|  7.62k|    ctx->iv_set = 1;
  655|  7.62k|    memcpy(ctx->iv, iv, ivlen);
  656|  7.62k|    memcpy(ctx->oiv, iv, ivlen);
  657|  7.62k|    return 1;
  658|  7.62k|}
ossl_cipher_generic_initkey:
  664|      5|{
  665|      5|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  666|       |
  667|      5|    if ((flags & PROV_CIPHER_FLAG_INVERSE_CIPHER) != 0)
  ------------------
  |  |   46|      5|# define PROV_CIPHER_FLAG_INVERSE_CIPHER   0x0200
  ------------------
  |  Branch (667:9): [True: 0, False: 5]
  ------------------
  668|      0|        ctx->inverse_cipher = 1;
  669|      5|    if ((flags & PROV_CIPHER_FLAG_VARIABLE_LENGTH) != 0)
  ------------------
  |  |   45|      5|# define PROV_CIPHER_FLAG_VARIABLE_LENGTH  0x0100
  ------------------
  |  Branch (669:9): [True: 0, False: 5]
  ------------------
  670|      0|        ctx->variable_keylength = 1;
  671|       |
  672|      5|    ctx->pad = 1;
  673|      5|    ctx->keylen = ((kbits) / 8);
  674|      5|    ctx->ivlen = ((ivbits) / 8);
  675|      5|    ctx->hw = hw;
  676|      5|    ctx->mode = mode;
  677|      5|    ctx->blocksize = blkbits / 8;
  678|      5|    if (provctx != NULL)
  ------------------
  |  Branch (678:9): [True: 5, False: 0]
  ------------------
  679|      5|        ctx->libctx = PROV_LIBCTX_OF(provctx); /* used for rand */
  ------------------
  |  |   29|      5|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  680|      5|}
ciphercommon.c:cipher_generic_init_internal:
  189|  22.8k|{
  190|  22.8k|    ctx->num = 0;
  191|  22.8k|    ctx->bufsz = 0;
  192|  22.8k|    ctx->updated = 0;
  193|  22.8k|    ctx->enc = enc ? 1 : 0;
  ------------------
  |  Branch (193:16): [True: 22.8k, False: 0]
  ------------------
  194|       |
  195|  22.8k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (195:9): [True: 0, False: 22.8k]
  ------------------
  196|      0|        return 0;
  197|       |
  198|  22.8k|    if (iv != NULL && ctx->mode != EVP_CIPH_ECB_MODE) {
  ------------------
  |  |  299|  7.62k|# define         EVP_CIPH_ECB_MODE               0x1
  ------------------
  |  Branch (198:9): [True: 7.62k, False: 15.2k]
  |  Branch (198:23): [True: 7.62k, False: 0]
  ------------------
  199|  7.62k|        if (!ossl_cipher_generic_initiv(ctx, iv, ivlen))
  ------------------
  |  Branch (199:13): [True: 0, False: 7.62k]
  ------------------
  200|      0|            return 0;
  201|  7.62k|    }
  202|  22.8k|    if (iv == NULL && ctx->iv_set
  ------------------
  |  Branch (202:9): [True: 15.2k, False: 7.62k]
  |  Branch (202:23): [True: 7.62k, False: 7.63k]
  ------------------
  203|  22.8k|        && (ctx->mode == EVP_CIPH_CBC_MODE
  ------------------
  |  |  300|  15.2k|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (203:13): [True: 0, False: 7.62k]
  ------------------
  204|  7.62k|            || ctx->mode == EVP_CIPH_CFB_MODE
  ------------------
  |  |  301|  15.2k|# define         EVP_CIPH_CFB_MODE               0x3
  ------------------
  |  Branch (204:16): [True: 0, False: 7.62k]
  ------------------
  205|  7.62k|            || ctx->mode == EVP_CIPH_OFB_MODE))
  ------------------
  |  |  302|  7.62k|# define         EVP_CIPH_OFB_MODE               0x4
  ------------------
  |  Branch (205:16): [True: 0, False: 7.62k]
  ------------------
  206|       |        /* reset IV for these modes to keep compatibility with 1.1.1 */
  207|      0|        memcpy(ctx->iv, ctx->oiv, ctx->ivlen);
  208|       |
  209|  22.8k|    if (key != NULL) {
  ------------------
  |  Branch (209:9): [True: 15.2k, False: 7.62k]
  ------------------
  210|  15.2k|        if (ctx->variable_keylength == 0) {
  ------------------
  |  Branch (210:13): [True: 15.2k, False: 0]
  ------------------
  211|  15.2k|            if (keylen != ctx->keylen) {
  ------------------
  |  Branch (211:17): [True: 0, False: 15.2k]
  ------------------
  212|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  213|      0|                return 0;
  214|      0|            }
  215|  15.2k|        } else {
  216|      0|            ctx->keylen = keylen;
  217|      0|        }
  218|  15.2k|        if (!ctx->hw->init(ctx, key, ctx->keylen))
  ------------------
  |  Branch (218:13): [True: 0, False: 15.2k]
  ------------------
  219|      0|            return 0;
  220|  15.2k|    }
  221|  22.8k|    return ossl_cipher_generic_set_ctx_params(ctx, params);
  222|  22.8k|}

ossl_cipher_hw_generic_ctr:
  113|  7.62k|{
  114|  7.62k|    unsigned int num = dat->num;
  115|       |
  116|  7.62k|    if (dat->stream.ctr)
  ------------------
  |  Branch (116:9): [True: 7.62k, False: 0]
  ------------------
  117|  7.62k|        CRYPTO_ctr128_encrypt_ctr32(in, out, len, dat->ks, dat->iv, dat->buf,
  118|  7.62k|                                    &num, dat->stream.ctr);
  119|      0|    else
  120|      0|        CRYPTO_ctr128_encrypt(in, out, len, dat->ks, dat->iv, dat->buf,
  121|      0|                              &num, dat->block);
  122|  7.62k|    dat->num = num;
  123|       |
  124|  7.62k|    return 1;
  125|  7.62k|}

blake2_prov.c:blake2b512_get_params:
   94|      1|{
   95|      1|    return ossl_digest_default_get_params(params, BLAKE2B_BLOCKBYTES, 64, 0);
  ------------------
  |  |   25|      1|# define BLAKE2B_BLOCKBYTES    128
  ------------------
   96|      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);
  ------------------
  |  |  195|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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);
  ------------------
  |  |  198|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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);
  ------------------
  |  |  200|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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);
  ------------------
  |  |  194|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      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|  20.3k|{
   44|  20.3k|    const OSSL_PARAM *p;
   45|  20.3k|    SHA_CTX *ctx = (SHA_CTX *)vctx;
   46|       |
   47|  20.3k|    if (ctx == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 20.3k]
  ------------------
   48|      0|        return 0;
   49|  20.3k|    if (params == NULL)
  ------------------
  |  Branch (49:9): [True: 20.3k, False: 0]
  ------------------
   50|  20.3k|        return 1;
   51|       |
   52|      0|    p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_SSL3_MS);
  ------------------
  |  |  199|      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,
  ------------------
  |  |  406|      0|# define         EVP_CTRL_SSL3_MASTER_SECRET             0x1d
  ------------------
   55|      0|                              p->data_size, p->data);
   56|      0|    return 1;
   57|      0|}

decode_der2key.c:der2key_newctx:
  129|   101k|{
  130|   101k|    struct der2key_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |   99|   101k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   101k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   101k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  131|       |
  132|   101k|    if (ctx != NULL) {
  ------------------
  |  Branch (132:9): [True: 101k, False: 0]
  ------------------
  133|   101k|        ctx->provctx = provctx;
  134|   101k|        ctx->desc = desc;
  135|   101k|    }
  136|   101k|    return ctx;
  137|   101k|}
decode_der2key.c:dh_adjust:
  377|  4.62k|{
  378|  4.62k|    ossl_dh_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|  4.62k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  379|  4.62k|}
decode_der2key.c:der2key_freectx:
  162|   101k|{
  163|   101k|    struct der2key_ctx_st *ctx = vctx;
  164|       |
  165|   101k|    OPENSSL_free(ctx);
  ------------------
  |  |  107|   101k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|   101k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|   101k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  166|   101k|}
decode_der2key.c:PrivateKeyInfo_der2dh_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:der2key_check_selection:
  170|  28.6k|{
  171|       |    /*
  172|       |     * The selections are kinda sorta "levels", i.e. each selection given
  173|       |     * here is assumed to include those following.
  174|       |     */
  175|  28.6k|    int checks[] = {
  176|  28.6k|        OSSL_KEYMGMT_SELECT_PRIVATE_KEY,
  ------------------
  |  |  542|  28.6k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  177|  28.6k|        OSSL_KEYMGMT_SELECT_PUBLIC_KEY,
  ------------------
  |  |  543|  28.6k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  178|  28.6k|        OSSL_KEYMGMT_SELECT_ALL_PARAMETERS
  ------------------
  |  |  549|  28.6k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  ------------------
  |  |  |  |  544|  28.6k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  |  |  550|  28.6k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  545|  28.6k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
  179|  28.6k|    };
  180|  28.6k|    size_t i;
  181|       |
  182|       |    /* The decoder implementations made here support guessing */
  183|  28.6k|    if (selection == 0)
  ------------------
  |  Branch (183:9): [True: 0, False: 28.6k]
  ------------------
  184|      0|        return 1;
  185|       |
  186|  57.2k|    for (i = 0; i < OSSL_NELEM(checks); i++) {
  ------------------
  |  |   14|  57.2k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (186:17): [True: 57.2k, False: 0]
  ------------------
  187|  57.2k|        int check1 = (selection & checks[i]) != 0;
  188|  57.2k|        int check2 = (desc->selection_mask & checks[i]) != 0;
  189|       |
  190|       |        /*
  191|       |         * If the caller asked for the currently checked bit(s), return
  192|       |         * whether the decoder description says it's supported.
  193|       |         */
  194|  57.2k|        if (check1)
  ------------------
  |  Branch (194:13): [True: 28.6k, False: 28.6k]
  ------------------
  195|  28.6k|            return check2;
  196|  57.2k|    }
  197|       |
  198|       |    /* This should be dead code, but just to be safe... */
  199|      0|    return 0;
  200|  28.6k|}
decode_der2key.c:der2key_decode:
  205|  54.8k|{
  206|  54.8k|    struct der2key_ctx_st *ctx = vctx;
  207|  54.8k|    unsigned char *der = NULL;
  208|  54.8k|    const unsigned char *derp;
  209|  54.8k|    long der_len = 0;
  210|  54.8k|    void *key = NULL;
  211|  54.8k|    int ok = 0;
  212|       |
  213|  54.8k|    ctx->selection = selection;
  214|       |    /*
  215|       |     * The caller is allowed to specify 0 as a selection mark, to have the
  216|       |     * structure and key type guessed.  For type-specific structures, this
  217|       |     * is not recommended, as some structures are very similar.
  218|       |     * Note that 0 isn't the same as OSSL_KEYMGMT_SELECT_ALL, as the latter
  219|       |     * signifies a private key structure, where everything else is assumed
  220|       |     * to be present as well.
  221|       |     */
  222|  54.8k|    if (selection == 0)
  ------------------
  |  Branch (222:9): [True: 0, False: 54.8k]
  ------------------
  223|      0|        selection = ctx->desc->selection_mask;
  224|  54.8k|    if ((selection & ctx->desc->selection_mask) == 0) {
  ------------------
  |  Branch (224:9): [True: 0, False: 54.8k]
  ------------------
  225|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  226|      0|        return 0;
  227|      0|    }
  228|       |
  229|  54.8k|    ok = ossl_read_der(ctx->provctx, cin, &der, &der_len);
  230|  54.8k|    if (!ok)
  ------------------
  |  Branch (230:9): [True: 6, False: 54.8k]
  ------------------
  231|      6|        goto next;
  232|       |
  233|  54.8k|    ok = 0; /* Assume that we fail */
  234|       |
  235|  54.8k|    ERR_set_mark();
  236|  54.8k|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  542|  54.8k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (236:9): [True: 0, False: 54.8k]
  ------------------
  237|      0|        derp = der;
  238|      0|        if (ctx->desc->d2i_PKCS8 != NULL) {
  ------------------
  |  Branch (238:13): [True: 0, False: 0]
  ------------------
  239|      0|            key = ctx->desc->d2i_PKCS8(NULL, &derp, der_len, ctx);
  240|      0|            if (ctx->flag_fatal) {
  ------------------
  |  Branch (240:17): [True: 0, False: 0]
  ------------------
  241|      0|                ERR_clear_last_mark();
  242|      0|                goto end;
  243|      0|            }
  244|      0|        } else if (ctx->desc->d2i_private_key != NULL) {
  ------------------
  |  Branch (244:20): [True: 0, False: 0]
  ------------------
  245|      0|            key = ctx->desc->d2i_private_key(NULL, &derp, der_len);
  246|      0|        }
  247|      0|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (247:13): [True: 0, False: 0]
  |  Branch (247:28): [True: 0, False: 0]
  ------------------
  248|      0|            ERR_clear_last_mark();
  249|      0|            goto next;
  250|      0|        }
  251|      0|    }
  252|  54.8k|    if (key == NULL && (selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
  ------------------
  |  |  543|  54.8k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (252:9): [True: 54.8k, False: 0]
  |  Branch (252:24): [True: 54.8k, False: 0]
  ------------------
  253|  54.8k|        derp = der;
  254|  54.8k|        if (ctx->desc->d2i_PUBKEY != NULL)
  ------------------
  |  Branch (254:13): [True: 54.6k, False: 168]
  ------------------
  255|  54.6k|            key = ctx->desc->d2i_PUBKEY(NULL, &derp, der_len);
  256|    168|        else if (ctx->desc->d2i_public_key != NULL)
  ------------------
  |  Branch (256:18): [True: 168, False: 0]
  ------------------
  257|    168|            key = ctx->desc->d2i_public_key(NULL, &derp, der_len);
  258|  54.8k|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (258:13): [True: 25.1k, False: 29.6k]
  |  Branch (258:28): [True: 25.1k, False: 0]
  ------------------
  259|  25.1k|            ERR_clear_last_mark();
  260|  25.1k|            goto next;
  261|  25.1k|        }
  262|  54.8k|    }
  263|  29.6k|    if (key == NULL && (selection & OSSL_KEYMGMT_SELECT_ALL_PARAMETERS) != 0) {
  ------------------
  |  |  549|      0|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  ------------------
  |  |  |  |  544|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  |  |  550|      0|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  545|      0|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
  |  Branch (263:9): [True: 0, False: 29.6k]
  |  Branch (263:24): [True: 0, False: 0]
  ------------------
  264|      0|        derp = der;
  265|      0|        if (ctx->desc->d2i_key_params != NULL)
  ------------------
  |  Branch (265:13): [True: 0, False: 0]
  ------------------
  266|      0|            key = ctx->desc->d2i_key_params(NULL, &derp, der_len);
  267|      0|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (267:13): [True: 0, False: 0]
  |  Branch (267:28): [True: 0, False: 0]
  ------------------
  268|      0|            ERR_clear_last_mark();
  269|      0|            goto next;
  270|      0|        }
  271|      0|    }
  272|  29.6k|    if (key == NULL)
  ------------------
  |  Branch (272:9): [True: 0, False: 29.6k]
  ------------------
  273|      0|        ERR_clear_last_mark();
  274|  29.6k|    else
  275|  29.6k|        ERR_pop_to_mark();
  276|       |
  277|       |    /*
  278|       |     * Last minute check to see if this was the correct type of key.  This
  279|       |     * should never lead to a fatal error, i.e. the decoding itself was
  280|       |     * correct, it was just an unexpected key type.  This is generally for
  281|       |     * classes of key types that have subtle variants, like RSA-PSS keys as
  282|       |     * opposed to plain RSA keys.
  283|       |     */
  284|  29.6k|    if (key != NULL
  ------------------
  |  Branch (284:9): [True: 29.6k, False: 0]
  ------------------
  285|  29.6k|        && ctx->desc->check_key != NULL
  ------------------
  |  Branch (285:12): [True: 22.4k, False: 7.19k]
  ------------------
  286|  29.6k|        && !ctx->desc->check_key(key, ctx)) {
  ------------------
  |  Branch (286:12): [True: 0, False: 22.4k]
  ------------------
  287|      0|        ctx->desc->free_key(key);
  288|      0|        key = NULL;
  289|      0|    }
  290|       |
  291|  29.6k|    if (key != NULL && ctx->desc->adjust_key != NULL)
  ------------------
  |  Branch (291:9): [True: 29.6k, False: 0]
  |  Branch (291:24): [True: 29.6k, False: 0]
  ------------------
  292|  29.6k|        ctx->desc->adjust_key(key, ctx);
  293|       |
  294|  54.8k| next:
  295|       |    /*
  296|       |     * Indicated that we successfully decoded something, or not at all.
  297|       |     * Ending up "empty handed" is not an error.
  298|       |     */
  299|  54.8k|    ok = 1;
  300|       |
  301|       |    /*
  302|       |     * We free memory here so it's not held up during the callback, because
  303|       |     * we know the process is recursive and the allocated chunks of memory
  304|       |     * add up.
  305|       |     */
  306|  54.8k|    OPENSSL_free(der);
  ------------------
  |  |  107|  54.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  54.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  54.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  307|  54.8k|    der = NULL;
  308|       |
  309|  54.8k|    if (key != NULL) {
  ------------------
  |  Branch (309:9): [True: 29.6k, False: 25.1k]
  ------------------
  310|  29.6k|        OSSL_PARAM params[4];
  311|  29.6k|        int object_type = OSSL_OBJECT_PKEY;
  ------------------
  |  |   29|  29.6k|# define OSSL_OBJECT_PKEY               2 /* EVP_PKEY * */
  ------------------
  312|       |
  313|  29.6k|        params[0] =
  314|  29.6k|            OSSL_PARAM_construct_int(OSSL_OBJECT_PARAM_TYPE, &object_type);
  ------------------
  |  |  314|  29.6k|# define OSSL_OBJECT_PARAM_TYPE "type"
  ------------------
  315|  29.6k|        params[1] =
  316|  29.6k|            OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  311|  29.6k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  317|  29.6k|                                             (char *)ctx->desc->keytype_name,
  318|  29.6k|                                             0);
  319|       |        /* The address of the key becomes the octet string */
  320|  29.6k|        params[2] =
  321|  29.6k|            OSSL_PARAM_construct_octet_string(OSSL_OBJECT_PARAM_REFERENCE,
  ------------------
  |  |  313|  29.6k|# define OSSL_OBJECT_PARAM_REFERENCE "reference"
  ------------------
  322|  29.6k|                                              &key, sizeof(key));
  323|  29.6k|        params[3] = OSSL_PARAM_construct_end();
  324|       |
  325|  29.6k|        ok = data_cb(params, data_cbarg);
  326|  29.6k|    }
  327|       |
  328|  54.8k| end:
  329|  54.8k|    ctx->desc->free_key(key);
  330|  54.8k|    OPENSSL_free(der);
  ------------------
  |  |  107|  54.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  54.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  54.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  331|       |
  332|  54.8k|    return ok;
  333|  54.8k|}
decode_der2key.c:SubjectPublicKeyInfo_der2dh_newctx:
  762|  2.94k|    {                                                                   \
  763|  2.94k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  2.94k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dh_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:type_specific_params_der2dh_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:DH_der2dh_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2dhx_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dhx_newctx:
  762|  4.62k|    {                                                                   \
  763|  4.62k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  4.62k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dhx_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:type_specific_params_der2dhx_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:DHX_der2dhx_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:dsa_adjust:
  412|  2.17k|{
  413|  2.17k|    ossl_dsa_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|  2.17k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  414|  2.17k|}
decode_der2key.c:PrivateKeyInfo_der2dsa_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dsa_newctx:
  762|  5.37k|    {                                                                   \
  763|  5.37k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  5.37k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dsa_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:type_specific_der2dsa_newctx:
  762|  5.37k|    {                                                                   \
  763|  5.37k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  5.37k|    }                                                                   \
decode_der2key.c:type_specific_der2dsa_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:DSA_der2dsa_newctx:
  762|  5.37k|    {                                                                   \
  763|  5.37k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  5.37k|    }                                                                   \
decode_der2key.c:DSA_der2dsa_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:ec_check:
  436|  18.4k|{
  437|       |    /* We're trying to be clever by comparing two truths */
  438|       |
  439|  18.4k|    int sm2 = (EC_KEY_get_flags(key) & EC_FLAG_SM2_RANGE) != 0;
  ------------------
  |  |  962|  18.4k|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
  440|       |
  441|  18.4k|    return sm2 == (ctx->desc->evp_type == EVP_PKEY_SM2);
  ------------------
  |  |   70|  18.4k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1228|  18.4k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  442|  18.4k|}
decode_der2key.c:ec_adjust:
  445|  18.4k|{
  446|  18.4k|    ossl_ec_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|  18.4k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  447|  18.4k|}
decode_der2key.c:PrivateKeyInfo_der2ec_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ec_newctx:
  762|  34.4k|    {                                                                   \
  763|  34.4k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  34.4k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ec_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2ec_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:EC_der2ec_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:ecx_key_adjust:
  463|    387|{
  464|    387|    ossl_ecx_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|    387|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  465|    387|}
decode_der2key.c:PrivateKeyInfo_der2x25519_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x25519_newctx:
  762|    241|    {                                                                   \
  763|    241|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|    241|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x25519_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2x448_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x448_newctx:
  762|    397|    {                                                                   \
  763|    397|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|    397|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x448_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed25519_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed25519_newctx:
  762|  1.46k|    {                                                                   \
  763|  1.46k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  1.46k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed25519_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed448_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed448_newctx:
  762|    563|    {                                                                   \
  763|    563|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|    563|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed448_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2sm2_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2sm2_newctx:
  762|  34.4k|    {                                                                   \
  763|  34.4k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  34.4k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2sm2_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2sm2_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:rsa_check:
  546|  3.99k|{
  547|  3.99k|    switch (RSA_test_flags(key, RSA_FLAG_TYPE_MASK)) {
  ------------------
  |  |  117|  3.99k|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  |  Branch (547:13): [True: 0, False: 3.99k]
  ------------------
  548|    609|    case RSA_FLAG_TYPE_RSA:
  ------------------
  |  |  118|    609|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  |  Branch (548:5): [True: 609, False: 3.38k]
  ------------------
  549|    609|        return ctx->desc->evp_type == EVP_PKEY_RSA;
  ------------------
  |  |   59|    609|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|    609|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  550|  3.38k|    case RSA_FLAG_TYPE_RSASSAPSS:
  ------------------
  |  |  119|  3.38k|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (550:5): [True: 3.38k, False: 609]
  ------------------
  551|  3.38k|        return ctx->desc->evp_type == EVP_PKEY_RSA_PSS;
  ------------------
  |  |   61|  3.38k|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|  3.38k|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  552|  3.99k|    }
  553|       |
  554|       |    /* Currently unsupported RSA key type */
  555|      0|    return 0;
  556|  3.99k|}
decode_der2key.c:rsa_adjust:
  559|  3.99k|{
  560|  3.99k|    ossl_rsa_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|  3.99k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  561|  3.99k|}
decode_der2key.c:PrivateKeyInfo_der2rsa_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsa_newctx:
  762|    672|    {                                                                   \
  763|    672|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|    672|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsa_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:type_specific_keypair_der2rsa_newctx:
  762|    672|    {                                                                   \
  763|    672|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|    672|    }                                                                   \
decode_der2key.c:type_specific_keypair_der2rsa_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:RSA_der2rsa_newctx:
  762|    672|    {                                                                   \
  763|    672|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|    672|    }                                                                   \
decode_der2key.c:RSA_der2rsa_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2rsapss_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsapss_newctx:
  762|  3.87k|    {                                                                   \
  763|  3.87k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  3.87k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsapss_does_selection:
  767|    868|    {                                                                   \
  768|    868|        return der2key_check_selection(selection,                       \
  769|    868|                                       &kind##_##keytype##_desc);       \
  770|    868|    }                                                                   \

decode_epki2pki.c:epki2pki_newctx:
   41|  54.6k|{
   42|  54.6k|    struct epki2pki_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |   99|  54.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  54.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  54.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   43|       |
   44|  54.6k|    if (ctx != NULL)
  ------------------
  |  Branch (44:9): [True: 54.6k, False: 0]
  ------------------
   45|  54.6k|        ctx->provctx = provctx;
   46|  54.6k|    return ctx;
   47|  54.6k|}
decode_epki2pki.c:epki2pki_freectx:
   50|  54.6k|{
   51|  54.6k|    struct epki2pki_ctx_st *ctx = vctx;
   52|       |
   53|  54.6k|    OPENSSL_free(ctx);
  ------------------
  |  |  107|  54.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  54.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  54.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   54|  54.6k|}

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

decode_pem2der.c:pem2der_newctx:
   58|  54.6k|{
   59|  54.6k|    struct pem2der_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |   99|  54.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  54.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  54.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   60|       |
   61|  54.6k|    if (ctx != NULL)
  ------------------
  |  Branch (61:9): [True: 54.6k, False: 0]
  ------------------
   62|  54.6k|        ctx->provctx = provctx;
   63|  54.6k|    return ctx;
   64|  54.6k|}
decode_pem2der.c:pem2der_freectx:
   67|  54.6k|{
   68|  54.6k|    struct pem2der_ctx_st *ctx = vctx;
   69|       |
   70|  54.6k|    OPENSSL_free(ctx);
  ------------------
  |  |  107|  54.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  54.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  54.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   71|  54.6k|}

decode_pvk2key.c:pvk2key_does_selection:
  109|  1.73k|{
  110|  1.73k|    if (selection == 0)
  ------------------
  |  Branch (110:9): [True: 0, False: 1.73k]
  ------------------
  111|      0|        return 1;
  112|       |
  113|  1.73k|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY)  != 0)
  ------------------
  |  |  542|  1.73k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (113:9): [True: 0, False: 1.73k]
  ------------------
  114|      0|        return 1;
  115|       |
  116|  1.73k|    return 0;
  117|  1.73k|}

decode_spki2typespki.c:spki2typespki_newctx:
   39|  54.6k|{
   40|  54.6k|    struct spki2typespki_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |   99|  54.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  54.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  54.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   41|       |
   42|  54.6k|    if (ctx != NULL)
  ------------------
  |  Branch (42:9): [True: 54.6k, False: 0]
  ------------------
   43|  54.6k|        ctx->provctx = provctx;
   44|  54.6k|    return ctx;
   45|  54.6k|}
decode_spki2typespki.c:spki2typespki_freectx:
   48|  54.6k|{
   49|  54.6k|    struct spki2typespki_ctx_st *ctx = vctx;
   50|       |
   51|  54.6k|    OPENSSL_free(ctx);
  ------------------
  |  |  107|  54.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  54.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  54.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|  54.6k|}
decode_spki2typespki.c:spki2typespki_decode:
   79|  54.6k|{
   80|  54.6k|    struct spki2typespki_ctx_st *ctx = vctx;
   81|  54.6k|    unsigned char *der, *derp;
   82|  54.6k|    long len;
   83|  54.6k|    int ok = 0;
   84|  54.6k|    int objtype = OSSL_OBJECT_PKEY;
  ------------------
  |  |   29|  54.6k|# define OSSL_OBJECT_PKEY               2 /* EVP_PKEY * */
  ------------------
   85|  54.6k|    X509_PUBKEY *xpub = NULL;
   86|  54.6k|    X509_ALGOR *algor = NULL;
   87|  54.6k|    const ASN1_OBJECT *oid = NULL;
   88|  54.6k|    char dataname[OSSL_MAX_NAME_SIZE];
   89|  54.6k|    OSSL_PARAM params[5], *p = params;
   90|       |
   91|  54.6k|    if (!ossl_read_der(ctx->provctx, cin, &der, &len))
  ------------------
  |  Branch (91:9): [True: 3, False: 54.6k]
  ------------------
   92|      3|        return 1;
   93|  54.6k|    derp = der;
   94|  54.6k|    xpub = ossl_d2i_X509_PUBKEY_INTERNAL((const unsigned char **)&derp, len,
   95|  54.6k|                                         PROV_LIBCTX_OF(ctx->provctx),
  ------------------
  |  |   29|  54.6k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
   96|  54.6k|                                         ctx->propq);
   97|       |
   98|  54.6k|    if (xpub == NULL) {
  ------------------
  |  Branch (98:9): [True: 173, False: 54.4k]
  ------------------
   99|       |        /* We return "empty handed".  This is not an error. */
  100|    173|        ok = 1;
  101|    173|        goto end;
  102|    173|    }
  103|       |
  104|  54.4k|    if (!X509_PUBKEY_get0_param(NULL, NULL, NULL, &algor, xpub))
  ------------------
  |  Branch (104:9): [True: 0, False: 54.4k]
  ------------------
  105|      0|        goto end;
  106|  54.4k|    X509_ALGOR_get0(&oid, NULL, NULL, algor);
  107|       |
  108|  54.4k|#ifndef OPENSSL_NO_EC
  109|       |    /* SM2 abuses the EC oid, so this could actually be SM2 */
  110|  54.4k|    if (OBJ_obj2nid(oid) == NID_X9_62_id_ecPublicKey
  ------------------
  |  |  178|   108k|#define NID_X9_62_id_ecPublicKey                408
  ------------------
  |  Branch (110:9): [True: 34.3k, False: 20.0k]
  ------------------
  111|  54.4k|            && ossl_x509_algor_is_sm2(algor))
  ------------------
  |  Branch (111:16): [True: 1, False: 34.3k]
  ------------------
  112|      1|        strcpy(dataname, "SM2");
  113|  54.4k|    else
  114|  54.4k|#endif
  115|  54.4k|    if (OBJ_obj2txt(dataname, sizeof(dataname), oid, 0) <= 0)
  ------------------
  |  Branch (115:9): [True: 0, False: 54.4k]
  ------------------
  116|      0|        goto end;
  117|       |
  118|  54.4k|    ossl_X509_PUBKEY_INTERNAL_free(xpub);
  119|  54.4k|    xpub = NULL;
  120|       |
  121|  54.4k|    *p++ =
  122|  54.4k|        OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  311|  54.4k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  123|  54.4k|                                            dataname, 0);
  124|       |
  125|  54.4k|    *p++ =
  126|  54.4k|        OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_STRUCTURE,
  ------------------
  |  |  310|  54.4k|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  127|  54.4k|                                            "SubjectPublicKeyInfo",
  128|  54.4k|                                            0);
  129|  54.4k|    *p++ =
  130|  54.4k|        OSSL_PARAM_construct_octet_string(OSSL_OBJECT_PARAM_DATA, der, len);
  ------------------
  |  |  309|  54.4k|# define OSSL_OBJECT_PARAM_DATA "data"
  ------------------
  131|  54.4k|    *p++ =
  132|  54.4k|        OSSL_PARAM_construct_int(OSSL_OBJECT_PARAM_TYPE, &objtype);
  ------------------
  |  |  314|  54.4k|# define OSSL_OBJECT_PARAM_TYPE "type"
  ------------------
  133|       |
  134|  54.4k|    *p = OSSL_PARAM_construct_end();
  135|       |
  136|  54.4k|    ok = data_cb(params, data_cbarg);
  137|       |
  138|  54.6k| end:
  139|  54.6k|    ossl_X509_PUBKEY_INTERNAL_free(xpub);
  140|  54.6k|    OPENSSL_free(der);
  ------------------
  |  |  107|  54.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  54.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  54.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  141|  54.6k|    return ok;
  142|  54.4k|}

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

cipher_aes.c:aes_256_ecb_newctx:
  197|      3|static void * alg##_##kbits##_##lcmode##_newctx(void *provctx)                 \
  198|      3|{                                                                              \
  199|      3|     PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\
  ------------------
  |  |   99|      3|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (199:32): [True: 3, False: 0]
  ------------------
  200|      3|                                                     : NULL;                   \
  201|      3|     if (ctx != NULL) {                                                        \
  ------------------
  |  Branch (201:10): [True: 3, False: 0]
  ------------------
  202|      3|         ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits,              \
  203|      3|                                     EVP_CIPH_##UCMODE##_MODE, flags,          \
  204|      3|                                     ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\
  205|      3|                                     provctx);                                 \
  206|      3|     }                                                                         \
  207|      3|     return ctx;                                                               \
  208|      3|}                                                                              \
cipher_aes.c:aes_256_ecb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_192_ecb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_128_ecb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_256_cbc_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_192_cbc_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_128_cbc_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_256_ofb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_192_ofb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_128_ofb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_256_cfb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_192_cfb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_128_cfb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_256_cfb1_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_192_cfb1_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_128_cfb1_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_256_cfb8_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_192_cfb8_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_128_cfb8_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_256_ctr_newctx:
  197|      2|static void * alg##_##kbits##_##lcmode##_newctx(void *provctx)                 \
  198|      2|{                                                                              \
  199|      2|     PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (199:32): [True: 2, False: 0]
  ------------------
  200|      2|                                                     : NULL;                   \
  201|      2|     if (ctx != NULL) {                                                        \
  ------------------
  |  Branch (201:10): [True: 2, False: 0]
  ------------------
  202|      2|         ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits,              \
  203|      2|                                     EVP_CIPH_##UCMODE##_MODE, flags,          \
  204|      2|                                     ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\
  205|      2|                                     provctx);                                 \
  206|      2|     }                                                                         \
  207|      2|     return ctx;                                                               \
  208|      2|}                                                                              \
cipher_aes.c:aes_256_ctr_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_192_ctr_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_128_ctr_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aes.c:aes_cbc_cts_gettable_ctx_params:
  340|      3|                                              ossl_unused void *provctx)       \
  341|      3|{                                                                              \
  342|      3|    return name##_known_gettable_ctx_params;                                   \
  343|      3|}
cipher_aria.c:aria_256_ecb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_192_ecb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_128_ecb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_256_cbc_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_192_cbc_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_128_cbc_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_256_ofb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_192_ofb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_128_ofb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_256_cfb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_192_cfb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_128_cfb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_256_cfb1_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_192_cfb1_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_128_cfb1_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_256_cfb8_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_192_cfb8_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_128_cfb8_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_256_ctr_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_192_ctr_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_aria.c:aria_128_ctr_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_256_ecb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_192_ecb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_128_ecb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_256_cbc_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_192_cbc_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_128_cbc_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_256_ofb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_192_ofb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_128_ofb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_256_cfb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_192_cfb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_128_cfb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_256_cfb1_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_192_cfb1_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_128_cfb1_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_256_cfb8_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_192_cfb8_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_128_cfb8_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_256_ctr_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_192_ctr_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_128_ctr_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_camellia.c:camellia_cbc_cts_gettable_ctx_params:
  340|      3|                                              ossl_unused void *provctx)       \
  341|      3|{                                                                              \
  342|      3|    return name##_known_gettable_ctx_params;                                   \
  343|      3|}
cipher_sm4.c:sm4_128_ecb_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_sm4.c:sm4_128_cbc_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_sm4.c:sm4_128_ctr_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_sm4.c:sm4_128_ofb128_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
cipher_sm4.c:sm4_128_cfb128_get_params:
  191|      1|static int alg##_##kbits##_##lcmode##_get_params(OSSL_PARAM params[])          \
  192|      1|{                                                                              \
  193|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  194|      1|                                          flags, kbits, blkbits, ivbits);      \
  195|      1|}                                                                              \
ossl_tdes_gettable_ctx_params:
  340|     11|                                              ossl_unused void *provctx)       \
  341|     11|{                                                                              \
  342|     11|    return name##_known_gettable_ctx_params;                                   \
  343|     11|}
ossl_cipher_generic_gettable_ctx_params:
  340|     83|                                              ossl_unused void *provctx)       \
  341|     83|{                                                                              \
  342|     83|    return name##_known_gettable_ctx_params;                                   \
  343|     83|}

cipher_aes_ccm.c:aes_128_ccm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aes_ccm.c:aes_192_ccm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aes_ccm.c:aes_256_ccm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aes_gcm.c:aes_128_gcm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aes_gcm.c:aes_192_gcm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aes_gcm.c:aes_256_gcm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aria_ccm.c:aria_128_ccm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aria_ccm.c:aria_192_ccm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aria_ccm.c:aria_256_ccm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aria_gcm.c:aria_128_gcm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aria_gcm.c:aria_192_gcm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_aria_gcm.c:aria_256_gcm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_sm4_ccm.c:sm4_128_ccm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \
cipher_sm4_gcm.c:sm4_128_gcm_get_params:
   20|      1|static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[])              \
   21|      1|{                                                                              \
   22|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   23|      1|                                          flags, kbits, blkbits, ivbits);      \
   24|      1|}                                                                              \

blake2_prov.c:blake2s256_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_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|  20.3k|static void *name##_newctx(void *prov_ctx)                                     \
   56|  20.3k|{                                                                              \
   57|  20.3k|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |   99|  20.3k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  20.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  20.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 20.3k, False: 0]
  ------------------
   58|  20.3k|    return ctx;                                                                \
   59|  20.3k|}                                                                              \
sha2_prov.c:sha1_internal_final:
   41|  20.3k|                                 size_t outsz)                                 \
   42|  20.3k|{                                                                              \
   43|  20.3k|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 20.3k, False: 0]
  |  Branch (43:35): [True: 20.3k, False: 0]
  |  Branch (43:56): [True: 20.3k, False: 0]
  ------------------
   44|  20.3k|        *outl = dgstsize;                                                      \
   45|  20.3k|        return 1;                                                              \
   46|  20.3k|    }                                                                          \
   47|  20.3k|    return 0;                                                                  \
   48|  20.3k|}
sha2_prov.c:sha1_freectx:
   60|  20.3k|static void name##_freectx(void *vctx)                                         \
   61|  20.3k|{                                                                              \
   62|  20.3k|    CTX *ctx = (CTX *)vctx;                                                    \
   63|  20.3k|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  105|  20.3k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  20.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  20.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|  20.3k|}                                                                              \
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:
  104|  20.3k|static int name##_internal_init(void *ctx, const OSSL_PARAM params[])          \
  105|  20.3k|{                                                                              \
  106|  20.3k|    return ossl_prov_is_running()                                              \
  ------------------
  |  Branch (106:12): [True: 20.3k, False: 0]
  ------------------
  107|  20.3k|           && init(ctx)                                                        \
  ------------------
  |  Branch (107:15): [True: 20.3k, False: 0]
  ------------------
  108|  20.3k|           && set_ctx_params(ctx, params);                                     \
  ------------------
  |  Branch (108:15): [True: 20.3k, False: 0]
  ------------------
  109|  20.3k|}                                                                              \
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_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_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:
  804|  4.62k|{
  805|  4.62k|    DH *dh = NULL;
  806|       |
  807|  4.62k|    if (ossl_prov_is_running() && reference_sz == sizeof(dh)) {
  ------------------
  |  Branch (807:9): [True: 4.62k, False: 0]
  |  Branch (807:35): [True: 4.62k, False: 0]
  ------------------
  808|       |        /* The contents of the reference is the address to our object */
  809|  4.62k|        dh = *(DH **)reference;
  810|       |        /* We grabbed, so we detach it */
  811|  4.62k|        *(DH **)reference = NULL;
  812|  4.62k|        return dh;
  813|  4.62k|    }
  814|      0|    return NULL;
  815|  4.62k|}
dh_kmgmt.c:dh_freedata:
  125|  4.62k|{
  126|  4.62k|    DH_free(keydata);
  127|  4.62k|}
dh_kmgmt.c:dh_get_params:
  315|  4.62k|{
  316|  4.62k|    DH *dh = key;
  317|  4.62k|    OSSL_PARAM *p;
  318|       |
  319|  4.62k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  316|  4.62k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (319:9): [True: 4.62k, False: 0]
  ------------------
  320|  4.62k|        && !OSSL_PARAM_set_int(p, DH_bits(dh)))
  ------------------
  |  Branch (320:12): [True: 0, False: 4.62k]
  ------------------
  321|      0|        return 0;
  322|  4.62k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  427|  4.62k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (322:9): [True: 4.62k, False: 0]
  ------------------
  323|  4.62k|        && !OSSL_PARAM_set_int(p, DH_security_bits(dh)))
  ------------------
  |  Branch (323:12): [True: 0, False: 4.62k]
  ------------------
  324|      0|        return 0;
  325|  4.62k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  368|  4.62k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (325:9): [True: 4.62k, False: 0]
  ------------------
  326|  4.62k|        && !OSSL_PARAM_set_int(p, DH_size(dh)))
  ------------------
  |  Branch (326:12): [True: 0, False: 4.62k]
  ------------------
  327|      0|        return 0;
  328|  4.62k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL) {
  ------------------
  |  |  346|  4.62k|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
  |  Branch (328:9): [True: 0, False: 4.62k]
  ------------------
  329|      0|        if (p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (329:13): [True: 0, False: 0]
  ------------------
  330|      0|            return 0;
  331|      0|        p->return_size = ossl_dh_key2buf(dh, (unsigned char **)&p->data,
  332|      0|                                         p->data_size, 0);
  333|      0|        if (p->return_size == 0)
  ------------------
  |  Branch (333:13): [True: 0, False: 0]
  ------------------
  334|      0|            return 0;
  335|      0|    }
  336|       |
  337|  4.62k|    return ossl_dh_params_todata(dh, NULL, params)
  ------------------
  |  Branch (337:12): [True: 4.62k, False: 0]
  ------------------
  338|  4.62k|        && ossl_dh_key_todata(dh, NULL, params, 1);
  ------------------
  |  Branch (338:12): [True: 4.62k, False: 0]
  ------------------
  339|  4.62k|}

dsa_kmgmt.c:dsa_load:
  637|  2.17k|{
  638|  2.17k|    DSA *dsa = NULL;
  639|       |
  640|  2.17k|    if (ossl_prov_is_running() && reference_sz == sizeof(dsa)) {
  ------------------
  |  Branch (640:9): [True: 2.17k, False: 0]
  |  Branch (640:35): [True: 2.17k, False: 0]
  ------------------
  641|       |        /* The contents of the reference is the address to our object */
  642|  2.17k|        dsa = *(DSA **)reference;
  643|       |        /* We grabbed, so we detach it */
  644|  2.17k|        *(DSA **)reference = NULL;
  645|  2.17k|        return dsa;
  646|  2.17k|    }
  647|      0|    return NULL;
  648|  2.17k|}
dsa_kmgmt.c:dsa_freedata:
  126|  2.17k|{
  127|  2.17k|    DSA_free(keydata);
  128|  2.17k|}
dsa_kmgmt.c:dsa_get_params:
  313|  2.17k|{
  314|  2.17k|    DSA *dsa = key;
  315|  2.17k|    OSSL_PARAM *p;
  316|       |
  317|  2.17k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  316|  2.17k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (317:9): [True: 2.17k, False: 0]
  ------------------
  318|  2.17k|        && !OSSL_PARAM_set_int(p, DSA_bits(dsa)))
  ------------------
  |  Branch (318:12): [True: 0, False: 2.17k]
  ------------------
  319|      0|        return 0;
  320|  2.17k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  427|  2.17k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (320:9): [True: 2.17k, False: 0]
  ------------------
  321|  2.17k|        && !OSSL_PARAM_set_int(p, DSA_security_bits(dsa)))
  ------------------
  |  Branch (321:12): [True: 0, False: 2.17k]
  ------------------
  322|      0|        return 0;
  323|  2.17k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  368|  2.17k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (323:9): [True: 2.17k, False: 0]
  ------------------
  324|  2.17k|        && !OSSL_PARAM_set_int(p, DSA_size(dsa)))
  ------------------
  |  Branch (324:12): [True: 0, False: 2.17k]
  ------------------
  325|      0|        return 0;
  326|  2.17k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  318|  2.17k|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (326:9): [True: 0, False: 2.17k]
  ------------------
  327|  2.17k|        && !OSSL_PARAM_set_utf8_string(p, DSA_DEFAULT_MD))
  ------------------
  |  |   48|      0|#define DSA_DEFAULT_MD "SHA256"
  ------------------
  |  Branch (327:12): [True: 0, False: 0]
  ------------------
  328|      0|        return 0;
  329|  2.17k|    return ossl_ffc_params_todata(ossl_dsa_get0_params(dsa), NULL, params)
  ------------------
  |  Branch (329:12): [True: 2.17k, False: 0]
  ------------------
  330|  2.17k|           && dsa_key_todata(dsa, NULL, params, 1);
  ------------------
  |  Branch (330:15): [True: 2.17k, False: 0]
  ------------------
  331|  2.17k|}
dsa_kmgmt.c:dsa_key_todata:
  100|  2.17k|{
  101|  2.17k|    const BIGNUM *priv = NULL, *pub = NULL;
  102|       |
  103|  2.17k|    if (dsa == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 2.17k]
  ------------------
  104|      0|        return 0;
  105|       |
  106|  2.17k|    DSA_get0_key(dsa, &pub, &priv);
  107|  2.17k|    if (include_private
  ------------------
  |  Branch (107:9): [True: 2.17k, False: 0]
  ------------------
  108|  2.17k|        && priv != NULL
  ------------------
  |  Branch (108:12): [True: 0, False: 2.17k]
  ------------------
  109|  2.17k|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PRIV_KEY, priv))
  ------------------
  |  |  372|      0|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  |  Branch (109:12): [True: 0, False: 0]
  ------------------
  110|      0|        return 0;
  111|  2.17k|    if (pub != NULL
  ------------------
  |  Branch (111:9): [True: 2.17k, False: 0]
  ------------------
  112|  2.17k|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PUB_KEY, pub))
  ------------------
  |  |  374|  2.17k|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  |  Branch (112:12): [True: 0, False: 2.17k]
  ------------------
  113|      0|        return 0;
  114|       |
  115|  2.17k|    return 1;
  116|  2.17k|}

ec_kmgmt.c:ec_load:
 1401|  18.4k|{
 1402|  18.4k|    return common_load(reference, reference_sz, 0);
 1403|  18.4k|}
ec_kmgmt.c:common_load:
 1383|  18.4k|{
 1384|  18.4k|    EC_KEY *ec = NULL;
 1385|       |
 1386|  18.4k|    if (ossl_prov_is_running() && reference_sz == sizeof(ec)) {
  ------------------
  |  Branch (1386:9): [True: 18.4k, False: 0]
  |  Branch (1386:35): [True: 18.4k, False: 0]
  ------------------
 1387|       |        /* The contents of the reference is the address to our object */
 1388|  18.4k|        ec = *(EC_KEY **)reference;
 1389|       |
 1390|  18.4k|        if (!common_check_sm2(ec, sm2_wanted))
  ------------------
  |  Branch (1390:13): [True: 0, False: 18.4k]
  ------------------
 1391|      0|            return NULL;
 1392|       |
 1393|       |        /* We grabbed, so we detach it */
 1394|  18.4k|        *(EC_KEY **)reference = NULL;
 1395|  18.4k|        return ec;
 1396|  18.4k|    }
 1397|      0|    return NULL;
 1398|  18.4k|}
ec_kmgmt.c:common_check_sm2:
  376|  18.4k|{
  377|  18.4k|    const EC_GROUP *ecg = NULL;
  378|       |
  379|       |    /*
  380|       |     * sm2_wanted: import the keys or domparams only on SM2 Curve
  381|       |     * !sm2_wanted: import the keys or domparams only not on SM2 Curve
  382|       |     */
  383|  18.4k|    if ((ecg = EC_KEY_get0_group(ec)) == NULL
  ------------------
  |  Branch (383:9): [True: 0, False: 18.4k]
  ------------------
  384|  18.4k|        || (sm2_wanted ^ (EC_GROUP_get_curve_name(ecg) == NID_sm2)))
  ------------------
  |  | 1228|  18.4k|#define NID_sm2         1172
  ------------------
  |  Branch (384:12): [True: 0, False: 18.4k]
  ------------------
  385|      0|        return 0;
  386|  18.4k|    return 1;
  387|  18.4k|}
ec_kmgmt.c:ec_freedata:
  299|  18.4k|{
  300|  18.4k|    EC_KEY_free(keydata);
  301|  18.4k|}
ec_kmgmt.c:ec_get_params:
  768|  18.4k|{
  769|  18.4k|    return common_get_params(key, params, 0);
  770|  18.4k|}
ec_kmgmt.c:common_get_params:
  637|  18.4k|{
  638|  18.4k|    int ret = 0;
  639|  18.4k|    EC_KEY *eck = key;
  640|  18.4k|    const EC_GROUP *ecg = NULL;
  641|  18.4k|    OSSL_PARAM *p;
  642|  18.4k|    unsigned char *pub_key = NULL, *genbuf = NULL;
  643|  18.4k|    OSSL_LIB_CTX *libctx;
  644|  18.4k|    const char *propq;
  645|  18.4k|    BN_CTX *bnctx = NULL;
  646|       |
  647|  18.4k|    ecg = EC_KEY_get0_group(eck);
  648|  18.4k|    if (ecg == NULL) {
  ------------------
  |  Branch (648:9): [True: 0, False: 18.4k]
  ------------------
  649|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  650|      0|        return 0;
  651|      0|    }
  652|       |
  653|  18.4k|    libctx = ossl_ec_key_get_libctx(eck);
  654|  18.4k|    propq = ossl_ec_key_get0_propq(eck);
  655|       |
  656|  18.4k|    bnctx = BN_CTX_new_ex(libctx);
  657|  18.4k|    if (bnctx == NULL)
  ------------------
  |  Branch (657:9): [True: 0, False: 18.4k]
  ------------------
  658|      0|        return 0;
  659|  18.4k|    BN_CTX_start(bnctx);
  660|       |
  661|  18.4k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  368|  18.4k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (661:9): [True: 18.4k, False: 0]
  ------------------
  662|  18.4k|        && !OSSL_PARAM_set_int(p, ECDSA_size(eck)))
  ------------------
  |  Branch (662:12): [True: 0, False: 18.4k]
  ------------------
  663|      0|        goto err;
  664|  18.4k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  316|  18.4k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (664:9): [True: 18.4k, False: 0]
  ------------------
  665|  18.4k|        && !OSSL_PARAM_set_int(p, EC_GROUP_order_bits(ecg)))
  ------------------
  |  Branch (665:12): [True: 0, False: 18.4k]
  ------------------
  666|      0|        goto err;
  667|  18.4k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL) {
  ------------------
  |  |  427|  18.4k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (667:9): [True: 18.4k, False: 0]
  ------------------
  668|  18.4k|        int ecbits, sec_bits;
  669|       |
  670|  18.4k|        ecbits = EC_GROUP_order_bits(ecg);
  671|       |
  672|       |        /*
  673|       |         * The following estimates are based on the values published
  674|       |         * in Table 2 of "NIST Special Publication 800-57 Part 1 Revision 4"
  675|       |         * at http://dx.doi.org/10.6028/NIST.SP.800-57pt1r4 .
  676|       |         *
  677|       |         * Note that the above reference explicitly categorizes algorithms in a
  678|       |         * discrete set of values {80, 112, 128, 192, 256}, and that it is
  679|       |         * relevant only for NIST approved Elliptic Curves, while OpenSSL
  680|       |         * applies the same logic also to other curves.
  681|       |         *
  682|       |         * Classifications produced by other standardazing bodies might differ,
  683|       |         * so the results provided for "bits of security" by this provider are
  684|       |         * to be considered merely indicative, and it is the users'
  685|       |         * responsibility to compare these values against the normative
  686|       |         * references that may be relevant for their intent and purposes.
  687|       |         */
  688|  18.4k|        if (ecbits >= 512)
  ------------------
  |  Branch (688:13): [True: 4.97k, False: 13.4k]
  ------------------
  689|  4.97k|            sec_bits = 256;
  690|  13.4k|        else if (ecbits >= 384)
  ------------------
  |  Branch (690:18): [True: 600, False: 12.8k]
  ------------------
  691|    600|            sec_bits = 192;
  692|  12.8k|        else if (ecbits >= 256)
  ------------------
  |  Branch (692:18): [True: 164, False: 12.7k]
  ------------------
  693|    164|            sec_bits = 128;
  694|  12.7k|        else if (ecbits >= 224)
  ------------------
  |  Branch (694:18): [True: 6.08k, False: 6.64k]
  ------------------
  695|  6.08k|            sec_bits = 112;
  696|  6.64k|        else if (ecbits >= 160)
  ------------------
  |  Branch (696:18): [True: 729, False: 5.91k]
  ------------------
  697|    729|            sec_bits = 80;
  698|  5.91k|        else
  699|  5.91k|            sec_bits = ecbits / 2;
  700|       |
  701|  18.4k|        if (!OSSL_PARAM_set_int(p, sec_bits))
  ------------------
  |  Branch (701:13): [True: 0, False: 18.4k]
  ------------------
  702|      0|            goto err;
  703|  18.4k|    }
  704|       |
  705|  18.4k|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (705:9): [True: 0, False: 18.4k]
  ------------------
  706|  18.4k|                               OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS))
  ------------------
  |  |  334|  18.4k|# define OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS "decoded-from-explicit"
  ------------------
  707|  18.4k|            != NULL) {
  708|      0|        int explicitparams = EC_KEY_decoded_from_explicit_params(eck);
  709|       |
  710|      0|        if (explicitparams < 0
  ------------------
  |  Branch (710:13): [True: 0, False: 0]
  ------------------
  711|      0|             || !OSSL_PARAM_set_int(p, explicitparams))
  ------------------
  |  Branch (711:17): [True: 0, False: 0]
  ------------------
  712|      0|            goto err;
  713|      0|    }
  714|       |
  715|  18.4k|    if (!sm2) {
  ------------------
  |  Branch (715:9): [True: 18.4k, False: 1]
  ------------------
  716|  18.4k|        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  318|  18.4k|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (716:13): [True: 0, False: 18.4k]
  ------------------
  717|  18.4k|                && !OSSL_PARAM_set_utf8_string(p, EC_DEFAULT_MD))
  ------------------
  |  |   72|      0|#define EC_DEFAULT_MD "SHA256"
  ------------------
  |  Branch (717:20): [True: 0, False: 0]
  ------------------
  718|      0|            goto err;
  719|  18.4k|    } else {
  720|      1|        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  318|      1|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (720:13): [True: 0, False: 1]
  ------------------
  721|      1|                && !OSSL_PARAM_set_utf8_string(p, SM2_DEFAULT_MD))
  ------------------
  |  |   75|      0|#define SM2_DEFAULT_MD "SM3"
  ------------------
  |  Branch (721:20): [True: 0, False: 0]
  ------------------
  722|      0|            goto err;
  723|      1|    }
  724|       |
  725|       |    /* SM2 doesn't support this PARAM */
  726|  18.4k|    if (!sm2) {
  ------------------
  |  Branch (726:9): [True: 18.4k, False: 1]
  ------------------
  727|  18.4k|        p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_USE_COFACTOR_ECDH);
  ------------------
  |  |  428|  18.4k|# define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH OSSL_PKEY_PARAM_USE_COFACTOR_FLAG
  |  |  ------------------
  |  |  |  |  429|  18.4k|# define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag"
  |  |  ------------------
  ------------------
  728|  18.4k|        if (p != NULL) {
  ------------------
  |  Branch (728:13): [True: 0, False: 18.4k]
  ------------------
  729|      0|            int ecdh_cofactor_mode = 0;
  730|       |
  731|      0|            ecdh_cofactor_mode =
  732|      0|                (EC_KEY_get_flags(eck) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0;
  ------------------
  |  |  963|      0|#  define EC_FLAG_COFACTOR_ECDH          0x1000
  ------------------
  |  Branch (732:17): [True: 0, False: 0]
  ------------------
  733|       |
  734|      0|            if (!OSSL_PARAM_set_int(p, ecdh_cofactor_mode))
  ------------------
  |  Branch (734:17): [True: 0, False: 0]
  ------------------
  735|      0|                goto err;
  736|      0|        }
  737|  18.4k|    }
  738|  18.4k|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (738:9): [True: 0, False: 18.4k]
  ------------------
  739|  18.4k|                               OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL) {
  ------------------
  |  |  346|  18.4k|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
  740|      0|        const EC_POINT *ecp = EC_KEY_get0_public_key(key);
  741|       |
  742|      0|        if (ecp == NULL) {
  ------------------
  |  Branch (742:13): [True: 0, False: 0]
  ------------------
  743|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  744|      0|            goto err;
  745|      0|        }
  746|      0|        p->return_size = EC_POINT_point2oct(ecg, ecp,
  747|      0|                                            POINT_CONVERSION_UNCOMPRESSED,
  748|      0|                                            p->data, p->data_size, bnctx);
  749|      0|        if (p->return_size == 0)
  ------------------
  |  Branch (749:13): [True: 0, False: 0]
  ------------------
  750|      0|            goto err;
  751|      0|    }
  752|       |
  753|  18.4k|    ret = ec_get_ecm_params(ecg, params)
  ------------------
  |  Branch (753:11): [True: 18.4k, False: 0]
  ------------------
  754|  18.4k|          && ossl_ec_group_todata(ecg, NULL, params, libctx, propq, bnctx,
  ------------------
  |  Branch (754:14): [True: 18.4k, False: 0]
  ------------------
  755|  18.4k|                                  &genbuf)
  756|  18.4k|          && key_to_params(eck, NULL, params, 1, &pub_key)
  ------------------
  |  Branch (756:14): [True: 18.4k, False: 0]
  ------------------
  757|  18.4k|          && otherparams_to_params(eck, NULL, params);
  ------------------
  |  Branch (757:14): [True: 18.4k, False: 0]
  ------------------
  758|  18.4k|err:
  759|  18.4k|    OPENSSL_free(genbuf);
  ------------------
  |  |  107|  18.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  18.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  18.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  760|  18.4k|    OPENSSL_free(pub_key);
  ------------------
  |  |  107|  18.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  18.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  18.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  761|  18.4k|    BN_CTX_end(bnctx);
  762|  18.4k|    BN_CTX_free(bnctx);
  763|  18.4k|    return ret;
  764|  18.4k|}
ec_kmgmt.c:ec_get_ecm_params:
  585|  18.4k|{
  586|       |#ifdef OPENSSL_NO_EC2M
  587|       |    return 1;
  588|       |#else
  589|  18.4k|    int ret = 0, m;
  590|  18.4k|    unsigned int k1 = 0, k2 = 0, k3 = 0;
  591|  18.4k|    int basis_nid;
  592|  18.4k|    const char *basis_name = NULL;
  593|  18.4k|    int fid = EC_GROUP_get_field_type(group);
  594|       |
  595|  18.4k|    if (fid != NID_X9_62_characteristic_two_field)
  ------------------
  |  |  156|  18.4k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (595:9): [True: 10.1k, False: 8.30k]
  ------------------
  596|  10.1k|        return 1;
  597|       |
  598|  8.30k|    basis_nid = EC_GROUP_get_basis_type(group);
  599|  8.30k|    if (basis_nid == NID_X9_62_tpBasis)
  ------------------
  |  |  168|  8.30k|#define NID_X9_62_tpBasis               682
  ------------------
  |  Branch (599:9): [True: 3.77k, False: 4.53k]
  ------------------
  600|  3.77k|        basis_name = SN_X9_62_tpBasis;
  ------------------
  |  |  167|  3.77k|#define SN_X9_62_tpBasis                "tpBasis"
  ------------------
  601|  4.53k|    else if (basis_nid == NID_X9_62_ppBasis)
  ------------------
  |  |  172|  4.53k|#define NID_X9_62_ppBasis               683
  ------------------
  |  Branch (601:14): [True: 4.53k, False: 0]
  ------------------
  602|  4.53k|        basis_name = SN_X9_62_ppBasis;
  ------------------
  |  |  171|  4.53k|#define SN_X9_62_ppBasis                "ppBasis"
  ------------------
  603|      0|    else
  604|      0|        goto err;
  605|       |
  606|  8.30k|    m = EC_GROUP_get_degree(group);
  607|  8.30k|    if (!ossl_param_build_set_int(NULL, params, OSSL_PKEY_PARAM_EC_CHAR2_M, m)
  ------------------
  |  |  327|  8.30k|# define OSSL_PKEY_PARAM_EC_CHAR2_M "m"
  ------------------
  |  Branch (607:9): [True: 0, False: 8.30k]
  ------------------
  608|  8.30k|        || !ossl_param_build_set_utf8_string(NULL, params,
  ------------------
  |  Branch (608:12): [True: 0, False: 8.30k]
  ------------------
  609|  8.30k|                                             OSSL_PKEY_PARAM_EC_CHAR2_TYPE,
  ------------------
  |  |  332|  8.30k|# define OSSL_PKEY_PARAM_EC_CHAR2_TYPE "basis-type"
  ------------------
  610|  8.30k|                                             basis_name))
  611|      0|        goto err;
  612|       |
  613|  8.30k|    if (basis_nid == NID_X9_62_tpBasis) {
  ------------------
  |  |  168|  8.30k|#define NID_X9_62_tpBasis               682
  ------------------
  |  Branch (613:9): [True: 3.77k, False: 4.53k]
  ------------------
  614|  3.77k|        if (!EC_GROUP_get_trinomial_basis(group, &k1)
  ------------------
  |  Branch (614:13): [True: 0, False: 3.77k]
  ------------------
  615|  3.77k|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (615:16): [True: 0, False: 3.77k]
  ------------------
  616|  3.77k|                                         OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS,
  ------------------
  |  |  331|  3.77k|# define OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS "tp"
  ------------------
  617|  3.77k|                                         (int)k1))
  618|      0|            goto err;
  619|  4.53k|    } else {
  620|  4.53k|        if (!EC_GROUP_get_pentanomial_basis(group, &k1, &k2, &k3)
  ------------------
  |  Branch (620:13): [True: 0, False: 4.53k]
  ------------------
  621|  4.53k|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (621:16): [True: 0, False: 4.53k]
  ------------------
  622|  4.53k|                                         OSSL_PKEY_PARAM_EC_CHAR2_PP_K1, (int)k1)
  ------------------
  |  |  328|  4.53k|# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K1 "k1"
  ------------------
  623|  4.53k|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (623:16): [True: 0, False: 4.53k]
  ------------------
  624|  4.53k|                                         OSSL_PKEY_PARAM_EC_CHAR2_PP_K2, (int)k2)
  ------------------
  |  |  329|  4.53k|# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K2 "k2"
  ------------------
  625|  4.53k|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (625:16): [True: 0, False: 4.53k]
  ------------------
  626|  4.53k|                                         OSSL_PKEY_PARAM_EC_CHAR2_PP_K3, (int)k3))
  ------------------
  |  |  330|  4.53k|# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K3 "k3"
  ------------------
  627|      0|            goto err;
  628|  4.53k|    }
  629|  8.30k|    ret = 1;
  630|  8.30k|err:
  631|  8.30k|    return ret;
  632|  8.30k|#endif /* OPENSSL_NO_EC2M */
  633|  8.30k|}
ec_kmgmt.c:key_to_params:
  114|  18.4k|{
  115|  18.4k|    BIGNUM *x = NULL, *y = NULL;
  116|  18.4k|    const BIGNUM *priv_key = NULL;
  117|  18.4k|    const EC_POINT *pub_point = NULL;
  118|  18.4k|    const EC_GROUP *ecg = NULL;
  119|  18.4k|    size_t pub_key_len = 0;
  120|  18.4k|    int ret = 0;
  121|  18.4k|    BN_CTX *bnctx = NULL;
  122|       |
  123|  18.4k|    if (eckey == NULL
  ------------------
  |  Branch (123:9): [True: 0, False: 18.4k]
  ------------------
  124|  18.4k|        || (ecg = EC_KEY_get0_group(eckey)) == NULL)
  ------------------
  |  Branch (124:12): [True: 0, False: 18.4k]
  ------------------
  125|      0|        return 0;
  126|       |
  127|  18.4k|    priv_key = EC_KEY_get0_private_key(eckey);
  128|  18.4k|    pub_point = EC_KEY_get0_public_key(eckey);
  129|       |
  130|  18.4k|    if (pub_point != NULL) {
  ------------------
  |  Branch (130:9): [True: 18.4k, False: 0]
  ------------------
  131|  18.4k|        OSSL_PARAM *p = NULL, *px = NULL, *py = NULL;
  132|       |        /*
  133|       |         * EC_POINT_point2buf() can generate random numbers in some
  134|       |         * implementations so we need to ensure we use the correct libctx.
  135|       |         */
  136|  18.4k|        bnctx = BN_CTX_new_ex(ossl_ec_key_get_libctx(eckey));
  137|  18.4k|        if (bnctx == NULL)
  ------------------
  |  Branch (137:13): [True: 0, False: 18.4k]
  ------------------
  138|      0|            goto err;
  139|       |
  140|       |
  141|       |        /* If we are doing a get then check first before decoding the point */
  142|  18.4k|        if (tmpl == NULL) {
  ------------------
  |  Branch (142:13): [True: 18.4k, False: 0]
  ------------------
  143|  18.4k|            p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_PUB_KEY);
  ------------------
  |  |  374|  18.4k|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  144|  18.4k|            px = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_EC_PUB_X);
  ------------------
  |  |  343|  18.4k|# define OSSL_PKEY_PARAM_EC_PUB_X "qx"
  ------------------
  145|  18.4k|            py = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_EC_PUB_Y);
  ------------------
  |  |  344|  18.4k|# define OSSL_PKEY_PARAM_EC_PUB_Y "qy"
  ------------------
  146|  18.4k|        }
  147|       |
  148|  18.4k|        if (p != NULL || tmpl != NULL) {
  ------------------
  |  Branch (148:13): [True: 0, False: 18.4k]
  |  Branch (148:26): [True: 0, False: 18.4k]
  ------------------
  149|       |            /* convert pub_point to a octet string according to the SECG standard */
  150|      0|            point_conversion_form_t format = EC_KEY_get_conv_form(eckey);
  151|       |
  152|      0|            if ((pub_key_len = EC_POINT_point2buf(ecg, pub_point,
  ------------------
  |  Branch (152:17): [True: 0, False: 0]
  ------------------
  153|      0|                                                  format,
  154|      0|                                                  pub_key, bnctx)) == 0
  155|      0|                || !ossl_param_build_set_octet_string(tmpl, p,
  ------------------
  |  Branch (155:20): [True: 0, False: 0]
  ------------------
  156|      0|                                                      OSSL_PKEY_PARAM_PUB_KEY,
  ------------------
  |  |  374|      0|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  157|      0|                                                      *pub_key, pub_key_len))
  158|      0|                goto err;
  159|      0|        }
  160|  18.4k|        if (px != NULL || py != NULL) {
  ------------------
  |  Branch (160:13): [True: 0, False: 18.4k]
  |  Branch (160:27): [True: 0, False: 18.4k]
  ------------------
  161|      0|            if (px != NULL) {
  ------------------
  |  Branch (161:17): [True: 0, False: 0]
  ------------------
  162|      0|                x = BN_CTX_get(bnctx);
  163|      0|                if (x == NULL)
  ------------------
  |  Branch (163:21): [True: 0, False: 0]
  ------------------
  164|      0|                    goto err;
  165|      0|            }
  166|      0|            if (py != NULL) {
  ------------------
  |  Branch (166:17): [True: 0, False: 0]
  ------------------
  167|      0|                y = BN_CTX_get(bnctx);
  168|      0|                if (y == NULL)
  ------------------
  |  Branch (168:21): [True: 0, False: 0]
  ------------------
  169|      0|                    goto err;
  170|      0|            }
  171|       |
  172|      0|            if (!EC_POINT_get_affine_coordinates(ecg, pub_point, x, y, bnctx))
  ------------------
  |  Branch (172:17): [True: 0, False: 0]
  ------------------
  173|      0|                goto err;
  174|      0|            if (px != NULL
  ------------------
  |  Branch (174:17): [True: 0, False: 0]
  ------------------
  175|      0|                && !ossl_param_build_set_bn(tmpl, px,
  ------------------
  |  Branch (175:20): [True: 0, False: 0]
  ------------------
  176|      0|                                            OSSL_PKEY_PARAM_EC_PUB_X, x))
  ------------------
  |  |  343|      0|# define OSSL_PKEY_PARAM_EC_PUB_X "qx"
  ------------------
  177|      0|                goto err;
  178|      0|            if (py != NULL
  ------------------
  |  Branch (178:17): [True: 0, False: 0]
  ------------------
  179|      0|                && !ossl_param_build_set_bn(tmpl, py,
  ------------------
  |  Branch (179:20): [True: 0, False: 0]
  ------------------
  180|      0|                                            OSSL_PKEY_PARAM_EC_PUB_Y, y))
  ------------------
  |  |  344|      0|# define OSSL_PKEY_PARAM_EC_PUB_Y "qy"
  ------------------
  181|      0|                goto err;
  182|      0|        }
  183|  18.4k|    }
  184|       |
  185|  18.4k|    if (priv_key != NULL && include_private) {
  ------------------
  |  Branch (185:9): [True: 0, False: 18.4k]
  |  Branch (185:29): [True: 0, False: 0]
  ------------------
  186|      0|        size_t sz;
  187|      0|        int ecbits;
  188|       |
  189|       |        /*
  190|       |         * Key import/export should never leak the bit length of the secret
  191|       |         * scalar in the key.
  192|       |         *
  193|       |         * For this reason, on export we use padded BIGNUMs with fixed length.
  194|       |         *
  195|       |         * When importing we also should make sure that, even if short lived,
  196|       |         * the newly created BIGNUM is marked with the BN_FLG_CONSTTIME flag as
  197|       |         * soon as possible, so that any processing of this BIGNUM might opt for
  198|       |         * constant time implementations in the backend.
  199|       |         *
  200|       |         * Setting the BN_FLG_CONSTTIME flag alone is never enough, we also have
  201|       |         * to preallocate the BIGNUM internal buffer to a fixed public size big
  202|       |         * enough that operations performed during the processing never trigger
  203|       |         * a realloc which would leak the size of the scalar through memory
  204|       |         * accesses.
  205|       |         *
  206|       |         * Fixed Length
  207|       |         * ------------
  208|       |         *
  209|       |         * The order of the large prime subgroup of the curve is our choice for
  210|       |         * a fixed public size, as that is generally the upper bound for
  211|       |         * generating a private key in EC cryptosystems and should fit all valid
  212|       |         * secret scalars.
  213|       |         *
  214|       |         * For padding on export we just use the bit length of the order
  215|       |         * converted to bytes (rounding up).
  216|       |         *
  217|       |         * For preallocating the BIGNUM storage we look at the number of "words"
  218|       |         * required for the internal representation of the order, and we
  219|       |         * preallocate 2 extra "words" in case any of the subsequent processing
  220|       |         * might temporarily overflow the order length.
  221|       |         */
  222|      0|        ecbits = EC_GROUP_order_bits(ecg);
  223|      0|        if (ecbits <= 0)
  ------------------
  |  Branch (223:13): [True: 0, False: 0]
  ------------------
  224|      0|            goto err;
  225|      0|        sz = (ecbits + 7) / 8;
  226|       |
  227|      0|        if (!ossl_param_build_set_bn_pad(tmpl, params,
  ------------------
  |  Branch (227:13): [True: 0, False: 0]
  ------------------
  228|      0|                                         OSSL_PKEY_PARAM_PRIV_KEY,
  ------------------
  |  |  372|      0|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  229|      0|                                         priv_key, sz))
  230|      0|            goto err;
  231|      0|    }
  232|  18.4k|    ret = 1;
  233|  18.4k| err:
  234|  18.4k|    BN_CTX_free(bnctx);
  235|  18.4k|    return ret;
  236|  18.4k|}
ec_kmgmt.c:otherparams_to_params:
  241|  18.4k|{
  242|  18.4k|    int ecdh_cofactor_mode = 0, group_check = 0;
  243|  18.4k|    const char *name = NULL;
  244|  18.4k|    point_conversion_form_t format;
  245|       |
  246|  18.4k|    if (ec == NULL)
  ------------------
  |  Branch (246:9): [True: 0, False: 18.4k]
  ------------------
  247|      0|        return 0;
  248|       |
  249|  18.4k|    format = EC_KEY_get_conv_form(ec);
  250|  18.4k|    name = ossl_ec_pt_format_id2name((int)format);
  251|  18.4k|    if (name != NULL
  ------------------
  |  Branch (251:9): [True: 15.6k, False: 2.77k]
  ------------------
  252|  18.4k|        && !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (252:12): [True: 0, False: 15.6k]
  ------------------
  253|  15.6k|                                             OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT,
  ------------------
  |  |  342|  15.6k|# define OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT "point-format"
  ------------------
  254|  15.6k|                                             name))
  255|      0|        return 0;
  256|       |
  257|  18.4k|    group_check = EC_KEY_get_flags(ec) & EC_FLAG_CHECK_NAMED_GROUP_MASK;
  ------------------
  |  |  967|  18.4k|    (EC_FLAG_CHECK_NAMED_GROUP | EC_FLAG_CHECK_NAMED_GROUP_NIST)
  |  |  ------------------
  |  |  |  |  964|  18.4k|#  define EC_FLAG_CHECK_NAMED_GROUP      0x2000
  |  |  ------------------
  |  |                   (EC_FLAG_CHECK_NAMED_GROUP | EC_FLAG_CHECK_NAMED_GROUP_NIST)
  |  |  ------------------
  |  |  |  |  965|  18.4k|#  define EC_FLAG_CHECK_NAMED_GROUP_NIST 0x4000
  |  |  ------------------
  ------------------
  258|  18.4k|    name = ossl_ec_check_group_type_id2name(group_check);
  259|  18.4k|    if (name != NULL
  ------------------
  |  Branch (259:9): [True: 18.4k, False: 0]
  ------------------
  260|  18.4k|        && !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (260:12): [True: 0, False: 18.4k]
  ------------------
  261|  18.4k|                                             OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE,
  ------------------
  |  |  338|  18.4k|# define OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE "group-check"
  ------------------
  262|  18.4k|                                             name))
  263|      0|        return 0;
  264|       |
  265|  18.4k|    if ((EC_KEY_get_enc_flags(ec) & EC_PKEY_NO_PUBKEY) != 0
  ------------------
  |  |  959|  18.4k|#  define EC_PKEY_NO_PUBKEY       0x002
  ------------------
  |  Branch (265:9): [True: 0, False: 18.4k]
  ------------------
  266|  18.4k|            && !ossl_param_build_set_int(tmpl, params,
  ------------------
  |  Branch (266:16): [True: 0, False: 0]
  ------------------
  267|      0|                                         OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 0))
  ------------------
  |  |  339|      0|# define OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC "include-public"
  ------------------
  268|      0|        return 0;
  269|       |
  270|  18.4k|    ecdh_cofactor_mode =
  271|  18.4k|        (EC_KEY_get_flags(ec) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0;
  ------------------
  |  |  963|  18.4k|#  define EC_FLAG_COFACTOR_ECDH          0x1000
  ------------------
  |  Branch (271:9): [True: 0, False: 18.4k]
  ------------------
  272|  18.4k|    return ossl_param_build_set_int(tmpl, params,
  273|  18.4k|                                    OSSL_PKEY_PARAM_USE_COFACTOR_ECDH,
  ------------------
  |  |  428|  18.4k|# define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH OSSL_PKEY_PARAM_USE_COFACTOR_FLAG
  |  |  ------------------
  |  |  |  |  429|  18.4k|# define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag"
  |  |  ------------------
  ------------------
  274|  18.4k|                                    ecdh_cofactor_mode);
  275|  18.4k|}
ec_kmgmt.c:sm2_load:
 1408|      1|{
 1409|      1|    return common_load(reference, reference_sz, 1);
 1410|      1|}
ec_kmgmt.c:sm2_get_params:
  860|      1|{
  861|      1|    return common_get_params(key, params, 1);
  862|      1|}

ecx_kmgmt.c:x25519_get_params:
  321|      6|{
  322|      6|    return ecx_get_params(key, params, X25519_BITS, X25519_SECURITY_BITS,
  ------------------
  |  |   33|      6|#  define X25519_BITS           253
  ------------------
                  return ecx_get_params(key, params, X25519_BITS, X25519_SECURITY_BITS,
  ------------------
  |  |   34|      6|#  define X25519_SECURITY_BITS  128
  ------------------
  323|      6|                          X25519_KEYLEN);
  ------------------
  |  |   26|      6|#  define X25519_KEYLEN         32
  ------------------
  324|      6|}
ecx_kmgmt.c:ecx_get_params:
  286|    387|{
  287|    387|    ECX_KEY *ecx = key;
  288|    387|    OSSL_PARAM *p;
  289|       |
  290|    387|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  316|    387|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (290:9): [True: 387, False: 0]
  ------------------
  291|    387|        && !OSSL_PARAM_set_int(p, bits))
  ------------------
  |  Branch (291:12): [True: 0, False: 387]
  ------------------
  292|      0|        return 0;
  293|    387|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  427|    387|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (293:9): [True: 387, False: 0]
  ------------------
  294|    387|        && !OSSL_PARAM_set_int(p, secbits))
  ------------------
  |  Branch (294:12): [True: 0, False: 387]
  ------------------
  295|      0|        return 0;
  296|    387|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  368|    387|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (296:9): [True: 387, False: 0]
  ------------------
  297|    387|        && !OSSL_PARAM_set_int(p, size))
  ------------------
  |  Branch (297:12): [True: 0, False: 387]
  ------------------
  298|      0|        return 0;
  299|    387|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL
  ------------------
  |  |  346|    387|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
  |  Branch (299:9): [True: 0, False: 387]
  ------------------
  300|    387|            && (ecx->type == ECX_KEY_TYPE_X25519
  ------------------
  |  Branch (300:17): [True: 0, False: 0]
  ------------------
  301|      0|                || ecx->type == ECX_KEY_TYPE_X448)) {
  ------------------
  |  Branch (301:20): [True: 0, False: 0]
  ------------------
  302|      0|        if (!OSSL_PARAM_set_octet_string(p, ecx->pubkey, ecx->keylen))
  ------------------
  |  Branch (302:13): [True: 0, False: 0]
  ------------------
  303|      0|            return 0;
  304|      0|    }
  305|       |
  306|    387|    return key_to_params(ecx, NULL, params, 1);
  307|    387|}
ecx_kmgmt.c:key_to_params:
  214|    387|{
  215|    387|    if (key == NULL)
  ------------------
  |  Branch (215:9): [True: 0, False: 387]
  ------------------
  216|      0|        return 0;
  217|       |
  218|    387|    if (!ossl_param_build_set_octet_string(tmpl, params,
  ------------------
  |  Branch (218:9): [True: 0, False: 387]
  ------------------
  219|    387|                                           OSSL_PKEY_PARAM_PUB_KEY,
  ------------------
  |  |  374|    387|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  220|    387|                                           key->pubkey, key->keylen))
  221|      0|        return 0;
  222|       |
  223|    387|    if (include_private
  ------------------
  |  Branch (223:9): [True: 387, False: 0]
  ------------------
  224|    387|        && key->privkey != NULL
  ------------------
  |  Branch (224:12): [True: 0, False: 387]
  ------------------
  225|    387|        && !ossl_param_build_set_octet_string(tmpl, params,
  ------------------
  |  Branch (225:12): [True: 0, False: 0]
  ------------------
  226|      0|                                              OSSL_PKEY_PARAM_PRIV_KEY,
  ------------------
  |  |  372|      0|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  227|      0|                                              key->privkey, key->keylen))
  228|      0|        return 0;
  229|       |
  230|    387|    return 1;
  231|    387|}
ecx_kmgmt.c:ecx_load:
  728|    387|{
  729|    387|    ECX_KEY *key = NULL;
  730|       |
  731|    387|    if (ossl_prov_is_running() && reference_sz == sizeof(key)) {
  ------------------
  |  Branch (731:9): [True: 387, False: 0]
  |  Branch (731:35): [True: 387, False: 0]
  ------------------
  732|       |        /* The contents of the reference is the address to our object */
  733|    387|        key = *(ECX_KEY **)reference;
  734|       |        /* We grabbed, so we detach it */
  735|    387|        *(ECX_KEY **)reference = NULL;
  736|    387|        return key;
  737|    387|    }
  738|      0|    return NULL;
  739|    387|}
ecx_kmgmt.c:x448_get_params:
  327|     70|{
  328|     70|    return ecx_get_params(key, params, X448_BITS, X448_SECURITY_BITS,
  ------------------
  |  |   36|     70|#  define X448_BITS             448
  ------------------
                  return ecx_get_params(key, params, X448_BITS, X448_SECURITY_BITS,
  ------------------
  |  |   37|     70|#  define X448_SECURITY_BITS    224
  ------------------
  329|     70|                          X448_KEYLEN);
  ------------------
  |  |   27|     70|#  define X448_KEYLEN           56
  ------------------
  330|     70|}
ecx_kmgmt.c:ed25519_get_params:
  333|      6|{
  334|      6|    return ecx_get_params(key, params, ED25519_BITS, ED25519_SECURITY_BITS,
  ------------------
  |  |   39|      6|#  define ED25519_BITS          256
  ------------------
                  return ecx_get_params(key, params, ED25519_BITS, ED25519_SECURITY_BITS,
  ------------------
  |  |   41|      6|#  define ED25519_SECURITY_BITS 128
  ------------------
  |  Branch (334:12): [True: 6, False: 0]
  ------------------
  335|      6|                          ED25519_SIGSIZE)
  ------------------
  |  |   42|      6|#  define ED25519_SIGSIZE       64
  ------------------
  336|      6|        && ed_get_params(key, params);
  ------------------
  |  Branch (336:12): [True: 6, False: 0]
  ------------------
  337|      6|}
ecx_kmgmt.c:ed_get_params:
  310|    311|{
  311|    311|    OSSL_PARAM *p;
  312|       |
  313|    311|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (313:9): [True: 0, False: 311]
  ------------------
  314|    311|                               OSSL_PKEY_PARAM_MANDATORY_DIGEST)) != NULL
  ------------------
  |  |  366|    311|# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
  ------------------
  315|    311|        && !OSSL_PARAM_set_utf8_string(p, ""))
  ------------------
  |  Branch (315:12): [True: 0, False: 0]
  ------------------
  316|      0|        return 0;
  317|    311|    return 1;
  318|    311|}
ecx_kmgmt.c:ed448_get_params:
  340|    305|{
  341|    305|    return ecx_get_params(key, params, ED448_BITS, ED448_SECURITY_BITS,
  ------------------
  |  |   44|    305|#  define ED448_BITS            456
  ------------------
                  return ecx_get_params(key, params, ED448_BITS, ED448_SECURITY_BITS,
  ------------------
  |  |   46|    305|#  define ED448_SECURITY_BITS   224
  ------------------
  |  Branch (341:12): [True: 305, False: 0]
  ------------------
  342|    305|                          ED448_SIGSIZE)
  ------------------
  |  |   47|    305|#  define ED448_SIGSIZE         114
  ------------------
  343|    305|        && ed_get_params(key, params);
  ------------------
  |  Branch (343:12): [True: 305, False: 0]
  ------------------
  344|    305|}

rsa_kmgmt.c:rsa_load:
  673|    609|{
  674|    609|    return common_load(reference, reference_sz, RSA_FLAG_TYPE_RSA);
  ------------------
  |  |  118|    609|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  675|    609|}
rsa_kmgmt.c:common_load:
  655|  3.99k|{
  656|  3.99k|    RSA *rsa = NULL;
  657|       |
  658|  3.99k|    if (ossl_prov_is_running() && reference_sz == sizeof(rsa)) {
  ------------------
  |  Branch (658:9): [True: 3.99k, False: 0]
  |  Branch (658:35): [True: 3.99k, False: 0]
  ------------------
  659|       |        /* The contents of the reference is the address to our object */
  660|  3.99k|        rsa = *(RSA **)reference;
  661|       |
  662|  3.99k|        if (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK) != expected_rsa_type)
  ------------------
  |  |  117|  3.99k|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  |  Branch (662:13): [True: 0, False: 3.99k]
  ------------------
  663|      0|            return NULL;
  664|       |
  665|       |        /* We grabbed, so we detach it */
  666|  3.99k|        *(RSA **)reference = NULL;
  667|  3.99k|        return rsa;
  668|  3.99k|    }
  669|      0|    return NULL;
  670|  3.99k|}
rsa_kmgmt.c:rsa_freedata:
  111|  3.99k|{
  112|  3.99k|    RSA_free(keydata);
  113|  3.99k|}
rsa_kmgmt.c:rsa_get_params:
  331|  3.99k|{
  332|  3.99k|    RSA *rsa = key;
  333|  3.99k|    const RSA_PSS_PARAMS_30 *pss_params = ossl_rsa_get0_pss_params_30(rsa);
  334|  3.99k|    int rsa_type = RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK);
  ------------------
  |  |  117|  3.99k|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  335|  3.99k|    OSSL_PARAM *p;
  336|  3.99k|    int empty = RSA_get0_n(rsa) == NULL;
  337|       |
  338|  3.99k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  316|  3.99k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (338:9): [True: 3.99k, False: 0]
  ------------------
  339|  3.99k|        && (empty || !OSSL_PARAM_set_int(p, RSA_bits(rsa))))
  ------------------
  |  Branch (339:13): [True: 0, False: 3.99k]
  |  Branch (339:22): [True: 0, False: 3.99k]
  ------------------
  340|      0|        return 0;
  341|  3.99k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  427|  3.99k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (341:9): [True: 3.99k, False: 0]
  ------------------
  342|  3.99k|        && (empty || !OSSL_PARAM_set_int(p, RSA_security_bits(rsa))))
  ------------------
  |  Branch (342:13): [True: 0, False: 3.99k]
  |  Branch (342:22): [True: 0, False: 3.99k]
  ------------------
  343|      0|        return 0;
  344|  3.99k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  368|  3.99k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (344:9): [True: 3.99k, False: 0]
  ------------------
  345|  3.99k|        && (empty || !OSSL_PARAM_set_int(p, RSA_size(rsa))))
  ------------------
  |  Branch (345:13): [True: 0, False: 3.99k]
  |  Branch (345:22): [True: 0, False: 3.99k]
  ------------------
  346|      0|        return 0;
  347|       |
  348|       |    /*
  349|       |     * For restricted RSA-PSS keys, we ignore the default digest request.
  350|       |     * With RSA-OAEP keys, this may need to be amended.
  351|       |     */
  352|  3.99k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  318|  3.99k|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (352:9): [True: 0, False: 3.99k]
  ------------------
  353|  3.99k|        && (rsa_type != RSA_FLAG_TYPE_RSASSAPSS
  ------------------
  |  |  119|      0|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (353:13): [True: 0, False: 0]
  ------------------
  354|      0|            || ossl_rsa_pss_params_30_is_unrestricted(pss_params))) {
  ------------------
  |  Branch (354:16): [True: 0, False: 0]
  ------------------
  355|      0|        if (!OSSL_PARAM_set_utf8_string(p, RSA_DEFAULT_MD))
  ------------------
  |  |   54|      0|#define RSA_DEFAULT_MD "SHA256"
  ------------------
  |  Branch (355:13): [True: 0, False: 0]
  ------------------
  356|      0|            return 0;
  357|      0|    }
  358|       |
  359|       |    /*
  360|       |     * For non-RSA-PSS keys, we ignore the mandatory digest request.
  361|       |     * With RSA-OAEP keys, this may need to be amended.
  362|       |     */
  363|  3.99k|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (363:9): [True: 0, False: 3.99k]
  ------------------
  364|  3.99k|                               OSSL_PKEY_PARAM_MANDATORY_DIGEST)) != NULL
  ------------------
  |  |  366|  3.99k|# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
  ------------------
  365|  3.99k|        && rsa_type == RSA_FLAG_TYPE_RSASSAPSS
  ------------------
  |  |  119|  3.99k|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (365:12): [True: 0, False: 0]
  ------------------
  366|  3.99k|        && !ossl_rsa_pss_params_30_is_unrestricted(pss_params)) {
  ------------------
  |  Branch (366:12): [True: 0, False: 0]
  ------------------
  367|      0|        const char *mdname =
  368|      0|            ossl_rsa_oaeppss_nid2name(ossl_rsa_pss_params_30_hashalg(pss_params));
  369|       |
  370|      0|        if (mdname == NULL || !OSSL_PARAM_set_utf8_string(p, mdname))
  ------------------
  |  Branch (370:13): [True: 0, False: 0]
  |  Branch (370:31): [True: 0, False: 0]
  ------------------
  371|      0|            return 0;
  372|      0|    }
  373|  3.99k|    return (rsa_type != RSA_FLAG_TYPE_RSASSAPSS
  ------------------
  |  |  119|  7.99k|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (373:13): [True: 609, False: 3.38k]
  ------------------
  374|  3.99k|            || ossl_rsa_pss_params_30_todata(pss_params, NULL, params))
  ------------------
  |  Branch (374:16): [True: 3.38k, False: 0]
  ------------------
  375|  3.99k|        && ossl_rsa_todata(rsa, NULL, params, 1);
  ------------------
  |  Branch (375:12): [True: 3.99k, False: 0]
  ------------------
  376|  3.99k|}
rsa_kmgmt.c:rsapss_load:
  678|  3.38k|{
  679|  3.38k|    return common_load(reference, reference_sz, RSA_FLAG_TYPE_RSASSAPSS);
  ------------------
  |  |  119|  3.38k|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  680|  3.38k|}

ossl_drbg_lock:
   55|  15.2k|{
   56|  15.2k|    return 1;
   57|  15.2k|}
ossl_drbg_unlock:
   61|  15.2k|{
   62|  15.2k|}
ossl_drbg_get_seed:
  149|      2|{
  150|      2|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  151|      2|    size_t bytes_needed;
  152|      2|    unsigned char *buffer;
  153|       |
  154|       |    /* Figure out how many bytes we need */
  155|      2|    bytes_needed = entropy >= 0 ? (entropy + 7) / 8 : 0;
  ------------------
  |  Branch (155:20): [True: 2, False: 0]
  ------------------
  156|      2|    if (bytes_needed < min_len)
  ------------------
  |  Branch (156:9): [True: 2, False: 0]
  ------------------
  157|      2|        bytes_needed = min_len;
  158|      2|    if (bytes_needed > max_len)
  ------------------
  |  Branch (158:9): [True: 0, False: 2]
  ------------------
  159|      0|        bytes_needed = max_len;
  160|       |
  161|       |    /* Allocate storage */
  162|      2|    buffer = OPENSSL_secure_malloc(bytes_needed);
  ------------------
  |  |  115|      2|        CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|      2|    if (buffer == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 2]
  ------------------
  164|      0|        return 0;
  165|       |
  166|       |    /*
  167|       |     * Get random data.  Include our DRBG address as
  168|       |     * additional input, in order to provide a distinction between
  169|       |     * different DRBG child instances.
  170|       |     *
  171|       |     * Note: using the sizeof() operator on a pointer triggers
  172|       |     *       a warning in some static code analyzers, but it's
  173|       |     *       intentional and correct here.
  174|       |     */
  175|      2|    if (!ossl_prov_drbg_generate(drbg, buffer, bytes_needed,
  ------------------
  |  Branch (175:9): [True: 0, False: 2]
  ------------------
  176|      2|                                 drbg->strength, prediction_resistance,
  177|      2|                                 (unsigned char *)&drbg, sizeof(drbg))) {
  178|      0|        OPENSSL_secure_clear_free(buffer, bytes_needed);
  ------------------
  |  |  121|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  179|      0|        ERR_raise(ERR_LIB_PROV, PROV_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  180|      0|        return 0;
  181|      0|    }
  182|      2|    *pout = buffer;
  183|      2|    return bytes_needed;
  184|      2|}
ossl_drbg_clear_seed:
  189|      2|{
  190|      2|    OPENSSL_secure_clear_free(out, outlen);
  ------------------
  |  |  121|      2|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  191|      2|}
ossl_prov_drbg_nonce_ctx_new:
  277|      2|{
  278|      2|    PROV_DRBG_NONCE_GLOBAL *dngbl = OPENSSL_zalloc(sizeof(*dngbl));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  279|       |
  280|      2|    if (dngbl == NULL)
  ------------------
  |  Branch (280:9): [True: 0, False: 2]
  ------------------
  281|      0|        return NULL;
  282|       |
  283|      2|    dngbl->rand_nonce_lock = CRYPTO_THREAD_lock_new();
  284|      2|    if (dngbl->rand_nonce_lock == NULL) {
  ------------------
  |  Branch (284:9): [True: 0, False: 2]
  ------------------
  285|      0|        OPENSSL_free(dngbl);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  286|      0|        return NULL;
  287|      0|    }
  288|       |
  289|      2|    return dngbl;
  290|      2|}
ossl_prov_drbg_nonce_ctx_free:
  293|      2|{
  294|      2|    PROV_DRBG_NONCE_GLOBAL *dngbl = vdngbl;
  295|       |
  296|      2|    if (dngbl == NULL)
  ------------------
  |  Branch (296:9): [True: 0, False: 2]
  ------------------
  297|      0|        return;
  298|       |
  299|      2|    CRYPTO_THREAD_lock_free(dngbl->rand_nonce_lock);
  300|       |
  301|      2|    OPENSSL_free(dngbl);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  302|      2|}
ossl_prov_drbg_instantiate:
  357|      2|{
  358|      2|    unsigned char *nonce = NULL, *entropy = NULL;
  359|      2|    size_t noncelen = 0, entropylen = 0;
  360|      2|    size_t min_entropy, min_entropylen, max_entropylen;
  361|       |
  362|      2|    if (strength > drbg->strength) {
  ------------------
  |  Branch (362:9): [True: 0, False: 2]
  ------------------
  363|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INSUFFICIENT_DRBG_STRENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  364|      0|        goto end;
  365|      0|    }
  366|      2|    min_entropy = drbg->strength;
  367|      2|    min_entropylen = drbg->min_entropylen;
  368|      2|    max_entropylen = drbg->max_entropylen;
  369|       |
  370|      2|    if (pers == NULL) {
  ------------------
  |  Branch (370:9): [True: 2, False: 0]
  ------------------
  371|      2|        pers = (const unsigned char *)ossl_pers_string;
  372|      2|        perslen = sizeof(ossl_pers_string);
  373|      2|    }
  374|      2|    if (perslen > drbg->max_perslen) {
  ------------------
  |  Branch (374:9): [True: 0, False: 2]
  ------------------
  375|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PERSONALISATION_STRING_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  376|      0|        goto end;
  377|      0|    }
  378|       |
  379|      2|    if (drbg->state != EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1292|      2|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
  |  Branch (379:9): [True: 0, False: 2]
  ------------------
  380|      0|        if (drbg->state == EVP_RAND_STATE_ERROR)
  ------------------
  |  | 1294|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  |  Branch (380:13): [True: 0, False: 0]
  ------------------
  381|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_IN_ERROR_STATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  382|      0|        else
  383|      0|            ERR_raise(ERR_LIB_PROV, PROV_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  384|      0|        goto end;
  385|      0|    }
  386|       |
  387|      2|    drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1294|      2|# define EVP_RAND_STATE_ERROR            2
  ------------------
  388|       |
  389|      2|    if (drbg->min_noncelen > 0) {
  ------------------
  |  Branch (389:9): [True: 1, False: 1]
  ------------------
  390|      1|        if (drbg->parent_nonce != NULL) {
  ------------------
  |  Branch (390:13): [True: 0, False: 1]
  ------------------
  391|      0|            noncelen = drbg->parent_nonce(drbg->parent, NULL, drbg->strength,
  392|      0|                                          drbg->min_noncelen,
  393|      0|                                          drbg->max_noncelen);
  394|      0|            if (noncelen == 0) {
  ------------------
  |  Branch (394:17): [True: 0, False: 0]
  ------------------
  395|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  396|      0|                goto end;
  397|      0|            }
  398|      0|            nonce = OPENSSL_malloc(noncelen);
  ------------------
  |  |   97|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  399|      0|            if (nonce == NULL) {
  ------------------
  |  Branch (399:17): [True: 0, False: 0]
  ------------------
  400|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  401|      0|                goto end;
  402|      0|            }
  403|      0|            if (noncelen != drbg->parent_nonce(drbg->parent, nonce,
  ------------------
  |  Branch (403:17): [True: 0, False: 0]
  ------------------
  404|      0|                                               drbg->strength,
  405|      0|                                               drbg->min_noncelen,
  406|      0|                                               drbg->max_noncelen)) {
  407|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  408|      0|                goto end;
  409|      0|            }
  410|      0|#ifndef PROV_RAND_GET_RANDOM_NONCE
  411|      1|        } else if (drbg->parent != NULL) {
  ------------------
  |  Branch (411:20): [True: 1, False: 0]
  ------------------
  412|      1|#endif
  413|       |            /*
  414|       |             * NIST SP800-90Ar1 section 9.1 says you can combine getting
  415|       |             * the entropy and nonce in 1 call by increasing the entropy
  416|       |             * with 50% and increasing the minimum length to accommodate
  417|       |             * the length of the nonce. We do this in case a nonce is
  418|       |             * required and there is no parental nonce capability.
  419|       |             */
  420|      1|            min_entropy += drbg->strength / 2;
  421|      1|            min_entropylen += drbg->min_noncelen;
  422|      1|            max_entropylen += drbg->max_noncelen;
  423|      1|        }
  424|      0|#ifndef PROV_RAND_GET_RANDOM_NONCE
  425|      0|        else { /* parent == NULL */
  426|      0|            noncelen = prov_drbg_get_nonce(drbg, &nonce, drbg->min_noncelen, 
  427|      0|                                           drbg->max_noncelen);
  428|      0|            if (noncelen < drbg->min_noncelen
  ------------------
  |  Branch (428:17): [True: 0, False: 0]
  ------------------
  429|      0|                    || noncelen > drbg->max_noncelen) {
  ------------------
  |  Branch (429:24): [True: 0, False: 0]
  ------------------
  430|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  431|      0|                goto end;
  432|      0|            }
  433|      0|        }
  434|      1|#endif
  435|      1|    }
  436|       |
  437|      2|    drbg->reseed_next_counter = tsan_load(&drbg->reseed_counter);
  ------------------
  |  |   61|      2|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  438|      2|    if (drbg->reseed_next_counter) {
  ------------------
  |  Branch (438:9): [True: 2, False: 0]
  ------------------
  439|      2|        drbg->reseed_next_counter++;
  440|      2|        if (!drbg->reseed_next_counter)
  ------------------
  |  Branch (440:13): [True: 0, False: 2]
  ------------------
  441|      0|            drbg->reseed_next_counter = 1;
  442|      2|    }
  443|       |
  444|      2|    entropylen = get_entropy(drbg, &entropy, min_entropy,
  445|      2|                             min_entropylen, max_entropylen,
  446|      2|                             prediction_resistance);
  447|      2|    if (entropylen < min_entropylen
  ------------------
  |  Branch (447:9): [True: 0, False: 2]
  ------------------
  448|      2|            || entropylen > max_entropylen) {
  ------------------
  |  Branch (448:16): [True: 0, False: 2]
  ------------------
  449|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_ENTROPY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  450|      0|        goto end;
  451|      0|    }
  452|       |
  453|      2|    if (!drbg->instantiate(drbg, entropy, entropylen, nonce, noncelen,
  ------------------
  |  Branch (453:9): [True: 0, False: 2]
  ------------------
  454|      2|                           pers, perslen)) {
  455|      0|        cleanup_entropy(drbg, entropy, entropylen);
  456|      0|        ERR_raise(ERR_LIB_PROV, PROV_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  457|      0|        goto end;
  458|      0|    }
  459|      2|    cleanup_entropy(drbg, entropy, entropylen);
  460|       |
  461|      2|    drbg->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1293|      2|# define EVP_RAND_STATE_READY            1
  ------------------
  462|      2|    drbg->generate_counter = 1;
  463|      2|    drbg->reseed_time = time(NULL);
  464|      2|    tsan_store(&drbg->reseed_counter, drbg->reseed_next_counter);
  ------------------
  |  |   62|      2|#   define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  465|       |
  466|      2| end:
  467|      2|    if (nonce != NULL)
  ------------------
  |  Branch (467:9): [True: 0, False: 2]
  ------------------
  468|      0|        ossl_prov_cleanup_nonce(drbg->provctx, nonce, noncelen);
  469|      2|    if (drbg->state == EVP_RAND_STATE_READY)
  ------------------
  |  | 1293|      2|# define EVP_RAND_STATE_READY            1
  ------------------
  |  Branch (469:9): [True: 2, False: 0]
  ------------------
  470|      2|        return 1;
  471|      0|    return 0;
  472|      2|}
ossl_prov_drbg_generate:
  632|  7.62k|{
  633|  7.62k|    int fork_id;
  634|  7.62k|    int reseed_required = 0;
  635|  7.62k|    int ret = 0;
  636|       |
  637|  7.62k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (637:9): [True: 0, False: 7.62k]
  ------------------
  638|      0|        return 0;
  639|       |
  640|  7.62k|    if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  ------------------
  |  Branch (640:9): [True: 2, False: 7.61k]
  |  Branch (640:31): [True: 0, False: 2]
  ------------------
  641|      0|        return 0;
  642|       |
  643|  7.62k|    if (drbg->state != EVP_RAND_STATE_READY) {
  ------------------
  |  | 1293|  7.62k|# define EVP_RAND_STATE_READY            1
  ------------------
  |  Branch (643:9): [True: 0, False: 7.62k]
  ------------------
  644|       |        /* try to recover from previous errors */
  645|      0|        rand_drbg_restart(drbg);
  646|       |
  647|      0|        if (drbg->state == EVP_RAND_STATE_ERROR) {
  ------------------
  |  | 1294|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  |  Branch (647:13): [True: 0, False: 0]
  ------------------
  648|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_IN_ERROR_STATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  649|      0|            goto err;
  650|      0|        }
  651|      0|        if (drbg->state == EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1292|      0|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
  |  Branch (651:13): [True: 0, False: 0]
  ------------------
  652|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  653|      0|            goto err;
  654|      0|        }
  655|      0|    }
  656|  7.62k|    if (strength > drbg->strength) {
  ------------------
  |  Branch (656:9): [True: 0, False: 7.62k]
  ------------------
  657|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INSUFFICIENT_DRBG_STRENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  658|      0|        goto err;
  659|      0|    }
  660|       |
  661|  7.62k|    if (outlen > drbg->max_request) {
  ------------------
  |  Branch (661:9): [True: 0, False: 7.62k]
  ------------------
  662|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_REQUEST_TOO_LARGE_FOR_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  663|      0|        goto err;
  664|      0|    }
  665|  7.62k|    if (adinlen > drbg->max_adinlen) {
  ------------------
  |  Branch (665:9): [True: 0, False: 7.62k]
  ------------------
  666|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ADDITIONAL_INPUT_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  667|      0|        goto err;
  668|      0|    }
  669|       |
  670|  7.62k|    fork_id = openssl_get_fork_id();
  671|       |
  672|  7.62k|    if (drbg->fork_id != fork_id) {
  ------------------
  |  Branch (672:9): [True: 0, False: 7.62k]
  ------------------
  673|      0|        drbg->fork_id = fork_id;
  674|      0|        reseed_required = 1;
  675|      0|    }
  676|       |
  677|  7.62k|    if (drbg->reseed_interval > 0) {
  ------------------
  |  Branch (677:9): [True: 7.62k, False: 0]
  ------------------
  678|  7.62k|        if (drbg->generate_counter >= drbg->reseed_interval)
  ------------------
  |  Branch (678:13): [True: 0, False: 7.62k]
  ------------------
  679|      0|            reseed_required = 1;
  680|  7.62k|    }
  681|  7.62k|    if (drbg->reseed_time_interval > 0) {
  ------------------
  |  Branch (681:9): [True: 7.62k, False: 0]
  ------------------
  682|  7.62k|        time_t now = time(NULL);
  683|  7.62k|        if (now < drbg->reseed_time
  ------------------
  |  Branch (683:13): [True: 0, False: 7.62k]
  ------------------
  684|  7.62k|            || now - drbg->reseed_time >= drbg->reseed_time_interval)
  ------------------
  |  Branch (684:16): [True: 0, False: 7.62k]
  ------------------
  685|      0|            reseed_required = 1;
  686|  7.62k|    }
  687|  7.62k|    if (drbg->parent != NULL
  ------------------
  |  Branch (687:9): [True: 7.62k, False: 0]
  ------------------
  688|  7.62k|            && get_parent_reseed_count(drbg) != drbg->parent_reseed_counter)
  ------------------
  |  Branch (688:16): [True: 1, False: 7.61k]
  ------------------
  689|      1|        reseed_required = 1;
  690|       |
  691|  7.62k|    if (reseed_required || prediction_resistance) {
  ------------------
  |  Branch (691:9): [True: 1, False: 7.61k]
  |  Branch (691:28): [True: 0, False: 7.61k]
  ------------------
  692|      1|        if (!ossl_prov_drbg_reseed_unlocked(drbg, prediction_resistance, NULL,
  ------------------
  |  Branch (692:13): [True: 0, False: 1]
  ------------------
  693|      1|                                            0, adin, adinlen)) {
  694|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_RESEED_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  695|      0|            goto err;
  696|      0|        }
  697|      1|        adin = NULL;
  698|      1|        adinlen = 0;
  699|      1|    }
  700|       |
  701|  7.62k|    if (!drbg->generate(drbg, out, outlen, adin, adinlen)) {
  ------------------
  |  Branch (701:9): [True: 0, False: 7.62k]
  ------------------
  702|      0|        drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1294|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  703|      0|        ERR_raise(ERR_LIB_PROV, PROV_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  704|      0|        goto err;
  705|      0|    }
  706|       |
  707|  7.62k|    drbg->generate_counter++;
  708|       |
  709|  7.62k|    ret = 1;
  710|  7.62k| err:
  711|  7.62k|    if (drbg->lock != NULL)
  ------------------
  |  Branch (711:9): [True: 2, False: 7.61k]
  ------------------
  712|      2|        CRYPTO_THREAD_unlock(drbg->lock);
  713|       |
  714|  7.62k|    return ret;
  715|  7.62k|}
ossl_drbg_enable_locking:
  762|      1|{
  763|      1|    PROV_DRBG *drbg = vctx;
  764|       |
  765|      1|    if (drbg != NULL && drbg->lock == NULL) {
  ------------------
  |  Branch (765:9): [True: 1, False: 0]
  |  Branch (765:25): [True: 1, False: 0]
  ------------------
  766|      1|        if (drbg->parent_enable_locking != NULL)
  ------------------
  |  Branch (766:13): [True: 1, False: 0]
  ------------------
  767|      1|            if (!drbg->parent_enable_locking(drbg->parent)) {
  ------------------
  |  Branch (767:17): [True: 0, False: 1]
  ------------------
  768|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_LOCKING_NOT_ENABLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  769|      0|                return 0;
  770|      0|            }
  771|      1|        drbg->lock = CRYPTO_THREAD_lock_new();
  772|      1|        if (drbg->lock == NULL) {
  ------------------
  |  Branch (772:13): [True: 0, False: 1]
  ------------------
  773|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_CREATE_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  774|      0|            return 0;
  775|      0|        }
  776|      1|    }
  777|      1|    return 1;
  778|      1|}
ossl_rand_drbg_new:
  800|      2|{
  801|      2|    PROV_DRBG *drbg;
  802|      2|    unsigned int p_str;
  803|      2|    const OSSL_DISPATCH *pfunc;
  804|       |
  805|      2|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (805:9): [True: 0, False: 2]
  ------------------
  806|      0|        return NULL;
  807|       |
  808|      2|    drbg = OPENSSL_zalloc(sizeof(*drbg));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  809|      2|    if (drbg == NULL)
  ------------------
  |  Branch (809:9): [True: 0, False: 2]
  ------------------
  810|      0|        return NULL;
  811|       |
  812|      2|    drbg->provctx = provctx;
  813|      2|    drbg->instantiate = instantiate;
  814|      2|    drbg->uninstantiate = uninstantiate;
  815|      2|    drbg->reseed = reseed;
  816|      2|    drbg->generate = generate;
  817|      2|    drbg->fork_id = openssl_get_fork_id();
  818|       |
  819|       |    /* Extract parent's functions */
  820|      2|    drbg->parent = parent;
  821|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_ENABLE_LOCKING)) != NULL)
  ------------------
  |  |  444|      2|# define OSSL_FUNC_RAND_ENABLE_LOCKING                8
  ------------------
  |  Branch (821:9): [True: 2, False: 0]
  ------------------
  822|      2|        drbg->parent_enable_locking = OSSL_FUNC_rand_enable_locking(pfunc);
  823|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_LOCK)) != NULL)
  ------------------
  |  |  445|      2|# define OSSL_FUNC_RAND_LOCK                          9
  ------------------
  |  Branch (823:9): [True: 2, False: 0]
  ------------------
  824|      2|        drbg->parent_lock = OSSL_FUNC_rand_lock(pfunc);
  825|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_UNLOCK)) != NULL)
  ------------------
  |  |  446|      2|# define OSSL_FUNC_RAND_UNLOCK                       10
  ------------------
  |  Branch (825:9): [True: 2, False: 0]
  ------------------
  826|      2|        drbg->parent_unlock = OSSL_FUNC_rand_unlock(pfunc);
  827|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_GET_CTX_PARAMS)) != NULL)
  ------------------
  |  |  451|      2|# define OSSL_FUNC_RAND_GET_CTX_PARAMS               15
  ------------------
  |  Branch (827:9): [True: 2, False: 0]
  ------------------
  828|      2|        drbg->parent_get_ctx_params = OSSL_FUNC_rand_get_ctx_params(pfunc);
  829|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_NONCE)) != NULL)
  ------------------
  |  |  443|      2|# define OSSL_FUNC_RAND_NONCE                         7
  ------------------
  |  Branch (829:9): [True: 0, False: 2]
  ------------------
  830|      0|        drbg->parent_nonce = OSSL_FUNC_rand_nonce(pfunc);
  831|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_GET_SEED)) != NULL)
  ------------------
  |  |  454|      2|# define OSSL_FUNC_RAND_GET_SEED                     18
  ------------------
  |  Branch (831:9): [True: 2, False: 0]
  ------------------
  832|      2|        drbg->parent_get_seed = OSSL_FUNC_rand_get_seed(pfunc);
  833|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_CLEAR_SEED)) != NULL)
  ------------------
  |  |  455|      2|# define OSSL_FUNC_RAND_CLEAR_SEED                   19
  ------------------
  |  Branch (833:9): [True: 2, False: 0]
  ------------------
  834|      2|        drbg->parent_clear_seed = OSSL_FUNC_rand_clear_seed(pfunc);
  835|       |
  836|       |    /* Set some default maximums up */
  837|      2|    drbg->max_entropylen = DRBG_MAX_LENGTH;
  ------------------
  |  |   50|      2|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  838|      2|    drbg->max_noncelen = DRBG_MAX_LENGTH;
  ------------------
  |  |   50|      2|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  839|      2|    drbg->max_perslen = DRBG_MAX_LENGTH;
  ------------------
  |  |   50|      2|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  840|      2|    drbg->max_adinlen = DRBG_MAX_LENGTH;
  ------------------
  |  |   50|      2|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  841|      2|    drbg->generate_counter = 1;
  842|      2|    drbg->reseed_counter = 1;
  843|      2|    drbg->reseed_interval = RESEED_INTERVAL;
  ------------------
  |  |   30|      2|# define RESEED_INTERVAL                         (1 << 8)
  ------------------
  844|      2|    drbg->reseed_time_interval = TIME_INTERVAL;
  ------------------
  |  |   31|      2|# define TIME_INTERVAL                           (60*60)   /* 1 hour */
  ------------------
  845|       |
  846|      2|    if (!dnew(drbg))
  ------------------
  |  Branch (846:9): [True: 0, False: 2]
  ------------------
  847|      0|        goto err;
  848|       |
  849|      2|    if (parent != NULL) {
  ------------------
  |  Branch (849:9): [True: 2, False: 0]
  ------------------
  850|      2|        if (!get_parent_strength(drbg, &p_str))
  ------------------
  |  Branch (850:13): [True: 0, False: 2]
  ------------------
  851|      0|            goto err;
  852|      2|        if (drbg->strength > p_str) {
  ------------------
  |  Branch (852:13): [True: 0, False: 2]
  ------------------
  853|       |            /*
  854|       |             * We currently don't support the algorithm from NIST SP 800-90C
  855|       |             * 10.1.2 to use a weaker DRBG as source
  856|       |             */
  857|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_STRENGTH_TOO_WEAK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  858|      0|            goto err;
  859|      0|        }
  860|      2|    }
  861|       |#ifdef TSAN_REQUIRES_LOCKING
  862|       |    if (!ossl_drbg_enable_locking(drbg))
  863|       |        goto err;
  864|       |#endif
  865|      2|    return drbg;
  866|       |
  867|      0| err:
  868|      0|    ossl_rand_drbg_free(drbg);
  869|      0|    return NULL;
  870|      2|}
ossl_rand_drbg_free:
  873|      2|{
  874|      2|    if (drbg == NULL)
  ------------------
  |  Branch (874:9): [True: 0, False: 2]
  ------------------
  875|      0|        return;
  876|       |
  877|      2|    CRYPTO_THREAD_lock_free(drbg->lock);
  878|      2|    OPENSSL_free(drbg);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  879|      2|}
ossl_drbg_get_ctx_params:
  886|      3|{
  887|      3|    OSSL_PARAM *p;
  888|       |
  889|      3|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
  ------------------
  |  |  444|      3|# define OSSL_RAND_PARAM_STATE "state"
  ------------------
  890|      3|    if (p != NULL && !OSSL_PARAM_set_int(p, drbg->state))
  ------------------
  |  Branch (890:9): [True: 0, False: 3]
  |  Branch (890:22): [True: 0, False: 0]
  ------------------
  891|      0|        return 0;
  892|       |
  893|      3|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
  ------------------
  |  |  445|      3|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
  894|      3|    if (p != NULL && !OSSL_PARAM_set_int(p, drbg->strength))
  ------------------
  |  Branch (894:9): [True: 3, False: 0]
  |  Branch (894:22): [True: 0, False: 3]
  ------------------
  895|      0|        return 0;
  896|       |
  897|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MIN_ENTROPYLEN);
  ------------------
  |  |  211|      3|# define OSSL_DRBG_PARAM_MIN_ENTROPYLEN "min_entropylen"
  ------------------
  898|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->min_entropylen))
  ------------------
  |  Branch (898:9): [True: 0, False: 3]
  |  Branch (898:22): [True: 0, False: 0]
  ------------------
  899|      0|        return 0;
  900|       |
  901|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_ENTROPYLEN);
  ------------------
  |  |  207|      3|# define OSSL_DRBG_PARAM_MAX_ENTROPYLEN "max_entropylen"
  ------------------
  902|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_entropylen))
  ------------------
  |  Branch (902:9): [True: 0, False: 3]
  |  Branch (902:22): [True: 0, False: 0]
  ------------------
  903|      0|        return 0;
  904|       |
  905|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MIN_NONCELEN);
  ------------------
  |  |  213|      3|# define OSSL_DRBG_PARAM_MIN_NONCELEN "min_noncelen"
  ------------------
  906|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->min_noncelen))
  ------------------
  |  Branch (906:9): [True: 0, False: 3]
  |  Branch (906:22): [True: 0, False: 0]
  ------------------
  907|      0|        return 0;
  908|       |
  909|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_NONCELEN);
  ------------------
  |  |  209|      3|# define OSSL_DRBG_PARAM_MAX_NONCELEN "max_noncelen"
  ------------------
  910|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_noncelen))
  ------------------
  |  Branch (910:9): [True: 0, False: 3]
  |  Branch (910:22): [True: 0, False: 0]
  ------------------
  911|      0|        return 0;
  912|       |
  913|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_PERSLEN);
  ------------------
  |  |  210|      3|# define OSSL_DRBG_PARAM_MAX_PERSLEN "max_perslen"
  ------------------
  914|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_perslen))
  ------------------
  |  Branch (914:9): [True: 0, False: 3]
  |  Branch (914:22): [True: 0, False: 0]
  ------------------
  915|      0|        return 0;
  916|       |
  917|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_ADINLEN);
  ------------------
  |  |  206|      3|# define OSSL_DRBG_PARAM_MAX_ADINLEN "max_adinlen"
  ------------------
  918|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_adinlen))
  ------------------
  |  Branch (918:9): [True: 0, False: 3]
  |  Branch (918:22): [True: 0, False: 0]
  ------------------
  919|      0|        return 0;
  920|       |
  921|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_REQUESTS);
  ------------------
  |  |  218|      3|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  922|      3|    if (p != NULL && !OSSL_PARAM_set_uint(p, drbg->reseed_interval))
  ------------------
  |  Branch (922:9): [True: 0, False: 3]
  |  Branch (922:22): [True: 0, False: 0]
  ------------------
  923|      0|        return 0;
  924|       |
  925|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_TIME);
  ------------------
  |  |  219|      3|# define OSSL_DRBG_PARAM_RESEED_TIME "reseed_time"
  ------------------
  926|      3|    if (p != NULL && !OSSL_PARAM_set_time_t(p, drbg->reseed_time))
  ------------------
  |  Branch (926:9): [True: 0, False: 3]
  |  Branch (926:22): [True: 0, False: 0]
  ------------------
  927|      0|        return 0;
  928|       |
  929|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL);
  ------------------
  |  |  220|      3|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  930|      3|    if (p != NULL && !OSSL_PARAM_set_time_t(p, drbg->reseed_time_interval))
  ------------------
  |  Branch (930:9): [True: 0, False: 3]
  |  Branch (930:22): [True: 0, False: 0]
  ------------------
  931|      0|        return 0;
  932|       |
  933|      3|    return 1;
  934|      3|}
ossl_drbg_get_ctx_params_no_lock:
  942|  15.2k|{
  943|  15.2k|    size_t cnt = 0;
  944|  15.2k|    OSSL_PARAM *p;
  945|       |
  946|       |    /* This value never changes once set */
  947|  15.2k|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
  ------------------
  |  |  443|  15.2k|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  948|  15.2k|    if (p != NULL) {
  ------------------
  |  Branch (948:9): [True: 7.61k, False: 7.62k]
  ------------------
  949|  7.61k|        if (!OSSL_PARAM_set_size_t(p, drbg->max_request))
  ------------------
  |  Branch (949:13): [True: 0, False: 7.61k]
  ------------------
  950|      0|            return 0;
  951|  7.61k|        cnt++;
  952|  7.61k|    }
  953|       |
  954|       |    /*
  955|       |     * Can be changed by multiple threads, but we tolerate inaccuracies in this
  956|       |     * value.
  957|       |     */
  958|  15.2k|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_COUNTER);
  ------------------
  |  |  217|  15.2k|# define OSSL_DRBG_PARAM_RESEED_COUNTER "reseed_counter"
  ------------------
  959|  15.2k|    if (p != NULL) {
  ------------------
  |  Branch (959:9): [True: 7.61k, False: 7.62k]
  ------------------
  960|  7.61k|        if (!OSSL_PARAM_set_uint(p, tsan_load(&drbg->reseed_counter)))
  ------------------
  |  |   61|  7.61k|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (960:13): [True: 0, False: 7.61k]
  ------------------
  961|      0|            return 0;
  962|  7.61k|        cnt++;
  963|  7.61k|    }
  964|       |
  965|  15.2k|    if (params[cnt].key == NULL)
  ------------------
  |  Branch (965:9): [True: 15.2k, False: 3]
  ------------------
  966|  15.2k|        *complete = 1;
  967|      3|    else
  968|      3|        *complete = 0;
  969|       |
  970|  15.2k|    return 1;
  971|  15.2k|}
ossl_drbg_set_ctx_params:
  974|      2|{
  975|      2|    const OSSL_PARAM *p;
  976|       |
  977|      2|    if (params == NULL)
  ------------------
  |  Branch (977:9): [True: 0, False: 2]
  ------------------
  978|      0|        return 1;
  979|       |
  980|      2|    p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_RESEED_REQUESTS);
  ------------------
  |  |  218|      2|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  981|      2|    if (p != NULL && !OSSL_PARAM_get_uint(p, &drbg->reseed_interval))
  ------------------
  |  Branch (981:9): [True: 2, False: 0]
  |  Branch (981:22): [True: 0, False: 2]
  ------------------
  982|      0|        return 0;
  983|       |
  984|      2|    p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL);
  ------------------
  |  |  220|      2|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  985|      2|    if (p != NULL && !OSSL_PARAM_get_time_t(p, &drbg->reseed_time_interval))
  ------------------
  |  Branch (985:9): [True: 2, False: 0]
  |  Branch (985:22): [True: 0, False: 2]
  ------------------
  986|      0|        return 0;
  987|      2|    return 1;
  988|      2|}
drbg.c:get_entropy:
  196|      3|{
  197|      3|    size_t bytes;
  198|      3|    unsigned int p_str;
  199|       |
  200|      3|    if (drbg->parent == NULL)
  ------------------
  |  Branch (200:9): [True: 0, False: 3]
  ------------------
  201|       |#ifdef FIPS_MODULE
  202|       |        return ossl_crngt_get_entropy(drbg, pout, entropy, min_len, max_len,
  203|       |                                      prediction_resistance);
  204|       |#else
  205|      0|        return ossl_prov_get_entropy(drbg->provctx, pout, entropy, min_len,
  206|      0|                                     max_len);
  207|      3|#endif
  208|       |
  209|      3|    if (drbg->parent_get_seed == NULL) {
  ------------------
  |  Branch (209:9): [True: 0, False: 3]
  ------------------
  210|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  211|      0|        return 0;
  212|      0|    }
  213|      3|    if (!get_parent_strength(drbg, &p_str))
  ------------------
  |  Branch (213:9): [True: 0, False: 3]
  ------------------
  214|      0|        return 0;
  215|      3|    if (drbg->strength > p_str) {
  ------------------
  |  Branch (215:9): [True: 0, False: 3]
  ------------------
  216|       |        /*
  217|       |         * We currently don't support the algorithm from NIST SP 800-90C
  218|       |         * 10.1.2 to use a weaker DRBG as source
  219|       |         */
  220|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_STRENGTH_TOO_WEAK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  221|      0|        return 0;
  222|      0|    }
  223|       |
  224|       |    /*
  225|       |     * Our lock is already held, but we need to lock our parent before
  226|       |     * generating bits from it.  Note: taking the lock will be a no-op
  227|       |     * if locking is not required (while drbg->parent->lock == NULL).
  228|       |     */
  229|      3|    if (!ossl_drbg_lock_parent(drbg))
  ------------------
  |  Branch (229:9): [True: 0, False: 3]
  ------------------
  230|      0|        return 0;
  231|       |    /*
  232|       |     * Get random data from parent.  Include our DRBG address as
  233|       |     * additional input, in order to provide a distinction between
  234|       |     * different DRBG child instances.
  235|       |     *
  236|       |     * Note: using the sizeof() operator on a pointer triggers
  237|       |     *       a warning in some static code analyzers, but it's
  238|       |     *       intentional and correct here.
  239|       |     */
  240|      3|    bytes = drbg->parent_get_seed(drbg->parent, pout, drbg->strength,
  241|      3|                                  min_len, max_len, prediction_resistance,
  242|      3|                                  (unsigned char *)&drbg, sizeof(drbg));
  243|      3|    ossl_drbg_unlock_parent(drbg);
  244|      3|    return bytes;
  245|      3|}
drbg.c:ossl_drbg_lock_parent:
   65|  7.63k|{
   66|  7.63k|    void *parent = drbg->parent;
   67|       |
   68|  7.63k|    if (parent != NULL
  ------------------
  |  Branch (68:9): [True: 7.63k, False: 0]
  ------------------
   69|  7.63k|            && drbg->parent_lock != NULL
  ------------------
  |  Branch (69:16): [True: 7.63k, False: 0]
  ------------------
   70|  7.63k|            && !drbg->parent_lock(parent)) {
  ------------------
  |  Branch (70:16): [True: 0, False: 7.63k]
  ------------------
   71|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_LOCKING_NOT_ENABLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   72|      0|        return 0;
   73|      0|    }
   74|  7.63k|    return 1;
   75|  7.63k|}
drbg.c:ossl_drbg_unlock_parent:
   78|  7.63k|{
   79|  7.63k|    void *parent = drbg->parent;
   80|       |
   81|  7.63k|    if (parent != NULL && drbg->parent_unlock != NULL)
  ------------------
  |  Branch (81:9): [True: 7.63k, False: 0]
  |  Branch (81:27): [True: 7.63k, False: 0]
  ------------------
   82|  7.63k|        drbg->parent_unlock(parent);
   83|  7.63k|}
drbg.c:cleanup_entropy:
  248|      3|{
  249|      3|    if (drbg->parent == NULL) {
  ------------------
  |  Branch (249:9): [True: 0, False: 3]
  ------------------
  250|       |#ifdef FIPS_MODULE
  251|       |        ossl_crngt_cleanup_entropy(drbg, out, outlen);
  252|       |#else
  253|      0|        ossl_prov_cleanup_entropy(drbg->provctx, out, outlen);
  254|      0|#endif
  255|      3|    } else if (drbg->parent_clear_seed != NULL) {
  ------------------
  |  Branch (255:16): [True: 3, False: 0]
  ------------------
  256|      3|        if (!ossl_drbg_lock_parent(drbg))
  ------------------
  |  Branch (256:13): [True: 0, False: 3]
  ------------------
  257|      0|            return;
  258|      3|        drbg->parent_clear_seed(drbg->parent, out, outlen);
  259|      3|        ossl_drbg_unlock_parent(drbg);
  260|      3|    }
  261|      3|}
drbg.c:ossl_prov_drbg_reseed_unlocked:
  493|      1|{
  494|      1|    unsigned char *entropy = NULL;
  495|      1|    size_t entropylen = 0;
  496|       |
  497|      1|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (497:9): [True: 0, False: 1]
  ------------------
  498|      0|        return 0;
  499|       |
  500|      1|    if (drbg->state != EVP_RAND_STATE_READY) {
  ------------------
  |  | 1293|      1|# define EVP_RAND_STATE_READY            1
  ------------------
  |  Branch (500:9): [True: 0, False: 1]
  ------------------
  501|       |        /* try to recover from previous errors */
  502|      0|        rand_drbg_restart(drbg);
  503|       |
  504|      0|        if (drbg->state == EVP_RAND_STATE_ERROR) {
  ------------------
  |  | 1294|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  |  Branch (504:13): [True: 0, False: 0]
  ------------------
  505|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_IN_ERROR_STATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  506|      0|            return 0;
  507|      0|        }
  508|      0|        if (drbg->state == EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1292|      0|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
  |  Branch (508:13): [True: 0, False: 0]
  ------------------
  509|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  510|      0|            return 0;
  511|      0|        }
  512|      0|    }
  513|       |
  514|      1|    if (ent != NULL) {
  ------------------
  |  Branch (514:9): [True: 0, False: 1]
  ------------------
  515|      0|        if (ent_len < drbg->min_entropylen) {
  ------------------
  |  Branch (515:13): [True: 0, False: 0]
  ------------------
  516|      0|            ERR_raise(ERR_LIB_RAND, RAND_R_ENTROPY_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  517|      0|            drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1294|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  518|      0|            return 0;
  519|      0|        }
  520|      0|        if (ent_len > drbg->max_entropylen) {
  ------------------
  |  Branch (520:13): [True: 0, False: 0]
  ------------------
  521|      0|            ERR_raise(ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  522|      0|            drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1294|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  523|      0|            return 0;
  524|      0|        }
  525|      0|    }
  526|       |
  527|      1|    if (adin == NULL) {
  ------------------
  |  Branch (527:9): [True: 1, False: 0]
  ------------------
  528|      1|        adinlen = 0;
  529|      1|    } else if (adinlen > drbg->max_adinlen) {
  ------------------
  |  Branch (529:16): [True: 0, False: 0]
  ------------------
  530|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ADDITIONAL_INPUT_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  531|      0|        return 0;
  532|      0|    }
  533|       |
  534|      1|    drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1294|      1|# define EVP_RAND_STATE_ERROR            2
  ------------------
  535|       |
  536|      1|    drbg->reseed_next_counter = tsan_load(&drbg->reseed_counter);
  ------------------
  |  |   61|      1|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  537|      1|    if (drbg->reseed_next_counter) {
  ------------------
  |  Branch (537:9): [True: 1, False: 0]
  ------------------
  538|      1|        drbg->reseed_next_counter++;
  539|      1|        if (!drbg->reseed_next_counter)
  ------------------
  |  Branch (539:13): [True: 0, False: 1]
  ------------------
  540|      0|            drbg->reseed_next_counter = 1;
  541|      1|    }
  542|       |
  543|      1|    if (ent != NULL) {
  ------------------
  |  Branch (543:9): [True: 0, False: 1]
  ------------------
  544|       |#ifdef FIPS_MODULE
  545|       |        /*
  546|       |         * NIST SP-800-90A mandates that entropy *shall not* be provided
  547|       |         * by the consuming application. Instead the data is added as additional
  548|       |         * input.
  549|       |         *
  550|       |         * (NIST SP-800-90Ar1, Sections 9.1 and 9.2)
  551|       |         */
  552|       |        if (!drbg->reseed(drbg, NULL, 0, ent, ent_len)) {
  553|       |            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_RESEED);
  554|       |            return 0;
  555|       |        }
  556|       |#else
  557|      0|        if (!drbg->reseed(drbg, ent, ent_len, adin, adinlen)) {
  ------------------
  |  Branch (557:13): [True: 0, False: 0]
  ------------------
  558|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_RESEED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  559|      0|            return 0;
  560|      0|        }
  561|       |        /* There isn't much point adding the same additional input twice */
  562|      0|        adin = NULL;
  563|      0|        adinlen = 0;
  564|      0|#endif
  565|      0|    }
  566|       |
  567|       |    /* Reseed using our sources in addition */
  568|      1|    entropylen = get_entropy(drbg, &entropy, drbg->strength,
  569|      1|                             drbg->min_entropylen, drbg->max_entropylen,
  570|      1|                             prediction_resistance);
  571|      1|    if (entropylen < drbg->min_entropylen
  ------------------
  |  Branch (571:9): [True: 0, False: 1]
  ------------------
  572|      1|            || entropylen > drbg->max_entropylen) {
  ------------------
  |  Branch (572:16): [True: 0, False: 1]
  ------------------
  573|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_ENTROPY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  574|      0|        goto end;
  575|      0|    }
  576|       |
  577|      1|    if (!drbg->reseed(drbg, entropy, entropylen, adin, adinlen))
  ------------------
  |  Branch (577:9): [True: 0, False: 1]
  ------------------
  578|      0|        goto end;
  579|       |
  580|      1|    drbg->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1293|      1|# define EVP_RAND_STATE_READY            1
  ------------------
  581|      1|    drbg->generate_counter = 1;
  582|      1|    drbg->reseed_time = time(NULL);
  583|      1|    tsan_store(&drbg->reseed_counter, drbg->reseed_next_counter);
  ------------------
  |  |   62|      1|#   define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  584|      1|    if (drbg->parent != NULL)
  ------------------
  |  Branch (584:9): [True: 1, False: 0]
  ------------------
  585|      1|        drbg->parent_reseed_counter = get_parent_reseed_count(drbg);
  586|       |
  587|      1| end:
  588|      1|    cleanup_entropy(drbg, entropy, entropylen);
  589|      1|    if (drbg->state == EVP_RAND_STATE_READY)
  ------------------
  |  | 1293|      1|# define EVP_RAND_STATE_READY            1
  ------------------
  |  Branch (589:9): [True: 1, False: 0]
  ------------------
  590|      1|        return 1;
  591|      0|    return 0;
  592|      1|}
drbg.c:get_parent_reseed_count:
  111|  7.62k|{
  112|  7.62k|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  7.62k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  7.62k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  113|  7.62k|    void *parent = drbg->parent;
  114|  7.62k|    unsigned int r = 0;
  115|       |
  116|  7.62k|    *params = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_COUNTER, &r);
  ------------------
  |  |  217|  7.62k|# define OSSL_DRBG_PARAM_RESEED_COUNTER "reseed_counter"
  ------------------
  117|  7.62k|    if (!ossl_drbg_lock_parent(drbg)) {
  ------------------
  |  Branch (117:9): [True: 0, False: 7.62k]
  ------------------
  118|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_LOCK_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  119|      0|        goto err;
  120|      0|    }
  121|  7.62k|    if (!drbg->parent_get_ctx_params(parent, params))
  ------------------
  |  Branch (121:9): [True: 0, False: 7.62k]
  ------------------
  122|      0|        r = 0;
  123|  7.62k|    ossl_drbg_unlock_parent(drbg);
  124|  7.62k|    return r;
  125|       |
  126|      0| err:
  127|      0|    r = tsan_load(&drbg->reseed_counter) - 2;
  ------------------
  |  |   61|      0|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  128|      0|    if (r == 0)
  ------------------
  |  Branch (128:9): [True: 0, False: 0]
  ------------------
  129|      0|        r = UINT_MAX;
  130|      0|    return r;
  131|  7.62k|}
drbg.c:find_call:
  751|     14|{
  752|     14|    if (dispatch != NULL)
  ------------------
  |  Branch (752:9): [True: 14, False: 0]
  ------------------
  753|    162|        while (dispatch->function_id != 0) {
  ------------------
  |  Branch (753:16): [True: 160, False: 2]
  ------------------
  754|    160|            if (dispatch->function_id == function)
  ------------------
  |  Branch (754:17): [True: 12, False: 148]
  ------------------
  755|     12|                return dispatch;
  756|    148|            dispatch++;
  757|    148|        }
  758|      2|    return NULL;
  759|     14|}
drbg.c:get_parent_strength:
   86|      5|{
   87|      5|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      5|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      5|    { NULL, 0, NULL, 0, 0 }
  ------------------
   88|      5|    void *parent = drbg->parent;
   89|      5|    int res;
   90|       |
   91|      5|    if (drbg->parent_get_ctx_params == NULL) {
  ------------------
  |  Branch (91:9): [True: 0, False: 5]
  ------------------
   92|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PARENT_STRENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   93|      0|        return 0;
   94|      0|    }
   95|       |
   96|      5|    *params = OSSL_PARAM_construct_uint(OSSL_RAND_PARAM_STRENGTH, str);
  ------------------
  |  |  445|      5|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
   97|      5|    if (!ossl_drbg_lock_parent(drbg)) {
  ------------------
  |  Branch (97:9): [True: 0, False: 5]
  ------------------
   98|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_LOCK_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   99|      0|        return 0;
  100|      0|    }
  101|      5|    res = drbg->parent_get_ctx_params(parent, params);
  102|      5|    ossl_drbg_unlock_parent(drbg);
  103|      5|    if (!res) {
  ------------------
  |  Branch (103:9): [True: 0, False: 5]
  ------------------
  104|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PARENT_STRENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  105|      0|        return 0;
  106|      0|    }
  107|      5|    return 1;
  108|      5|}

drbg_ctr.c:drbg_ctr_new_wrapper:
  633|      2|{
  634|      2|    return ossl_rand_drbg_new(provctx, parent, parent_dispatch, &drbg_ctr_new,
  635|      2|                              &drbg_ctr_instantiate, &drbg_ctr_uninstantiate,
  636|      2|                              &drbg_ctr_reseed, &drbg_ctr_generate);
  637|      2|}
drbg_ctr.c:drbg_ctr_new:
  619|      2|{
  620|      2|    PROV_DRBG_CTR *ctr;
  621|       |
  622|      2|    ctr = OPENSSL_secure_zalloc(sizeof(*ctr));
  ------------------
  |  |  117|      2|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  623|      2|    if (ctr == NULL)
  ------------------
  |  Branch (623:9): [True: 0, False: 2]
  ------------------
  624|      0|        return 0;
  625|       |
  626|      2|    ctr->use_df = 1;
  627|      2|    drbg->data = ctr;
  628|      2|    return drbg_ctr_init_lengths(drbg);
  629|      2|}
drbg_ctr.c:drbg_ctr_init_lengths:
  525|      4|{
  526|      4|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  527|      4|    int res = 1;
  528|       |
  529|       |    /* Maximum number of bits per request = 2^19  = 2^16 bytes */
  530|      4|    drbg->max_request = 1 << 16;
  531|      4|    if (ctr->use_df) {
  ------------------
  |  Branch (531:9): [True: 3, False: 1]
  ------------------
  532|      3|        drbg->min_entropylen = 0;
  533|      3|        drbg->max_entropylen = DRBG_MAX_LENGTH;
  ------------------
  |  |   50|      3|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  534|      3|        drbg->min_noncelen = 0;
  535|      3|        drbg->max_noncelen = DRBG_MAX_LENGTH;
  ------------------
  |  |   50|      3|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  536|      3|        drbg->max_perslen = DRBG_MAX_LENGTH;
  ------------------
  |  |   50|      3|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  537|      3|        drbg->max_adinlen = DRBG_MAX_LENGTH;
  ------------------
  |  |   50|      3|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  538|       |
  539|      3|        if (ctr->keylen > 0) {
  ------------------
  |  Branch (539:13): [True: 1, False: 2]
  ------------------
  540|      1|            drbg->min_entropylen = ctr->keylen;
  541|      1|            drbg->min_noncelen = drbg->min_entropylen / 2;
  542|      1|        }
  543|      3|    } else {
  544|      1|        const size_t len = ctr->keylen > 0 ? drbg->seedlen : DRBG_MAX_LENGTH;
  ------------------
  |  |   50|      1|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  |  Branch (544:28): [True: 1, False: 0]
  ------------------
  545|       |
  546|      1|        drbg->min_entropylen = len;
  547|      1|        drbg->max_entropylen = len;
  548|       |        /* Nonce not used */
  549|      1|        drbg->min_noncelen = 0;
  550|      1|        drbg->max_noncelen = 0;
  551|      1|        drbg->max_perslen = len;
  552|      1|        drbg->max_adinlen = len;
  553|      1|    }
  554|      4|    return res;
  555|      4|}
drbg_ctr.c:drbg_ctr_instantiate:
  311|      2|{
  312|      2|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  313|       |
  314|      2|    if (entropy == NULL)
  ------------------
  |  Branch (314:9): [True: 0, False: 2]
  ------------------
  315|      0|        return 0;
  316|       |
  317|      2|    memset(ctr->K, 0, sizeof(ctr->K));
  318|      2|    memset(ctr->V, 0, sizeof(ctr->V));
  319|      2|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->K, NULL, -1))
  ------------------
  |  Branch (319:9): [True: 0, False: 2]
  ------------------
  320|      0|        return 0;
  321|       |
  322|      2|    inc_128(ctr);
  323|      2|    if (!ctr_update(drbg, entropy, entropylen, pers, perslen, nonce, noncelen))
  ------------------
  |  Branch (323:9): [True: 0, False: 2]
  ------------------
  324|      0|        return 0;
  325|      2|    return 1;
  326|      2|}
drbg_ctr.c:inc_128:
   61|  22.8k|{
   62|  22.8k|    unsigned char *p = &ctr->V[0];
   63|  22.8k|    u32 n = 16, c = 1;
   64|       |
   65|   366k|    do {
   66|   366k|        --n;
   67|   366k|        c += p[n];
   68|   366k|        p[n] = (u8)c;
   69|   366k|        c >>= 8;
   70|   366k|    } while (n);
  ------------------
  |  Branch (70:14): [True: 343k, False: 22.8k]
  ------------------
   71|  22.8k|}
drbg_ctr.c:ctr_update:
  265|  7.62k|{
  266|  7.62k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  267|  7.62k|    int outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|  7.62k|# define AES_BLOCK_SIZE 16
  ------------------
  268|  7.62k|    unsigned char V_tmp[48], out[48];
  269|  7.62k|    unsigned char len;
  270|       |
  271|       |    /* correct key is already set up. */
  272|  7.62k|    memcpy(V_tmp, ctr->V, 16);
  273|  7.62k|    inc_128(ctr);
  274|  7.62k|    memcpy(V_tmp + 16, ctr->V, 16);
  275|  7.62k|    if (ctr->keylen == 16) {
  ------------------
  |  Branch (275:9): [True: 0, False: 7.62k]
  ------------------
  276|      0|        len = 32;
  277|  7.62k|    } else {
  278|  7.62k|        inc_128(ctr);
  279|  7.62k|        memcpy(V_tmp + 32, ctr->V, 16);
  280|  7.62k|        len = 48;
  281|  7.62k|    }
  282|  7.62k|    if (!EVP_CipherUpdate(ctr->ctx_ecb, out, &outlen, V_tmp, len)
  ------------------
  |  Branch (282:9): [True: 0, False: 7.62k]
  ------------------
  283|  7.62k|            || outlen != len)
  ------------------
  |  Branch (283:16): [True: 0, False: 7.62k]
  ------------------
  284|      0|        return 0;
  285|  7.62k|    memcpy(ctr->K, out, ctr->keylen);
  286|  7.62k|    memcpy(ctr->V, out + ctr->keylen, 16);
  287|       |
  288|  7.62k|    if (ctr->use_df) {
  ------------------
  |  Branch (288:9): [True: 5, False: 7.62k]
  ------------------
  289|       |        /* If no input reuse existing derived value */
  290|      5|        if (in1 != NULL || nonce != NULL || in2 != NULL)
  ------------------
  |  Branch (290:13): [True: 3, False: 2]
  |  Branch (290:28): [True: 0, False: 2]
  |  Branch (290:45): [True: 0, False: 2]
  ------------------
  291|      3|            if (!ctr_df(ctr, in1, in1len, nonce, noncelen, in2, in2len))
  ------------------
  |  Branch (291:17): [True: 0, False: 3]
  ------------------
  292|      0|                return 0;
  293|       |        /* If this a reuse input in1len != 0 */
  294|      5|        if (in1len)
  ------------------
  |  Branch (294:13): [True: 5, False: 0]
  ------------------
  295|      5|            ctr_XOR(ctr, ctr->KX, drbg->seedlen);
  296|  7.62k|    } else {
  297|  7.62k|        ctr_XOR(ctr, in1, in1len);
  298|  7.62k|        ctr_XOR(ctr, in2, in2len);
  299|  7.62k|    }
  300|       |
  301|  7.62k|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->K, NULL, -1)
  ------------------
  |  Branch (301:9): [True: 0, False: 7.62k]
  ------------------
  302|  7.62k|        || !EVP_CipherInit_ex(ctr->ctx_ctr, NULL, NULL, ctr->K, NULL, -1))
  ------------------
  |  Branch (302:12): [True: 0, False: 7.62k]
  ------------------
  303|      0|        return 0;
  304|  7.62k|    return 1;
  305|  7.62k|}
drbg_ctr.c:ctr_df:
  202|      3|{
  203|      3|    static unsigned char c80 = 0x80;
  204|      3|    size_t inlen;
  205|      3|    unsigned char *p = ctr->bltmp;
  206|      3|    int outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|      3|# define AES_BLOCK_SIZE 16
  ------------------
  207|       |
  208|      3|    if (!ctr_BCC_init(ctr))
  ------------------
  |  Branch (208:9): [True: 0, False: 3]
  ------------------
  209|      0|        return 0;
  210|      3|    if (in1 == NULL)
  ------------------
  |  Branch (210:9): [True: 0, False: 3]
  ------------------
  211|      0|        in1len = 0;
  212|      3|    if (in2 == NULL)
  ------------------
  |  Branch (212:9): [True: 3, False: 0]
  ------------------
  213|      3|        in2len = 0;
  214|      3|    if (in3 == NULL)
  ------------------
  |  Branch (214:9): [True: 2, False: 1]
  ------------------
  215|      2|        in3len = 0;
  216|      3|    inlen = in1len + in2len + in3len;
  217|       |    /* Initialise L||N in temporary block */
  218|      3|    *p++ = (inlen >> 24) & 0xff;
  219|      3|    *p++ = (inlen >> 16) & 0xff;
  220|      3|    *p++ = (inlen >> 8) & 0xff;
  221|      3|    *p++ = inlen & 0xff;
  222|       |
  223|       |    /* NB keylen is at most 32 bytes */
  224|      3|    *p++ = 0;
  225|      3|    *p++ = 0;
  226|      3|    *p++ = 0;
  227|      3|    *p = (unsigned char)((ctr->keylen + 16) & 0xff);
  228|      3|    ctr->bltmp_pos = 8;
  229|      3|    if (!ctr_BCC_update(ctr, in1, in1len)
  ------------------
  |  Branch (229:9): [True: 0, False: 3]
  ------------------
  230|      3|        || !ctr_BCC_update(ctr, in2, in2len)
  ------------------
  |  Branch (230:12): [True: 0, False: 3]
  ------------------
  231|      3|        || !ctr_BCC_update(ctr, in3, in3len)
  ------------------
  |  Branch (231:12): [True: 0, False: 3]
  ------------------
  232|      3|        || !ctr_BCC_update(ctr, &c80, 1)
  ------------------
  |  Branch (232:12): [True: 0, False: 3]
  ------------------
  233|      3|        || !ctr_BCC_final(ctr))
  ------------------
  |  Branch (233:12): [True: 0, False: 3]
  ------------------
  234|      0|        return 0;
  235|       |    /* Set up key K */
  236|      3|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->KX, NULL, -1))
  ------------------
  |  Branch (236:9): [True: 0, False: 3]
  ------------------
  237|      0|        return 0;
  238|       |    /* X follows key K */
  239|      3|    if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX, &outlen, ctr->KX + ctr->keylen,
  ------------------
  |  Branch (239:9): [True: 0, False: 3]
  ------------------
  240|      3|                          AES_BLOCK_SIZE)
  ------------------
  |  |   26|      3|# define AES_BLOCK_SIZE 16
  ------------------
  241|      3|        || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|      3|# define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (241:12): [True: 0, False: 3]
  ------------------
  242|      0|        return 0;
  243|      3|    if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX + 16, &outlen, ctr->KX,
  ------------------
  |  Branch (243:9): [True: 0, False: 3]
  ------------------
  244|      3|                          AES_BLOCK_SIZE)
  ------------------
  |  |   26|      3|# define AES_BLOCK_SIZE 16
  ------------------
  245|      3|        || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|      3|# define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (245:12): [True: 0, False: 3]
  ------------------
  246|      0|        return 0;
  247|      3|    if (ctr->keylen != 16)
  ------------------
  |  Branch (247:9): [True: 3, False: 0]
  ------------------
  248|      3|        if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX + 32, &outlen,
  ------------------
  |  Branch (248:13): [True: 0, False: 3]
  ------------------
  249|      3|                              ctr->KX + 16, AES_BLOCK_SIZE)
  ------------------
  |  |   26|      3|# define AES_BLOCK_SIZE 16
  ------------------
  250|      3|            || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|      3|# define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (250:16): [True: 0, False: 3]
  ------------------
  251|      0|            return 0;
  252|      3|    return 1;
  253|      3|}
drbg_ctr.c:ctr_BCC_init:
  139|      3|{
  140|      3|    unsigned char bltmp[48] = {0};
  141|      3|    unsigned char num_of_blk;
  142|       |
  143|      3|    memset(ctr->KX, 0, 48);
  144|      3|    num_of_blk = ctr->keylen == 16 ? 2 : 3;
  ------------------
  |  Branch (144:18): [True: 0, False: 3]
  ------------------
  145|      3|    bltmp[(AES_BLOCK_SIZE * 1) + 3] = 1;
  ------------------
  |  |   26|      3|# define AES_BLOCK_SIZE 16
  ------------------
  146|      3|    bltmp[(AES_BLOCK_SIZE * 2) + 3] = 2;
  ------------------
  |  |   26|      3|# define AES_BLOCK_SIZE 16
  ------------------
  147|      3|    return ctr_BCC_block(ctr, ctr->KX, bltmp, num_of_blk * AES_BLOCK_SIZE);
  ------------------
  |  |   26|      3|# define AES_BLOCK_SIZE 16
  ------------------
  148|      3|}
drbg_ctr.c:ctr_BCC_block:
  104|     13|{
  105|     13|    int i, outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|     13|# define AES_BLOCK_SIZE 16
  ------------------
  106|       |
  107|    637|    for (i = 0; i < len; i++)
  ------------------
  |  Branch (107:17): [True: 624, False: 13]
  ------------------
  108|    624|        out[i] ^= in[i];
  109|       |
  110|     13|    if (!EVP_CipherUpdate(ctr->ctx_df, out, &outlen, out, len)
  ------------------
  |  Branch (110:9): [True: 0, False: 13]
  ------------------
  111|     13|        || outlen != len)
  ------------------
  |  Branch (111:12): [True: 0, False: 13]
  ------------------
  112|      0|        return 0;
  113|     13|    return 1;
  114|     13|}
drbg_ctr.c:ctr_BCC_update:
  155|     12|{
  156|     12|    if (in == NULL || inlen == 0)
  ------------------
  |  Branch (156:9): [True: 5, False: 7]
  |  Branch (156:23): [True: 0, False: 7]
  ------------------
  157|      5|        return 1;
  158|       |
  159|       |    /* If we have partial block handle it first */
  160|      7|    if (ctr->bltmp_pos) {
  ------------------
  |  Branch (160:9): [True: 5, False: 2]
  ------------------
  161|      5|        size_t left = 16 - ctr->bltmp_pos;
  162|       |
  163|       |        /* If we now have a complete block process it */
  164|      5|        if (inlen >= left) {
  ------------------
  |  Branch (164:13): [True: 4, False: 1]
  ------------------
  165|      4|            memcpy(ctr->bltmp + ctr->bltmp_pos, in, left);
  166|      4|            if (!ctr_BCC_blocks(ctr, ctr->bltmp))
  ------------------
  |  Branch (166:17): [True: 0, False: 4]
  ------------------
  167|      0|                return 0;
  168|      4|            ctr->bltmp_pos = 0;
  169|      4|            inlen -= left;
  170|      4|            in += left;
  171|      4|        }
  172|      5|    }
  173|       |
  174|       |    /* Process zero or more complete blocks */
  175|     10|    for (; inlen >= 16; in += 16, inlen -= 16) {
  ------------------
  |  Branch (175:12): [True: 3, False: 7]
  ------------------
  176|      3|        if (!ctr_BCC_blocks(ctr, in))
  ------------------
  |  Branch (176:13): [True: 0, False: 3]
  ------------------
  177|      0|            return 0;
  178|      3|    }
  179|       |
  180|       |    /* Copy any remaining partial block to the temporary buffer */
  181|      7|    if (inlen > 0) {
  ------------------
  |  Branch (181:9): [True: 5, False: 2]
  ------------------
  182|      5|        memcpy(ctr->bltmp + ctr->bltmp_pos, in, inlen);
  183|      5|        ctr->bltmp_pos += inlen;
  184|      5|    }
  185|      7|    return 1;
  186|      7|}
drbg_ctr.c:ctr_BCC_blocks:
  121|     10|{
  122|     10|    unsigned char in_tmp[48];
  123|     10|    unsigned char num_of_blk = 2;
  124|       |
  125|     10|    memcpy(in_tmp, in, 16);
  126|     10|    memcpy(in_tmp + 16, in, 16);
  127|     10|    if (ctr->keylen != 16) {
  ------------------
  |  Branch (127:9): [True: 10, False: 0]
  ------------------
  128|     10|        memcpy(in_tmp + 32, in, 16);
  129|     10|        num_of_blk = 3;
  130|     10|    }
  131|     10|    return ctr_BCC_block(ctr, ctr->KX, in_tmp, AES_BLOCK_SIZE * num_of_blk);
  ------------------
  |  |   26|     10|# define AES_BLOCK_SIZE 16
  ------------------
  132|     10|}
drbg_ctr.c:ctr_BCC_final:
  189|      3|{
  190|      3|    if (ctr->bltmp_pos) {
  ------------------
  |  Branch (190:9): [True: 3, False: 0]
  ------------------
  191|      3|        memset(ctr->bltmp + ctr->bltmp_pos, 0, 16 - ctr->bltmp_pos);
  192|      3|        if (!ctr_BCC_blocks(ctr, ctr->bltmp))
  ------------------
  |  Branch (192:13): [True: 0, False: 3]
  ------------------
  193|      0|            return 0;
  194|      3|    }
  195|      3|    return 1;
  196|      3|}
drbg_ctr.c:ctr_XOR:
   74|  15.2k|{
   75|  15.2k|    size_t i, n;
   76|       |
   77|  15.2k|    if (in == NULL || inlen == 0)
  ------------------
  |  Branch (77:9): [True: 15.2k, False: 8]
  |  Branch (77:23): [True: 0, False: 8]
  ------------------
   78|  15.2k|        return;
   79|       |
   80|       |    /*
   81|       |     * Any zero padding will have no effect on the result as we
   82|       |     * are XORing. So just process however much input we have.
   83|       |     */
   84|      8|    n = inlen < ctr->keylen ? inlen : ctr->keylen;
  ------------------
  |  Branch (84:9): [True: 1, False: 7]
  ------------------
   85|    261|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (85:17): [True: 253, False: 8]
  ------------------
   86|    253|        ctr->K[i] ^= in[i];
   87|      8|    if (inlen <= ctr->keylen)
  ------------------
  |  Branch (87:9): [True: 1, False: 7]
  ------------------
   88|      1|        return;
   89|       |
   90|      7|    n = inlen - ctr->keylen;
   91|      7|    if (n > 16) {
  ------------------
  |  Branch (91:9): [True: 0, False: 7]
  ------------------
   92|       |        /* Should never happen */
   93|      0|        n = 16;
   94|      0|    }
   95|    119|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (95:17): [True: 112, False: 7]
  ------------------
   96|    112|        ctr->V[i] ^= in[i + ctr->keylen];
   97|      7|}
drbg_ctr.c:drbg_ctr_reseed:
  354|      1|{
  355|      1|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  356|       |
  357|      1|    if (entropy == NULL)
  ------------------
  |  Branch (357:9): [True: 0, False: 1]
  ------------------
  358|      0|        return 0;
  359|       |
  360|      1|    inc_128(ctr);
  361|      1|    if (!ctr_update(drbg, entropy, entropylen, adin, adinlen, NULL, 0))
  ------------------
  |  Branch (361:9): [True: 0, False: 1]
  ------------------
  362|      0|        return 0;
  363|      1|    return 1;
  364|      1|}
drbg_ctr.c:drbg_ctr_generate:
  391|  7.62k|{
  392|  7.62k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  393|  7.62k|    unsigned int ctr32, blocks;
  394|  7.62k|    int outl, buflen;
  395|       |
  396|  7.62k|    if (adin != NULL && adinlen != 0) {
  ------------------
  |  Branch (396:9): [True: 2, False: 7.61k]
  |  Branch (396:25): [True: 2, False: 0]
  ------------------
  397|      2|        inc_128(ctr);
  398|       |
  399|      2|        if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (399:13): [True: 0, False: 2]
  ------------------
  400|      0|            return 0;
  401|       |        /* This means we reuse derived value */
  402|      2|        if (ctr->use_df) {
  ------------------
  |  Branch (402:13): [True: 2, False: 0]
  ------------------
  403|      2|            adin = NULL;
  404|      2|            adinlen = 1;
  405|      2|        }
  406|  7.61k|    } else {
  407|  7.61k|        adinlen = 0;
  408|  7.61k|    }
  409|       |
  410|  7.62k|    inc_128(ctr);
  411|       |
  412|  7.62k|    if (outlen == 0) {
  ------------------
  |  Branch (412:9): [True: 0, False: 7.62k]
  ------------------
  413|      0|        inc_128(ctr);
  414|       |
  415|      0|        if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (415:13): [True: 0, False: 0]
  ------------------
  416|      0|            return 0;
  417|      0|        return 1;
  418|      0|    }
  419|       |
  420|  7.62k|    memset(out, 0, outlen);
  421|       |
  422|  7.62k|    do {
  423|  7.62k|        if (!EVP_CipherInit_ex(ctr->ctx_ctr,
  ------------------
  |  Branch (423:13): [True: 0, False: 7.62k]
  ------------------
  424|  7.62k|                               NULL, NULL, NULL, ctr->V, -1))
  425|      0|            return 0;
  426|       |
  427|       |        /*-
  428|       |         * outlen has type size_t while EVP_CipherUpdate takes an
  429|       |         * int argument and thus cannot be guaranteed to process more
  430|       |         * than 2^31-1 bytes at a time. We process such huge generate
  431|       |         * requests in 2^30 byte chunks, which is the greatest multiple
  432|       |         * of AES block size lower than or equal to 2^31-1.
  433|       |         */
  434|  7.62k|        buflen = outlen > (1U << 30) ? (1U << 30) : outlen;
  ------------------
  |  Branch (434:18): [True: 0, False: 7.62k]
  ------------------
  435|  7.62k|        blocks = (buflen + 15) / 16;
  436|       |
  437|  7.62k|        ctr32 = GETU32(ctr->V + 12) + blocks;
  ------------------
  |  |  103|  7.62k|# define GETU32(p)       ((u32)(p)[0]<<24|(u32)(p)[1]<<16|(u32)(p)[2]<<8|(u32)(p)[3])
  ------------------
  438|  7.62k|        if (ctr32 < blocks) {
  ------------------
  |  Branch (438:13): [True: 0, False: 7.62k]
  ------------------
  439|       |            /* 32-bit counter overflow into V. */
  440|      0|            if (ctr32 != 0) {
  ------------------
  |  Branch (440:17): [True: 0, False: 0]
  ------------------
  441|      0|                blocks -= ctr32;
  442|      0|                buflen = blocks * 16;
  443|      0|                ctr32 = 0;
  444|      0|            }
  445|      0|            ctr96_inc(ctr->V);
  446|      0|        }
  447|  7.62k|        PUTU32(ctr->V + 12, ctr32);
  ------------------
  |  |  104|  7.62k|# define PUTU32(p,v)     ((p)[0]=(u8)((v)>>24),(p)[1]=(u8)((v)>>16),(p)[2]=(u8)((v)>>8),(p)[3]=(u8)(v))
  ------------------
  448|       |
  449|  7.62k|        if (!EVP_CipherUpdate(ctr->ctx_ctr, out, &outl, out, buflen)
  ------------------
  |  Branch (449:13): [True: 0, False: 7.62k]
  ------------------
  450|  7.62k|            || outl != buflen)
  ------------------
  |  Branch (450:16): [True: 0, False: 7.62k]
  ------------------
  451|      0|            return 0;
  452|       |
  453|  7.62k|        out += buflen;
  454|  7.62k|        outlen -= buflen;
  455|  7.62k|    } while (outlen);
  ------------------
  |  Branch (455:14): [True: 0, False: 7.62k]
  ------------------
  456|       |
  457|  7.62k|    if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (457:9): [True: 0, False: 7.62k]
  ------------------
  458|      0|        return 0;
  459|  7.62k|    return 1;
  460|  7.62k|}
drbg_ctr.c:drbg_ctr_free:
  640|      2|{
  641|      2|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  642|      2|    PROV_DRBG_CTR *ctr;
  643|       |
  644|      2|    if (drbg != NULL && (ctr = (PROV_DRBG_CTR *)drbg->data) != NULL) {
  ------------------
  |  Branch (644:9): [True: 2, False: 0]
  |  Branch (644:25): [True: 2, False: 0]
  ------------------
  645|      2|        EVP_CIPHER_CTX_free(ctr->ctx_ecb);
  646|      2|        EVP_CIPHER_CTX_free(ctr->ctx_ctr);
  647|      2|        EVP_CIPHER_CTX_free(ctr->ctx_df);
  648|      2|        EVP_CIPHER_free(ctr->cipher_ecb);
  649|      2|        EVP_CIPHER_free(ctr->cipher_ctr);
  650|       |
  651|      2|        OPENSSL_secure_clear_free(ctr, sizeof(*ctr));
  ------------------
  |  |  121|      2|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  652|      2|    }
  653|      2|    ossl_rand_drbg_free(drbg);
  654|      2|}
drbg_ctr.c:drbg_ctr_instantiate_wrapper:
  333|      2|{
  334|      2|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  335|      2|    int ret = 0;
  336|       |
  337|      2|    if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  ------------------
  |  Branch (337:9): [True: 0, False: 2]
  |  Branch (337:31): [True: 0, False: 0]
  ------------------
  338|      0|        return 0;
  339|       |
  340|      2|    if (!ossl_prov_is_running()
  ------------------
  |  Branch (340:9): [True: 0, False: 2]
  ------------------
  341|      2|            || !drbg_ctr_set_ctx_params_locked(drbg, params))
  ------------------
  |  Branch (341:16): [True: 0, False: 2]
  ------------------
  342|      0|        goto err;
  343|      2|    ret = ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
  344|      2|                                     pstr, pstr_len);
  345|      2| err:
  346|      2|    if (drbg->lock != NULL)
  ------------------
  |  Branch (346:9): [True: 0, False: 2]
  ------------------
  347|      0|        CRYPTO_THREAD_unlock(drbg->lock);
  348|      2|    return ret;
  349|      2|}
drbg_ctr.c:drbg_ctr_set_ctx_params_locked:
  705|      2|{
  706|      2|    PROV_DRBG *ctx = (PROV_DRBG *)vctx;
  707|      2|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)ctx->data;
  708|      2|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
  ------------------
  |  |   29|      2|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  709|      2|    const OSSL_PARAM *p;
  710|      2|    char *ecb;
  711|      2|    const char *propquery = NULL;
  712|      2|    int i, cipher_init = 0;
  713|       |
  714|      2|    if ((p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_USE_DF)) != NULL
  ------------------
  |  |  222|      2|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  |  Branch (714:9): [True: 2, False: 0]
  ------------------
  715|      2|            && OSSL_PARAM_get_int(p, &i)) {
  ------------------
  |  Branch (715:16): [True: 2, False: 0]
  ------------------
  716|       |        /* FIPS errors out in the drbg_ctr_init() call later */
  717|      2|        ctr->use_df = i != 0;
  718|      2|        cipher_init = 1;
  719|      2|    }
  720|       |
  721|      2|    if ((p = OSSL_PARAM_locate_const(params,
  ------------------
  |  Branch (721:9): [True: 0, False: 2]
  ------------------
  722|      2|                                     OSSL_DRBG_PARAM_PROPERTIES)) != NULL) {
  ------------------
  |  |  215|      2|# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  116|      2|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  723|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (723:13): [True: 0, False: 0]
  ------------------
  724|      0|            return 0;
  725|      0|        propquery = (const char *)p->data;
  726|      0|    }
  727|       |
  728|      2|    if ((p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_CIPHER)) != NULL) {
  ------------------
  |  |  202|      2|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  112|      2|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  |  Branch (728:9): [True: 2, False: 0]
  ------------------
  729|      2|        const char *base = (const char *)p->data;
  730|      2|        size_t ctr_str_len = sizeof("CTR") - 1;
  731|      2|        size_t ecb_str_len = sizeof("ECB") - 1;
  732|       |
  733|      2|        if (p->data_type != OSSL_PARAM_UTF8_STRING
  ------------------
  |  |  117|      4|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (733:13): [True: 0, False: 2]
  ------------------
  734|      2|                || p->data_size < ctr_str_len)
  ------------------
  |  Branch (734:20): [True: 0, False: 2]
  ------------------
  735|      0|            return 0;
  736|      2|        if (OPENSSL_strcasecmp("CTR", base + p->data_size - ctr_str_len) != 0) {
  ------------------
  |  Branch (736:13): [True: 0, False: 2]
  ------------------
  737|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_REQUIRE_CTR_MODE_CIPHER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  738|      0|            return 0;
  739|      0|        }
  740|      2|        if ((ecb = OPENSSL_strndup(base, p->data_size)) == NULL)
  ------------------
  |  |  113|      2|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (740:13): [True: 0, False: 2]
  ------------------
  741|      0|            return 0;
  742|      2|        strcpy(ecb + p->data_size - ecb_str_len, "ECB");
  743|      2|        EVP_CIPHER_free(ctr->cipher_ecb);
  744|      2|        EVP_CIPHER_free(ctr->cipher_ctr);
  745|      2|        ctr->cipher_ctr = EVP_CIPHER_fetch(libctx, base, propquery);
  746|      2|        ctr->cipher_ecb = EVP_CIPHER_fetch(libctx, ecb, propquery);
  747|      2|        OPENSSL_free(ecb);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  748|      2|        if (ctr->cipher_ctr == NULL || ctr->cipher_ecb == NULL) {
  ------------------
  |  Branch (748:13): [True: 0, False: 2]
  |  Branch (748:40): [True: 0, False: 2]
  ------------------
  749|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_FIND_CIPHERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  750|      0|            return 0;
  751|      0|        }
  752|      2|        cipher_init = 1;
  753|      2|    }
  754|       |
  755|      2|    if (cipher_init && !drbg_ctr_init(ctx))
  ------------------
  |  Branch (755:9): [True: 2, False: 0]
  |  Branch (755:24): [True: 0, False: 2]
  ------------------
  756|      0|        return 0;
  757|       |
  758|      2|    return ossl_drbg_set_ctx_params(ctx, params);
  759|      2|}
drbg_ctr.c:drbg_ctr_init:
  558|      2|{
  559|      2|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  560|      2|    size_t keylen;
  561|       |
  562|      2|    if (ctr->cipher_ctr == NULL) {
  ------------------
  |  Branch (562:9): [True: 0, False: 2]
  ------------------
  563|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_CIPHER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  564|      0|        return 0;
  565|      0|    }
  566|      2|    ctr->keylen = keylen = EVP_CIPHER_get_key_length(ctr->cipher_ctr);
  567|      2|    if (ctr->ctx_ecb == NULL)
  ------------------
  |  Branch (567:9): [True: 2, False: 0]
  ------------------
  568|      2|        ctr->ctx_ecb = EVP_CIPHER_CTX_new();
  569|      2|    if (ctr->ctx_ctr == NULL)
  ------------------
  |  Branch (569:9): [True: 2, False: 0]
  ------------------
  570|      2|        ctr->ctx_ctr = EVP_CIPHER_CTX_new();
  571|      2|    if (ctr->ctx_ecb == NULL || ctr->ctx_ctr == NULL) {
  ------------------
  |  Branch (571:9): [True: 0, False: 2]
  |  Branch (571:33): [True: 0, False: 2]
  ------------------
  572|      0|        ERR_raise(ERR_LIB_PROV, 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  573|      0|        goto err;
  574|      0|    }
  575|       |
  576|      2|    if (!EVP_CipherInit_ex(ctr->ctx_ecb,
  ------------------
  |  Branch (576:9): [True: 0, False: 2]
  ------------------
  577|      2|                           ctr->cipher_ecb, NULL, NULL, NULL, 1)
  578|      2|        || !EVP_CipherInit_ex(ctr->ctx_ctr,
  ------------------
  |  Branch (578:12): [True: 0, False: 2]
  ------------------
  579|      2|                              ctr->cipher_ctr, NULL, NULL, NULL, 1)) {
  580|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_INITIALISE_CIPHERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  581|      0|        goto err;
  582|      0|    }
  583|       |
  584|      2|    drbg->strength = keylen * 8;
  585|      2|    drbg->seedlen = keylen + 16;
  586|       |
  587|      2|    if (ctr->use_df) {
  ------------------
  |  Branch (587:9): [True: 1, False: 1]
  ------------------
  588|       |        /* df initialisation */
  589|      1|        static const unsigned char df_key[32] = {
  590|      1|            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
  591|      1|            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
  592|      1|            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
  593|      1|            0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
  594|      1|        };
  595|       |
  596|      1|        if (ctr->ctx_df == NULL)
  ------------------
  |  Branch (596:13): [True: 1, False: 0]
  ------------------
  597|      1|            ctr->ctx_df = EVP_CIPHER_CTX_new();
  598|      1|        if (ctr->ctx_df == NULL) {
  ------------------
  |  Branch (598:13): [True: 0, False: 1]
  ------------------
  599|      0|            ERR_raise(ERR_LIB_PROV, 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  600|      0|            goto err;
  601|      0|        }
  602|       |        /* Set key schedule for df_key */
  603|      1|        if (!EVP_CipherInit_ex(ctr->ctx_df,
  ------------------
  |  Branch (603:13): [True: 0, False: 1]
  ------------------
  604|      1|                               ctr->cipher_ecb, NULL, df_key, NULL, 1)) {
  605|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_DERIVATION_FUNCTION_INIT_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  606|      0|            goto err;
  607|      0|        }
  608|      1|    }
  609|      2|    return drbg_ctr_init_lengths(drbg);
  610|       |
  611|      0|err:
  612|      0|    EVP_CIPHER_CTX_free(ctr->ctx_ecb);
  613|      0|    EVP_CIPHER_CTX_free(ctr->ctx_ctr);
  614|      0|    ctr->ctx_ecb = ctr->ctx_ctr = NULL;
  615|      0|    return 0;    
  616|      2|}
drbg_ctr.c:drbg_ctr_generate_wrapper:
  466|  7.61k|{
  467|  7.61k|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  468|       |
  469|  7.61k|    return ossl_prov_drbg_generate(drbg, out, outlen, strength,
  470|  7.61k|                                   prediction_resistance, adin, adin_len);
  471|  7.61k|}
drbg_ctr.c:drbg_ctr_settable_ctx_params:
  779|      2|{
  780|      2|    static const OSSL_PARAM known_settable_ctx_params[] = {
  781|      2|        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_PROPERTIES, NULL, 0),
  ------------------
  |  |   61|      2|    OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_STRING, (addr), sz)
  |  |  ------------------
  |  |  |  |   28|      2|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      2|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  782|      2|        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_CIPHER, NULL, 0),
  ------------------
  |  |   61|      2|    OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_STRING, (addr), sz)
  |  |  ------------------
  |  |  |  |   28|      2|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      2|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  783|      2|        OSSL_PARAM_int(OSSL_DRBG_PARAM_USE_DF, NULL),
  ------------------
  |  |   32|      2|    OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int))
  |  |  ------------------
  |  |  |  |   28|      2|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      2|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  784|      2|        OSSL_PARAM_DRBG_SETTABLE_CTX_COMMON,
  ------------------
  |  |  230|      2|    OSSL_PARAM_uint(OSSL_DRBG_PARAM_RESEED_REQUESTS, NULL),             \
  |  |  ------------------
  |  |  |  |   34|      2|    OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      2|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   22|      2|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   35|      2|                    sizeof(unsigned int))
  |  |  ------------------
  |  |  231|      2|    OSSL_PARAM_uint64(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL, NULL)
  |  |  ------------------
  |  |  |  |   49|      2|    OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      2|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   22|      2|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   50|      2|                    sizeof(uint64_t))
  |  |  ------------------
  ------------------
  785|      2|        OSSL_PARAM_END
  ------------------
  |  |   25|      2|    { NULL, 0, NULL, 0, 0 }
  ------------------
  786|      2|    };
  787|      2|    return known_settable_ctx_params;
  788|      2|}
drbg_ctr.c:drbg_ctr_get_ctx_params:
  657|  15.2k|{
  658|  15.2k|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  659|  15.2k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  660|  15.2k|    OSSL_PARAM *p;
  661|  15.2k|    int ret = 0, complete = 0;
  662|       |
  663|  15.2k|    if (!ossl_drbg_get_ctx_params_no_lock(drbg, params, &complete))
  ------------------
  |  Branch (663:9): [True: 0, False: 15.2k]
  ------------------
  664|      0|        return 0;
  665|       |
  666|  15.2k|    if (complete)
  ------------------
  |  Branch (666:9): [True: 15.2k, False: 3]
  ------------------
  667|  15.2k|        return 1;
  668|       |
  669|      3|    if (drbg->lock != NULL && !CRYPTO_THREAD_read_lock(drbg->lock))
  ------------------
  |  Branch (669:9): [True: 3, False: 0]
  |  Branch (669:31): [True: 0, False: 3]
  ------------------
  670|      0|        return 0;
  671|       |
  672|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_USE_DF);
  ------------------
  |  |  222|      3|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  673|      3|    if (p != NULL && !OSSL_PARAM_set_int(p, ctr->use_df))
  ------------------
  |  Branch (673:9): [True: 0, False: 3]
  |  Branch (673:22): [True: 0, False: 0]
  ------------------
  674|      0|        goto err;
  675|       |
  676|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_CIPHER);
  ------------------
  |  |  202|      3|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  112|      3|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  677|      3|    if (p != NULL) {
  ------------------
  |  Branch (677:9): [True: 0, False: 3]
  ------------------
  678|      0|        if (ctr->cipher_ctr == NULL
  ------------------
  |  Branch (678:13): [True: 0, False: 0]
  ------------------
  679|      0|            || !OSSL_PARAM_set_utf8_string(p,
  ------------------
  |  Branch (679:16): [True: 0, False: 0]
  ------------------
  680|      0|                                           EVP_CIPHER_get0_name(ctr->cipher_ctr)))
  681|      0|            goto err;
  682|      0|    }
  683|       |
  684|      3|    ret = ossl_drbg_get_ctx_params(drbg, params);
  685|      3| err:
  686|      3|    if (drbg->lock != NULL)
  ------------------
  |  Branch (686:9): [True: 3, False: 0]
  ------------------
  687|      3|        CRYPTO_THREAD_unlock(drbg->lock);
  688|       |
  689|      3|    return ret;
  690|      3|}

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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   52|      0|        return NULL;
   53|      0|    }
   54|       |
   55|      1|    s = OPENSSL_zalloc(sizeof(*s));
  ------------------
  |  |   99|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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;
  ------------------
  |  | 1292|      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);
  ------------------
  |  |  107|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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;
  ------------------
  |  | 1293|      1|# define EVP_RAND_STATE_READY            1
  ------------------
   77|      1|    return 1;
   78|      1|}
seed_src.c:seed_src_generate:
   93|      1|{
   94|      1|    PROV_SEED_SRC *s = (PROV_SEED_SRC *)vseed;
   95|      1|    size_t entropy_available;
   96|      1|    RAND_POOL *pool;
   97|       |
   98|      1|    if (s->state != EVP_RAND_STATE_READY) {
  ------------------
  |  | 1293|      1|# define EVP_RAND_STATE_READY            1
  ------------------
  |  Branch (98:9): [True: 0, False: 1]
  ------------------
   99|      0|        ERR_raise(ERR_LIB_PROV,
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  |  |  |  Branch (401:55): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  100|      0|                  s->state == EVP_RAND_STATE_ERROR ? PROV_R_IN_ERROR_STATE
  101|      0|                                                   : PROV_R_NOT_INSTANTIATED);
  102|      0|        return 0;
  103|      0|    }
  104|       |
  105|      1|    pool = ossl_rand_pool_new(strength, 1, outlen, outlen);
  106|      1|    if (pool == NULL) {
  ------------------
  |  Branch (106:9): [True: 0, False: 1]
  ------------------
  107|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_RAND_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  108|      0|        return 0;
  109|      0|    }
  110|       |
  111|       |    /* Get entropy by polling system entropy sources. */
  112|      1|    entropy_available = ossl_pool_acquire_entropy(pool);
  113|       |
  114|      1|    if (entropy_available > 0)
  ------------------
  |  Branch (114:9): [True: 1, False: 0]
  ------------------
  115|      1|        memcpy(out, ossl_rand_pool_buffer(pool), ossl_rand_pool_length(pool));
  116|       |
  117|      1|    ossl_rand_pool_free(pool);
  118|      1|    return entropy_available > 0;
  119|      1|}
seed_src.c:seed_src_enable_locking:
  216|      1|{
  217|      1|    return 1;
  218|      1|}
seed_src.c:seed_src_lock:
  221|      7|{
  222|      7|    return 1;
  223|      7|}
seed_src.c:seed_src_unlock:
  226|      7|{
  227|      7|}
seed_src.c:seed_src_get_ctx_params:
  140|      4|{
  141|      4|    PROV_SEED_SRC *s = (PROV_SEED_SRC *)vseed;
  142|      4|    OSSL_PARAM *p;
  143|       |
  144|      4|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
  ------------------
  |  |  444|      4|# define OSSL_RAND_PARAM_STATE "state"
  ------------------
  145|      4|    if (p != NULL && !OSSL_PARAM_set_int(p, s->state))
  ------------------
  |  Branch (145:9): [True: 0, False: 4]
  |  Branch (145:22): [True: 0, False: 0]
  ------------------
  146|      0|        return 0;
  147|       |
  148|      4|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
  ------------------
  |  |  445|      4|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
  149|      4|    if (p != NULL && !OSSL_PARAM_set_int(p, 1024))
  ------------------
  |  Branch (149:9): [True: 2, False: 2]
  |  Branch (149:22): [True: 0, False: 2]
  ------------------
  150|      0|        return 0;
  151|       |
  152|      4|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
  ------------------
  |  |  443|      4|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  153|      4|    if (p != NULL && !OSSL_PARAM_set_size_t(p, 128))
  ------------------
  |  Branch (153:9): [True: 0, False: 4]
  |  Branch (153:22): [True: 0, False: 0]
  ------------------
  154|      0|        return 0;
  155|      4|    return 1;
  156|      4|}
seed_src.c:seed_get_seed:
  179|      1|{
  180|      1|    size_t bytes_needed;
  181|      1|    unsigned char *p;
  182|       |
  183|       |    /*
  184|       |     * Figure out how many bytes we need.
  185|       |     * This assumes that the seed sources provide eight bits of entropy
  186|       |     * per byte.  For lower quality sources, the formula will need to be
  187|       |     * different.
  188|       |     */
  189|      1|    bytes_needed = entropy >= 0 ? (entropy + 7) / 8 : 0;
  ------------------
  |  Branch (189:20): [True: 1, False: 0]
  ------------------
  190|      1|    if (bytes_needed < min_len)
  ------------------
  |  Branch (190:9): [True: 1, False: 0]
  ------------------
  191|      1|        bytes_needed = min_len;
  192|      1|    if (bytes_needed > max_len) {
  ------------------
  |  Branch (192:9): [True: 0, False: 1]
  ------------------
  193|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  194|      0|        return 0;
  195|      0|    }
  196|       |
  197|      1|    p = OPENSSL_secure_malloc(bytes_needed);
  ------------------
  |  |  115|      1|        CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  198|      1|    if (p == NULL)
  ------------------
  |  Branch (198:9): [True: 0, False: 1]
  ------------------
  199|      0|        return 0;
  200|      1|    if (seed_src_generate(vseed, p, bytes_needed, 0, prediction_resistance,
  ------------------
  |  Branch (200:9): [True: 1, False: 0]
  ------------------
  201|      1|                          adin, adin_len) != 0) {
  202|      1|        *pout = p;
  203|      1|        return bytes_needed;
  204|      1|    }
  205|      0|    OPENSSL_secure_clear_free(p, bytes_needed);
  ------------------
  |  |  121|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  206|      0|    return 0;
  207|      1|}
seed_src.c:seed_clear_seed:
  211|      1|{
  212|      1|    OPENSSL_secure_clear_free(out, outlen);
  ------------------
  |  |  121|      1|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  213|      1|}

ossl_rand_pool_init:
  568|      1|{
  569|      1|    size_t i;
  570|       |
  571|      5|    for (i = 0; i < OSSL_NELEM(random_devices); i++)
  ------------------
  |  |   14|      5|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (571:17): [True: 4, False: 1]
  ------------------
  572|      4|        random_devices[i].fd = -1;
  573|       |
  574|      1|    return 1;
  575|      1|}
ossl_rand_pool_cleanup:
  578|      1|{
  579|      1|    size_t i;
  580|       |
  581|      5|    for (i = 0; i < OSSL_NELEM(random_devices); i++)
  ------------------
  |  |   14|      5|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (581:17): [True: 4, False: 1]
  ------------------
  582|      4|        close_random_device(i);
  583|      1|}
ossl_pool_acquire_entropy:
  628|      1|{
  629|       |#  if defined(OPENSSL_RAND_SEED_NONE)
  630|       |    return ossl_rand_pool_entropy_available(pool);
  631|       |#  else
  632|      1|    size_t entropy_available = 0;
  633|       |
  634|      1|    (void)entropy_available;    /* avoid compiler warning */
  635|       |
  636|      1|#   if defined(OPENSSL_RAND_SEED_GETRANDOM)
  637|      1|    {
  638|      1|        size_t bytes_needed;
  639|      1|        unsigned char *buffer;
  640|      1|        ssize_t bytes;
  641|       |        /* Maximum allowed number of consecutive unsuccessful attempts */
  642|      1|        int attempts = 3;
  643|       |
  644|      1|        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  645|      2|        while (bytes_needed != 0 && attempts-- > 0) {
  ------------------
  |  Branch (645:16): [True: 1, False: 1]
  |  Branch (645:37): [True: 1, False: 0]
  ------------------
  646|      1|            buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  647|      1|            bytes = syscall_random(buffer, bytes_needed);
  648|      1|            if (bytes > 0) {
  ------------------
  |  Branch (648:17): [True: 1, False: 0]
  ------------------
  649|      1|                ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  650|      1|                bytes_needed -= bytes;
  651|      1|                attempts = 3; /* reset counter after successful attempt */
  652|      1|            } else if (bytes < 0 && errno != EINTR) {
  ------------------
  |  Branch (652:24): [True: 0, False: 0]
  |  Branch (652:37): [True: 0, False: 0]
  ------------------
  653|      0|                break;
  654|      0|            }
  655|      1|        }
  656|      1|    }
  657|      1|    entropy_available = ossl_rand_pool_entropy_available(pool);
  658|      1|    if (entropy_available > 0)
  ------------------
  |  Branch (658:9): [True: 1, False: 0]
  ------------------
  659|      1|        return entropy_available;
  660|      0|#   endif
  661|       |
  662|       |#   if defined(OPENSSL_RAND_SEED_LIBRANDOM)
  663|       |    {
  664|       |        /* Not yet implemented. */
  665|       |    }
  666|       |#   endif
  667|       |
  668|      0|#   if defined(OPENSSL_RAND_SEED_DEVRANDOM)
  669|      0|    if (wait_random_seeded()) {
  ------------------
  |  Branch (669:9): [True: 0, False: 0]
  ------------------
  670|      0|        size_t bytes_needed;
  671|      0|        unsigned char *buffer;
  672|      0|        size_t i;
  673|       |
  674|      0|        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  675|      0|        for (i = 0; bytes_needed > 0 && i < OSSL_NELEM(random_device_paths);
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (675:21): [True: 0, False: 0]
  |  Branch (675:41): [True: 0, False: 0]
  ------------------
  676|      0|             i++) {
  677|      0|            ssize_t bytes = 0;
  678|       |            /* Maximum number of consecutive unsuccessful attempts */
  679|      0|            int attempts = 3;
  680|      0|            const int fd = get_random_device(i);
  681|       |
  682|      0|            if (fd == -1)
  ------------------
  |  Branch (682:17): [True: 0, False: 0]
  ------------------
  683|      0|                continue;
  684|       |
  685|      0|            while (bytes_needed != 0 && attempts-- > 0) {
  ------------------
  |  Branch (685:20): [True: 0, False: 0]
  |  Branch (685:41): [True: 0, False: 0]
  ------------------
  686|      0|                buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  687|      0|                bytes = read(fd, buffer, bytes_needed);
  688|       |
  689|      0|                if (bytes > 0) {
  ------------------
  |  Branch (689:21): [True: 0, False: 0]
  ------------------
  690|      0|                    ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  691|      0|                    bytes_needed -= bytes;
  692|      0|                    attempts = 3; /* reset counter on successful attempt */
  693|      0|                } else if (bytes < 0 && errno != EINTR) {
  ------------------
  |  Branch (693:28): [True: 0, False: 0]
  |  Branch (693:41): [True: 0, False: 0]
  ------------------
  694|      0|                    break;
  695|      0|                }
  696|      0|            }
  697|      0|            if (bytes < 0 || !keep_random_devices_open)
  ------------------
  |  Branch (697:17): [True: 0, False: 0]
  |  Branch (697:30): [True: 0, False: 0]
  ------------------
  698|      0|                close_random_device(i);
  699|       |
  700|      0|            bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
  701|      0|        }
  702|      0|        entropy_available = ossl_rand_pool_entropy_available(pool);
  703|      0|        if (entropy_available > 0)
  ------------------
  |  Branch (703:13): [True: 0, False: 0]
  ------------------
  704|      0|            return entropy_available;
  705|      0|    }
  706|      0|#   endif
  707|       |
  708|       |#   if defined(OPENSSL_RAND_SEED_RDTSC)
  709|       |    entropy_available = ossl_prov_acquire_entropy_from_tsc(pool);
  710|       |    if (entropy_available > 0)
  711|       |        return entropy_available;
  712|       |#   endif
  713|       |
  714|       |#   if defined(OPENSSL_RAND_SEED_RDCPU)
  715|       |    entropy_available = ossl_prov_acquire_entropy_from_cpu(pool);
  716|       |    if (entropy_available > 0)
  717|       |        return entropy_available;
  718|       |#   endif
  719|       |
  720|       |#   if defined(OPENSSL_RAND_SEED_EGD)
  721|       |    {
  722|       |        static const char *paths[] = { DEVRANDOM_EGD, NULL };
  723|       |        size_t bytes_needed;
  724|       |        unsigned char *buffer;
  725|       |        int i;
  726|       |
  727|       |        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  728|       |        for (i = 0; bytes_needed > 0 && paths[i] != NULL; i++) {
  729|       |            size_t bytes = 0;
  730|       |            int num;
  731|       |
  732|       |            buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  733|       |            num = RAND_query_egd_bytes(paths[i],
  734|       |                                       buffer, (int)bytes_needed);
  735|       |            if (num == (int)bytes_needed)
  736|       |                bytes = bytes_needed;
  737|       |
  738|       |            ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  739|       |            bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
  740|       |        }
  741|       |        entropy_available = ossl_rand_pool_entropy_available(pool);
  742|       |        if (entropy_available > 0)
  743|       |            return entropy_available;
  744|       |    }
  745|       |#   endif
  746|       |
  747|      0|    return ossl_rand_pool_entropy_available(pool);
  748|      0|#  endif
  749|      0|}
rand_unix.c:close_random_device:
  559|      4|{
  560|      4|    struct random_device *rd = &random_devices[n];
  561|       |
  562|      4|    if (check_random_device(rd))
  ------------------
  |  Branch (562:9): [True: 0, False: 4]
  ------------------
  563|      0|        close(rd->fd);
  564|      4|    rd->fd = -1;
  565|      4|}
rand_unix.c:check_random_device:
  514|      4|{
  515|      4|    struct stat st;
  516|       |
  517|      4|    return rd->fd != -1
  ------------------
  |  Branch (517:12): [True: 0, False: 4]
  ------------------
  518|      4|           && fstat(rd->fd, &st) != -1
  ------------------
  |  Branch (518:15): [True: 0, False: 0]
  ------------------
  519|      4|           && rd->dev == st.st_dev
  ------------------
  |  Branch (519:15): [True: 0, False: 0]
  ------------------
  520|      4|           && rd->ino == st.st_ino
  ------------------
  |  Branch (520:15): [True: 0, False: 0]
  ------------------
  521|      4|           && ((rd->mode ^ st.st_mode) & ~(S_IRWXU | S_IRWXG | S_IRWXO)) == 0
  ------------------
  |  Branch (521:15): [True: 0, False: 0]
  ------------------
  522|      4|           && rd->rdev == st.st_rdev;
  ------------------
  |  Branch (522:15): [True: 0, False: 0]
  ------------------
  523|      4|}
rand_unix.c:syscall_random:
  332|      1|{
  333|       |    /*
  334|       |     * Note: 'buflen' equals the size of the buffer which is used by the
  335|       |     * get_entropy() callback of the RAND_DRBG. It is roughly bounded by
  336|       |     *
  337|       |     *   2 * RAND_POOL_FACTOR * (RAND_DRBG_STRENGTH / 8) = 2^14
  338|       |     *
  339|       |     * which is way below the OSSL_SSIZE_MAX limit. Therefore sign conversion
  340|       |     * between size_t and ssize_t is safe even without a range check.
  341|       |     */
  342|       |
  343|       |    /*
  344|       |     * Do runtime detection to find getentropy().
  345|       |     *
  346|       |     * Known OSs that should support this:
  347|       |     * - Darwin since 16 (OSX 10.12, IOS 10.0).
  348|       |     * - Solaris since 11.3
  349|       |     * - OpenBSD since 5.6
  350|       |     * - Linux since 3.17 with glibc 2.25
  351|       |     * - FreeBSD since 12.0 (1200061)
  352|       |     *
  353|       |     * Note: Sometimes getentropy() can be provided but not implemented
  354|       |     * internally. So we need to check errno for ENOSYS
  355|       |     */
  356|      1|#  if !defined(__DragonFly__) && !defined(__NetBSD__)
  357|      1|#    if defined(__GNUC__) && __GNUC__>=2 && defined(__ELF__) && !defined(__hpux)
  358|      1|    extern int getentropy(void *buffer, size_t length) __attribute__((weak));
  359|       |
  360|      1|    if (getentropy != NULL) {
  ------------------
  |  Branch (360:9): [True: 1, False: 0]
  ------------------
  361|      1|        if (getentropy(buf, buflen) == 0)
  ------------------
  |  Branch (361:13): [True: 1, False: 0]
  ------------------
  362|      1|            return (ssize_t)buflen;
  363|      0|        if (errno != ENOSYS)
  ------------------
  |  Branch (363:13): [True: 0, False: 0]
  ------------------
  364|      0|            return -1;
  365|      0|    }
  366|       |#    elif defined(OPENSSL_APPLE_CRYPTO_RANDOM)
  367|       |
  368|       |    if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
  369|       |	    return (ssize_t)buflen;
  370|       |
  371|       |    return -1;
  372|       |#    else
  373|       |    union {
  374|       |        void *p;
  375|       |        int (*f)(void *buffer, size_t length);
  376|       |    } p_getentropy;
  377|       |
  378|       |    /*
  379|       |     * We could cache the result of the lookup, but we normally don't
  380|       |     * call this function often.
  381|       |     */
  382|       |    ERR_set_mark();
  383|       |    p_getentropy.p = DSO_global_lookup("getentropy");
  384|       |    ERR_pop_to_mark();
  385|       |    if (p_getentropy.p != NULL)
  386|       |        return p_getentropy.f(buf, buflen) == 0 ? (ssize_t)buflen : -1;
  387|       |#    endif
  388|      0|#  endif /* !__DragonFly__ */
  389|       |
  390|       |    /* Linux supports this since version 3.17 */
  391|      0|#  if defined(__linux) && defined(__NR_getrandom)
  392|      0|    return syscall(__NR_getrandom, buf, buflen, 0);
  393|       |#  elif (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(KERN_ARND)
  394|       |    return sysctl_random(buf, buflen);
  395|       |#  elif (defined(__DragonFly__)  && __DragonFly_version >= 500700) \
  396|       |     || (defined(__NetBSD__) && __NetBSD_Version >= 1000000000)
  397|       |    return getrandom(buf, buflen, 0);
  398|       |#  elif defined(__wasi__)
  399|       |    if (getentropy(buf, buflen) == 0)
  400|       |      return (ssize_t)buflen;
  401|       |    return -1;
  402|       |#  else
  403|       |    errno = ENOSYS;
  404|       |    return -1;
  405|       |#  endif
  406|      1|}

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

