ossl_i2c_ASN1_BIT_STRING:
   22|  94.1k|{
   23|  94.1k|    int ret, j, bits, len;
   24|  94.1k|    unsigned char *p, *d;
   25|       |
   26|  94.1k|    if (a == NULL)
  ------------------
  |  Branch (26:9): [True: 0, False: 94.1k]
  ------------------
   27|      0|        return 0;
   28|       |
   29|  94.1k|    len = a->length;
   30|       |
   31|  94.1k|    if (len > 0) {
  ------------------
  |  Branch (31:9): [True: 25.3k, False: 68.8k]
  ------------------
   32|  25.3k|        if (a->flags & ASN1_STRING_FLAG_BITS_LEFT) {
  ------------------
  |  |  161|  25.3k|# define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  |  Branch (32:13): [True: 25.3k, False: 0]
  ------------------
   33|  25.3k|            bits = (int)a->flags & 0x07;
   34|  25.3k|        } 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.3k|    } else
   60|  68.8k|        bits = 0;
   61|       |
   62|  94.1k|    ret = 1 + len;
   63|  94.1k|    if (pp == NULL)
  ------------------
  |  Branch (63:9): [True: 72.9k, False: 21.2k]
  ------------------
   64|  72.9k|        return ret;
   65|       |
   66|  21.2k|    p = *pp;
   67|       |
   68|  21.2k|    *(p++) = (unsigned char)bits;
   69|  21.2k|    d = a->data;
   70|  21.2k|    if (len > 0) {
  ------------------
  |  Branch (70:9): [True: 5.07k, False: 16.1k]
  ------------------
   71|  5.07k|        memcpy(p, d, len);
   72|  5.07k|        p += len;
   73|  5.07k|        p[-1] &= (0xff << bits);
   74|  5.07k|    }
   75|  21.2k|    *pp = p;
   76|  21.2k|    return ret;
   77|  94.1k|}
ossl_c2i_ASN1_BIT_STRING:
   81|   172k|{
   82|   172k|    ASN1_BIT_STRING *ret = NULL;
   83|   172k|    const unsigned char *p;
   84|   172k|    unsigned char *s;
   85|   172k|    int i = 0;
   86|       |
   87|   172k|    if (len < 1) {
  ------------------
  |  Branch (87:9): [True: 50, False: 172k]
  ------------------
   88|     50|        i = ASN1_R_STRING_TOO_SHORT;
  ------------------
  |  |  116|     50|# define ASN1_R_STRING_TOO_SHORT                          152
  ------------------
   89|     50|        goto err;
   90|     50|    }
   91|       |
   92|   172k|    if (len > INT_MAX) {
  ------------------
  |  Branch (92:9): [True: 0, False: 172k]
  ------------------
   93|      0|        i = ASN1_R_STRING_TOO_LONG;
  ------------------
  |  |  115|      0|# define ASN1_R_STRING_TOO_LONG                           151
  ------------------
   94|      0|        goto err;
   95|      0|    }
   96|       |
   97|   172k|    if ((a == NULL) || ((*a) == NULL)) {
  ------------------
  |  Branch (97:9): [True: 0, False: 172k]
  |  Branch (97:24): [True: 38.8k, False: 133k]
  ------------------
   98|  38.8k|        if ((ret = ASN1_BIT_STRING_new()) == NULL)
  ------------------
  |  Branch (98:13): [True: 0, False: 38.8k]
  ------------------
   99|      0|            return NULL;
  100|  38.8k|    } else
  101|   133k|        ret = (*a);
  102|       |
  103|   172k|    p = *pp;
  104|   172k|    i = *(p++);
  105|   172k|    if (i > 7) {
  ------------------
  |  Branch (105:9): [True: 1.16k, False: 171k]
  ------------------
  106|  1.16k|        i = ASN1_R_INVALID_BIT_STRING_BITS_LEFT;
  ------------------
  |  |   72|  1.16k|# define ASN1_R_INVALID_BIT_STRING_BITS_LEFT              220
  ------------------
  107|  1.16k|        goto err;
  108|  1.16k|    }
  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|   171k|    ossl_asn1_string_set_bits_left(ret, i);
  114|       |
  115|   171k|    if (len-- > 1) {            /* using one because of the bits left byte */
  ------------------
  |  Branch (115:9): [True: 117k, False: 53.8k]
  ------------------
  116|   117k|        s = OPENSSL_malloc((int)len);
  ------------------
  |  |  102|   117k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   117k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   117k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  117|   117k|        if (s == NULL) {
  ------------------
  |  Branch (117:13): [True: 0, False: 117k]
  ------------------
  118|      0|            goto err;
  119|      0|        }
  120|   117k|        memcpy(s, p, (int)len);
  121|   117k|        s[len - 1] &= (0xff << i);
  122|   117k|        p += len;
  123|   117k|    } else
  124|  53.8k|        s = NULL;
  125|       |
  126|   171k|    ASN1_STRING_set0(ret, s, (int)len);
  127|   171k|    ret->type = V_ASN1_BIT_STRING;
  ------------------
  |  |   65|   171k|# define V_ASN1_BIT_STRING               3
  ------------------
  128|   171k|    if (a != NULL)
  ------------------
  |  Branch (128:9): [True: 171k, False: 0]
  ------------------
  129|   171k|        (*a) = ret;
  130|   171k|    *pp = p;
  131|   171k|    return ret;
  132|  1.21k| err:
  133|  1.21k|    if (i != 0)
  ------------------
  |  Branch (133:9): [True: 1.21k, False: 0]
  ------------------
  134|  1.21k|        ERR_raise(ERR_LIB_ASN1, i);
  ------------------
  |  |  401|  1.21k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.21k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.21k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  1.21k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  1.21k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  1.21k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.21k|     ERR_set_error)
  |  |  ------------------
  ------------------
  135|  1.21k|    if ((a == NULL) || (*a != ret))
  ------------------
  |  Branch (135:9): [True: 0, False: 1.21k]
  |  Branch (135:24): [True: 638, False: 580]
  ------------------
  136|    638|        ASN1_BIT_STRING_free(ret);
  137|  1.21k|    return NULL;
  138|   171k|}

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

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

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

ASN1_item_i2d_bio:
   86|  1.08k|{
   87|  1.08k|    unsigned char *b = NULL;
   88|  1.08k|    int i, j = 0, n, ret = 1;
   89|       |
   90|  1.08k|    n = ASN1_item_i2d(x, &b, it);
   91|  1.08k|    if (b == NULL) {
  ------------------
  |  Branch (91:9): [True: 0, False: 1.08k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   93|      0|        return 0;
   94|      0|    }
   95|       |
   96|  1.08k|    for (;;) {
   97|  1.08k|        i = BIO_write(out, &(b[j]), n);
   98|  1.08k|        if (i == n)
  ------------------
  |  Branch (98:13): [True: 1.08k, False: 0]
  ------------------
   99|  1.08k|            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|  1.08k|    OPENSSL_free(b);
  ------------------
  |  |  115|  1.08k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.08k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.08k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  108|  1.08k|    return ret;
  109|  1.08k|}

ossl_i2c_ASN1_INTEGER:
  208|  56.4k|{
  209|  56.4k|    return i2c_ibuf(a->data, a->length, a->type & V_ASN1_NEG, pp);
  ------------------
  |  |   97|  56.4k|# define V_ASN1_NEG                      0x100
  ------------------
  210|  56.4k|}
ossl_c2i_ASN1_INTEGER:
  288|   127k|{
  289|   127k|    ASN1_INTEGER *ret = NULL;
  290|   127k|    size_t r;
  291|   127k|    int neg;
  292|       |
  293|   127k|    r = c2i_ibuf(NULL, NULL, *pp, len);
  294|       |
  295|   127k|    if (r == 0)
  ------------------
  |  Branch (295:9): [True: 992, False: 126k]
  ------------------
  296|    992|        return NULL;
  297|       |
  298|   126k|    if ((a == NULL) || ((*a) == NULL)) {
  ------------------
  |  Branch (298:9): [True: 0, False: 126k]
  |  Branch (298:24): [True: 29.0k, False: 97.7k]
  ------------------
  299|  29.0k|        ret = ASN1_INTEGER_new();
  300|  29.0k|        if (ret == NULL)
  ------------------
  |  Branch (300:13): [True: 0, False: 29.0k]
  ------------------
  301|      0|            return NULL;
  302|  29.0k|        ret->type = V_ASN1_INTEGER;
  ------------------
  |  |   64|  29.0k|# define V_ASN1_INTEGER                  2
  ------------------
  303|  29.0k|    } else
  304|  97.7k|        ret = *a;
  305|       |
  306|   126k|    if (ASN1_STRING_set(ret, NULL, r) == 0) {
  ------------------
  |  Branch (306:9): [True: 0, False: 126k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  308|      0|        goto err;
  309|      0|    }
  310|       |
  311|   126k|    c2i_ibuf(ret->data, &neg, *pp, len);
  312|       |
  313|   126k|    if (neg != 0)
  ------------------
  |  Branch (313:9): [True: 10.8k, False: 115k]
  ------------------
  314|  10.8k|        ret->type |= V_ASN1_NEG;
  ------------------
  |  |   97|  10.8k|# define V_ASN1_NEG                      0x100
  ------------------
  315|   115k|    else
  316|   115k|        ret->type &= ~V_ASN1_NEG;
  ------------------
  |  |   97|   115k|# define V_ASN1_NEG                      0x100
  ------------------
  317|       |
  318|   126k|    *pp += len;
  319|   126k|    if (a != NULL)
  ------------------
  |  Branch (319:9): [True: 126k, False: 0]
  ------------------
  320|   126k|        (*a) = ret;
  321|   126k|    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|   126k|}
ASN1_INTEGER_to_BN:
  568|     52|{
  569|     52|    return asn1_string_to_bn(ai, bn, V_ASN1_INTEGER);
  ------------------
  |  |   64|     52|# define V_ASN1_INTEGER                  2
  ------------------
  570|     52|}
ASN1_ENUMERATED_get_int64:
  573|  16.9k|{
  574|  16.9k|    return asn1_string_get_int64(pr, a, V_ASN1_ENUMERATED);
  ------------------
  |  |   72|  16.9k|# define V_ASN1_ENUMERATED               10
  ------------------
  575|  16.9k|}
ASN1_ENUMERATED_get:
  588|  16.9k|{
  589|  16.9k|    int i;
  590|  16.9k|    int64_t r;
  591|  16.9k|    if (a == NULL)
  ------------------
  |  Branch (591:9): [True: 0, False: 16.9k]
  ------------------
  592|      0|        return 0;
  593|  16.9k|    if ((a->type & ~V_ASN1_NEG) != V_ASN1_ENUMERATED)
  ------------------
  |  |   97|  16.9k|# define V_ASN1_NEG                      0x100
  ------------------
                  if ((a->type & ~V_ASN1_NEG) != V_ASN1_ENUMERATED)
  ------------------
  |  |   72|  16.9k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (593:9): [True: 0, False: 16.9k]
  ------------------
  594|      0|        return -1;
  595|  16.9k|    if (a->length > (int)sizeof(long))
  ------------------
  |  Branch (595:9): [True: 10, False: 16.9k]
  ------------------
  596|     10|        return 0xffffffffL;
  597|  16.9k|    i = ASN1_ENUMERATED_get_int64(&r, a);
  598|  16.9k|    if (i == 0)
  ------------------
  |  Branch (598:9): [True: 136, False: 16.7k]
  ------------------
  599|    136|        return -1;
  600|  16.7k|    if (r > LONG_MAX || r < LONG_MIN)
  ------------------
  |  Branch (600:9): [True: 0, False: 16.7k]
  |  Branch (600:25): [True: 0, False: 16.7k]
  ------------------
  601|      0|        return -1;
  602|  16.7k|    return (long)r;
  603|  16.7k|}
ossl_c2i_uint64_int:
  618|  12.7k|{
  619|  12.7k|    unsigned char buf[sizeof(uint64_t)];
  620|  12.7k|    size_t buflen;
  621|       |
  622|  12.7k|    buflen = c2i_ibuf(NULL, NULL, *pp, len);
  623|  12.7k|    if (buflen == 0)
  ------------------
  |  Branch (623:9): [True: 8, False: 12.7k]
  ------------------
  624|      8|        return 0;
  625|  12.7k|    if (buflen > sizeof(uint64_t)) {
  ------------------
  |  Branch (625:9): [True: 23, False: 12.7k]
  ------------------
  626|     23|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|     23|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     23|    (ERR_new(),                                                 \
  |  |  |  |  404|     23|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     23|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     23|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     23|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     23|     ERR_set_error)
  |  |  ------------------
  ------------------
  627|     23|        return 0;
  628|     23|    }
  629|  12.7k|    (void)c2i_ibuf(buf, neg, *pp, len);
  630|  12.7k|    return asn1_get_uint64(ret, buf, buflen);
  631|  12.7k|}
ossl_i2c_uint64_int:
  634|  39.3k|{
  635|  39.3k|    unsigned char buf[sizeof(uint64_t)];
  636|  39.3k|    size_t off;
  637|       |
  638|  39.3k|    off = asn1_put_uint64(buf, r);
  639|  39.3k|    return i2c_ibuf(buf + off, sizeof(buf) - off, neg, &p);
  640|  39.3k|}
a_int.c:i2c_ibuf:
   99|  95.7k|{
  100|  95.7k|    unsigned int pad = 0;
  101|  95.7k|    size_t ret, i;
  102|  95.7k|    unsigned char *p, pb = 0;
  103|       |
  104|  95.7k|    if (b != NULL && blen) {
  ------------------
  |  Branch (104:9): [True: 95.7k, False: 0]
  |  Branch (104:22): [True: 95.7k, False: 0]
  ------------------
  105|  95.7k|        ret = blen;
  106|  95.7k|        i = b[0];
  107|  95.7k|        if (!neg && (i > 127)) {
  ------------------
  |  Branch (107:13): [True: 61.9k, False: 33.7k]
  |  Branch (107:21): [True: 5.65k, False: 56.3k]
  ------------------
  108|  5.65k|            pad = 1;
  109|  5.65k|            pb = 0;
  110|  90.1k|        } else if (neg) {
  ------------------
  |  Branch (110:20): [True: 33.7k, False: 56.3k]
  ------------------
  111|  33.7k|            pb = 0xFF;
  112|  33.7k|            if (i > 128) {
  ------------------
  |  Branch (112:17): [True: 4.98k, False: 28.7k]
  ------------------
  113|  4.98k|                pad = 1;
  114|  28.7k|            } else if (i == 128) {
  ------------------
  |  Branch (114:24): [True: 14.5k, False: 14.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|  1.05M|                for (pad = 0, i = 1; i < blen; i++)
  ------------------
  |  Branch (119:38): [True: 1.04M, False: 14.5k]
  ------------------
  120|  1.04M|                    pad |= b[i];
  121|  14.5k|                pb = pad != 0 ? 0xffU : 0;
  ------------------
  |  Branch (121:22): [True: 168, False: 14.3k]
  ------------------
  122|  14.5k|                pad = pb & 1;
  123|  14.5k|            }
  124|  33.7k|        }
  125|  95.7k|        ret += pad;
  126|  95.7k|    } else {
  127|      0|        ret = 1;
  128|      0|        blen = 0;   /* reduce '(b == NULL || blen == 0)' to '(blen == 0)' */
  129|      0|    }
  130|       |
  131|  95.7k|    if (pp == NULL || (p = *pp) == NULL)
  ------------------
  |  Branch (131:9): [True: 49.6k, False: 46.0k]
  |  Branch (131:23): [True: 34.2k, False: 11.8k]
  ------------------
  132|  83.9k|        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|  11.8k|    *p = pb;
  140|  11.8k|    p += pad;       /* yes, p[0] can be written twice, but it's little
  141|       |                     * price to pay for eliminated branches */
  142|  11.8k|    twos_complement(p, b, blen, pb);
  143|       |
  144|  11.8k|    *pp += ret;
  145|  11.8k|    return ret;
  146|  95.7k|}
a_int.c:twos_complement:
   78|  80.9k|{
   79|  80.9k|    unsigned int carry = pad & 1;
   80|       |
   81|       |    /* Begin at the end of the encoding */
   82|  80.9k|    if (len != 0) {
  ------------------
  |  Branch (82:9): [True: 80.9k, False: 0]
  ------------------
   83|       |        /*
   84|       |         * if len == 0 then src/dst could be NULL, and this would be undefined
   85|       |         * behaviour.
   86|       |         */
   87|  80.9k|        dst += len;
   88|  80.9k|        src += len;
   89|  80.9k|    }
   90|       |    /* two's complement value: ~value + 1 */
   91|  3.51M|    while (len-- != 0) {
  ------------------
  |  Branch (91:12): [True: 3.43M, False: 80.9k]
  ------------------
   92|  3.43M|        *(--dst) = (unsigned char)(carry += *(--src) ^ pad);
   93|  3.43M|        carry >>= 8;
   94|  3.43M|    }
   95|  80.9k|}
a_int.c:c2i_ibuf:
  156|   279k|{
  157|   279k|    int neg, pad;
  158|       |    /* Zero content length is illegal */
  159|   279k|    if (plen == 0) {
  ------------------
  |  Branch (159:9): [True: 374, False: 279k]
  ------------------
  160|    374|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  401|    374|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    374|    (ERR_new(),                                                 \
  |  |  |  |  404|    374|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    374|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    374|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    374|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    374|     ERR_set_error)
  |  |  ------------------
  ------------------
  161|    374|        return 0;
  162|    374|    }
  163|   279k|    neg = p[0] & 0x80;
  164|   279k|    if (pneg)
  ------------------
  |  Branch (164:9): [True: 139k, False: 140k]
  ------------------
  165|   139k|        *pneg = neg;
  166|       |    /* Handle common case where length is 1 octet separately */
  167|   279k|    if (plen == 1) {
  ------------------
  |  Branch (167:9): [True: 140k, False: 138k]
  ------------------
  168|   140k|        if (b != NULL) {
  ------------------
  |  Branch (168:13): [True: 70.2k, False: 70.2k]
  ------------------
  169|  70.2k|            if (neg)
  ------------------
  |  Branch (169:17): [True: 9.74k, False: 60.5k]
  ------------------
  170|  9.74k|                b[0] = (p[0] ^ 0xFF) + 1;
  171|  60.5k|            else
  172|  60.5k|                b[0] = p[0];
  173|  70.2k|        }
  174|   140k|        return 1;
  175|   140k|    }
  176|       |
  177|   138k|    pad = 0;
  178|   138k|    if (p[0] == 0) {
  ------------------
  |  Branch (178:9): [True: 35.7k, False: 103k]
  ------------------
  179|  35.7k|        pad = 1;
  180|   103k|    } else if (p[0] == 0xFF) {
  ------------------
  |  Branch (180:16): [True: 7.22k, False: 95.9k]
  ------------------
  181|  7.22k|        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|  2.62M|        for (pad = 0, i = 1; i < plen; i++)
  ------------------
  |  Branch (187:30): [True: 2.62M, False: 7.22k]
  ------------------
  188|  2.62M|            pad |= p[i];
  189|  7.22k|        pad = pad != 0 ? 1 : 0;
  ------------------
  |  Branch (189:15): [True: 7.12k, False: 103]
  ------------------
  190|  7.22k|    }
  191|       |    /* reject illegal padding: first two octets MSB can't match */
  192|   138k|    if (pad && (neg == (p[1] & 0x80))) {
  ------------------
  |  Branch (192:9): [True: 42.9k, False: 96.0k]
  |  Branch (192:16): [True: 626, False: 42.2k]
  ------------------
  193|    626|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING);
  ------------------
  |  |  401|    626|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    626|    (ERR_new(),                                                 \
  |  |  |  |  404|    626|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    626|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    626|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    626|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    626|     ERR_set_error)
  |  |  ------------------
  ------------------
  194|    626|        return 0;
  195|    626|    }
  196|       |
  197|       |    /* skip over pad */
  198|   138k|    p += pad;
  199|   138k|    plen -= pad;
  200|       |
  201|   138k|    if (b != NULL)
  ------------------
  |  Branch (201:9): [True: 69.1k, False: 69.1k]
  ------------------
  202|  69.1k|        twos_complement(b, p, plen, neg ? 0xffU : 0);
  ------------------
  |  Branch (202:37): [True: 4.58k, False: 64.5k]
  ------------------
  203|       |
  204|   138k|    return plen;
  205|   138k|}
a_int.c:asn1_string_get_int64:
  329|  16.9k|{
  330|  16.9k|    if (a == NULL) {
  ------------------
  |  Branch (330:9): [True: 0, False: 16.9k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  332|      0|        return 0;
  333|      0|    }
  334|  16.9k|    if ((a->type & ~V_ASN1_NEG) != itype) {
  ------------------
  |  |   97|  16.9k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (334:9): [True: 0, False: 16.9k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  336|      0|        return 0;
  337|      0|    }
  338|  16.9k|    return asn1_get_int64(pr, a->data, a->length, a->type & V_ASN1_NEG);
  ------------------
  |  |   97|  16.9k|# define V_ASN1_NEG                      0x100
  ------------------
  339|  16.9k|}
a_int.c:asn1_get_int64:
  257|  16.9k|{
  258|  16.9k|    uint64_t r;
  259|  16.9k|    if (asn1_get_uint64(&r, b, blen) == 0)
  ------------------
  |  Branch (259:9): [True: 0, False: 16.9k]
  ------------------
  260|      0|        return 0;
  261|  16.9k|    if (neg) {
  ------------------
  |  Branch (261:9): [True: 2.39k, False: 14.5k]
  ------------------
  262|  2.39k|        if (r <= INT64_MAX) {
  ------------------
  |  Branch (262:13): [True: 2.30k, False: 91]
  ------------------
  263|       |            /* Most significant bit is guaranteed to be clear, negation
  264|       |             * is guaranteed to be meaningful in platform-neutral sense. */
  265|  2.30k|            *pr = -(int64_t)r;
  266|  2.30k|        } else if (r == ABS_INT64_MIN) {
  ------------------
  |  |  252|     91|#define ABS_INT64_MIN ((uint64_t)INT64_MAX + (-(INT64_MIN + INT64_MAX)))
  ------------------
  |  Branch (266:20): [True: 0, False: 91]
  ------------------
  267|       |            /* This never happens if INT64_MAX == ABS_INT64_MIN, e.g.
  268|       |             * on ones'-complement system. */
  269|      0|            *pr = (int64_t)(0 - r);
  270|     91|        } else {
  271|     91|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|     91|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     91|    (ERR_new(),                                                 \
  |  |  |  |  404|     91|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     91|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     91|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     91|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     91|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|     91|            return 0;
  273|     91|        }
  274|  14.5k|    } else {
  275|  14.5k|        if (r <= INT64_MAX) {
  ------------------
  |  Branch (275:13): [True: 14.4k, False: 45]
  ------------------
  276|  14.4k|            *pr = (int64_t)r;
  277|  14.4k|        } else {
  278|     45|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|     45|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     45|    (ERR_new(),                                                 \
  |  |  |  |  404|     45|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     45|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     45|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     45|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     45|     ERR_set_error)
  |  |  ------------------
  ------------------
  279|     45|            return 0;
  280|     45|        }
  281|  14.5k|    }
  282|  16.7k|    return 1;
  283|  16.9k|}
a_int.c:asn1_string_to_bn:
  505|     52|{
  506|     52|    BIGNUM *ret;
  507|       |
  508|     52|    if ((ai->type & ~V_ASN1_NEG) != itype) {
  ------------------
  |  |   97|     52|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (508:9): [True: 0, False: 52]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  510|      0|        return NULL;
  511|      0|    }
  512|       |
  513|     52|    ret = BN_bin2bn(ai->data, ai->length, bn);
  514|     52|    if (ret == NULL) {
  ------------------
  |  Branch (514:9): [True: 0, False: 52]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  516|      0|        return NULL;
  517|      0|    }
  518|     52|    if (ai->type & V_ASN1_NEG)
  ------------------
  |  |   97|     52|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (518:9): [True: 9, False: 43]
  ------------------
  519|      9|        BN_set_negative(ret, 1);
  520|     52|    return ret;
  521|     52|}
a_int.c:asn1_get_uint64:
  214|  29.6k|{
  215|  29.6k|    size_t i;
  216|  29.6k|    uint64_t r;
  217|       |
  218|  29.6k|    if (blen > sizeof(*pr)) {
  ------------------
  |  Branch (218:9): [True: 0, False: 29.6k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|      0|        return 0;
  221|      0|    }
  222|  29.6k|    if (b == NULL)
  ------------------
  |  Branch (222:9): [True: 0, False: 29.6k]
  ------------------
  223|      0|        return 0;
  224|  62.7k|    for (r = 0, i = 0; i < blen; i++) {
  ------------------
  |  Branch (224:24): [True: 33.1k, False: 29.6k]
  ------------------
  225|  33.1k|        r <<= 8;
  226|  33.1k|        r |= b[i];
  227|  33.1k|    }
  228|  29.6k|    *pr = r;
  229|  29.6k|    return 1;
  230|  29.6k|}
a_int.c:asn1_put_uint64:
  238|  39.3k|{
  239|  39.3k|    size_t off = sizeof(uint64_t);
  240|       |
  241|  43.0k|    do {
  242|  43.0k|        b[--off] = (unsigned char)r;
  243|  43.0k|    } while (r >>= 8);
  ------------------
  |  Branch (243:14): [True: 3.68k, False: 39.3k]
  ------------------
  244|       |
  245|  39.3k|    return off;
  246|  39.3k|}

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

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

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

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

UTF8_getc:
   29|  29.0k|{
   30|  29.0k|    const unsigned char *p;
   31|  29.0k|    unsigned long value;
   32|  29.0k|    int ret;
   33|  29.0k|    if (len <= 0)
  ------------------
  |  Branch (33:9): [True: 0, False: 29.0k]
  ------------------
   34|      0|        return 0;
   35|  29.0k|    p = str;
   36|       |
   37|       |    /* Check syntax and work out the encoded value (if correct) */
   38|  29.0k|    if ((*p & 0x80) == 0) {
  ------------------
  |  Branch (38:9): [True: 26.9k, False: 2.04k]
  ------------------
   39|  26.9k|        value = *p++ & 0x7f;
   40|  26.9k|        ret = 1;
   41|  26.9k|    } else if ((*p & 0xe0) == 0xc0) {
  ------------------
  |  Branch (41:16): [True: 417, False: 1.62k]
  ------------------
   42|    417|        if (len < 2)
  ------------------
  |  Branch (42:13): [True: 6, False: 411]
  ------------------
   43|      6|            return -1;
   44|    411|        if ((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (44:13): [True: 25, False: 386]
  ------------------
   45|     25|            return -3;
   46|    386|        value = (*p++ & 0x1f) << 6;
   47|    386|        value |= *p++ & 0x3f;
   48|    386|        if (value < 0x80)
  ------------------
  |  Branch (48:13): [True: 16, False: 370]
  ------------------
   49|     16|            return -4;
   50|    370|        ret = 2;
   51|  1.62k|    } else if ((*p & 0xf0) == 0xe0) {
  ------------------
  |  Branch (51:16): [True: 905, False: 719]
  ------------------
   52|    905|        if (len < 3)
  ------------------
  |  Branch (52:13): [True: 13, False: 892]
  ------------------
   53|     13|            return -1;
   54|    892|        if (((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (54:13): [True: 29, False: 863]
  ------------------
   55|    892|            || ((p[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (55:16): [True: 27, False: 836]
  ------------------
   56|     56|            return -3;
   57|    836|        value = (*p++ & 0xf) << 12;
   58|    836|        value |= (*p++ & 0x3f) << 6;
   59|    836|        value |= *p++ & 0x3f;
   60|    836|        if (value < 0x800)
  ------------------
  |  Branch (60:13): [True: 12, False: 824]
  ------------------
   61|     12|            return -4;
   62|    824|        if (is_unicode_surrogate(value))
  ------------------
  |  Branch (62:13): [True: 10, False: 814]
  ------------------
   63|     10|            return -2;
   64|    814|        ret = 3;
   65|    814|    } else if ((*p & 0xf8) == 0xf0) {
  ------------------
  |  Branch (65:16): [True: 676, False: 43]
  ------------------
   66|    676|        if (len < 4)
  ------------------
  |  Branch (66:13): [True: 13, False: 663]
  ------------------
   67|     13|            return -1;
   68|    663|        if (((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (68:13): [True: 16, False: 647]
  ------------------
   69|    663|            || ((p[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (69:16): [True: 4, False: 643]
  ------------------
   70|    663|            || ((p[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (70:16): [True: 3, False: 640]
  ------------------
   71|     23|            return -3;
   72|    640|        value = ((unsigned long)(*p++ & 0x7)) << 18;
   73|    640|        value |= (*p++ & 0x3f) << 12;
   74|    640|        value |= (*p++ & 0x3f) << 6;
   75|    640|        value |= *p++ & 0x3f;
   76|    640|        if (value < 0x10000)
  ------------------
  |  Branch (76:13): [True: 16, False: 624]
  ------------------
   77|     16|            return -4;
   78|    624|        ret = 4;
   79|    624|    } else
   80|     43|        return -2;
   81|  28.7k|    *val = value;
   82|  28.7k|    return ret;
   83|  29.0k|}
UTF8_putc:
   94|  18.5M|{
   95|  18.5M|    if (!str)
  ------------------
  |  Branch (95:9): [True: 9.29M, False: 9.29M]
  ------------------
   96|  9.29M|        len = 4;                /* Maximum we will need */
   97|  9.29M|    else if (len <= 0)
  ------------------
  |  Branch (97:14): [True: 0, False: 9.29M]
  ------------------
   98|      0|        return -1;
   99|  18.5M|    if (value < 0x80) {
  ------------------
  |  Branch (99:9): [True: 1.74M, False: 16.8M]
  ------------------
  100|  1.74M|        if (str)
  ------------------
  |  Branch (100:13): [True: 870k, False: 870k]
  ------------------
  101|   870k|            *str = (unsigned char)value;
  102|  1.74M|        return 1;
  103|  1.74M|    }
  104|  16.8M|    if (value < 0x800) {
  ------------------
  |  Branch (104:9): [True: 16.8M, False: 3.08k]
  ------------------
  105|  16.8M|        if (len < 2)
  ------------------
  |  Branch (105:13): [True: 0, False: 16.8M]
  ------------------
  106|      0|            return -1;
  107|  16.8M|        if (str) {
  ------------------
  |  Branch (107:13): [True: 8.41M, False: 8.41M]
  ------------------
  108|  8.41M|            *str++ = (unsigned char)(((value >> 6) & 0x1f) | 0xc0);
  109|  8.41M|            *str = (unsigned char)((value & 0x3f) | 0x80);
  110|  8.41M|        }
  111|  16.8M|        return 2;
  112|  16.8M|    }
  113|  3.08k|    if (value < 0x10000) {
  ------------------
  |  Branch (113:9): [True: 2.42k, False: 656]
  ------------------
  114|  2.42k|        if (is_unicode_surrogate(value))
  ------------------
  |  Branch (114:13): [True: 0, False: 2.42k]
  ------------------
  115|      0|            return -2;
  116|  2.42k|        if (len < 3)
  ------------------
  |  Branch (116:13): [True: 0, False: 2.42k]
  ------------------
  117|      0|            return -1;
  118|  2.42k|        if (str) {
  ------------------
  |  Branch (118:13): [True: 1.21k, False: 1.21k]
  ------------------
  119|  1.21k|            *str++ = (unsigned char)(((value >> 12) & 0xf) | 0xe0);
  120|  1.21k|            *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
  121|  1.21k|            *str = (unsigned char)((value & 0x3f) | 0x80);
  122|  1.21k|        }
  123|  2.42k|        return 3;
  124|  2.42k|    }
  125|    656|    if (value < UNICODE_LIMIT) {
  ------------------
  |  Branch (125:9): [True: 656, False: 0]
  ------------------
  126|    656|        if (len < 4)
  ------------------
  |  Branch (126:13): [True: 0, False: 656]
  ------------------
  127|      0|            return -1;
  128|    656|        if (str) {
  ------------------
  |  Branch (128:13): [True: 328, False: 328]
  ------------------
  129|    328|            *str++ = (unsigned char)(((value >> 18) & 0x7) | 0xf0);
  130|    328|            *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80);
  131|    328|            *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
  132|    328|            *str = (unsigned char)((value & 0x3f) | 0x80);
  133|    328|        }
  134|    656|        return 4;
  135|    656|    }
  136|      0|    return -2;
  137|    656|}

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

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

ASN1_get_object:
   48|  17.0M|{
   49|  17.0M|    int i, ret;
   50|  17.0M|    long len;
   51|  17.0M|    const unsigned char *p = *pp;
   52|  17.0M|    int tag, xclass, inf;
   53|  17.0M|    long max = omax;
   54|       |
   55|  17.0M|    if (omax <= 0) {
  ------------------
  |  Branch (55:9): [True: 0, False: 17.0M]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   57|      0|        return 0x80;
   58|      0|    }
   59|  17.0M|    ret = (*p & V_ASN1_CONSTRUCTED);
  ------------------
  |  |   52|  17.0M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
   60|  17.0M|    xclass = (*p & V_ASN1_PRIVATE);
  ------------------
  |  |   50|  17.0M|# define V_ASN1_PRIVATE                  0xc0
  ------------------
   61|  17.0M|    i = *p & V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   53|  17.0M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
   62|  17.0M|    if (i == V_ASN1_PRIMITIVE_TAG) { /* high-tag */
  ------------------
  |  |   53|  17.0M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  |  Branch (62:9): [True: 25.6k, False: 16.9M]
  ------------------
   63|  25.6k|        p++;
   64|  25.6k|        if (--max == 0)
  ------------------
  |  Branch (64:13): [True: 50, False: 25.5k]
  ------------------
   65|     50|            goto err;
   66|  25.5k|        len = 0;
   67|  32.8k|        while (*p & 0x80) {
  ------------------
  |  Branch (67:16): [True: 7.38k, False: 25.5k]
  ------------------
   68|  7.38k|            len <<= 7L;
   69|  7.38k|            len |= *(p++) & 0x7f;
   70|  7.38k|            if (--max == 0)
  ------------------
  |  Branch (70:17): [True: 34, False: 7.35k]
  ------------------
   71|     34|                goto err;
   72|  7.35k|            if (len > (INT_MAX >> 7L))
  ------------------
  |  Branch (72:17): [True: 52, False: 7.30k]
  ------------------
   73|     52|                goto err;
   74|  7.35k|        }
   75|  25.5k|        len <<= 7L;
   76|  25.5k|        len |= *(p++) & 0x7f;
   77|  25.5k|        tag = (int)len;
   78|  25.5k|        if (--max == 0)
  ------------------
  |  Branch (78:13): [True: 22, False: 25.4k]
  ------------------
   79|     22|            goto err;
   80|  16.9M|    } else {
   81|  16.9M|        tag = i;
   82|  16.9M|        p++;
   83|  16.9M|        if (--max == 0)
  ------------------
  |  Branch (83:13): [True: 2.42k, False: 16.9M]
  ------------------
   84|  2.42k|            goto err;
   85|  16.9M|    }
   86|  16.9M|    *ptag = tag;
   87|  16.9M|    *pclass = xclass;
   88|  16.9M|    if (!asn1_get_length(&p, &inf, plength, max))
  ------------------
  |  Branch (88:9): [True: 2.42k, False: 16.9M]
  ------------------
   89|  2.42k|        goto err;
   90|       |
   91|  16.9M|    if (inf && !(ret & V_ASN1_CONSTRUCTED))
  ------------------
  |  |   52|  1.99M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (91:9): [True: 1.99M, False: 15.0M]
  |  Branch (91:16): [True: 830, False: 1.98M]
  ------------------
   92|    830|        goto err;
   93|       |
   94|  16.9M|    if (*plength > (omax - (p - *pp))) {
  ------------------
  |  Branch (94:9): [True: 530k, False: 16.4M]
  ------------------
   95|   530k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|   530k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|   530k|    (ERR_new(),                                                 \
  |  |  |  |  404|   530k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|   530k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|   530k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|   530k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|   530k|     ERR_set_error)
  |  |  ------------------
  ------------------
   96|       |        /*
   97|       |         * Set this so that even if things are not long enough the values are
   98|       |         * set correctly
   99|       |         */
  100|   530k|        ret |= 0x80;
  101|   530k|    }
  102|  16.9M|    *pp = p;
  103|  16.9M|    return ret | inf;
  104|  5.83k| err:
  105|  5.83k|    ERR_raise(ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG);
  ------------------
  |  |  401|  5.83k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  5.83k|    (ERR_new(),                                                 \
  |  |  |  |  404|  5.83k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  5.83k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  5.83k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  5.83k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  5.83k|     ERR_set_error)
  |  |  ------------------
  ------------------
  106|  5.83k|    return 0x80;
  107|  16.9M|}
ASN1_put_object:
  162|  2.63M|{
  163|  2.63M|    unsigned char *p = *pp;
  164|  2.63M|    int i, ttag;
  165|       |
  166|  2.63M|    i = (constructed) ? V_ASN1_CONSTRUCTED : 0;
  ------------------
  |  |   52|  1.13M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (166:9): [True: 1.13M, False: 1.50M]
  ------------------
  167|  2.63M|    i |= (xclass & V_ASN1_PRIVATE);
  ------------------
  |  |   50|  2.63M|# define V_ASN1_PRIVATE                  0xc0
  ------------------
  168|  2.63M|    if (tag < 31) {
  ------------------
  |  Branch (168:9): [True: 2.63M, False: 619]
  ------------------
  169|  2.63M|        *(p++) = i | (tag & V_ASN1_PRIMITIVE_TAG);
  ------------------
  |  |   53|  2.63M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  170|  2.63M|    } else {
  171|    619|        *(p++) = i | V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   53|    619|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  172|  2.00k|        for (i = 0, ttag = tag; ttag > 0; i++)
  ------------------
  |  Branch (172:33): [True: 1.38k, False: 619]
  ------------------
  173|  1.38k|            ttag >>= 7;
  174|    619|        ttag = i;
  175|  2.00k|        while (i-- > 0) {
  ------------------
  |  Branch (175:16): [True: 1.38k, False: 619]
  ------------------
  176|  1.38k|            p[i] = tag & 0x7f;
  177|  1.38k|            if (i != (ttag - 1))
  ------------------
  |  Branch (177:17): [True: 765, False: 619]
  ------------------
  178|    765|                p[i] |= 0x80;
  179|  1.38k|            tag >>= 7;
  180|  1.38k|        }
  181|    619|        p += ttag;
  182|    619|    }
  183|  2.63M|    if (constructed == 2)
  ------------------
  |  Branch (183:9): [True: 0, False: 2.63M]
  ------------------
  184|      0|        *(p++) = 0x80;
  185|  2.63M|    else
  186|  2.63M|        asn1_put_length(&p, length);
  187|  2.63M|    *pp = p;
  188|  2.63M|}
ASN1_object_size:
  223|  9.81M|{
  224|  9.81M|    int ret = 1;
  225|       |
  226|  9.81M|    if (length < 0)
  ------------------
  |  Branch (226:9): [True: 0, False: 9.81M]
  ------------------
  227|      0|        return -1;
  228|  9.81M|    if (tag >= 31) {
  ------------------
  |  Branch (228:9): [True: 4.58k, False: 9.80M]
  ------------------
  229|  14.6k|        while (tag > 0) {
  ------------------
  |  Branch (229:16): [True: 10.0k, False: 4.58k]
  ------------------
  230|  10.0k|            tag >>= 7;
  231|  10.0k|            ret++;
  232|  10.0k|        }
  233|  4.58k|    }
  234|  9.81M|    if (constructed == 2) {
  ------------------
  |  Branch (234:9): [True: 0, False: 9.81M]
  ------------------
  235|      0|        ret += 3;
  236|  9.81M|    } else {
  237|  9.81M|        ret++;
  238|  9.81M|        if (length > 127) {
  ------------------
  |  Branch (238:13): [True: 39.7k, False: 9.77M]
  ------------------
  239|  39.7k|            int tmplen = length;
  240|   107k|            while (tmplen > 0) {
  ------------------
  |  Branch (240:20): [True: 67.8k, False: 39.7k]
  ------------------
  241|  67.8k|                tmplen >>= 8;
  242|  67.8k|                ret++;
  243|  67.8k|            }
  244|  39.7k|        }
  245|  9.81M|    }
  246|  9.81M|    if (ret >= INT_MAX - length)
  ------------------
  |  Branch (246:9): [True: 0, False: 9.81M]
  ------------------
  247|      0|        return -1;
  248|  9.81M|    return ret + length;
  249|  9.81M|}
ossl_asn1_string_set_bits_left:
  252|   171k|{
  253|   171k|    str->flags &= ~0x07;
  254|   171k|    str->flags |= ASN1_STRING_FLAG_BITS_LEFT | (num & 0x07);
  ------------------
  |  |  161|   171k|# define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  255|   171k|}
ASN1_STRING_copy:
  258|   372k|{
  259|   372k|    if (str == NULL)
  ------------------
  |  Branch (259:9): [True: 0, False: 372k]
  ------------------
  260|      0|        return 0;
  261|   372k|    dst->type = str->type;
  262|   372k|    if (!ASN1_STRING_set(dst, str->data, str->length))
  ------------------
  |  Branch (262:9): [True: 0, False: 372k]
  ------------------
  263|      0|        return 0;
  264|       |    /* Copy flags but preserve embed value */
  265|   372k|    dst->flags &= ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|   372k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  266|   372k|    dst->flags |= str->flags & ~ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|   372k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  267|   372k|    return 1;
  268|   372k|}
ASN1_STRING_set:
  287|  1.36M|{
  288|  1.36M|    unsigned char *c;
  289|  1.36M|    const char *data = _data;
  290|  1.36M|    size_t len;
  291|       |
  292|  1.36M|    if (len_in < 0) {
  ------------------
  |  Branch (292:9): [True: 0, False: 1.36M]
  ------------------
  293|      0|        if (data == NULL)
  ------------------
  |  Branch (293:13): [True: 0, False: 0]
  ------------------
  294|      0|            return 0;
  295|      0|        len = strlen(data);
  296|  1.36M|    } else {
  297|  1.36M|        len = (size_t)len_in;
  298|  1.36M|    }
  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.36M|    if (len > INT_MAX - 1) {
  ------------------
  |  Branch (304:9): [True: 0, False: 1.36M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  306|      0|        return 0;
  307|      0|    }
  308|  1.36M|    if ((size_t)str->length <= len || str->data == NULL) {
  ------------------
  |  Branch (308:9): [True: 1.36M, False: 0]
  |  Branch (308:39): [True: 0, False: 0]
  ------------------
  309|  1.36M|        c = str->data;
  310|  1.36M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  311|       |        /* No NUL terminator in fuzzing builds */
  312|  1.36M|        str->data = OPENSSL_realloc(c, len != 0 ? len : 1);
  ------------------
  |  |  109|  2.72M|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.36M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.36M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (109:30): [True: 734k, False: 629k]
  |  |  ------------------
  ------------------
  313|       |#else
  314|       |        str->data = OPENSSL_realloc(c, len + 1);
  315|       |#endif
  316|  1.36M|        if (str->data == NULL) {
  ------------------
  |  Branch (316:13): [True: 0, False: 1.36M]
  ------------------
  317|      0|            str->data = c;
  318|      0|            return 0;
  319|      0|        }
  320|  1.36M|    }
  321|  1.36M|    str->length = len;
  322|  1.36M|    if (data != NULL) {
  ------------------
  |  Branch (322:9): [True: 1.23M, False: 126k]
  ------------------
  323|  1.23M|        memcpy(str->data, data, len);
  324|  1.23M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  325|       |        /* Set the unused byte to something non NUL and printable. */
  326|  1.23M|        if (len == 0)
  ------------------
  |  Branch (326:13): [True: 629k, False: 607k]
  ------------------
  327|   629k|            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.23M|    }
  336|  1.36M|    return 1;
  337|  1.36M|}
ASN1_STRING_set0:
  340|   479k|{
  341|   479k|    OPENSSL_free(str->data);
  ------------------
  |  |  115|   479k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   479k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   479k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  342|   479k|    str->data = data;
  343|   479k|    str->length = len;
  344|   479k|}
ASN1_STRING_type_new:
  352|  1.61M|{
  353|  1.61M|    ASN1_STRING *ret;
  354|       |
  355|  1.61M|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  1.61M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.61M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.61M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  356|  1.61M|    if (ret == NULL)
  ------------------
  |  Branch (356:9): [True: 0, False: 1.61M]
  ------------------
  357|      0|        return NULL;
  358|  1.61M|    ret->type = type;
  359|  1.61M|    return ret;
  360|  1.61M|}
ossl_asn1_string_embed_free:
  363|  1.85M|{
  364|  1.85M|    if (a == NULL)
  ------------------
  |  Branch (364:9): [True: 0, False: 1.85M]
  ------------------
  365|      0|        return;
  366|  1.85M|    if (!(a->flags & ASN1_STRING_FLAG_NDEF))
  ------------------
  |  |  167|  1.85M|# define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (366:9): [True: 1.85M, False: 0]
  ------------------
  367|  1.85M|        OPENSSL_free(a->data);
  ------------------
  |  |  115|  1.85M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.85M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.85M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  368|  1.85M|    if (embed == 0)
  ------------------
  |  Branch (368:9): [True: 1.61M, False: 240k]
  ------------------
  369|  1.61M|        OPENSSL_free(a);
  ------------------
  |  |  115|  1.61M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.61M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.61M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  370|  1.85M|}
ASN1_STRING_free:
  373|   336k|{
  374|   336k|    if (a == NULL)
  ------------------
  |  Branch (374:9): [True: 241k, False: 95.6k]
  ------------------
  375|   241k|        return;
  376|  95.6k|    ossl_asn1_string_embed_free(a, a->flags & ASN1_STRING_FLAG_EMBED);
  ------------------
  |  |  182|  95.6k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  377|  95.6k|}
ASN1_STRING_length:
  406|  45.0k|{
  407|  45.0k|    return x->length;
  408|  45.0k|}
ASN1_STRING_get0_data:
  423|  45.0k|{
  424|  45.0k|    return x->data;
  425|  45.0k|}
asn1_lib.c:asn1_get_length:
  118|  16.9M|{
  119|  16.9M|    const unsigned char *p = *pp;
  120|  16.9M|    unsigned long ret = 0;
  121|  16.9M|    int i;
  122|       |
  123|  16.9M|    if (max-- < 1)
  ------------------
  |  Branch (123:9): [True: 0, False: 16.9M]
  ------------------
  124|      0|        return 0;
  125|  16.9M|    if (*p == 0x80) {
  ------------------
  |  Branch (125:9): [True: 1.99M, False: 15.0M]
  ------------------
  126|  1.99M|        *inf = 1;
  127|  1.99M|        p++;
  128|  15.0M|    } else {
  129|  15.0M|        *inf = 0;
  130|  15.0M|        i = *p & 0x7f;
  131|  15.0M|        if (*p++ & 0x80) {
  ------------------
  |  Branch (131:13): [True: 73.2k, False: 14.9M]
  ------------------
  132|  73.2k|            if (max < i + 1)
  ------------------
  |  Branch (132:17): [True: 2.03k, False: 71.2k]
  ------------------
  133|  2.03k|                return 0;
  134|       |            /* Skip leading zeroes */
  135|  98.0k|            while (i > 0 && *p == 0) {
  ------------------
  |  Branch (135:20): [True: 74.2k, False: 23.7k]
  |  Branch (135:29): [True: 26.8k, False: 47.4k]
  ------------------
  136|  26.8k|                p++;
  137|  26.8k|                i--;
  138|  26.8k|            }
  139|  71.2k|            if (i > (int)sizeof(long))
  ------------------
  |  Branch (139:17): [True: 217, False: 70.9k]
  ------------------
  140|    217|                return 0;
  141|   141k|            while (i > 0) {
  ------------------
  |  Branch (141:20): [True: 70.2k, False: 70.9k]
  ------------------
  142|  70.2k|                ret <<= 8;
  143|  70.2k|                ret |= *p++;
  144|  70.2k|                i--;
  145|  70.2k|            }
  146|  70.9k|            if (ret > LONG_MAX)
  ------------------
  |  Branch (146:17): [True: 171, False: 70.8k]
  ------------------
  147|    171|                return 0;
  148|  14.9M|        } else {
  149|  14.9M|            ret = i;
  150|  14.9M|        }
  151|  15.0M|    }
  152|  16.9M|    *pp = p;
  153|  16.9M|    *rl = (long)ret;
  154|  16.9M|    return 1;
  155|  16.9M|}
asn1_lib.c:asn1_put_length:
  201|  2.63M|{
  202|  2.63M|    unsigned char *p = *pp;
  203|  2.63M|    int i, len;
  204|       |
  205|  2.63M|    if (length <= 127) {
  ------------------
  |  Branch (205:9): [True: 2.62M, False: 14.8k]
  ------------------
  206|  2.62M|        *(p++) = (unsigned char)length;
  207|  2.62M|    } else {
  208|  14.8k|        len = length;
  209|  39.6k|        for (i = 0; len > 0; i++)
  ------------------
  |  Branch (209:21): [True: 24.8k, False: 14.8k]
  ------------------
  210|  24.8k|            len >>= 8;
  211|  14.8k|        *(p++) = i | 0x80;
  212|  14.8k|        len = i;
  213|  39.6k|        while (i-- > 0) {
  ------------------
  |  Branch (213:16): [True: 24.8k, False: 14.8k]
  ------------------
  214|  24.8k|            p[i] = length & 0xff;
  215|  24.8k|            length >>= 8;
  216|  24.8k|        }
  217|  14.8k|        p += len;
  218|  14.8k|    }
  219|  2.63M|    *pp = p;
  220|  2.63M|}

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

ASN1_tag2bit:
   88|  1.10M|{
   89|  1.10M|    if ((tag < 0) || (tag > 30))
  ------------------
  |  Branch (89:9): [True: 0, False: 1.10M]
  |  Branch (89:22): [True: 33, False: 1.10M]
  ------------------
   90|     33|        return 0;
   91|  1.10M|    return tag2bit[tag];
   92|  1.10M|}
ASN1_item_ex_d2i:
  128|   181k|{
  129|   181k|    return asn1_item_ex_d2i_intern(pval, in, len, it, tag, aclass, opt, ctx,
  130|   181k|                                   NULL, NULL);
  131|   181k|}
ASN1_item_d2i_ex:
  137|   128k|{
  138|   128k|    ASN1_TLC c;
  139|   128k|    ASN1_VALUE *ptmpval = NULL;
  140|       |
  141|   128k|    if (pval == NULL)
  ------------------
  |  Branch (141:9): [True: 55.0k, False: 73.0k]
  ------------------
  142|  55.0k|        pval = &ptmpval;
  143|   128k|    asn1_tlc_clear_nc(&c);
  ------------------
  |  |   98|   128k|#define asn1_tlc_clear_nc(c)    do {(c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (98:62): [Folded - Ignored]
  |  |  ------------------
  ------------------
  144|   128k|    if (asn1_item_ex_d2i_intern(pval, in, len, it, -1, 0, 0, &c, libctx,
  ------------------
  |  Branch (144:9): [True: 99.0k, False: 29.0k]
  ------------------
  145|   128k|                                propq) > 0)
  146|  99.0k|        return *pval;
  147|  29.0k|    return NULL;
  148|   128k|}
ASN1_item_d2i:
  153|  82.7k|{
  154|  82.7k|    return ASN1_item_d2i_ex(pval, in, len, it, NULL, NULL);
  155|  82.7k|}
tasn_dec.c:asn1_item_ex_d2i_intern:
  111|   309k|{
  112|   309k|    int rv;
  113|       |
  114|   309k|    if (pval == NULL || it == NULL) {
  ------------------
  |  Branch (114:9): [True: 0, False: 309k]
  |  Branch (114:25): [True: 0, False: 309k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  116|      0|        return 0;
  117|      0|    }
  118|   309k|    rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0,
  119|   309k|                             libctx, propq);
  120|   309k|    if (rv <= 0)
  ------------------
  |  Branch (120:9): [True: 31.1k, False: 278k]
  ------------------
  121|  31.1k|        ASN1_item_ex_free(pval, it);
  122|   309k|    return rv;
  123|   309k|}
tasn_dec.c:asn1_item_embed_d2i:
  167|  7.06M|{
  168|  7.06M|    const ASN1_TEMPLATE *tt, *errtt = NULL;
  169|  7.06M|    const ASN1_EXTERN_FUNCS *ef;
  170|  7.06M|    const ASN1_AUX *aux;
  171|  7.06M|    ASN1_aux_cb *asn1_cb;
  172|  7.06M|    const unsigned char *p = NULL, *q;
  173|  7.06M|    unsigned char oclass;
  174|  7.06M|    char seq_eoc, seq_nolen, cst, isopt;
  175|  7.06M|    long tmplen;
  176|  7.06M|    int i;
  177|  7.06M|    int otag;
  178|  7.06M|    int ret = 0;
  179|  7.06M|    ASN1_VALUE **pchptr;
  180|       |
  181|  7.06M|    if (pval == NULL || it == NULL) {
  ------------------
  |  Branch (181:9): [True: 0, False: 7.06M]
  |  Branch (181:25): [True: 0, False: 7.06M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  183|      0|        return 0;
  184|      0|    }
  185|  7.06M|    if (len <= 0) {
  ------------------
  |  Branch (185:9): [True: 314, False: 7.06M]
  ------------------
  186|    314|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|    314|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    314|    (ERR_new(),                                                 \
  |  |  |  |  404|    314|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    314|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    314|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    314|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    314|     ERR_set_error)
  |  |  ------------------
  ------------------
  187|    314|        return 0;
  188|    314|    }
  189|  7.06M|    aux = it->funcs;
  190|  7.06M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (190:9): [True: 389k, False: 6.67M]
  |  Branch (190:16): [True: 168k, False: 221k]
  ------------------
  191|   168k|        asn1_cb = aux->asn1_cb;
  192|  6.89M|    else
  193|  6.89M|        asn1_cb = 0;
  194|       |
  195|  7.06M|    if (++depth > ASN1_MAX_CONSTRUCTED_NEST) {
  ------------------
  |  |   26|  7.06M|#define ASN1_MAX_CONSTRUCTED_NEST 30
  ------------------
  |  Branch (195:9): [True: 0, False: 7.06M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  197|      0|        goto err;
  198|      0|    }
  199|       |
  200|  7.06M|    switch (it->itype) {
  201|  5.00M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  5.00M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (201:5): [True: 5.00M, False: 2.05M]
  ------------------
  202|  5.00M|        if (it->templates) {
  ------------------
  |  Branch (202:13): [True: 3.22M, False: 1.78M]
  ------------------
  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.22M|            if ((tag != -1) || opt) {
  ------------------
  |  Branch (209:17): [True: 0, False: 3.22M]
  |  Branch (209:32): [True: 0, False: 3.22M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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.22M|            return asn1_template_ex_d2i(pval, in, len, it->templates, opt, ctx,
  215|  3.22M|                                        depth, libctx, propq);
  216|  3.22M|        }
  217|  1.78M|        return asn1_d2i_ex_primitive(pval, in, len, it,
  218|  1.78M|                                     tag, aclass, opt, ctx);
  219|       |
  220|   567k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   567k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (220:5): [True: 567k, False: 6.49M]
  ------------------
  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|   567k|        if (tag != -1) {
  ------------------
  |  Branch (225:13): [True: 0, False: 567k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  227|      0|            goto err;
  228|      0|        }
  229|       |
  230|   567k|        p = *in;
  231|       |        /* Just read in tag and class */
  232|   567k|        ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL,
  233|   567k|                              &p, len, -1, 0, 1, ctx);
  234|   567k|        if (!ret) {
  ------------------
  |  Branch (234:13): [True: 162, False: 567k]
  ------------------
  235|    162|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|    162|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    162|    (ERR_new(),                                                 \
  |  |  |  |  404|    162|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    162|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    162|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    162|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    162|     ERR_set_error)
  |  |  ------------------
  ------------------
  236|    162|            goto err;
  237|    162|        }
  238|       |
  239|       |        /* Must be UNIVERSAL class */
  240|   567k|        if (oclass != V_ASN1_UNIVERSAL) {
  ------------------
  |  |   47|   567k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (240:13): [True: 12.4k, False: 555k]
  ------------------
  241|       |            /* If OPTIONAL, assume this is OK */
  242|  12.4k|            if (opt)
  ------------------
  |  Branch (242:17): [True: 11.9k, False: 529]
  ------------------
  243|  11.9k|                return -1;
  244|  12.4k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL);
  ------------------
  |  |  401|    529|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    529|    (ERR_new(),                                                 \
  |  |  |  |  404|    529|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    529|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    529|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    529|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    529|     ERR_set_error)
  |  |  ------------------
  ------------------
  245|    529|            goto err;
  246|  12.4k|        }
  247|       |
  248|       |        /* Check tag matches bit map */
  249|   555k|        if (!(ASN1_tag2bit(otag) & it->utype)) {
  ------------------
  |  Branch (249:13): [True: 374, False: 554k]
  ------------------
  250|       |            /* If OPTIONAL, assume this is OK */
  251|    374|            if (opt)
  ------------------
  |  Branch (251:17): [True: 121, False: 253]
  ------------------
  252|    121|                return -1;
  253|    374|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG);
  ------------------
  |  |  401|    253|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    253|    (ERR_new(),                                                 \
  |  |  |  |  404|    253|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    253|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    253|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    253|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    253|     ERR_set_error)
  |  |  ------------------
  ------------------
  254|    253|            goto err;
  255|    374|        }
  256|   554k|        return asn1_d2i_ex_primitive(pval, in, len, it, otag, 0, 0, ctx);
  257|       |
  258|   181k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   181k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (258:5): [True: 181k, False: 6.88M]
  ------------------
  259|       |        /* Use new style d2i */
  260|   181k|        ef = it->funcs;
  261|   181k|        if (ef->asn1_ex_d2i_ex != NULL)
  ------------------
  |  Branch (261:13): [True: 76.6k, False: 104k]
  ------------------
  262|  76.6k|            return ef->asn1_ex_d2i_ex(pval, in, len, it, tag, aclass, opt, ctx,
  263|  76.6k|                                      libctx, propq);
  264|   104k|        return ef->asn1_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx);
  265|       |
  266|   123k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   123k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (266:5): [True: 123k, False: 6.94M]
  ------------------
  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|   123k|        if (tag != -1) {
  ------------------
  |  Branch (271:13): [True: 0, False: 123k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  273|      0|            goto err;
  274|      0|        }
  275|       |
  276|   123k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
  ------------------
  |  |  746|  17.6k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (276:13): [True: 17.6k, False: 106k]
  |  Branch (276:24): [True: 0, False: 17.6k]
  ------------------
  277|      0|            goto auxerr;
  278|   123k|        if (*pval) {
  ------------------
  |  Branch (278:13): [True: 8.19k, False: 115k]
  ------------------
  279|       |            /* Free up and zero CHOICE value if initialised */
  280|  8.19k|            i = ossl_asn1_get_choice_selector(pval, it);
  281|  8.19k|            if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (281:17): [True: 0, False: 8.19k]
  |  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|   115k|        } else if (!ossl_asn1_item_ex_new_intern(pval, it, libctx, propq)) {
  ------------------
  |  Branch (287:20): [True: 0, False: 115k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|   123k|        p = *in;
  293|   252k|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (293:41): [True: 252k, False: 335]
  ------------------
  294|   252k|            pchptr = ossl_asn1_get_field_ptr(pval, tt);
  295|       |            /*
  296|       |             * We mark field as OPTIONAL so its absence can be recognised.
  297|       |             */
  298|   252k|            ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx, depth,
  299|   252k|                                       libctx, propq);
  300|       |            /* If field not present, try the next one */
  301|   252k|            if (ret == -1)
  ------------------
  |  Branch (301:17): [True: 128k, False: 123k]
  ------------------
  302|   128k|                continue;
  303|       |            /* If positive return, read OK, break loop */
  304|   123k|            if (ret > 0)
  ------------------
  |  Branch (304:17): [True: 110k, False: 13.4k]
  ------------------
  305|   110k|                break;
  306|       |            /*
  307|       |             * Must be an ASN1 parsing error.
  308|       |             * Free up any partial choice value
  309|       |             */
  310|  13.4k|            ossl_asn1_template_free(pchptr, tt);
  311|  13.4k|            errtt = tt;
  312|  13.4k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  13.4k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  13.4k|    (ERR_new(),                                                 \
  |  |  |  |  404|  13.4k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  13.4k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  13.4k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  13.4k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  13.4k|     ERR_set_error)
  |  |  ------------------
  ------------------
  313|  13.4k|            goto err;
  314|   123k|        }
  315|       |
  316|       |        /* Did we fall off the end without reading anything? */
  317|   110k|        if (i == it->tcount) {
  ------------------
  |  Branch (317:13): [True: 335, False: 110k]
  ------------------
  318|       |            /* If OPTIONAL, this is OK */
  319|    335|            if (opt) {
  ------------------
  |  Branch (319:17): [True: 0, False: 335]
  ------------------
  320|       |                /* Free and zero it */
  321|      0|                ASN1_item_ex_free(pval, it);
  322|      0|                return -1;
  323|      0|            }
  324|    335|            ERR_raise(ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE);
  ------------------
  |  |  401|    335|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    335|    (ERR_new(),                                                 \
  |  |  |  |  404|    335|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    335|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    335|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    335|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    335|     ERR_set_error)
  |  |  ------------------
  ------------------
  325|    335|            goto err;
  326|    335|        }
  327|       |
  328|   110k|        ossl_asn1_set_choice_selector(pval, i, it);
  329|       |
  330|   110k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
  ------------------
  |  |  747|  12.2k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (330:13): [True: 12.2k, False: 97.9k]
  |  Branch (330:24): [True: 0, False: 12.2k]
  ------------------
  331|      0|            goto auxerr;
  332|   110k|        *in = p;
  333|   110k|        return 1;
  334|       |
  335|  15.7k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  15.7k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (335:5): [True: 15.7k, False: 7.04M]
  ------------------
  336|  1.18M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  1.18M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (336:5): [True: 1.16M, False: 5.89M]
  ------------------
  337|  1.18M|        p = *in;
  338|  1.18M|        tmplen = len;
  339|       |
  340|       |        /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */
  341|  1.18M|        if (tag == -1) {
  ------------------
  |  Branch (341:13): [True: 1.14M, False: 38.6k]
  ------------------
  342|  1.14M|            tag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  1.14M|# define V_ASN1_SEQUENCE                 16
  ------------------
  343|  1.14M|            aclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  1.14M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  344|  1.14M|        }
  345|       |        /* Get SEQUENCE length and update len, p */
  346|  1.18M|        ret = asn1_check_tlen(&len, NULL, NULL, &seq_eoc, &cst,
  347|  1.18M|                              &p, len, tag, aclass, opt, ctx);
  348|  1.18M|        if (!ret) {
  ------------------
  |  Branch (348:13): [True: 3.04k, False: 1.18M]
  ------------------
  349|  3.04k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  3.04k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  3.04k|    (ERR_new(),                                                 \
  |  |  |  |  404|  3.04k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  3.04k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  3.04k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  3.04k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  3.04k|     ERR_set_error)
  |  |  ------------------
  ------------------
  350|  3.04k|            goto err;
  351|  1.18M|        } else if (ret == -1)
  ------------------
  |  Branch (351:20): [True: 71.6k, False: 1.10M]
  ------------------
  352|  71.6k|            return -1;
  353|  1.10M|        if (aux && (aux->flags & ASN1_AFLG_BROKEN)) {
  ------------------
  |  |  736|   133k|# define ASN1_AFLG_BROKEN        4
  ------------------
  |  Branch (353:13): [True: 133k, False: 974k]
  |  Branch (353:20): [True: 0, False: 133k]
  ------------------
  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.10M|        else
  359|  1.10M|            seq_nolen = seq_eoc;
  360|  1.10M|        if (!cst) {
  ------------------
  |  Branch (360:13): [True: 62, False: 1.10M]
  ------------------
  361|     62|            ERR_raise(ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED);
  ------------------
  |  |  401|     62|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     62|    (ERR_new(),                                                 \
  |  |  |  |  404|     62|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     62|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     62|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     62|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     62|     ERR_set_error)
  |  |  ------------------
  ------------------
  362|     62|            goto err;
  363|     62|        }
  364|       |
  365|  1.10M|        if (*pval == NULL
  ------------------
  |  Branch (365:13): [True: 688k, False: 419k]
  ------------------
  366|  1.10M|                && !ossl_asn1_item_ex_new_intern(pval, it, libctx, propq)) {
  ------------------
  |  Branch (366:20): [True: 0, False: 688k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|      0|            goto err;
  369|      0|        }
  370|       |
  371|  1.10M|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
  ------------------
  |  |  746|  93.6k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (371:13): [True: 93.6k, False: 1.01M]
  |  Branch (371:24): [True: 0, False: 93.6k]
  ------------------
  372|      0|            goto auxerr;
  373|       |
  374|       |        /* Free up and zero any ADB found */
  375|  4.06M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (375:41): [True: 2.96M, False: 1.10M]
  ------------------
  376|  2.96M|            if (tt->flags & ASN1_TFLG_ADB_MASK) {
  ------------------
  |  |  583|  2.96M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
  |  Branch (376:17): [True: 7.54k, False: 2.95M]
  ------------------
  377|  7.54k|                const ASN1_TEMPLATE *seqtt;
  378|  7.54k|                ASN1_VALUE **pseqval;
  379|  7.54k|                seqtt = ossl_asn1_do_adb(*pval, tt, 0);
  380|  7.54k|                if (seqtt == NULL)
  ------------------
  |  Branch (380:21): [True: 7.54k, False: 0]
  ------------------
  381|  7.54k|                    continue;
  382|      0|                pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  383|      0|                ossl_asn1_template_free(pseqval, seqtt);
  384|      0|            }
  385|  2.96M|        }
  386|       |
  387|       |        /* Get each field entry */
  388|  3.67M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (388:41): [True: 2.77M, False: 896k]
  ------------------
  389|  2.77M|            const ASN1_TEMPLATE *seqtt;
  390|  2.77M|            ASN1_VALUE **pseqval;
  391|  2.77M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  392|  2.77M|            if (seqtt == NULL)
  ------------------
  |  Branch (392:17): [True: 0, False: 2.77M]
  ------------------
  393|      0|                goto err;
  394|  2.77M|            pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  395|       |            /* Have we ran out of data? */
  396|  2.77M|            if (!len)
  ------------------
  |  Branch (396:17): [True: 56.0k, False: 2.71M]
  ------------------
  397|  56.0k|                break;
  398|  2.71M|            q = p;
  399|  2.71M|            if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (399:17): [True: 118k, False: 2.59M]
  ------------------
  400|   118k|                if (!seq_eoc) {
  ------------------
  |  Branch (400:21): [True: 415, False: 118k]
  ------------------
  401|    415|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|    415|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    415|    (ERR_new(),                                                 \
  |  |  |  |  404|    415|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    415|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    415|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    415|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    415|     ERR_set_error)
  |  |  ------------------
  ------------------
  402|    415|                    goto err;
  403|    415|                }
  404|   118k|                len -= p - q;
  405|   118k|                seq_eoc = 0;
  406|   118k|                break;
  407|   118k|            }
  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|  2.59M|            if (i == (it->tcount - 1))
  ------------------
  |  Branch (414:17): [True: 907k, False: 1.69M]
  ------------------
  415|   907k|                isopt = 0;
  416|  1.69M|            else
  417|  1.69M|                isopt = (char)(seqtt->flags & ASN1_TFLG_OPTIONAL);
  ------------------
  |  |  523|  1.69M|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  418|       |            /*
  419|       |             * attempt to read in field, allowing each to be OPTIONAL
  420|       |             */
  421|       |
  422|  2.59M|            ret = asn1_template_ex_d2i(pseqval, &p, len, seqtt, isopt, ctx,
  423|  2.59M|                                       depth, libctx, propq);
  424|  2.59M|            if (!ret) {
  ------------------
  |  Branch (424:17): [True: 36.6k, False: 2.56M]
  ------------------
  425|  36.6k|                errtt = seqtt;
  426|  36.6k|                goto err;
  427|  2.56M|            } else if (ret == -1) {
  ------------------
  |  Branch (427:24): [True: 184k, False: 2.37M]
  ------------------
  428|       |                /*
  429|       |                 * OPTIONAL component absent. Free and zero the field.
  430|       |                 */
  431|   184k|                ossl_asn1_template_free(pseqval, seqtt);
  432|   184k|                continue;
  433|   184k|            }
  434|       |            /* Update length */
  435|  2.37M|            len -= p - q;
  436|  2.37M|        }
  437|       |
  438|       |        /* Check for EOC if expecting one */
  439|  1.07M|        if (seq_eoc && !asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (439:13): [True: 355k, False: 716k]
  |  Branch (439:24): [True: 1.04k, False: 353k]
  ------------------
  440|  1.04k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|  1.04k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.04k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.04k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  1.04k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  1.04k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  1.04k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.04k|     ERR_set_error)
  |  |  ------------------
  ------------------
  441|  1.04k|            goto err;
  442|  1.04k|        }
  443|       |        /* Check all data read */
  444|  1.07M|        if (!seq_nolen && len) {
  ------------------
  |  Branch (444:13): [True: 597k, False: 472k]
  |  Branch (444:27): [True: 228, False: 597k]
  ------------------
  445|    228|            ERR_raise(ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH);
  ------------------
  |  |  401|    228|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    228|    (ERR_new(),                                                 \
  |  |  |  |  404|    228|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    228|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    228|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    228|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    228|     ERR_set_error)
  |  |  ------------------
  ------------------
  446|    228|            goto err;
  447|    228|        }
  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.33M|        for (; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (454:16): [True: 265k, False: 1.06M]
  ------------------
  455|   265k|            const ASN1_TEMPLATE *seqtt;
  456|   265k|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  457|   265k|            if (seqtt == NULL)
  ------------------
  |  Branch (457:17): [True: 0, False: 265k]
  ------------------
  458|      0|                goto err;
  459|   265k|            if (seqtt->flags & ASN1_TFLG_OPTIONAL) {
  ------------------
  |  |  523|   265k|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (459:17): [True: 262k, False: 3.05k]
  ------------------
  460|   262k|                ASN1_VALUE **pseqval;
  461|   262k|                pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  462|   262k|                ossl_asn1_template_free(pseqval, seqtt);
  463|   262k|            } else {
  464|  3.05k|                errtt = seqtt;
  465|  3.05k|                ERR_raise(ERR_LIB_ASN1, ASN1_R_FIELD_MISSING);
  ------------------
  |  |  401|  3.05k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  3.05k|    (ERR_new(),                                                 \
  |  |  |  |  404|  3.05k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  3.05k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  3.05k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  3.05k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  3.05k|     ERR_set_error)
  |  |  ------------------
  ------------------
  466|  3.05k|                goto err;
  467|  3.05k|            }
  468|   265k|        }
  469|       |        /* Save encoding */
  470|  1.06M|        if (!ossl_asn1_enc_save(pval, *in, p - *in, it))
  ------------------
  |  Branch (470:13): [True: 0, False: 1.06M]
  ------------------
  471|      0|            goto auxerr;
  472|  1.06M|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
  ------------------
  |  |  747|  83.1k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (472:13): [True: 83.1k, False: 983k]
  |  Branch (472:24): [True: 0, False: 83.1k]
  ------------------
  473|      0|            goto auxerr;
  474|  1.06M|        *in = p;
  475|  1.06M|        return 1;
  476|       |
  477|      0|    default:
  ------------------
  |  Branch (477:5): [True: 0, False: 7.06M]
  ------------------
  478|      0|        return 0;
  479|  7.06M|    }
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  482|  59.1k| err:
  483|  59.1k|    if (errtt)
  ------------------
  |  Branch (483:9): [True: 53.1k, False: 6.06k]
  ------------------
  484|  53.1k|        ERR_add_error_data(4, "Field=", errtt->field_name,
  485|  53.1k|                           ", Type=", it->sname);
  486|  6.06k|    else
  487|  6.06k|        ERR_add_error_data(2, "Type=", it->sname);
  488|  59.1k|    return 0;
  489|      0|}
tasn_dec.c:asn1_template_ex_d2i:
  501|  6.07M|{
  502|  6.07M|    int flags, aclass;
  503|  6.07M|    int ret;
  504|  6.07M|    long len;
  505|  6.07M|    const unsigned char *p, *q;
  506|  6.07M|    char exp_eoc;
  507|  6.07M|    if (!val)
  ------------------
  |  Branch (507:9): [True: 0, False: 6.07M]
  ------------------
  508|      0|        return 0;
  509|  6.07M|    flags = tt->flags;
  510|  6.07M|    aclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  6.07M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  511|       |
  512|  6.07M|    p = *in;
  513|       |
  514|       |    /* Check if EXPLICIT tag expected */
  515|  6.07M|    if (flags & ASN1_TFLG_EXPTAG) {
  ------------------
  |  |  550|  6.07M|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (515:9): [True: 82.9k, False: 5.99M]
  ------------------
  516|  82.9k|        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|  82.9k|        ret = asn1_check_tlen(&len, NULL, NULL, &exp_eoc, &cst,
  522|  82.9k|                              &p, inlen, tt->tag, aclass, opt, ctx);
  523|  82.9k|        q = p;
  524|  82.9k|        if (!ret) {
  ------------------
  |  Branch (524:13): [True: 2.02k, False: 80.9k]
  ------------------
  525|  2.02k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  2.02k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.02k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.02k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.02k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.02k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  2.02k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.02k|     ERR_set_error)
  |  |  ------------------
  ------------------
  526|  2.02k|            return 0;
  527|  80.9k|        } else if (ret == -1)
  ------------------
  |  Branch (527:20): [True: 46.3k, False: 34.6k]
  ------------------
  528|  46.3k|            return -1;
  529|  34.6k|        if (!cst) {
  ------------------
  |  Branch (529:13): [True: 26, False: 34.6k]
  ------------------
  530|     26|            ERR_raise(ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED);
  ------------------
  |  |  401|     26|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     26|    (ERR_new(),                                                 \
  |  |  |  |  404|     26|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     26|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     26|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     26|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     26|     ERR_set_error)
  |  |  ------------------
  ------------------
  531|     26|            return 0;
  532|     26|        }
  533|       |        /* We've found the field so it can't be OPTIONAL now */
  534|  34.6k|        ret = asn1_template_noexp_d2i(val, &p, len, tt, 0, ctx, depth, libctx,
  535|  34.6k|                                      propq);
  536|  34.6k|        if (!ret) {
  ------------------
  |  Branch (536:13): [True: 12.3k, False: 22.2k]
  ------------------
  537|  12.3k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  12.3k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  12.3k|    (ERR_new(),                                                 \
  |  |  |  |  404|  12.3k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  12.3k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  12.3k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  12.3k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  12.3k|     ERR_set_error)
  |  |  ------------------
  ------------------
  538|  12.3k|            return 0;
  539|  12.3k|        }
  540|       |        /* We read the field in OK so update length */
  541|  22.2k|        len -= p - q;
  542|  22.2k|        if (exp_eoc) {
  ------------------
  |  Branch (542:13): [True: 15.6k, False: 6.55k]
  ------------------
  543|       |            /* If NDEF we must have an EOC here */
  544|  15.6k|            if (!asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (544:17): [True: 782, False: 14.8k]
  ------------------
  545|    782|                ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|    782|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    782|    (ERR_new(),                                                 \
  |  |  |  |  404|    782|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    782|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    782|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    782|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    782|     ERR_set_error)
  |  |  ------------------
  ------------------
  546|    782|                goto err;
  547|    782|            }
  548|  15.6k|        } else {
  549|       |            /*
  550|       |             * Otherwise we must hit the EXPLICIT tag end or its an error
  551|       |             */
  552|  6.55k|            if (len) {
  ------------------
  |  Branch (552:17): [True: 421, False: 6.13k]
  ------------------
  553|    421|                ERR_raise(ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    421|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    421|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    421|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    421|     ERR_set_error)
  |  |  ------------------
  ------------------
  554|    421|                goto err;
  555|    421|            }
  556|  6.55k|        }
  557|  22.2k|    } else
  558|  5.99M|        return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx, depth,
  559|  5.99M|                                       libctx, propq);
  560|       |
  561|  21.0k|    *in = p;
  562|  21.0k|    return 1;
  563|       |
  564|  1.20k| err:
  565|  1.20k|    return 0;
  566|  6.07M|}
tasn_dec.c:asn1_template_noexp_d2i:
  573|  6.02M|{
  574|  6.02M|    int flags, aclass;
  575|  6.02M|    int ret;
  576|  6.02M|    ASN1_VALUE *tval;
  577|  6.02M|    const unsigned char *p, *q;
  578|  6.02M|    if (!val)
  ------------------
  |  Branch (578:9): [True: 0, False: 6.02M]
  ------------------
  579|      0|        return 0;
  580|  6.02M|    flags = tt->flags;
  581|  6.02M|    aclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  6.02M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  582|       |
  583|  6.02M|    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|  6.02M|    if (tt->flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  597|  6.02M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  |  Branch (589:9): [True: 469k, False: 5.55M]
  ------------------
  590|   469k|        tval = (ASN1_VALUE *)val;
  591|   469k|        val = &tval;
  592|   469k|    }
  593|       |
  594|  6.02M|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  6.02M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (594:9): [True: 3.33M, False: 2.68M]
  ------------------
  595|       |        /* SET OF, SEQUENCE OF */
  596|  3.33M|        int sktag, skaclass;
  597|  3.33M|        char sk_eoc;
  598|       |        /* First work out expected inner tag value */
  599|  3.33M|        if (flags & ASN1_TFLG_IMPTAG) {
  ------------------
  |  |  547|  3.33M|# define ASN1_TFLG_IMPTAG        (0x1 << 3)
  ------------------
  |  Branch (599:13): [True: 21.9k, False: 3.31M]
  ------------------
  600|  21.9k|            sktag = tt->tag;
  601|  21.9k|            skaclass = aclass;
  602|  3.31M|        } else {
  603|  3.31M|            skaclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  3.31M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  604|  3.31M|            if (flags & ASN1_TFLG_SET_OF)
  ------------------
  |  |  526|  3.31M|# define ASN1_TFLG_SET_OF        (0x1 << 1)
  ------------------
  |  Branch (604:17): [True: 3.11M, False: 200k]
  ------------------
  605|  3.11M|                sktag = V_ASN1_SET;
  ------------------
  |  |   75|  3.11M|# define V_ASN1_SET                      17
  ------------------
  606|   200k|            else
  607|   200k|                sktag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|   200k|# define V_ASN1_SEQUENCE                 16
  ------------------
  608|  3.31M|        }
  609|       |        /* Get the tag */
  610|  3.33M|        ret = asn1_check_tlen(&len, NULL, NULL, &sk_eoc, NULL,
  611|  3.33M|                              &p, len, sktag, skaclass, opt, ctx);
  612|  3.33M|        if (!ret) {
  ------------------
  |  Branch (612:13): [True: 2.29k, False: 3.33M]
  ------------------
  613|  2.29k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.29k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.29k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  2.29k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.29k|     ERR_set_error)
  |  |  ------------------
  ------------------
  614|  2.29k|            return 0;
  615|  3.33M|        } else if (ret == -1)
  ------------------
  |  Branch (615:20): [True: 22.2k, False: 3.31M]
  ------------------
  616|  22.2k|            return -1;
  617|  3.31M|        if (*val == NULL)
  ------------------
  |  Branch (617:13): [True: 3.30M, False: 5.77k]
  ------------------
  618|  3.30M|            *val = (ASN1_VALUE *)sk_ASN1_VALUE_new_null();
  ------------------
  |  |  901|  3.30M|#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  619|  5.77k|        else {
  620|       |            /*
  621|       |             * We've got a valid STACK: free up any items present
  622|       |             */
  623|  5.77k|            STACK_OF(ASN1_VALUE) *sktmp = (STACK_OF(ASN1_VALUE) *)*val;
  ------------------
  |  |   31|  5.77k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  624|  5.77k|            ASN1_VALUE *vtmp;
  625|  5.77k|            while (sk_ASN1_VALUE_num(sktmp) > 0) {
  ------------------
  |  |  898|  5.77k|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (625:20): [True: 0, False: 5.77k]
  ------------------
  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.77k|        }
  630|       |
  631|  3.31M|        if (*val == NULL) {
  ------------------
  |  Branch (631:13): [True: 0, False: 3.31M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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.37M|        while (len > 0) {
  ------------------
  |  Branch (637:16): [True: 4.25M, False: 3.11M]
  ------------------
  638|  4.25M|            ASN1_VALUE *skfield;
  639|  4.25M|            q = p;
  640|       |            /* See if EOC found */
  641|  4.25M|            if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (641:17): [True: 187k, False: 4.07M]
  ------------------
  642|   187k|                if (!sk_eoc) {
  ------------------
  |  Branch (642:21): [True: 46, False: 187k]
  ------------------
  643|     46|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|     46|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     46|    (ERR_new(),                                                 \
  |  |  |  |  404|     46|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     46|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     46|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     46|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     46|     ERR_set_error)
  |  |  ------------------
  ------------------
  644|     46|                    goto err;
  645|     46|                }
  646|   187k|                len -= p - q;
  647|   187k|                sk_eoc = 0;
  648|   187k|                break;
  649|   187k|            }
  650|  4.07M|            skfield = NULL;
  651|  4.07M|            if (asn1_item_embed_d2i(&skfield, &p, len,
  ------------------
  |  Branch (651:17): [True: 13.0k, False: 4.05M]
  ------------------
  652|  4.07M|                                     ASN1_ITEM_ptr(tt->item), -1, 0, 0, ctx,
  ------------------
  |  |  421|  4.07M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  653|  4.07M|                                     depth, libctx, propq) <= 0) {
  654|  13.0k|                ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  13.0k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  13.0k|    (ERR_new(),                                                 \
  |  |  |  |  404|  13.0k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  13.0k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  13.0k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  13.0k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  13.0k|     ERR_set_error)
  |  |  ------------------
  ------------------
  655|       |                /* |skfield| may be partially allocated despite failure. */
  656|  13.0k|                ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  421|  13.0k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  657|  13.0k|                goto err;
  658|  13.0k|            }
  659|  4.05M|            len -= p - q;
  660|  4.05M|            if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val, skfield)) {
  ------------------
  |  |  908|  4.05M|#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.05M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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.05M|        }
  666|  3.30M|        if (sk_eoc) {
  ------------------
  |  Branch (666:13): [True: 109, False: 3.30M]
  ------------------
  667|    109|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|    109|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    109|    (ERR_new(),                                                 \
  |  |  |  |  404|    109|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    109|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    109|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    109|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    109|     ERR_set_error)
  |  |  ------------------
  ------------------
  668|    109|            goto err;
  669|    109|        }
  670|  3.30M|    } else if (flags & ASN1_TFLG_IMPTAG) {
  ------------------
  |  |  547|  2.68M|# define ASN1_TFLG_IMPTAG        (0x1 << 3)
  ------------------
  |  Branch (670:16): [True: 150k, False: 2.53M]
  ------------------
  671|       |        /* IMPLICIT tagging */
  672|   150k|        ret = asn1_item_embed_d2i(val, &p, len,
  673|   150k|                                  ASN1_ITEM_ptr(tt->item), tt->tag, aclass, opt,
  ------------------
  |  |  421|   150k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  674|   150k|                                  ctx, depth, libctx, propq);
  675|   150k|        if (!ret) {
  ------------------
  |  Branch (675:13): [True: 8.90k, False: 141k]
  ------------------
  676|  8.90k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  8.90k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  8.90k|    (ERR_new(),                                                 \
  |  |  |  |  404|  8.90k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  8.90k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  8.90k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  8.90k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  8.90k|     ERR_set_error)
  |  |  ------------------
  ------------------
  677|  8.90k|            goto err;
  678|   141k|        } else if (ret == -1)
  ------------------
  |  Branch (678:20): [True: 89.7k, False: 52.2k]
  ------------------
  679|  89.7k|            return -1;
  680|  2.53M|    } else {
  681|       |        /* Nothing special */
  682|  2.53M|        ret = asn1_item_embed_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  421|  2.53M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  683|  2.53M|                                  -1, 0, opt, ctx, depth, libctx, propq);
  684|  2.53M|        if (!ret) {
  ------------------
  |  Branch (684:13): [True: 26.1k, False: 2.50M]
  ------------------
  685|  26.1k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  26.1k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  26.1k|    (ERR_new(),                                                 \
  |  |  |  |  404|  26.1k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  26.1k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  26.1k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  26.1k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  26.1k|     ERR_set_error)
  |  |  ------------------
  ------------------
  686|  26.1k|            goto err;
  687|  2.50M|        } else if (ret == -1)
  ------------------
  |  Branch (687:20): [True: 155k, False: 2.35M]
  ------------------
  688|   155k|            return -1;
  689|  2.53M|    }
  690|       |
  691|  5.70M|    *in = p;
  692|  5.70M|    return 1;
  693|       |
  694|  48.2k| err:
  695|  48.2k|    return 0;
  696|  6.02M|}
tasn_dec.c:asn1_d2i_ex_primitive:
  702|  2.34M|{
  703|  2.34M|    int ret = 0, utype;
  704|  2.34M|    long plen;
  705|  2.34M|    char cst, inf, free_cont = 0;
  706|  2.34M|    const unsigned char *p;
  707|  2.34M|    BUF_MEM buf = { 0, NULL, 0, 0 };
  708|  2.34M|    const unsigned char *cont = NULL;
  709|  2.34M|    long len;
  710|       |
  711|  2.34M|    if (pval == NULL) {
  ------------------
  |  Branch (711:9): [True: 0, False: 2.34M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  713|      0|        return 0;               /* Should never happen */
  714|      0|    }
  715|       |
  716|  2.34M|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  2.34M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (716:9): [True: 554k, False: 1.78M]
  ------------------
  717|   554k|        utype = tag;
  718|   554k|        tag = -1;
  719|   554k|    } else
  720|  1.78M|        utype = it->utype;
  721|       |
  722|  2.34M|    if (utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  2.34M|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (722:9): [True: 433k, False: 1.90M]
  ------------------
  723|       |        /* If type is ANY need to figure out type from tag */
  724|   433k|        unsigned char oclass;
  725|   433k|        if (tag >= 0) {
  ------------------
  |  Branch (725:13): [True: 0, False: 433k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  727|      0|            return 0;
  728|      0|        }
  729|   433k|        if (opt) {
  ------------------
  |  Branch (729:13): [True: 0, False: 433k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  731|      0|            return 0;
  732|      0|        }
  733|   433k|        p = *in;
  734|   433k|        ret = asn1_check_tlen(NULL, &utype, &oclass, NULL, NULL,
  735|   433k|                              &p, inlen, -1, 0, 0, ctx);
  736|   433k|        if (!ret) {
  ------------------
  |  Branch (736:13): [True: 35, False: 433k]
  ------------------
  737|     35|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|     35|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     35|    (ERR_new(),                                                 \
  |  |  |  |  404|     35|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     35|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     35|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     35|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     35|     ERR_set_error)
  |  |  ------------------
  ------------------
  738|     35|            return 0;
  739|     35|        }
  740|   433k|        if (oclass != V_ASN1_UNIVERSAL)
  ------------------
  |  |   47|   433k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (740:13): [True: 4.51k, False: 428k]
  ------------------
  741|  4.51k|            utype = V_ASN1_OTHER;
  ------------------
  |  |   57|  4.51k|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  742|   433k|    }
  743|  2.34M|    if (tag == -1) {
  ------------------
  |  Branch (743:9): [True: 2.23M, False: 112k]
  ------------------
  744|  2.23M|        tag = utype;
  745|  2.23M|        aclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  2.23M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  746|  2.23M|    }
  747|  2.34M|    p = *in;
  748|       |    /* Check header */
  749|  2.34M|    ret = asn1_check_tlen(&plen, NULL, NULL, &inf, &cst,
  750|  2.34M|                          &p, inlen, tag, aclass, opt, ctx);
  751|  2.34M|    if (!ret) {
  ------------------
  |  Branch (751:9): [True: 8.03k, False: 2.33M]
  ------------------
  752|  8.03k|        ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  8.03k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  8.03k|    (ERR_new(),                                                 \
  |  |  |  |  404|  8.03k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  8.03k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  8.03k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  8.03k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  8.03k|     ERR_set_error)
  |  |  ------------------
  ------------------
  753|  8.03k|        return 0;
  754|  2.33M|    } else if (ret == -1)
  ------------------
  |  Branch (754:16): [True: 161k, False: 2.17M]
  ------------------
  755|   161k|        return -1;
  756|  2.17M|    ret = 0;
  757|       |    /* SEQUENCE, SET and "OTHER" are left in encoded form */
  758|  2.17M|    if ((utype == V_ASN1_SEQUENCE)
  ------------------
  |  |   74|  2.17M|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (758:9): [True: 36.7k, False: 2.13M]
  ------------------
  759|  2.17M|        || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {
  ------------------
  |  |   75|  2.13M|# define V_ASN1_SET                      17
  ------------------
                      || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {
  ------------------
  |  |   57|  1.84M|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  |  Branch (759:12): [True: 289k, False: 1.84M]
  |  Branch (759:37): [True: 4.51k, False: 1.84M]
  ------------------
  760|       |        /*
  761|       |         * Clear context cache for type OTHER because the auto clear when we
  762|       |         * have a exact match won't work
  763|       |         */
  764|   330k|        if (utype == V_ASN1_OTHER) {
  ------------------
  |  |   57|   330k|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  |  Branch (764:13): [True: 4.51k, False: 326k]
  ------------------
  765|  4.51k|            asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  4.51k|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 4.51k, False: 0]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
  766|  4.51k|        }
  767|       |        /* SEQUENCE and SET must be constructed */
  768|   326k|        else if (!cst) {
  ------------------
  |  Branch (768:18): [True: 36, False: 326k]
  ------------------
  769|     36|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     36|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     36|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     36|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     36|     ERR_set_error)
  |  |  ------------------
  ------------------
  770|     36|            return 0;
  771|     36|        }
  772|       |
  773|   330k|        cont = *in;
  774|       |        /* If indefinite length constructed find the real end */
  775|   330k|        if (inf) {
  ------------------
  |  Branch (775:13): [True: 1.17k, False: 329k]
  ------------------
  776|  1.17k|            if (!asn1_find_end(&p, plen, inf))
  ------------------
  |  Branch (776:17): [True: 96, False: 1.07k]
  ------------------
  777|     96|                goto err;
  778|  1.07k|            len = p - cont;
  779|   329k|        } else {
  780|   329k|            len = p - cont + plen;
  781|   329k|            p += plen;
  782|   329k|        }
  783|  1.84M|    } else if (cst) {
  ------------------
  |  Branch (783:16): [True: 151k, False: 1.69M]
  ------------------
  784|   151k|        if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN
  ------------------
  |  |   67|   302k|# define V_ASN1_NULL                     5
  ------------------
                      if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN
  ------------------
  |  |   63|   302k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (784:13): [True: 3, False: 151k]
  |  Branch (784:37): [True: 177, False: 150k]
  ------------------
  785|   151k|            || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER
  ------------------
  |  |   68|   302k|# define V_ASN1_OBJECT                   6
  ------------------
                          || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER
  ------------------
  |  |   64|   302k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (785:16): [True: 22, False: 150k]
  |  Branch (785:42): [True: 19, False: 150k]
  ------------------
  786|   151k|            || utype == V_ASN1_ENUMERATED) {
  ------------------
  |  |   72|   150k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (786:16): [True: 199, False: 150k]
  ------------------
  787|    420|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE);
  ------------------
  |  |  401|    420|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    420|    (ERR_new(),                                                 \
  |  |  |  |  404|    420|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    420|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    420|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    420|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    420|     ERR_set_error)
  |  |  ------------------
  ------------------
  788|    420|            return 0;
  789|    420|        }
  790|       |
  791|       |        /* Free any returned 'buf' content */
  792|   150k|        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|   150k|        if (!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL, 0)) {
  ------------------
  |  |   47|   150k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (799:13): [True: 1.31k, False: 149k]
  ------------------
  800|  1.31k|            goto err;
  801|  1.31k|        }
  802|   149k|        len = buf.length;
  803|       |        /* Append a final null to string */
  804|   149k|        if (!BUF_MEM_grow_clean(&buf, len + 1)) {
  ------------------
  |  Branch (804:13): [True: 0, False: 149k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  806|      0|            goto err;
  807|      0|        }
  808|   149k|        buf.data[len] = 0;
  809|   149k|        cont = (const unsigned char *)buf.data;
  810|  1.69M|    } else {
  811|  1.69M|        cont = p;
  812|  1.69M|        len = plen;
  813|  1.69M|        p += plen;
  814|  1.69M|    }
  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|  2.17M|    if (!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it))
  ------------------
  |  Branch (818:9): [True: 3.72k, False: 2.16M]
  ------------------
  819|  3.72k|        goto err;
  820|       |
  821|  2.16M|    *in = p;
  822|  2.16M|    ret = 1;
  823|  2.17M| err:
  824|  2.17M|    if (free_cont)
  ------------------
  |  Branch (824:9): [True: 20.5k, False: 2.15M]
  ------------------
  825|  20.5k|        OPENSSL_free(buf.data);
  ------------------
  |  |  115|  20.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  20.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  20.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  826|  2.17M|    return ret;
  827|  2.16M|}
tasn_dec.c:asn1_find_end:
  980|  1.17k|{
  981|  1.17k|    uint32_t expected_eoc;
  982|  1.17k|    long plen;
  983|  1.17k|    const unsigned char *p = *in, *q;
  984|       |    /* If not indefinite length constructed just add length */
  985|  1.17k|    if (inf == 0) {
  ------------------
  |  Branch (985:9): [True: 0, False: 1.17k]
  ------------------
  986|      0|        *in += len;
  987|      0|        return 1;
  988|      0|    }
  989|  1.17k|    expected_eoc = 1;
  990|       |    /*
  991|       |     * Indefinite length constructed form. Find the end when enough EOCs are
  992|       |     * found. If more indefinite length constructed headers are encountered
  993|       |     * increment the expected eoc count otherwise just skip to the end of the
  994|       |     * data.
  995|       |     */
  996|  2.24M|    while (len > 0) {
  ------------------
  |  Branch (996:12): [True: 2.24M, False: 45]
  ------------------
  997|  2.24M|        if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (997:13): [True: 39.3k, False: 2.20M]
  ------------------
  998|  39.3k|            expected_eoc--;
  999|  39.3k|            if (expected_eoc == 0)
  ------------------
  |  Branch (999:17): [True: 1.07k, False: 38.2k]
  ------------------
 1000|  1.07k|                break;
 1001|  38.2k|            len -= 2;
 1002|  38.2k|            continue;
 1003|  39.3k|        }
 1004|  2.20M|        q = p;
 1005|       |        /* Just read in a header: only care about the length */
 1006|  2.20M|        if (!asn1_check_tlen(&plen, NULL, NULL, &inf, NULL, &p, len,
  ------------------
  |  Branch (1006:13): [True: 51, False: 2.20M]
  ------------------
 1007|  2.20M|                             -1, 0, 0, NULL)) {
 1008|     51|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     51|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     51|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     51|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     51|     ERR_set_error)
  |  |  ------------------
  ------------------
 1009|     51|            return 0;
 1010|     51|        }
 1011|  2.20M|        if (inf) {
  ------------------
  |  Branch (1011:13): [True: 39.3k, False: 2.16M]
  ------------------
 1012|  39.3k|            if (expected_eoc == UINT32_MAX) {
  ------------------
  |  Branch (1012:17): [True: 0, False: 39.3k]
  ------------------
 1013|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1014|      0|                return 0;
 1015|      0|            }
 1016|  39.3k|            expected_eoc++;
 1017|  2.16M|        } else {
 1018|  2.16M|            p += plen;
 1019|  2.16M|        }
 1020|  2.20M|        len -= p - q;
 1021|  2.20M|    }
 1022|  1.12k|    if (expected_eoc) {
  ------------------
  |  Branch (1022:9): [True: 45, False: 1.07k]
  ------------------
 1023|     45|        ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|     45|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     45|    (ERR_new(),                                                 \
  |  |  |  |  404|     45|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     45|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     45|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     45|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     45|     ERR_set_error)
  |  |  ------------------
  ------------------
 1024|     45|        return 0;
 1025|     45|    }
 1026|  1.07k|    *in = p;
 1027|  1.07k|    return 1;
 1028|  1.12k|}
tasn_dec.c:asn1_collect:
 1048|   160k|{
 1049|   160k|    const unsigned char *p, *q;
 1050|   160k|    long plen;
 1051|   160k|    char cst, ininf;
 1052|   160k|    p = *in;
 1053|   160k|    inf &= 1;
 1054|       |    /*
 1055|       |     * If no buffer and not indefinite length constructed just pass over the
 1056|       |     * encoded data
 1057|       |     */
 1058|   160k|    if (!buf && !inf) {
  ------------------
  |  Branch (1058:9): [True: 0, False: 160k]
  |  Branch (1058:17): [True: 0, False: 0]
  ------------------
 1059|      0|        *in += len;
 1060|      0|        return 1;
 1061|      0|    }
 1062|   301k|    while (len > 0) {
  ------------------
  |  Branch (1062:12): [True: 164k, False: 136k]
  ------------------
 1063|   164k|        q = p;
 1064|       |        /* Check for EOC */
 1065|   164k|        if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (1065:13): [True: 20.1k, False: 144k]
  ------------------
 1066|       |            /*
 1067|       |             * EOC is illegal outside indefinite length constructed form
 1068|       |             */
 1069|  20.1k|            if (!inf) {
  ------------------
  |  Branch (1069:17): [True: 234, False: 19.9k]
  ------------------
 1070|    234|                ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|    234|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    234|    (ERR_new(),                                                 \
  |  |  |  |  404|    234|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    234|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    234|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    234|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    234|     ERR_set_error)
  |  |  ------------------
  ------------------
 1071|    234|                return 0;
 1072|    234|            }
 1073|  19.9k|            inf = 0;
 1074|  19.9k|            break;
 1075|  20.1k|        }
 1076|       |
 1077|   144k|        if (!asn1_check_tlen(&plen, NULL, NULL, &ininf, &cst, &p,
  ------------------
  |  Branch (1077:13): [True: 1.00k, False: 143k]
  ------------------
 1078|   144k|                             len, tag, aclass, 0, NULL)) {
 1079|  1.00k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  1.00k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.00k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.00k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  1.00k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  1.00k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  1.00k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.00k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1080|  1.00k|            return 0;
 1081|  1.00k|        }
 1082|       |
 1083|       |        /* If indefinite length constructed update max length */
 1084|   143k|        if (cst) {
  ------------------
  |  Branch (1084:13): [True: 10.0k, False: 133k]
  ------------------
 1085|  10.0k|            if (depth >= ASN1_MAX_STRING_NEST) {
  ------------------
  |  | 1043|  10.0k|# define ASN1_MAX_STRING_NEST 5
  ------------------
  |  Branch (1085:17): [True: 13, False: 10.0k]
  ------------------
 1086|     13|                ERR_raise(ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING);
  ------------------
  |  |  401|     13|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     13|    (ERR_new(),                                                 \
  |  |  |  |  404|     13|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     13|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     13|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     13|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     13|     ERR_set_error)
  |  |  ------------------
  ------------------
 1087|     13|                return 0;
 1088|     13|            }
 1089|  10.0k|            if (!asn1_collect(buf, &p, plen, ininf, tag, aclass, depth + 1))
  ------------------
  |  Branch (1089:17): [True: 2.84k, False: 7.16k]
  ------------------
 1090|  2.84k|                return 0;
 1091|   133k|        } else if (plen && !collect_data(buf, &p, plen))
  ------------------
  |  Branch (1091:20): [True: 128k, False: 4.33k]
  |  Branch (1091:28): [True: 0, False: 128k]
  ------------------
 1092|      0|            return 0;
 1093|   140k|        len -= p - q;
 1094|   140k|    }
 1095|   156k|    if (inf) {
  ------------------
  |  Branch (1095:9): [True: 72, False: 156k]
  ------------------
 1096|     72|        ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|     72|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     72|    (ERR_new(),                                                 \
  |  |  |  |  404|     72|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     72|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     72|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     72|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     72|     ERR_set_error)
  |  |  ------------------
  ------------------
 1097|     72|        return 0;
 1098|     72|    }
 1099|   156k|    *in = p;
 1100|   156k|    return 1;
 1101|   156k|}
tasn_dec.c:collect_data:
 1104|   128k|{
 1105|   128k|    int len;
 1106|   128k|    if (buf) {
  ------------------
  |  Branch (1106:9): [True: 128k, False: 0]
  ------------------
 1107|   128k|        len = buf->length;
 1108|   128k|        if (!BUF_MEM_grow_clean(buf, len + plen)) {
  ------------------
  |  Branch (1108:13): [True: 0, False: 128k]
  ------------------
 1109|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1110|      0|            return 0;
 1111|      0|        }
 1112|   128k|        memcpy(buf->data + len, *p, plen);
 1113|   128k|    }
 1114|   128k|    *p += plen;
 1115|   128k|    return 1;
 1116|   128k|}
tasn_dec.c:asn1_ex_c2i:
  833|  2.17M|{
  834|  2.17M|    ASN1_VALUE **opval = NULL;
  835|  2.17M|    ASN1_STRING *stmp;
  836|  2.17M|    ASN1_TYPE *typ = NULL;
  837|  2.17M|    int ret = 0;
  838|  2.17M|    const ASN1_PRIMITIVE_FUNCS *pf;
  839|  2.17M|    ASN1_INTEGER **tint;
  840|  2.17M|    pf = it->funcs;
  841|       |
  842|  2.17M|    if (pf && pf->prim_c2i)
  ------------------
  |  Branch (842:9): [True: 15.8k, False: 2.15M]
  |  Branch (842:15): [True: 15.8k, False: 0]
  ------------------
  843|  15.8k|        return pf->prim_c2i(pval, cont, len, utype, free_cont, it);
  844|       |    /* If ANY type clear type and set pointer to internal value */
  845|  2.15M|    if (it->utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  2.15M|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (845:9): [True: 433k, False: 1.72M]
  ------------------
  846|   433k|        if (*pval == NULL) {
  ------------------
  |  Branch (846:13): [True: 432k, False: 150]
  ------------------
  847|   432k|            typ = ASN1_TYPE_new();
  848|   432k|            if (typ == NULL)
  ------------------
  |  Branch (848:17): [True: 0, False: 432k]
  ------------------
  849|      0|                goto err;
  850|   432k|            *pval = (ASN1_VALUE *)typ;
  851|   432k|        } else
  852|    150|            typ = (ASN1_TYPE *)*pval;
  853|       |
  854|   433k|        if (utype != typ->type)
  ------------------
  |  Branch (854:13): [True: 433k, False: 0]
  ------------------
  855|   433k|            ASN1_TYPE_set(typ, utype, NULL);
  856|   433k|        opval = pval;
  857|   433k|        pval = &typ->value.asn1_value;
  858|   433k|    }
  859|  2.15M|    switch (utype) {
  860|   845k|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|   845k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (860:5): [True: 845k, False: 1.31M]
  ------------------
  861|   845k|        if (!ossl_c2i_ASN1_OBJECT((ASN1_OBJECT **)pval, &cont, len))
  ------------------
  |  Branch (861:13): [True: 1.07k, False: 844k]
  ------------------
  862|  1.07k|            goto err;
  863|   844k|        break;
  864|       |
  865|   844k|    case V_ASN1_NULL:
  ------------------
  |  |   67|  9.56k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (865:5): [True: 9.56k, False: 2.14M]
  ------------------
  866|  9.56k|        if (len) {
  ------------------
  |  Branch (866:13): [True: 7, False: 9.55k]
  ------------------
  867|      7|            ERR_raise(ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      7|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      7|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      7|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      7|     ERR_set_error)
  |  |  ------------------
  ------------------
  868|      7|            goto err;
  869|      7|        }
  870|  9.55k|        *pval = (ASN1_VALUE *)1;
  871|  9.55k|        break;
  872|       |
  873|  7.30k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|  7.30k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (873:5): [True: 7.30k, False: 2.14M]
  ------------------
  874|  7.30k|        if (len != 1) {
  ------------------
  |  Branch (874:13): [True: 185, False: 7.12k]
  ------------------
  875|    185|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH);
  ------------------
  |  |  401|    185|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    185|    (ERR_new(),                                                 \
  |  |  |  |  404|    185|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    185|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    185|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    185|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    185|     ERR_set_error)
  |  |  ------------------
  ------------------
  876|    185|            goto err;
  877|  7.12k|        } else {
  878|  7.12k|            ASN1_BOOLEAN *tbool;
  879|  7.12k|            tbool = (ASN1_BOOLEAN *)pval;
  880|  7.12k|            *tbool = *cont;
  881|  7.12k|        }
  882|  7.12k|        break;
  883|       |
  884|   172k|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   65|   172k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (884:5): [True: 172k, False: 1.98M]
  ------------------
  885|   172k|        if (!ossl_c2i_ASN1_BIT_STRING((ASN1_BIT_STRING **)pval, &cont, len))
  ------------------
  |  Branch (885:13): [True: 1.21k, False: 171k]
  ------------------
  886|  1.21k|            goto err;
  887|   171k|        break;
  888|       |
  889|   171k|    case V_ASN1_INTEGER:
  ------------------
  |  |   64|   108k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (889:5): [True: 108k, False: 2.04M]
  ------------------
  890|   127k|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   72|   127k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (890:5): [True: 19.4k, False: 2.13M]
  ------------------
  891|   127k|        tint = (ASN1_INTEGER **)pval;
  892|   127k|        if (!ossl_c2i_ASN1_INTEGER(tint, &cont, len))
  ------------------
  |  Branch (892:13): [True: 992, False: 126k]
  ------------------
  893|    992|            goto err;
  894|       |        /* Fixup type to match the expected form */
  895|   126k|        (*tint)->type = utype | ((*tint)->type & V_ASN1_NEG);
  ------------------
  |  |   97|   126k|# define V_ASN1_NEG                      0x100
  ------------------
  896|   126k|        break;
  897|       |
  898|   100k|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   66|   100k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (898:5): [True: 100k, False: 2.05M]
  ------------------
  899|   112k|    case V_ASN1_NUMERICSTRING:
  ------------------
  |  |   76|   112k|# define V_ASN1_NUMERICSTRING            18 /**/
  ------------------
  |  Branch (899:5): [True: 11.4k, False: 2.14M]
  ------------------
  900|   140k|    case V_ASN1_PRINTABLESTRING:
  ------------------
  |  |   77|   140k|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  |  Branch (900:5): [True: 28.0k, False: 2.12M]
  ------------------
  901|   140k|    case V_ASN1_T61STRING:
  ------------------
  |  |   78|   140k|# define V_ASN1_T61STRING                20
  ------------------
  |  Branch (901:5): [True: 291, False: 2.15M]
  ------------------
  902|   140k|    case V_ASN1_VIDEOTEXSTRING:
  ------------------
  |  |   80|   140k|# define V_ASN1_VIDEOTEXSTRING           21 /**/
  ------------------
  |  Branch (902:5): [True: 21, False: 2.15M]
  ------------------
  903|   195k|    case V_ASN1_IA5STRING:
  ------------------
  |  |   81|   195k|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (903:5): [True: 55.1k, False: 2.10M]
  ------------------
  904|   357k|    case V_ASN1_UTCTIME:
  ------------------
  |  |   82|   357k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (904:5): [True: 161k, False: 1.99M]
  ------------------
  905|   357k|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   83|   357k|# define V_ASN1_GENERALIZEDTIME          24 /**/
  ------------------
  |  Branch (905:5): [True: 403, False: 2.15M]
  ------------------
  906|   357k|    case V_ASN1_GRAPHICSTRING:
  ------------------
  |  |   84|   357k|# define V_ASN1_GRAPHICSTRING            25 /**/
  ------------------
  |  Branch (906:5): [True: 326, False: 2.15M]
  ------------------
  907|   357k|    case V_ASN1_VISIBLESTRING:
  ------------------
  |  |   86|   357k|# define V_ASN1_VISIBLESTRING            26/* alias */
  ------------------
  |  Branch (907:5): [True: 14, False: 2.15M]
  ------------------
  908|   357k|    case V_ASN1_GENERALSTRING:
  ------------------
  |  |   87|   357k|# define V_ASN1_GENERALSTRING            27 /**/
  ------------------
  |  Branch (908:5): [True: 148, False: 2.15M]
  ------------------
  909|   368k|    case V_ASN1_UNIVERSALSTRING:
  ------------------
  |  |   88|   368k|# define V_ASN1_UNIVERSALSTRING          28 /**/
  ------------------
  |  Branch (909:5): [True: 10.3k, False: 2.14M]
  ------------------
  910|   410k|    case V_ASN1_BMPSTRING:
  ------------------
  |  |   89|   410k|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (910:5): [True: 42.1k, False: 2.11M]
  ------------------
  911|   412k|    case V_ASN1_UTF8STRING:
  ------------------
  |  |   73|   412k|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (911:5): [True: 2.31k, False: 2.15M]
  ------------------
  912|   417k|    case V_ASN1_OTHER:
  ------------------
  |  |   57|   417k|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  |  Branch (912:5): [True: 4.47k, False: 2.15M]
  ------------------
  913|   706k|    case V_ASN1_SET:
  ------------------
  |  |   75|   706k|# define V_ASN1_SET                      17
  ------------------
  |  Branch (913:5): [True: 289k, False: 1.86M]
  ------------------
  914|   743k|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|   743k|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (914:5): [True: 36.6k, False: 2.11M]
  ------------------
  915|   992k|    default:
  ------------------
  |  Branch (915:5): [True: 249k, False: 1.90M]
  ------------------
  916|   992k|        if (utype == V_ASN1_BMPSTRING && (len & 1)) {
  ------------------
  |  |   89|  1.98M|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (916:13): [True: 42.1k, False: 950k]
  |  Branch (916:42): [True: 10, False: 42.1k]
  ------------------
  917|     10|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     10|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     10|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     10|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     10|     ERR_set_error)
  |  |  ------------------
  ------------------
  918|     10|            goto err;
  919|     10|        }
  920|   992k|        if (utype == V_ASN1_UNIVERSALSTRING && (len & 3)) {
  ------------------
  |  |   88|  1.98M|# define V_ASN1_UNIVERSALSTRING          28 /**/
  ------------------
  |  Branch (920:13): [True: 10.3k, False: 982k]
  |  Branch (920:48): [True: 3, False: 10.3k]
  ------------------
  921|      3|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
  922|      3|            goto err;
  923|      3|        }
  924|   992k|        if (utype == V_ASN1_GENERALIZEDTIME && (len < 15)) {
  ------------------
  |  |   83|  1.98M|# define V_ASN1_GENERALIZEDTIME          24 /**/
  ------------------
  |  Branch (924:13): [True: 403, False: 992k]
  |  Branch (924:48): [True: 42, False: 361]
  ------------------
  925|     42|            ERR_raise(ERR_LIB_ASN1, ASN1_R_GENERALIZEDTIME_IS_TOO_SHORT);
  ------------------
  |  |  401|     42|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     42|    (ERR_new(),                                                 \
  |  |  |  |  404|     42|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     42|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     42|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     42|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     42|     ERR_set_error)
  |  |  ------------------
  ------------------
  926|     42|            goto err;
  927|     42|        }
  928|   992k|        if (utype == V_ASN1_UTCTIME && (len < 13)) {
  ------------------
  |  |   82|  1.98M|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (928:13): [True: 161k, False: 831k]
  |  Branch (928:40): [True: 27, False: 161k]
  ------------------
  929|     27|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UTCTIME_IS_TOO_SHORT);
  ------------------
  |  |  401|     27|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     27|    (ERR_new(),                                                 \
  |  |  |  |  404|     27|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     27|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     27|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     27|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     27|     ERR_set_error)
  |  |  ------------------
  ------------------
  930|     27|            goto err;
  931|     27|        }
  932|       |        /* All based on ASN1_STRING and handled the same */
  933|   992k|        if (*pval == NULL) {
  ------------------
  |  Branch (933:13): [True: 350k, False: 642k]
  ------------------
  934|   350k|            stmp = ASN1_STRING_type_new(utype);
  935|   350k|            if (stmp == NULL) {
  ------------------
  |  Branch (935:17): [True: 0, False: 350k]
  ------------------
  936|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  937|      0|                goto err;
  938|      0|            }
  939|   350k|            *pval = (ASN1_VALUE *)stmp;
  940|   642k|        } else {
  941|   642k|            stmp = (ASN1_STRING *)*pval;
  942|   642k|            stmp->type = utype;
  943|   642k|        }
  944|       |        /* If we've already allocated a buffer use it */
  945|   992k|        if (*free_cont) {
  ------------------
  |  Branch (945:13): [True: 130k, False: 862k]
  ------------------
  946|   130k|            ASN1_STRING_set0(stmp, (unsigned char *)cont /* UGLY CAST! */, len);
  947|   130k|            *free_cont = 0;
  948|   862k|        } else {
  949|   862k|            if (!ASN1_STRING_set(stmp, cont, len)) {
  ------------------
  |  Branch (949:17): [True: 0, False: 862k]
  ------------------
  950|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  951|      0|                ASN1_STRING_free(stmp);
  952|      0|                *pval = NULL;
  953|      0|                goto err;
  954|      0|            }
  955|   862k|        }
  956|   992k|        break;
  957|  2.15M|    }
  958|       |    /* If ASN1_ANY and NULL type fix up value */
  959|  2.15M|    if (typ && (utype == V_ASN1_NULL))
  ------------------
  |  |   67|   432k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (959:9): [True: 432k, False: 1.71M]
  |  Branch (959:16): [True: 9.55k, False: 423k]
  ------------------
  960|  9.55k|        typ->value.ptr = NULL;
  961|       |
  962|  2.15M|    ret = 1;
  963|  2.15M| err:
  964|  2.15M|    if (!ret) {
  ------------------
  |  Branch (964:9): [True: 3.55k, False: 2.15M]
  ------------------
  965|  3.55k|        ASN1_TYPE_free(typ);
  966|  3.55k|        if (opval)
  ------------------
  |  Branch (966:13): [True: 132, False: 3.42k]
  ------------------
  967|    132|            *opval = NULL;
  968|  3.55k|    }
  969|  2.15M|    return ret;
  970|  2.15M|}
tasn_dec.c:asn1_check_tlen:
 1145|  10.3M|{
 1146|  10.3M|    int i;
 1147|  10.3M|    int ptag, pclass;
 1148|  10.3M|    long plen;
 1149|  10.3M|    const unsigned char *p, *q;
 1150|  10.3M|    p = *in;
 1151|  10.3M|    q = p;
 1152|       |
 1153|  10.3M|    if (len <= 0) {
  ------------------
  |  Branch (1153:9): [True: 9, False: 10.3M]
  ------------------
 1154|      9|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|      9|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      9|    (ERR_new(),                                                 \
  |  |  |  |  404|      9|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      9|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      9|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      9|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      9|     ERR_set_error)
  |  |  ------------------
  ------------------
 1155|      9|        goto err;
 1156|      9|    }
 1157|  10.3M|    if (ctx != NULL && ctx->valid) {
  ------------------
  |  Branch (1157:9): [True: 7.94M, False: 2.35M]
  |  Branch (1157:24): [True: 1.30M, False: 6.64M]
  ------------------
 1158|  1.30M|        i = ctx->ret;
 1159|  1.30M|        plen = ctx->plen;
 1160|  1.30M|        pclass = ctx->pclass;
 1161|  1.30M|        ptag = ctx->ptag;
 1162|  1.30M|        p += ctx->hdrlen;
 1163|  9.00M|    } else {
 1164|  9.00M|        i = ASN1_get_object(&p, &plen, &ptag, &pclass, len);
 1165|  9.00M|        if (ctx != NULL) {
  ------------------
  |  Branch (1165:13): [True: 6.64M, False: 2.35M]
  ------------------
 1166|  6.64M|            ctx->ret = i;
 1167|  6.64M|            ctx->plen = plen;
 1168|  6.64M|            ctx->pclass = pclass;
 1169|  6.64M|            ctx->ptag = ptag;
 1170|  6.64M|            ctx->hdrlen = p - q;
 1171|  6.64M|            ctx->valid = 1;
 1172|       |            /*
 1173|       |             * If definite length, and no error, length + header can't exceed
 1174|       |             * total amount of data available.
 1175|       |             */
 1176|  6.64M|            if ((i & 0x81) == 0 && (plen + ctx->hdrlen) > len) {
  ------------------
  |  Branch (1176:17): [True: 5.89M, False: 749k]
  |  Branch (1176:36): [True: 0, False: 5.89M]
  ------------------
 1177|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1178|      0|                goto err;
 1179|      0|            }
 1180|  6.64M|        }
 1181|  9.00M|    }
 1182|       |
 1183|  10.3M|    if ((i & 0x80) != 0) {
  ------------------
  |  Branch (1183:9): [True: 10.5k, False: 10.2M]
  ------------------
 1184|  10.5k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER);
  ------------------
  |  |  401|  10.5k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  10.5k|    (ERR_new(),                                                 \
  |  |  |  |  404|  10.5k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  10.5k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  10.5k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  10.5k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  10.5k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1185|  10.5k|        goto err;
 1186|  10.5k|    }
 1187|  10.2M|    if (exptag >= 0) {
  ------------------
  |  Branch (1187:9): [True: 6.93M, False: 3.35M]
  ------------------
 1188|  6.93M|        if (exptag != ptag || expclass != pclass) {
  ------------------
  |  Branch (1188:13): [True: 305k, False: 6.62M]
  |  Branch (1188:31): [True: 1.89k, False: 6.62M]
  ------------------
 1189|       |            /*
 1190|       |             * If type is OPTIONAL, not an error: indicate missing type.
 1191|       |             */
 1192|   307k|            if (opt != 0)
  ------------------
  |  Branch (1192:17): [True: 301k, False: 6.10k]
  ------------------
 1193|   301k|                return -1;
 1194|   307k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_TAG);
  ------------------
  |  |  401|  6.10k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  6.10k|    (ERR_new(),                                                 \
  |  |  |  |  404|  6.10k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  6.10k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  6.10k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  6.10k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  6.10k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1195|  6.10k|            goto err;
 1196|   307k|        }
 1197|       |        /*
 1198|       |         * We have a tag and class match: assume we are going to do something
 1199|       |         * with it
 1200|       |         */
 1201|  6.62M|        asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  6.62M|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 6.62M, False: 0]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1202|  6.62M|    }
 1203|       |
 1204|  9.98M|    if ((i & 1) != 0)
  ------------------
  |  Branch (1204:9): [True: 792k, False: 9.19M]
  ------------------
 1205|   792k|        plen = len - (p - q);
 1206|       |
 1207|  9.98M|    if (inf != NULL)
  ------------------
  |  Branch (1207:9): [True: 8.98M, False: 1.00M]
  ------------------
 1208|  8.98M|        *inf = i & 1;
 1209|       |
 1210|  9.98M|    if (cst != NULL)
  ------------------
  |  Branch (1210:9): [True: 3.46M, False: 6.52M]
  ------------------
 1211|  3.46M|        *cst = i & V_ASN1_CONSTRUCTED;
  ------------------
  |  |   52|  3.46M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
 1212|       |
 1213|  9.98M|    if (olen != NULL)
  ------------------
  |  Branch (1213:9): [True: 8.98M, False: 1.00M]
  ------------------
 1214|  8.98M|        *olen = plen;
 1215|       |
 1216|  9.98M|    if (oclass != NULL)
  ------------------
  |  Branch (1216:9): [True: 1.00M, False: 8.98M]
  ------------------
 1217|  1.00M|        *oclass = pclass;
 1218|       |
 1219|  9.98M|    if (otag != NULL)
  ------------------
  |  Branch (1219:9): [True: 1.00M, False: 8.98M]
  ------------------
 1220|  1.00M|        *otag = ptag;
 1221|       |
 1222|  9.98M|    *in = p;
 1223|  9.98M|    return 1;
 1224|       |
 1225|  16.6k| err:
 1226|  16.6k|    asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  16.6k|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 15.5k, False: 1.05k]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1227|  16.6k|    return 0;
 1228|  10.2M|}
tasn_dec.c:asn1_check_eoc:
 1121|  9.75M|{
 1122|  9.75M|    const unsigned char *p;
 1123|       |
 1124|  9.75M|    if (len < 2)
  ------------------
  |  Branch (1124:9): [True: 2.44k, False: 9.75M]
  ------------------
 1125|  2.44k|        return 0;
 1126|  9.75M|    p = *in;
 1127|  9.75M|    if (p[0] == '\0' && p[1] == '\0') {
  ------------------
  |  Branch (1127:9): [True: 756k, False: 9.00M]
  |  Branch (1127:25): [True: 735k, False: 21.0k]
  ------------------
 1128|   735k|        *in += 2;
 1129|   735k|        return 1;
 1130|   735k|    }
 1131|  9.02M|    return 0;
 1132|  9.75M|}

ASN1_item_i2d:
   44|  22.0k|{
   45|  22.0k|    return asn1_item_flags_i2d(val, out, it, 0);
   46|  22.0k|}
ASN1_item_ex_i2d:
   83|  12.7M|{
   84|  12.7M|    const ASN1_TEMPLATE *tt = NULL;
   85|  12.7M|    int i, seqcontlen, seqlen, ndef = 1;
   86|  12.7M|    const ASN1_EXTERN_FUNCS *ef;
   87|  12.7M|    const ASN1_AUX *aux = it->funcs;
   88|  12.7M|    ASN1_aux_const_cb *asn1_cb = NULL;
   89|       |
   90|  12.7M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
  ------------------
  |  |   80|  12.7M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (90:9): [True: 5.80M, False: 6.90M]
  |  Branch (90:48): [True: 14.5k, False: 5.79M]
  ------------------
   91|  14.5k|        return 0;
   92|       |
   93|  12.7M|    if (aux != NULL) {
  ------------------
  |  Branch (93:9): [True: 192k, False: 12.5M]
  ------------------
   94|   192k|        asn1_cb = ((aux->flags & ASN1_AFLG_CONST_CB) != 0) ? aux->asn1_const_cb
  ------------------
  |  |  738|   192k|# define ASN1_AFLG_CONST_CB      8
  ------------------
  |  Branch (94:19): [True: 0, False: 192k]
  ------------------
   95|   192k|            : (ASN1_aux_const_cb *)aux->asn1_cb; /* backward compatibility */
   96|   192k|    }
   97|       |
   98|  12.7M|    switch (it->itype) {
   99|       |
  100|  6.90M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  6.90M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (100:5): [True: 6.90M, False: 5.79M]
  ------------------
  101|  6.90M|        if (it->templates)
  ------------------
  |  Branch (101:13): [True: 800k, False: 6.10M]
  ------------------
  102|   800k|            return asn1_template_ex_i2d(pval, out, it->templates,
  103|   800k|                                        tag, aclass);
  104|  6.10M|        return asn1_i2d_ex_primitive(pval, out, it, tag, aclass);
  105|       |
  106|  2.99M|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|  2.99M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (106:5): [True: 2.99M, False: 9.70M]
  ------------------
  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|  2.99M|        if (tag != -1) {
  ------------------
  |  Branch (111:13): [True: 0, False: 2.99M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  113|      0|            return -1;
  114|      0|        }
  115|  2.99M|        return asn1_i2d_ex_primitive(pval, out, it, -1, aclass);
  116|       |
  117|   232k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   232k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (117:5): [True: 232k, False: 12.4M]
  ------------------
  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|   232k|        if (tag != -1) {
  ------------------
  |  Branch (122:13): [True: 0, False: 232k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  124|      0|            return -1;
  125|      0|        }
  126|   232k|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
  ------------------
  |  |  748|  30.4k|# define ASN1_OP_I2D_PRE         6
  ------------------
  |  Branch (126:13): [True: 30.4k, False: 202k]
  |  Branch (126:24): [True: 0, False: 30.4k]
  ------------------
  127|      0|            return 0;
  128|   232k|        i = ossl_asn1_get_choice_selector_const(pval, it);
  129|   232k|        if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (129:13): [True: 232k, False: 0]
  |  Branch (129:25): [True: 232k, False: 0]
  ------------------
  130|   232k|            const ASN1_VALUE **pchval;
  131|   232k|            const ASN1_TEMPLATE *chtt;
  132|   232k|            chtt = it->templates + i;
  133|   232k|            pchval = ossl_asn1_get_const_field_ptr(pval, chtt);
  134|   232k|            return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass);
  135|   232k|        }
  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|  4.64k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|  4.64k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (141:5): [True: 4.64k, False: 12.6M]
  ------------------
  142|       |        /* If new style i2d it does all the work */
  143|  4.64k|        ef = it->funcs;
  144|  4.64k|        return ef->asn1_ex_i2d(pval, out, it, tag, aclass);
  145|       |
  146|  8.86k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  8.86k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (146:5): [True: 8.86k, False: 12.6M]
  ------------------
  147|       |        /* Use indefinite length constructed if requested */
  148|  8.86k|        if (aclass & ASN1_TFLG_NDEF)
  ------------------
  |  |  594|  8.86k|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (148:13): [True: 0, False: 8.86k]
  ------------------
  149|      0|            ndef = 2;
  150|       |        /* fall through */
  151|       |
  152|  2.55M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  2.55M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (152:5): [True: 2.54M, False: 10.1M]
  ------------------
  153|  2.55M|        i = ossl_asn1_enc_restore(&seqcontlen, out, pval, it);
  154|       |        /* An error occurred */
  155|  2.55M|        if (i < 0)
  ------------------
  |  Branch (155:13): [True: 0, False: 2.55M]
  ------------------
  156|      0|            return 0;
  157|       |        /* We have a valid cached encoding... */
  158|  2.55M|        if (i > 0)
  ------------------
  |  Branch (158:13): [True: 59.1k, False: 2.49M]
  ------------------
  159|  59.1k|            return seqcontlen;
  160|       |        /* Otherwise carry on */
  161|  2.49M|        seqcontlen = 0;
  162|       |        /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */
  163|  2.49M|        if (tag == -1) {
  ------------------
  |  Branch (163:13): [True: 2.46M, False: 32.6k]
  ------------------
  164|  2.46M|            tag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  2.46M|# define V_ASN1_SEQUENCE                 16
  ------------------
  165|       |            /* Retain any other flags in aclass */
  166|  2.46M|            aclass = (aclass & ~ASN1_TFLG_TAG_CLASS)
  ------------------
  |  |  575|  2.46M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  167|  2.46M|                | V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  2.46M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  168|  2.46M|        }
  169|  2.49M|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
  ------------------
  |  |  748|  63.8k|# define ASN1_OP_I2D_PRE         6
  ------------------
  |  Branch (169:13): [True: 63.8k, False: 2.43M]
  |  Branch (169:24): [True: 0, False: 63.8k]
  ------------------
  170|      0|            return 0;
  171|       |        /* First work out sequence content length */
  172|  7.63M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (172:41): [True: 5.13M, False: 2.49M]
  ------------------
  173|  5.13M|            const ASN1_TEMPLATE *seqtt;
  174|  5.13M|            const ASN1_VALUE **pseqval;
  175|  5.13M|            int tmplen;
  176|  5.13M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  177|  5.13M|            if (!seqtt)
  ------------------
  |  Branch (177:17): [True: 0, False: 5.13M]
  ------------------
  178|      0|                return 0;
  179|  5.13M|            pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
  180|  5.13M|            tmplen = asn1_template_ex_i2d(pseqval, NULL, seqtt, -1, aclass);
  181|  5.13M|            if (tmplen == -1 || (tmplen > INT_MAX - seqcontlen))
  ------------------
  |  Branch (181:17): [True: 0, False: 5.13M]
  |  Branch (181:33): [True: 0, False: 5.13M]
  ------------------
  182|      0|                return -1;
  183|  5.13M|            seqcontlen += tmplen;
  184|  5.13M|        }
  185|       |
  186|  2.49M|        seqlen = ASN1_object_size(ndef, seqcontlen, tag);
  187|  2.49M|        if (!out || seqlen == -1)
  ------------------
  |  Branch (187:13): [True: 1.73M, False: 766k]
  |  Branch (187:21): [True: 0, False: 766k]
  ------------------
  188|  1.73M|            return seqlen;
  189|       |        /* Output SEQUENCE header */
  190|   766k|        ASN1_put_object(out, ndef, seqcontlen, tag, aclass);
  191|  2.33M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (191:41): [True: 1.57M, False: 766k]
  ------------------
  192|  1.57M|            const ASN1_TEMPLATE *seqtt;
  193|  1.57M|            const ASN1_VALUE **pseqval;
  194|  1.57M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  195|  1.57M|            if (!seqtt)
  ------------------
  |  Branch (195:17): [True: 0, False: 1.57M]
  ------------------
  196|      0|                return 0;
  197|  1.57M|            pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
  198|       |            /* FIXME: check for errors in enhanced version */
  199|  1.57M|            asn1_template_ex_i2d(pseqval, out, seqtt, -1, aclass);
  200|  1.57M|        }
  201|   766k|        if (ndef == 2)
  ------------------
  |  Branch (201:13): [True: 0, False: 766k]
  ------------------
  202|      0|            ASN1_put_eoc(out);
  203|   766k|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL))
  ------------------
  |  |  749|  24.1k|# define ASN1_OP_I2D_POST        7
  ------------------
  |  Branch (203:13): [True: 24.1k, False: 742k]
  |  Branch (203:24): [True: 0, False: 24.1k]
  ------------------
  204|      0|            return 0;
  205|   766k|        return seqlen;
  206|       |
  207|      0|    default:
  ------------------
  |  Branch (207:5): [True: 0, False: 12.7M]
  ------------------
  208|      0|        return 0;
  209|       |
  210|  12.7M|    }
  211|      0|    return 0;
  212|  12.7M|}
tasn_enc.c:asn1_item_flags_i2d:
   57|  22.0k|{
   58|  22.0k|    if (out != NULL && *out == NULL) {
  ------------------
  |  Branch (58:9): [True: 21.5k, False: 438]
  |  Branch (58:24): [True: 21.5k, False: 0]
  ------------------
   59|  21.5k|        unsigned char *p, *buf;
   60|  21.5k|        int len;
   61|       |
   62|  21.5k|        len = ASN1_item_ex_i2d(&val, NULL, it, -1, flags);
   63|  21.5k|        if (len <= 0)
  ------------------
  |  Branch (63:13): [True: 0, False: 21.5k]
  ------------------
   64|      0|            return len;
   65|  21.5k|        if ((buf = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  102|  21.5k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  21.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  21.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (65:13): [True: 0, False: 21.5k]
  ------------------
   66|      0|            return -1;
   67|  21.5k|        p = buf;
   68|  21.5k|        ASN1_item_ex_i2d(&val, &p, it, -1, flags);
   69|  21.5k|        *out = buf;
   70|  21.5k|        return len;
   71|  21.5k|    }
   72|       |
   73|    438|    return ASN1_item_ex_i2d(&val, out, it, -1, flags);
   74|  22.0k|}
tasn_enc.c:asn1_template_ex_i2d:
  216|  7.74M|{
  217|  7.74M|    const int flags = tt->flags;
  218|  7.74M|    int i, ret, ttag, tclass, ndef, len;
  219|  7.74M|    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|  7.74M|    if (flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  597|  7.74M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  |  Branch (225:9): [True: 211k, False: 7.52M]
  ------------------
  226|   211k|        tval = (ASN1_VALUE *)pval;
  227|   211k|        pval = &tval;
  228|   211k|    }
  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|  7.74M|    if (flags & ASN1_TFLG_TAG_MASK) {
  ------------------
  |  |  552|  7.74M|# define ASN1_TFLG_TAG_MASK      (0x3 << 3)
  ------------------
  |  Branch (236:9): [True: 284k, False: 7.45M]
  ------------------
  237|       |        /* Error if argument and template tagging */
  238|   284k|        if (tag != -1)
  ------------------
  |  Branch (238:13): [True: 0, False: 284k]
  ------------------
  239|       |            /* FIXME: error code here */
  240|      0|            return -1;
  241|       |        /* Get tagging from template */
  242|   284k|        ttag = tt->tag;
  243|   284k|        tclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|   284k|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  244|  7.45M|    } else if (tag != -1) {
  ------------------
  |  Branch (244:16): [True: 0, False: 7.45M]
  ------------------
  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|  7.45M|    } else {
  249|  7.45M|        ttag = -1;
  250|  7.45M|        tclass = 0;
  251|  7.45M|    }
  252|       |    /*
  253|       |     * Remove any class mask from iflag.
  254|       |     */
  255|  7.74M|    iclass &= ~ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  7.74M|# 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|  7.74M|    if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF))
  ------------------
  |  |  594|  7.74M|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
                  if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF))
  ------------------
  |  |  594|  3.98k|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (263:9): [True: 3.98k, False: 7.73M]
  |  Branch (263:37): [True: 0, False: 3.98k]
  ------------------
  264|      0|        ndef = 2;
  265|  7.74M|    else
  266|  7.74M|        ndef = 1;
  267|       |
  268|  7.74M|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  7.74M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (268:9): [True: 844k, False: 6.89M]
  ------------------
  269|       |        /* SET OF, SEQUENCE OF */
  270|   844k|        STACK_OF(const_ASN1_VALUE) *sk = (STACK_OF(const_ASN1_VALUE) *)*pval;
  ------------------
  |  |   31|   844k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  271|   844k|        int isset, sktag, skaclass;
  272|   844k|        int skcontlen, sklen;
  273|   844k|        const ASN1_VALUE *skitem;
  274|       |
  275|   844k|        if (*pval == NULL)
  ------------------
  |  Branch (275:13): [True: 18.2k, False: 826k]
  ------------------
  276|  18.2k|            return 0;
  277|       |
  278|   826k|        if (flags & ASN1_TFLG_SET_OF) {
  ------------------
  |  |  526|   826k|# define ASN1_TFLG_SET_OF        (0x1 << 1)
  ------------------
  |  Branch (278:13): [True: 816k, False: 10.3k]
  ------------------
  279|   816k|            isset = 1;
  280|       |            /* 2 means we reorder */
  281|   816k|            if (flags & ASN1_TFLG_SEQUENCE_OF)
  ------------------
  |  |  529|   816k|# define ASN1_TFLG_SEQUENCE_OF   (0x2 << 1)
  ------------------
  |  Branch (281:17): [True: 0, False: 816k]
  ------------------
  282|      0|                isset = 2;
  283|   816k|        } else
  284|  10.3k|            isset = 0;
  285|       |
  286|       |        /*
  287|       |         * Work out inner tag value: if EXPLICIT or no tagging use underlying
  288|       |         * type.
  289|       |         */
  290|   826k|        if ((ttag != -1) && !(flags & ASN1_TFLG_EXPTAG)) {
  ------------------
  |  |  550|  4.61k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (290:13): [True: 4.61k, False: 822k]
  |  Branch (290:29): [True: 4.61k, False: 0]
  ------------------
  291|  4.61k|            sktag = ttag;
  292|  4.61k|            skaclass = tclass;
  293|   822k|        } else {
  294|   822k|            skaclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|   822k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  295|   822k|            if (isset)
  ------------------
  |  Branch (295:17): [True: 811k, False: 10.3k]
  ------------------
  296|   811k|                sktag = V_ASN1_SET;
  ------------------
  |  |   75|   811k|# define V_ASN1_SET                      17
  ------------------
  297|  10.3k|            else
  298|  10.3k|                sktag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  10.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  299|   822k|        }
  300|       |
  301|       |        /* Determine total length of items */
  302|   826k|        skcontlen = 0;
  303|  4.91M|        for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  Branch (303:21): [True: 4.08M, False: 826k]
  ------------------
  304|  4.08M|            skitem = sk_const_ASN1_VALUE_value(sk, i);
  305|  4.08M|            len = ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  421|  4.08M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  306|  4.08M|                                   -1, iclass);
  307|  4.08M|            if (len == -1 || (skcontlen > INT_MAX - len))
  ------------------
  |  Branch (307:17): [True: 0, False: 4.08M]
  |  Branch (307:30): [True: 0, False: 4.08M]
  ------------------
  308|      0|                return -1;
  309|  4.08M|            if (len == 0 && (tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|      0|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (309:17): [True: 0, False: 4.08M]
  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  311|      0|                return -1;
  312|      0|            }
  313|  4.08M|            skcontlen += len;
  314|  4.08M|        }
  315|   826k|        sklen = ASN1_object_size(ndef, skcontlen, sktag);
  316|   826k|        if (sklen == -1)
  ------------------
  |  Branch (316:13): [True: 0, False: 826k]
  ------------------
  317|      0|            return -1;
  318|       |        /* If EXPLICIT need length of surrounding tag */
  319|   826k|        if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  550|   826k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (319:13): [True: 0, False: 826k]
  ------------------
  320|      0|            ret = ASN1_object_size(ndef, sklen, ttag);
  321|   826k|        else
  322|   826k|            ret = sklen;
  323|       |
  324|   826k|        if (!out || ret == -1)
  ------------------
  |  Branch (324:13): [True: 464k, False: 362k]
  |  Branch (324:21): [True: 0, False: 362k]
  ------------------
  325|   464k|            return ret;
  326|       |
  327|       |        /* Now encode this lot... */
  328|       |        /* EXPLICIT tag */
  329|   362k|        if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  550|   362k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (329:13): [True: 0, False: 362k]
  ------------------
  330|      0|            ASN1_put_object(out, ndef, sklen, ttag, tclass);
  331|       |        /* SET or SEQUENCE and IMPLICIT tag */
  332|   362k|        ASN1_put_object(out, ndef, skcontlen, sktag, skaclass);
  333|       |        /* And the stuff itself */
  334|   362k|        asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  421|   362k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  335|   362k|                         isset, iclass);
  336|   362k|        if (ndef == 2) {
  ------------------
  |  Branch (336:13): [True: 0, False: 362k]
  ------------------
  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|   362k|        return ret;
  343|   826k|    }
  344|       |
  345|  6.89M|    if (flags & ASN1_TFLG_EXPTAG) {
  ------------------
  |  |  550|  6.89M|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (345:9): [True: 24.0k, False: 6.87M]
  ------------------
  346|       |        /* EXPLICIT tagging */
  347|       |        /* Find length of tagged item */
  348|  24.0k|        i = ASN1_item_ex_i2d(pval, NULL, ASN1_ITEM_ptr(tt->item), -1, iclass);
  ------------------
  |  |  421|  24.0k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  349|  24.0k|        if (i == 0) {
  ------------------
  |  Branch (349:13): [True: 11.2k, False: 12.7k]
  ------------------
  350|  11.2k|            if ((tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|  11.2k|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (350:17): [True: 0, False: 11.2k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  352|      0|                return -1;
  353|      0|            }
  354|  11.2k|            return 0;
  355|  11.2k|        }
  356|       |        /* Find length of EXPLICIT tag */
  357|  12.7k|        ret = ASN1_object_size(ndef, i, ttag);
  358|  12.7k|        if (out && ret != -1) {
  ------------------
  |  Branch (358:13): [True: 2.44k, False: 10.3k]
  |  Branch (358:20): [True: 2.44k, False: 0]
  ------------------
  359|       |            /* Output tag and item */
  360|  2.44k|            ASN1_put_object(out, ndef, i, ttag, tclass);
  361|  2.44k|            ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, iclass);
  ------------------
  |  |  421|  2.44k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  362|  2.44k|            if (ndef == 2)
  ------------------
  |  Branch (362:17): [True: 0, False: 2.44k]
  ------------------
  363|      0|                ASN1_put_eoc(out);
  364|  2.44k|        }
  365|  12.7k|        return ret;
  366|  24.0k|    }
  367|       |
  368|       |    /* Either normal or IMPLICIT tagging: combine class and flags */
  369|  6.87M|    len = ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  421|  6.87M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  370|  6.87M|                              ttag, tclass | iclass);
  371|  6.87M|    if (len == 0 && (tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|   127k|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (371:9): [True: 127k, False: 6.74M]
  |  Branch (371:21): [True: 0, False: 127k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  373|      0|        return -1;
  374|      0|    }
  375|  6.87M|    return len;
  376|  6.87M|}
tasn_enc.c:asn1_set_seq_out:
  403|   362k|{
  404|   362k|    int i, ret = 0;
  405|   362k|    const ASN1_VALUE *skitem;
  406|   362k|    unsigned char *tmpdat = NULL, *p = NULL;
  407|   362k|    DER_ENC *derlst = NULL, *tder;
  408|       |
  409|   362k|    if (do_sort) {
  ------------------
  |  Branch (409:9): [True: 360k, False: 1.78k]
  ------------------
  410|       |        /* Don't need to sort less than 2 items */
  411|   360k|        if (sk_const_ASN1_VALUE_num(sk) < 2)
  ------------------
  |  Branch (411:13): [True: 352k, False: 8.13k]
  ------------------
  412|   352k|            do_sort = 0;
  413|  8.13k|        else {
  414|  8.13k|            derlst = OPENSSL_malloc(sk_const_ASN1_VALUE_num(sk)
  ------------------
  |  |  102|  8.13k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  8.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  8.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  415|  8.13k|                                    * sizeof(*derlst));
  416|  8.13k|            if (derlst == NULL)
  ------------------
  |  Branch (416:17): [True: 0, False: 8.13k]
  ------------------
  417|      0|                return 0;
  418|  8.13k|            tmpdat = OPENSSL_malloc(skcontlen);
  ------------------
  |  |  102|  8.13k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  8.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  8.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  419|  8.13k|            if (tmpdat == NULL)
  ------------------
  |  Branch (419:17): [True: 0, False: 8.13k]
  ------------------
  420|      0|                goto err;
  421|  8.13k|        }
  422|   360k|    }
  423|       |    /* If not sorting just output each item */
  424|   362k|    if (!do_sort) {
  ------------------
  |  Branch (424:9): [True: 354k, False: 8.13k]
  ------------------
  425|   790k|        for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  Branch (425:21): [True: 435k, False: 354k]
  ------------------
  426|   435k|            skitem = sk_const_ASN1_VALUE_value(sk, i);
  427|   435k|            ASN1_item_ex_i2d(&skitem, out, item, -1, iclass);
  428|   435k|        }
  429|   354k|        return 1;
  430|   354k|    }
  431|  8.13k|    p = tmpdat;
  432|       |
  433|       |    /* Doing sort: build up a list of each member's DER encoding */
  434|   708k|    for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++) {
  ------------------
  |  Branch (434:32): [True: 700k, False: 8.13k]
  ------------------
  435|   700k|        skitem = sk_const_ASN1_VALUE_value(sk, i);
  436|   700k|        tder->data = p;
  437|   700k|        tder->length = ASN1_item_ex_i2d(&skitem, &p, item, -1, iclass);
  438|   700k|        tder->field = skitem;
  439|   700k|    }
  440|       |
  441|       |    /* Now sort them */
  442|  8.13k|    qsort(derlst, sk_const_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp);
  443|       |    /* Output sorted DER encoding */
  444|  8.13k|    p = *out;
  445|   708k|    for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++) {
  ------------------
  |  Branch (445:32): [True: 700k, False: 8.13k]
  ------------------
  446|   700k|        memcpy(p, tder->data, tder->length);
  447|   700k|        p += tder->length;
  448|   700k|    }
  449|  8.13k|    *out = p;
  450|       |    /* If do_sort is 2 then reorder the STACK */
  451|  8.13k|    if (do_sort == 2) {
  ------------------
  |  Branch (451:9): [True: 0, False: 8.13k]
  ------------------
  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|  8.13k|    ret = 1;
  456|  8.13k|err:
  457|  8.13k|    OPENSSL_free(derlst);
  ------------------
  |  |  115|  8.13k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  8.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  8.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  458|  8.13k|    OPENSSL_free(tmpdat);
  ------------------
  |  |  115|  8.13k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  8.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  8.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  459|  8.13k|    return ret;
  460|  8.13k|}
tasn_enc.c:der_cmp:
  387|  7.25M|{
  388|  7.25M|    const DER_ENC *d1 = a, *d2 = b;
  389|  7.25M|    int cmplen, i;
  390|  7.25M|    cmplen = (d1->length < d2->length) ? d1->length : d2->length;
  ------------------
  |  Branch (390:14): [True: 11.9k, False: 7.23M]
  ------------------
  391|  7.25M|    i = memcmp(d1->data, d2->data, cmplen);
  392|  7.25M|    if (i)
  ------------------
  |  Branch (392:9): [True: 2.94M, False: 4.30M]
  ------------------
  393|  2.94M|        return i;
  394|  4.30M|    return d1->length - d2->length;
  395|  7.25M|}
tasn_enc.c:asn1_i2d_ex_primitive:
  464|  9.10M|{
  465|  9.10M|    int len;
  466|  9.10M|    int utype;
  467|  9.10M|    int usetag;
  468|  9.10M|    int ndef = 0;
  469|       |
  470|  9.10M|    utype = it->utype;
  471|       |
  472|       |    /*
  473|       |     * Get length of content octets and maybe find out the underlying type.
  474|       |     */
  475|       |
  476|  9.10M|    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|  9.10M|    if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) ||
  ------------------
  |  |   74|  9.10M|# define V_ASN1_SEQUENCE                 16
  ------------------
                  if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) ||
  ------------------
  |  |   75|  8.92M|# define V_ASN1_SET                      17
  ------------------
  |  Branch (483:9): [True: 180k, False: 8.92M]
  |  Branch (483:39): [True: 2.30M, False: 6.61M]
  ------------------
  484|  9.10M|        (utype == V_ASN1_OTHER))
  ------------------
  |  |   57|  6.61M|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  |  Branch (484:9): [True: 18.3k, False: 6.59M]
  ------------------
  485|  2.50M|        usetag = 0;
  486|  6.59M|    else
  487|  6.59M|        usetag = 1;
  488|       |
  489|       |    /* -1 means omit type */
  490|       |
  491|  9.10M|    if (len == -1)
  ------------------
  |  Branch (491:9): [True: 123k, False: 8.98M]
  ------------------
  492|   123k|        return 0;
  493|       |
  494|       |    /* -2 return is special meaning use ndef */
  495|  8.98M|    if (len == -2) {
  ------------------
  |  Branch (495:9): [True: 0, False: 8.98M]
  ------------------
  496|      0|        ndef = 2;
  497|      0|        len = 0;
  498|      0|    }
  499|       |
  500|       |    /* If not implicitly tagged get tag from underlying type */
  501|  8.98M|    if (tag == -1)
  ------------------
  |  Branch (501:9): [True: 8.78M, False: 193k]
  ------------------
  502|  8.78M|        tag = utype;
  503|       |
  504|       |    /* Output tag+length followed by content octets */
  505|  8.98M|    if (out) {
  ------------------
  |  Branch (505:9): [True: 1.82M, False: 7.15M]
  ------------------
  506|  1.82M|        if (usetag)
  ------------------
  |  Branch (506:13): [True: 1.50M, False: 321k]
  ------------------
  507|  1.50M|            ASN1_put_object(out, ndef, len, tag, aclass);
  508|  1.82M|        asn1_ex_i2c(pval, *out, &utype, it);
  509|  1.82M|        if (ndef)
  ------------------
  |  Branch (509:13): [True: 0, False: 1.82M]
  ------------------
  510|      0|            ASN1_put_eoc(out);
  511|  1.82M|        else
  512|  1.82M|            *out += len;
  513|  1.82M|    }
  514|       |
  515|  8.98M|    if (usetag)
  ------------------
  |  Branch (515:9): [True: 6.47M, False: 2.50M]
  ------------------
  516|  6.47M|        return ASN1_object_size(ndef, len, tag);
  517|  2.50M|    return len;
  518|  8.98M|}
tasn_enc.c:asn1_ex_i2c:
  524|  10.9M|{
  525|  10.9M|    ASN1_BOOLEAN *tbool = NULL;
  526|  10.9M|    ASN1_STRING *strtmp;
  527|  10.9M|    ASN1_OBJECT *otmp;
  528|  10.9M|    int utype;
  529|  10.9M|    const unsigned char *cont;
  530|  10.9M|    unsigned char c;
  531|  10.9M|    int len;
  532|  10.9M|    const ASN1_PRIMITIVE_FUNCS *pf;
  533|  10.9M|    pf = it->funcs;
  534|  10.9M|    if (pf && pf->prim_i2c)
  ------------------
  |  Branch (534:9): [True: 39.3k, False: 10.8M]
  |  Branch (534:15): [True: 39.3k, False: 0]
  ------------------
  535|  39.3k|        return pf->prim_i2c(pval, cout, putype, it);
  536|       |
  537|       |    /* Should type be omitted? */
  538|  10.8M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE)
  ------------------
  |  |   80|  10.8M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (538:9): [True: 3.70M, False: 7.18M]
  ------------------
  539|  10.8M|        || (it->utype != V_ASN1_BOOLEAN)) {
  ------------------
  |  |   63|  7.18M|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (539:12): [True: 7.18M, False: 0]
  ------------------
  540|  10.8M|        if (*pval == NULL)
  ------------------
  |  Branch (540:13): [True: 123k, False: 10.7M]
  ------------------
  541|   123k|            return -1;
  542|  10.8M|    }
  543|       |
  544|  10.7M|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  10.7M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (544:9): [True: 3.70M, False: 7.05M]
  ------------------
  545|       |        /* If MSTRING type set the underlying type */
  546|  3.70M|        strtmp = (ASN1_STRING *)*pval;
  547|  3.70M|        utype = strtmp->type;
  548|  3.70M|        *putype = utype;
  549|  7.05M|    } else if (it->utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  7.05M|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (549:16): [True: 2.81M, False: 4.24M]
  ------------------
  550|       |        /* If ANY set type and pointer to value */
  551|  2.81M|        ASN1_TYPE *typ;
  552|  2.81M|        typ = (ASN1_TYPE *)*pval;
  553|  2.81M|        utype = typ->type;
  554|  2.81M|        *putype = utype;
  555|  2.81M|        pval = (const ASN1_VALUE **)&typ->value.asn1_value; /* actually is const */
  556|  2.81M|    } else
  557|  4.24M|        utype = *putype;
  558|       |
  559|  10.7M|    switch (utype) {
  560|  3.91M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  3.91M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (560:5): [True: 3.91M, False: 6.85M]
  ------------------
  561|  3.91M|        otmp = (ASN1_OBJECT *)*pval;
  562|  3.91M|        cont = otmp->data;
  563|  3.91M|        len = otmp->length;
  564|  3.91M|        if (cont == NULL || len == 0)
  ------------------
  |  Branch (564:13): [True: 0, False: 3.91M]
  |  Branch (564:29): [True: 0, False: 3.91M]
  ------------------
  565|      0|            return -1;
  566|  3.91M|        break;
  567|       |
  568|  3.91M|    case V_ASN1_NULL:
  ------------------
  |  |   67|  57.3k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (568:5): [True: 57.3k, False: 10.7M]
  ------------------
  569|  57.3k|        cont = NULL;
  570|  57.3k|        len = 0;
  571|  57.3k|        break;
  572|       |
  573|  4.78k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|  4.78k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (573:5): [True: 4.78k, False: 10.7M]
  ------------------
  574|  4.78k|        tbool = (ASN1_BOOLEAN *)pval;
  575|  4.78k|        if (*tbool == -1)
  ------------------
  |  Branch (575:13): [True: 0, False: 4.78k]
  ------------------
  576|      0|            return -1;
  577|  4.78k|        if (it->utype != V_ASN1_ANY) {
  ------------------
  |  |   58|  4.78k|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (577:13): [True: 0, False: 4.78k]
  ------------------
  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|  4.78k|        c = (unsigned char)*tbool;
  587|  4.78k|        cont = &c;
  588|  4.78k|        len = 1;
  589|  4.78k|        break;
  590|       |
  591|  94.1k|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   65|  94.1k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (591:5): [True: 94.1k, False: 10.6M]
  ------------------
  592|  94.1k|        return ossl_i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval,
  593|  94.1k|                                        cout ? &cout : NULL);
  ------------------
  |  Branch (593:41): [True: 21.2k, False: 72.9k]
  ------------------
  594|       |
  595|  41.3k|    case V_ASN1_INTEGER:
  ------------------
  |  |   64|  41.3k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (595:5): [True: 41.3k, False: 10.7M]
  ------------------
  596|  56.4k|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   72|  56.4k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (596:5): [True: 15.0k, False: 10.7M]
  ------------------
  597|       |        /*
  598|       |         * These are all have the same content format as ASN1_INTEGER
  599|       |         */
  600|  56.4k|        return ossl_i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : NULL);
  ------------------
  |  Branch (600:61): [True: 6.71k, False: 49.6k]
  ------------------
  601|       |
  602|  61.2k|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   66|  61.2k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (602:5): [True: 61.2k, False: 10.7M]
  ------------------
  603|   166k|    case V_ASN1_NUMERICSTRING:
  ------------------
  |  |   76|   166k|# define V_ASN1_NUMERICSTRING            18 /**/
  ------------------
  |  Branch (603:5): [True: 104k, False: 10.6M]
  ------------------
  604|   183k|    case V_ASN1_PRINTABLESTRING:
  ------------------
  |  |   77|   183k|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  |  Branch (604:5): [True: 17.1k, False: 10.7M]
  ------------------
  605|   184k|    case V_ASN1_T61STRING:
  ------------------
  |  |   78|   184k|# define V_ASN1_T61STRING                20
  ------------------
  |  Branch (605:5): [True: 730, False: 10.7M]
  ------------------
  606|   184k|    case V_ASN1_VIDEOTEXSTRING:
  ------------------
  |  |   80|   184k|# define V_ASN1_VIDEOTEXSTRING           21 /**/
  ------------------
  |  Branch (606:5): [True: 83, False: 10.7M]
  ------------------
  607|   307k|    case V_ASN1_IA5STRING:
  ------------------
  |  |   81|   307k|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (607:5): [True: 123k, False: 10.6M]
  ------------------
  608|   309k|    case V_ASN1_UTCTIME:
  ------------------
  |  |   82|   309k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (608:5): [True: 1.67k, False: 10.7M]
  ------------------
  609|   309k|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   83|   309k|# define V_ASN1_GENERALIZEDTIME          24 /**/
  ------------------
  |  Branch (609:5): [True: 616, False: 10.7M]
  ------------------
  610|   312k|    case V_ASN1_GRAPHICSTRING:
  ------------------
  |  |   84|   312k|# define V_ASN1_GRAPHICSTRING            25 /**/
  ------------------
  |  Branch (610:5): [True: 2.83k, False: 10.7M]
  ------------------
  611|   312k|    case V_ASN1_VISIBLESTRING:
  ------------------
  |  |   86|   312k|# define V_ASN1_VISIBLESTRING            26/* alias */
  ------------------
  |  Branch (611:5): [True: 32, False: 10.7M]
  ------------------
  612|   314k|    case V_ASN1_GENERALSTRING:
  ------------------
  |  |   87|   314k|# define V_ASN1_GENERALSTRING            27 /**/
  ------------------
  |  Branch (612:5): [True: 1.37k, False: 10.7M]
  ------------------
  613|   341k|    case V_ASN1_UNIVERSALSTRING:
  ------------------
  |  |   88|   341k|# define V_ASN1_UNIVERSALSTRING          28 /**/
  ------------------
  |  Branch (613:5): [True: 27.8k, False: 10.7M]
  ------------------
  614|   437k|    case V_ASN1_BMPSTRING:
  ------------------
  |  |   89|   437k|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (614:5): [True: 95.5k, False: 10.6M]
  ------------------
  615|  1.33M|    case V_ASN1_UTF8STRING:
  ------------------
  |  |   73|  1.33M|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (615:5): [True: 892k, False: 9.87M]
  ------------------
  616|  1.54M|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|  1.54M|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (616:5): [True: 210k, False: 10.5M]
  ------------------
  617|  4.13M|    case V_ASN1_SET:
  ------------------
  |  |   75|  4.13M|# define V_ASN1_SET                      17
  ------------------
  |  Branch (617:5): [True: 2.59M, False: 8.17M]
  ------------------
  618|  6.64M|    default:
  ------------------
  |  Branch (618:5): [True: 2.50M, False: 8.26M]
  ------------------
  619|       |        /* All based on ASN1_STRING and handled the same */
  620|  6.64M|        strtmp = (ASN1_STRING *)*pval;
  621|       |        /* Special handling for NDEF */
  622|  6.64M|        if ((it->size == ASN1_TFLG_NDEF)
  ------------------
  |  |  594|  6.64M|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (622:13): [True: 85, False: 6.64M]
  ------------------
  623|  6.64M|            && (strtmp->flags & ASN1_STRING_FLAG_NDEF)) {
  ------------------
  |  |  167|     85|# define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (623:16): [True: 0, False: 85]
  ------------------
  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|  6.64M|        cont = strtmp->data;
  632|  6.64M|        len = strtmp->length;
  633|       |
  634|  6.64M|        break;
  635|       |
  636|  10.7M|    }
  637|  10.6M|    if (cout && len)
  ------------------
  |  Branch (637:9): [True: 1.79M, False: 8.82M]
  |  Branch (637:17): [True: 1.09M, False: 701k]
  ------------------
  638|  1.09M|        memcpy(cout, cont, len);
  639|  10.6M|    return len;
  640|  10.7M|}

ASN1_item_free:
   19|  1.76M|{
   20|  1.76M|    ossl_asn1_item_embed_free(&val, it, 0);
   21|  1.76M|}
ASN1_item_ex_free:
   24|  31.1k|{
   25|  31.1k|    ossl_asn1_item_embed_free(pval, it, 0);
   26|  31.1k|}
ossl_asn1_item_embed_free:
   29|  6.66M|{
   30|  6.66M|    const ASN1_TEMPLATE *tt = NULL, *seqtt;
   31|  6.66M|    const ASN1_EXTERN_FUNCS *ef;
   32|  6.66M|    const ASN1_AUX *aux = it->funcs;
   33|  6.66M|    ASN1_aux_cb *asn1_cb;
   34|  6.66M|    int i;
   35|       |
   36|  6.66M|    if (pval == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 6.66M]
  ------------------
   37|      0|        return;
   38|  6.66M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
  ------------------
  |  |   80|  6.66M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (38:9): [True: 3.56M, False: 3.10M]
  |  Branch (38:48): [True: 545k, False: 3.01M]
  ------------------
   39|   545k|        return;
   40|  6.12M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (40:9): [True: 349k, False: 5.77M]
  |  Branch (40:16): [True: 129k, False: 220k]
  ------------------
   41|   129k|        asn1_cb = aux->asn1_cb;
   42|  5.99M|    else
   43|  5.99M|        asn1_cb = 0;
   44|       |
   45|  6.12M|    switch (it->itype) {
  ------------------
  |  Branch (45:13): [True: 0, False: 6.12M]
  ------------------
   46|       |
   47|  3.10M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  3.10M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (47:5): [True: 3.10M, False: 3.01M]
  ------------------
   48|  3.10M|        if (it->templates)
  ------------------
  |  Branch (48:13): [True: 201k, False: 2.90M]
  ------------------
   49|   201k|            ossl_asn1_template_free(pval, it->templates);
   50|  2.90M|        else
   51|  2.90M|            ossl_asn1_primitive_free(pval, it, embed);
   52|  3.10M|        break;
   53|       |
   54|  1.10M|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|  1.10M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (54:5): [True: 1.10M, False: 5.01M]
  ------------------
   55|  1.10M|        ossl_asn1_primitive_free(pval, it, embed);
   56|  1.10M|        break;
   57|       |
   58|   124k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   124k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (58:5): [True: 124k, False: 5.99M]
  ------------------
   59|   124k|        if (asn1_cb) {
  ------------------
  |  Branch (59:13): [True: 17.6k, False: 106k]
  ------------------
   60|  17.6k|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  744|  17.6k|# define ASN1_OP_FREE_PRE        2
  ------------------
   61|  17.6k|            if (i == 2)
  ------------------
  |  Branch (61:17): [True: 0, False: 17.6k]
  ------------------
   62|      0|                return;
   63|  17.6k|        }
   64|   124k|        i = ossl_asn1_get_choice_selector(pval, it);
   65|   124k|        if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (65:13): [True: 110k, False: 13.8k]
  |  Branch (65:25): [True: 110k, False: 0]
  ------------------
   66|   110k|            ASN1_VALUE **pchval;
   67|       |
   68|   110k|            tt = it->templates + i;
   69|   110k|            pchval = ossl_asn1_get_field_ptr(pval, tt);
   70|   110k|            ossl_asn1_template_free(pchval, tt);
   71|   110k|        }
   72|   124k|        if (asn1_cb)
  ------------------
  |  Branch (72:13): [True: 17.6k, False: 106k]
  ------------------
   73|  17.6k|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  745|  17.6k|# define ASN1_OP_FREE_POST       3
  ------------------
   74|   124k|        if (embed == 0) {
  ------------------
  |  Branch (74:13): [True: 124k, False: 0]
  ------------------
   75|   124k|            OPENSSL_free(*pval);
  ------------------
  |  |  115|   124k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   124k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   124k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|   124k|            *pval = NULL;
   77|   124k|        }
   78|   124k|        break;
   79|       |
   80|   179k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   179k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (80:5): [True: 179k, False: 5.94M]
  ------------------
   81|   179k|        ef = it->funcs;
   82|   179k|        if (ef && ef->asn1_ex_free)
  ------------------
  |  Branch (82:13): [True: 179k, False: 0]
  |  Branch (82:19): [True: 179k, False: 0]
  ------------------
   83|   179k|            ef->asn1_ex_free(pval, it);
   84|   179k|        break;
   85|       |
   86|  20.6k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  20.6k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (86:5): [True: 20.6k, False: 6.10M]
  ------------------
   87|  1.60M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  1.60M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (87:5): [True: 1.58M, False: 4.53M]
  ------------------
   88|  1.60M|        if (ossl_asn1_do_lock(pval, -1, it) != 0) /* if error or ref-counter > 0 */
  ------------------
  |  Branch (88:13): [True: 0, False: 1.60M]
  ------------------
   89|      0|            return;
   90|  1.60M|        if (asn1_cb) {
  ------------------
  |  Branch (90:13): [True: 94.6k, False: 1.50M]
  ------------------
   91|  94.6k|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  744|  94.6k|# define ASN1_OP_FREE_PRE        2
  ------------------
   92|  94.6k|            if (i == 2)
  ------------------
  |  Branch (92:17): [True: 57, False: 94.6k]
  ------------------
   93|     57|                return;
   94|  94.6k|        }
   95|  1.60M|        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|  1.60M|        tt = it->templates + it->tcount;
  102|  5.55M|        for (i = 0; i < it->tcount; i++) {
  ------------------
  |  Branch (102:21): [True: 3.95M, False: 1.60M]
  ------------------
  103|  3.95M|            ASN1_VALUE **pseqval;
  104|       |
  105|  3.95M|            tt--;
  106|  3.95M|            seqtt = ossl_asn1_do_adb(*pval, tt, 0);
  107|  3.95M|            if (!seqtt)
  ------------------
  |  Branch (107:17): [True: 1.02k, False: 3.95M]
  ------------------
  108|  1.02k|                continue;
  109|  3.95M|            pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  110|  3.95M|            ossl_asn1_template_free(pseqval, seqtt);
  111|  3.95M|        }
  112|  1.60M|        if (asn1_cb)
  ------------------
  |  Branch (112:13): [True: 94.6k, False: 1.50M]
  ------------------
  113|  94.6k|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  745|  94.6k|# define ASN1_OP_FREE_POST       3
  ------------------
  114|  1.60M|        if (embed == 0) {
  ------------------
  |  Branch (114:13): [True: 1.38M, False: 220k]
  ------------------
  115|  1.38M|            OPENSSL_free(*pval);
  ------------------
  |  |  115|  1.38M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.38M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.38M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  116|  1.38M|            *pval = NULL;
  117|  1.38M|        }
  118|  1.60M|        break;
  119|  6.12M|    }
  120|  6.12M|}
ossl_asn1_template_free:
  123|  4.72M|{
  124|  4.72M|    int embed = tt->flags & ASN1_TFLG_EMBED;
  ------------------
  |  |  597|  4.72M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  125|  4.72M|    ASN1_VALUE *tval;
  126|  4.72M|    if (embed) {
  ------------------
  |  Branch (126:9): [True: 477k, False: 4.24M]
  ------------------
  127|   477k|        tval = (ASN1_VALUE *)pval;
  128|   477k|        pval = &tval;
  129|   477k|    }
  130|  4.72M|    if (tt->flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  4.72M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (130:9): [True: 444k, False: 4.27M]
  ------------------
  131|   444k|        STACK_OF(ASN1_VALUE) *sk = (STACK_OF(ASN1_VALUE) *)*pval;
  ------------------
  |  |   31|   444k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  132|   444k|        int i;
  133|       |
  134|  1.03M|        for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  |  898|  1.03M|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (134:21): [True: 588k, False: 444k]
  ------------------
  135|   588k|            ASN1_VALUE *vtmp = sk_ASN1_VALUE_value(sk, i);
  ------------------
  |  |  899|   588k|#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
  ------------------
  136|       |
  137|   588k|            ossl_asn1_item_embed_free(&vtmp, ASN1_ITEM_ptr(tt->item), embed);
  ------------------
  |  |  421|   588k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  138|   588k|        }
  139|   444k|        sk_ASN1_VALUE_free(sk);
  ------------------
  |  |  904|   444k|#define sk_ASN1_VALUE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_VALUE_sk_type(sk))
  ------------------
  140|   444k|        *pval = NULL;
  141|  4.27M|    } else {
  142|  4.27M|        ossl_asn1_item_embed_free(pval, ASN1_ITEM_ptr(tt->item), embed);
  ------------------
  |  |  421|  4.27M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  143|  4.27M|    }
  144|  4.72M|}
ossl_asn1_primitive_free:
  147|  4.44M|{
  148|  4.44M|    int utype;
  149|       |
  150|       |    /* Special case: if 'it' is a primitive with a free_func, use that. */
  151|  4.44M|    if (it) {
  ------------------
  |  Branch (151:9): [True: 4.01M, False: 433k]
  ------------------
  152|  4.01M|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  153|       |
  154|  4.01M|        if (embed) {
  ------------------
  |  Branch (154:13): [True: 256k, False: 3.75M]
  ------------------
  155|   256k|            if (pf && pf->prim_clear) {
  ------------------
  |  Branch (155:17): [True: 16.6k, False: 240k]
  |  Branch (155:23): [True: 16.6k, False: 0]
  ------------------
  156|  16.6k|                pf->prim_clear(pval, it);
  157|  16.6k|                return;
  158|  16.6k|            }
  159|  3.75M|        } else if (pf && pf->prim_free) {
  ------------------
  |  Branch (159:20): [True: 301, False: 3.75M]
  |  Branch (159:26): [True: 301, False: 0]
  ------------------
  160|    301|            pf->prim_free(pval, it);
  161|    301|            return;
  162|    301|        }
  163|  4.01M|    }
  164|       |
  165|       |    /* Special case: if 'it' is NULL, free contents of ASN1_TYPE */
  166|  4.42M|    if (!it) {
  ------------------
  |  Branch (166:9): [True: 433k, False: 3.99M]
  ------------------
  167|   433k|        ASN1_TYPE *typ = (ASN1_TYPE *)*pval;
  168|       |
  169|   433k|        utype = typ->type;
  170|   433k|        pval = &typ->value.asn1_value;
  171|   433k|        if (*pval == NULL)
  ------------------
  |  Branch (171:13): [True: 9.72k, False: 423k]
  ------------------
  172|  9.72k|            return;
  173|  3.99M|    } else if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  3.99M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (173:16): [True: 1.10M, False: 2.88M]
  ------------------
  174|  1.10M|        utype = -1;
  175|  1.10M|        if (*pval == NULL)
  ------------------
  |  Branch (175:13): [True: 0, False: 1.10M]
  ------------------
  176|      0|            return;
  177|  2.88M|    } else {
  178|  2.88M|        utype = it->utype;
  179|  2.88M|        if ((utype != V_ASN1_BOOLEAN) && *pval == NULL)
  ------------------
  |  |   63|  2.88M|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (179:13): [True: 2.65M, False: 229k]
  |  Branch (179:42): [True: 576k, False: 2.08M]
  ------------------
  180|   576k|            return;
  181|  2.88M|    }
  182|       |
  183|  3.84M|    switch (utype) {
  184|  1.41M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  1.41M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (184:5): [True: 1.41M, False: 2.42M]
  ------------------
  185|  1.41M|        ASN1_OBJECT_free((ASN1_OBJECT *)*pval);
  186|  1.41M|        break;
  187|       |
  188|   229k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|   229k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (188:5): [True: 229k, False: 3.61M]
  ------------------
  189|   229k|        if (it)
  ------------------
  |  Branch (189:13): [True: 229k, False: 590]
  ------------------
  190|   229k|            *(ASN1_BOOLEAN *)pval = it->size;
  191|    590|        else
  192|    590|            *(ASN1_BOOLEAN *)pval = -1;
  193|   229k|        return;
  194|       |
  195|      0|    case V_ASN1_NULL:
  ------------------
  |  |   67|      0|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (195:5): [True: 0, False: 3.84M]
  ------------------
  196|      0|        break;
  197|       |
  198|   433k|    case V_ASN1_ANY:
  ------------------
  |  |   58|   433k|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (198:5): [True: 433k, False: 3.40M]
  ------------------
  199|   433k|        ossl_asn1_primitive_free(pval, NULL, 0);
  200|   433k|        OPENSSL_free(*pval);
  ------------------
  |  |  115|   433k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   433k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   433k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  201|   433k|        break;
  202|       |
  203|  1.76M|    default:
  ------------------
  |  Branch (203:5): [True: 1.76M, False: 2.07M]
  ------------------
  204|  1.76M|        ossl_asn1_string_embed_free((ASN1_STRING *)*pval, embed);
  205|  1.76M|        break;
  206|  3.84M|    }
  207|  3.61M|    *pval = NULL;
  208|  3.61M|}

ASN1_item_new:
   30|  1.06M|{
   31|  1.06M|    ASN1_VALUE *ret = NULL;
   32|  1.06M|    if (ASN1_item_ex_new(&ret, it) > 0)
  ------------------
  |  Branch (32:9): [True: 1.06M, False: 0]
  ------------------
   33|  1.06M|        return ret;
   34|      0|    return NULL;
   35|  1.06M|}
ossl_asn1_item_ex_new_intern:
   51|   804k|{
   52|   804k|    return asn1_item_embed_new(pval, it, 0, libctx, propq);
   53|   804k|}
ASN1_item_ex_new:
   56|  1.06M|{
   57|  1.06M|    return asn1_item_embed_new(pval, it, 0, NULL, NULL);
   58|  1.06M|}
tasn_new.c:asn1_item_embed_new:
   62|  4.95M|{
   63|  4.95M|    const ASN1_TEMPLATE *tt = NULL;
   64|  4.95M|    const ASN1_EXTERN_FUNCS *ef;
   65|  4.95M|    const ASN1_AUX *aux = it->funcs;
   66|  4.95M|    ASN1_aux_cb *asn1_cb;
   67|  4.95M|    ASN1_VALUE **pseqval;
   68|  4.95M|    int i;
   69|  4.95M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (69:9): [True: 312k, False: 4.64M]
  |  Branch (69:16): [True: 129k, False: 183k]
  ------------------
   70|   129k|        asn1_cb = aux->asn1_cb;
   71|  4.82M|    else
   72|  4.82M|        asn1_cb = 0;
   73|       |
   74|  4.95M|    switch (it->itype) {
  ------------------
  |  Branch (74:13): [True: 0, False: 4.95M]
  ------------------
   75|       |
   76|   143k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   143k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (76:5): [True: 143k, False: 4.81M]
  ------------------
   77|   143k|        ef = it->funcs;
   78|   143k|        if (ef != NULL) {
  ------------------
  |  Branch (78:13): [True: 143k, False: 0]
  ------------------
   79|   143k|            if (ef->asn1_ex_new_ex != NULL) {
  ------------------
  |  Branch (79:17): [True: 40.3k, False: 102k]
  ------------------
   80|  40.3k|                if (!ef->asn1_ex_new_ex(pval, it, libctx, propq))
  ------------------
  |  Branch (80:21): [True: 0, False: 40.3k]
  ------------------
   81|      0|                    goto asn1err;
   82|   102k|            } else if (ef->asn1_ex_new != NULL) {
  ------------------
  |  Branch (82:24): [True: 102k, False: 0]
  ------------------
   83|   102k|                if (!ef->asn1_ex_new(pval, it))
  ------------------
  |  Branch (83:21): [True: 0, False: 102k]
  ------------------
   84|      0|                    goto asn1err;
   85|   102k|            }
   86|   143k|        }
   87|   143k|        break;
   88|       |
   89|  2.01M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  2.01M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (89:5): [True: 2.01M, False: 2.93M]
  ------------------
   90|  2.01M|        if (it->templates) {
  ------------------
  |  Branch (90:13): [True: 0, False: 2.01M]
  ------------------
   91|      0|            if (!asn1_template_new(pval, it->templates, libctx, propq))
  ------------------
  |  Branch (91:17): [True: 0, False: 0]
  ------------------
   92|      0|                goto asn1err;
   93|  2.01M|        } else if (!asn1_primitive_new(pval, it, embed))
  ------------------
  |  Branch (93:20): [True: 0, False: 2.01M]
  ------------------
   94|      0|            goto asn1err;
   95|  2.01M|        break;
   96|       |
   97|  2.01M|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|  1.10M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (97:5): [True: 1.10M, False: 3.85M]
  ------------------
   98|  1.10M|        if (!asn1_primitive_new(pval, it, embed))
  ------------------
  |  Branch (98:13): [True: 0, False: 1.10M]
  ------------------
   99|      0|            goto asn1err;
  100|  1.10M|        break;
  101|       |
  102|  1.10M|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   124k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (102:5): [True: 124k, False: 4.83M]
  ------------------
  103|   124k|        if (asn1_cb) {
  ------------------
  |  Branch (103:13): [True: 17.6k, False: 106k]
  ------------------
  104|  17.6k|            i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
  ------------------
  |  |  742|  17.6k|# define ASN1_OP_NEW_PRE         0
  ------------------
  105|  17.6k|            if (!i)
  ------------------
  |  Branch (105:17): [True: 0, False: 17.6k]
  ------------------
  106|      0|                goto auxerr;
  107|  17.6k|            if (i == 2) {
  ------------------
  |  Branch (107:17): [True: 0, False: 17.6k]
  ------------------
  108|      0|                return 1;
  109|      0|            }
  110|  17.6k|        }
  111|   124k|        if (embed) {
  ------------------
  |  Branch (111:13): [True: 0, False: 124k]
  ------------------
  112|      0|            memset(*pval, 0, it->size);
  113|   124k|        } else {
  114|   124k|            *pval = OPENSSL_zalloc(it->size);
  ------------------
  |  |  104|   124k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   124k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   124k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|   124k|            if (*pval == NULL)
  ------------------
  |  Branch (115:17): [True: 0, False: 124k]
  ------------------
  116|      0|                return 0;
  117|   124k|        }
  118|   124k|        ossl_asn1_set_choice_selector(pval, -1, it);
  119|   124k|        if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
  ------------------
  |  |  743|  17.6k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (119:13): [True: 17.6k, False: 106k]
  |  Branch (119:24): [True: 0, False: 17.6k]
  ------------------
  120|      0|            goto auxerr2;
  121|   124k|        break;
  122|       |
  123|   124k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  20.6k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (123:5): [True: 20.6k, False: 4.93M]
  ------------------
  124|  1.56M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  1.56M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (124:5): [True: 1.54M, False: 3.40M]
  ------------------
  125|  1.56M|        if (asn1_cb) {
  ------------------
  |  Branch (125:13): [True: 94.6k, False: 1.47M]
  ------------------
  126|  94.6k|            i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
  ------------------
  |  |  742|  94.6k|# define ASN1_OP_NEW_PRE         0
  ------------------
  127|  94.6k|            if (!i)
  ------------------
  |  Branch (127:17): [True: 0, False: 94.6k]
  ------------------
  128|      0|                goto auxerr;
  129|  94.6k|            if (i == 2) {
  ------------------
  |  Branch (129:17): [True: 76, False: 94.6k]
  ------------------
  130|     76|                return 1;
  131|     76|            }
  132|  94.6k|        }
  133|  1.56M|        if (embed) {
  ------------------
  |  Branch (133:13): [True: 220k, False: 1.34M]
  ------------------
  134|   220k|            memset(*pval, 0, it->size);
  135|  1.34M|        } else {
  136|  1.34M|            *pval = OPENSSL_zalloc(it->size);
  ------------------
  |  |  104|  1.34M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.34M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.34M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|  1.34M|            if (*pval == NULL)
  ------------------
  |  Branch (137:17): [True: 0, False: 1.34M]
  ------------------
  138|      0|                return 0;
  139|  1.34M|        }
  140|       |        /* 0 : init. lock */
  141|  1.56M|        if (ossl_asn1_do_lock(pval, 0, it) < 0) {
  ------------------
  |  Branch (141:13): [True: 0, False: 1.56M]
  ------------------
  142|      0|            if (!embed) {
  ------------------
  |  Branch (142:17): [True: 0, False: 0]
  ------------------
  143|      0|                OPENSSL_free(*pval);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  144|      0|                *pval = NULL;
  145|      0|            }
  146|      0|            goto asn1err;
  147|      0|        }
  148|  1.56M|        ossl_asn1_enc_init(pval, it);
  149|  5.44M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (149:41): [True: 3.87M, False: 1.56M]
  ------------------
  150|  3.87M|            pseqval = ossl_asn1_get_field_ptr(pval, tt);
  151|  3.87M|            if (!asn1_template_new(pseqval, tt, libctx, propq))
  ------------------
  |  Branch (151:17): [True: 0, False: 3.87M]
  ------------------
  152|      0|                goto asn1err2;
  153|  3.87M|        }
  154|  1.56M|        if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
  ------------------
  |  |  743|  94.6k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (154:13): [True: 94.6k, False: 1.47M]
  |  Branch (154:24): [True: 0, False: 94.6k]
  ------------------
  155|      0|            goto auxerr2;
  156|  1.56M|        break;
  157|  4.95M|    }
  158|  4.95M|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  170|      0|    return 0;
  171|       |
  172|      0|}
tasn_new.c:asn1_template_new:
  209|  3.87M|{
  210|  3.87M|    const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item);
  ------------------
  |  |  421|  3.87M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  211|  3.87M|    int embed = tt->flags & ASN1_TFLG_EMBED;
  ------------------
  |  |  597|  3.87M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  212|  3.87M|    ASN1_VALUE *tval;
  213|  3.87M|    int ret;
  214|  3.87M|    if (embed) {
  ------------------
  |  Branch (214:9): [True: 477k, False: 3.40M]
  ------------------
  215|   477k|        tval = (ASN1_VALUE *)pval;
  216|   477k|        pval = &tval;
  217|   477k|    }
  218|  3.87M|    if (tt->flags & ASN1_TFLG_OPTIONAL) {
  ------------------
  |  |  523|  3.87M|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (218:9): [True: 770k, False: 3.10M]
  ------------------
  219|   770k|        asn1_template_clear(pval, tt);
  220|   770k|        return 1;
  221|   770k|    }
  222|       |    /* If ANY DEFINED BY nothing to do */
  223|       |
  224|  3.10M|    if (tt->flags & ASN1_TFLG_ADB_MASK) {
  ------------------
  |  |  583|  3.10M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
  |  Branch (224:9): [True: 8.37k, False: 3.10M]
  ------------------
  225|  8.37k|        *pval = NULL;
  226|  8.37k|        return 1;
  227|  8.37k|    }
  228|       |    /* If SET OF or SEQUENCE OF, its a STACK */
  229|  3.10M|    if (tt->flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  3.10M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (229:9): [True: 10.3k, False: 3.09M]
  ------------------
  230|  10.3k|        STACK_OF(ASN1_VALUE) *skval;
  ------------------
  |  |   31|  10.3k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  231|  10.3k|        skval = sk_ASN1_VALUE_new_null();
  ------------------
  |  |  901|  10.3k|#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  232|  10.3k|        if (!skval) {
  ------------------
  |  Branch (232:13): [True: 0, False: 10.3k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  234|      0|            ret = 0;
  235|      0|            goto done;
  236|      0|        }
  237|  10.3k|        *pval = (ASN1_VALUE *)skval;
  238|  10.3k|        ret = 1;
  239|  10.3k|        goto done;
  240|  10.3k|    }
  241|       |    /* Otherwise pass it back to the item routine */
  242|  3.09M|    ret = asn1_item_embed_new(pval, it, embed, libctx, propq);
  243|  3.10M| done:
  244|  3.10M|    return ret;
  245|  3.09M|}
tasn_new.c:asn1_template_clear:
  248|   770k|{
  249|       |    /* If ADB or STACK just NULL the field */
  250|   770k|    if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK))
  ------------------
  |  |  583|   770k|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
                  if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK))
  ------------------
  |  |  539|   770k|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (250:9): [True: 162k, False: 608k]
  ------------------
  251|   162k|        *pval = NULL;
  252|   608k|    else
  253|   608k|        asn1_item_clear(pval, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  421|   608k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  254|   770k|}
tasn_new.c:asn1_item_clear:
  175|   608k|{
  176|   608k|    const ASN1_EXTERN_FUNCS *ef;
  177|       |
  178|   608k|    switch (it->itype) {
  ------------------
  |  Branch (178:13): [True: 0, False: 608k]
  ------------------
  179|       |
  180|      0|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|      0|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (180:5): [True: 0, False: 608k]
  ------------------
  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|   566k|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|   566k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (188:5): [True: 566k, False: 42.0k]
  ------------------
  189|   566k|        if (it->templates)
  ------------------
  |  Branch (189:13): [True: 0, False: 566k]
  ------------------
  190|      0|            asn1_template_clear(pval, it->templates);
  191|   566k|        else
  192|   566k|            asn1_primitive_clear(pval, it);
  193|   566k|        break;
  194|       |
  195|  19.8k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|  19.8k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (195:5): [True: 19.8k, False: 588k]
  ------------------
  196|  19.8k|        asn1_primitive_clear(pval, it);
  197|  19.8k|        break;
  198|       |
  199|  12.8k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|  12.8k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (199:5): [True: 12.8k, False: 595k]
  ------------------
  200|  22.2k|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  22.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (200:5): [True: 9.39k, False: 598k]
  ------------------
  201|  22.2k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  22.2k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (201:5): [True: 0, False: 608k]
  ------------------
  202|  22.2k|        *pval = NULL;
  203|  22.2k|        break;
  204|   608k|    }
  205|   608k|}
tasn_new.c:asn1_primitive_clear:
  328|   586k|{
  329|   586k|    int utype;
  330|   586k|    if (it && it->funcs) {
  ------------------
  |  Branch (330:9): [True: 586k, False: 0]
  |  Branch (330:15): [True: 90, False: 585k]
  ------------------
  331|     90|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  332|     90|        if (pf->prim_clear)
  ------------------
  |  Branch (332:13): [True: 0, False: 90]
  ------------------
  333|      0|            pf->prim_clear(pval, it);
  334|     90|        else
  335|     90|            *pval = NULL;
  336|     90|        return;
  337|     90|    }
  338|   585k|    if (!it || (it->itype == ASN1_ITYPE_MSTRING))
  ------------------
  |  |   85|   585k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (338:9): [True: 0, False: 585k]
  |  Branch (338:16): [True: 19.8k, False: 566k]
  ------------------
  339|  19.8k|        utype = -1;
  340|   566k|    else
  341|   566k|        utype = it->utype;
  342|   585k|    if (utype == V_ASN1_BOOLEAN)
  ------------------
  |  |   63|   585k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (342:9): [True: 134k, False: 451k]
  ------------------
  343|   134k|        *(ASN1_BOOLEAN *)pval = it->size;
  344|   451k|    else
  345|   451k|        *pval = NULL;
  346|   585k|}
tasn_new.c:asn1_primitive_new:
  263|  3.12M|{
  264|  3.12M|    ASN1_TYPE *typ;
  265|  3.12M|    ASN1_STRING *str;
  266|  3.12M|    int utype;
  267|       |
  268|  3.12M|    if (!it)
  ------------------
  |  Branch (268:9): [True: 0, False: 3.12M]
  ------------------
  269|      0|        return 0;
  270|       |
  271|  3.12M|    if (it->funcs) {
  ------------------
  |  Branch (271:9): [True: 16.9k, False: 3.10M]
  ------------------
  272|  16.9k|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  273|  16.9k|        if (embed) {
  ------------------
  |  Branch (273:13): [True: 16.6k, False: 271]
  ------------------
  274|  16.6k|            if (pf->prim_clear) {
  ------------------
  |  Branch (274:17): [True: 16.6k, False: 0]
  ------------------
  275|  16.6k|                pf->prim_clear(pval, it);
  276|  16.6k|                return 1;
  277|  16.6k|            }
  278|  16.6k|        } else if (pf->prim_new) {
  ------------------
  |  Branch (278:20): [True: 271, False: 0]
  ------------------
  279|    271|            return pf->prim_new(pval, it);
  280|    271|        }
  281|  16.9k|    }
  282|       |
  283|  3.10M|    if (it->itype == ASN1_ITYPE_MSTRING)
  ------------------
  |  |   85|  3.10M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (283:9): [True: 1.10M, False: 2.00M]
  ------------------
  284|  1.10M|        utype = -1;
  285|  2.00M|    else
  286|  2.00M|        utype = it->utype;
  287|  3.10M|    switch (utype) {
  288|  1.30M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  1.30M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (288:5): [True: 1.30M, False: 1.79M]
  ------------------
  289|  1.30M|        *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef);
  ------------------
  |  |   18|  1.30M|#define NID_undef                       0
  ------------------
  290|  1.30M|        return 1;
  291|       |
  292|      0|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|      0|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (292:5): [True: 0, False: 3.10M]
  ------------------
  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: 3.10M]
  ------------------
  297|      0|        *pval = (ASN1_VALUE *)1;
  298|      0|        return 1;
  299|       |
  300|   433k|    case V_ASN1_ANY:
  ------------------
  |  |   58|   433k|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (300:5): [True: 433k, False: 2.67M]
  ------------------
  301|   433k|        if ((typ = OPENSSL_malloc(sizeof(*typ))) == NULL)
  ------------------
  |  |  102|   433k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   433k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   433k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (301:13): [True: 0, False: 433k]
  ------------------
  302|      0|            return 0;
  303|   433k|        typ->value.ptr = NULL;
  304|   433k|        typ->type = -1;
  305|   433k|        *pval = (ASN1_VALUE *)typ;
  306|   433k|        break;
  307|       |
  308|  1.36M|    default:
  ------------------
  |  Branch (308:5): [True: 1.36M, False: 1.73M]
  ------------------
  309|  1.36M|        if (embed) {
  ------------------
  |  Branch (309:13): [True: 240k, False: 1.12M]
  ------------------
  310|   240k|            str = *(ASN1_STRING **)pval;
  311|   240k|            memset(str, 0, sizeof(*str));
  312|   240k|            str->type = utype;
  313|   240k|            str->flags = ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|   240k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  314|  1.12M|        } else {
  315|  1.12M|            str = ASN1_STRING_type_new(utype);
  316|  1.12M|            *pval = (ASN1_VALUE *)str;
  317|  1.12M|        }
  318|  1.36M|        if (it->itype == ASN1_ITYPE_MSTRING && str)
  ------------------
  |  |   85|  2.72M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (318:13): [True: 1.10M, False: 261k]
  |  Branch (318:48): [True: 1.10M, False: 0]
  ------------------
  319|  1.10M|            str->flags |= ASN1_STRING_FLAG_MSTRING;
  ------------------
  |  |  180|  1.10M|# define ASN1_STRING_FLAG_MSTRING 0x040
  ------------------
  320|  1.36M|        break;
  321|  3.10M|    }
  322|  1.79M|    if (*pval)
  ------------------
  |  Branch (322:9): [True: 1.79M, False: 0]
  ------------------
  323|  1.79M|        return 1;
  324|      0|    return 0;
  325|  1.79M|}

ASN1_OCTET_STRING_free:
   23|   161k|void sname##_free(sname *x) \
   24|   161k|{ \
   25|   161k|    ASN1_STRING_free(x); \
   26|   161k|}
ASN1_INTEGER_new:
   19|  29.0k|sname *sname##_new(void) \
   20|  29.0k|{ \
   21|  29.0k|    return ASN1_STRING_type_new(V_##sname); \
   22|  29.0k|} \
ASN1_INTEGER_free:
   23|  81.3k|void sname##_free(sname *x) \
   24|  81.3k|{ \
   25|  81.3k|    ASN1_STRING_free(x); \
   26|  81.3k|}
ASN1_ENUMERATED_free:
   23|  16.9k|void sname##_free(sname *x) \
   24|  16.9k|{ \
   25|  16.9k|    ASN1_STRING_free(x); \
   26|  16.9k|}
ASN1_BIT_STRING_new:
   19|   115k|sname *sname##_new(void) \
   20|   115k|{ \
   21|   115k|    return ASN1_STRING_type_new(V_##sname); \
   22|   115k|} \
ASN1_BIT_STRING_free:
   23|  77.3k|void sname##_free(sname *x) \
   24|  77.3k|{ \
   25|  77.3k|    ASN1_STRING_free(x); \
   26|  77.3k|}

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

X509_ALGOR_get0:
   74|   107k|{
   75|   107k|    if (paobj)
  ------------------
  |  Branch (75:9): [True: 36.4k, False: 70.7k]
  ------------------
   76|  36.4k|        *paobj = algor->algorithm;
   77|   107k|    if (pptype) {
  ------------------
  |  Branch (77:9): [True: 70.8k, False: 36.4k]
  ------------------
   78|  70.8k|        if (algor->parameter == NULL) {
  ------------------
  |  Branch (78:13): [True: 442, False: 70.3k]
  ------------------
   79|    442|            *pptype = V_ASN1_UNDEF;
  ------------------
  |  |   60|    442|# define V_ASN1_UNDEF                    -1
  ------------------
   80|    442|            return;
   81|    442|        } else
   82|  70.3k|            *pptype = algor->parameter->type;
   83|  70.3k|        if (ppval)
  ------------------
  |  Branch (83:13): [True: 70.3k, False: 54]
  ------------------
   84|  70.3k|            *ppval = algor->parameter->value.ptr;
   85|  70.3k|    }
   86|   107k|}
ossl_x509_algor_get_md:
  158|     16|{
  159|     16|    const EVP_MD *md;
  160|       |
  161|     16|    if (alg == NULL)
  ------------------
  |  Branch (161:9): [True: 16, False: 0]
  ------------------
  162|     16|        return EVP_sha1();
  163|      0|    md = EVP_get_digestbyobj(alg->algorithm);
  ------------------
  |  |  532|      0|# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a))
  |  |  ------------------
  |  |  |  |  531|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|    return md;
  167|     16|}

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

INT32_it:
  250|  83.7k|ASN1_ITEM_start(INT32)
  ------------------
  |  |   95|  83.7k|        { \
  |  |   96|  83.7k|                static const ASN1_ITEM local_it = {
  ------------------
  251|  83.7k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   80|  83.7k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   64|  83.7k|# define V_ASN1_INTEGER                  2
  ------------------
  252|  83.7k|    INTxx_FLAG_SIGNED, "INT32"
  ------------------
  |  |   27|  83.7k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  253|  83.7k|ASN1_ITEM_end(INT32)
  ------------------
  |  |  102|  83.7k|                }; \
  |  |  103|  83.7k|        return &local_it; \
  |  |  104|  83.7k|        }
  ------------------
x_int64.c:uint32_clear:
  136|  33.2k|{
  137|  33.2k|    **(uint32_t **)pval = 0;
  138|  33.2k|}
x_int64.c:uint32_c2i:
  173|  15.7k|{
  174|  15.7k|    uint64_t utmp = 0;
  175|  15.7k|    uint32_t utmp2 = 0;
  176|  15.7k|    char *cp;
  177|  15.7k|    int neg = 0;
  178|       |
  179|  15.7k|    if (*pval == NULL && !uint64_new(pval, it))
  ------------------
  |  Branch (179:9): [True: 0, False: 15.7k]
  |  Branch (179:26): [True: 0, False: 0]
  ------------------
  180|      0|        return 0;
  181|       |
  182|  15.7k|    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|  15.7k|    if (len == 0)
  ------------------
  |  Branch (190:9): [True: 2.98k, False: 12.7k]
  ------------------
  191|  2.98k|        goto long_compat;
  192|       |
  193|  12.7k|    if (!ossl_c2i_uint64_int(&utmp, &neg, &cont, len))
  ------------------
  |  Branch (193:9): [True: 31, False: 12.7k]
  ------------------
  194|     31|        return 0;
  195|  12.7k|    if ((it->size & INTxx_FLAG_SIGNED) == 0 && neg) {
  ------------------
  |  |   27|  12.7k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (195:9): [True: 0, False: 12.7k]
  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  197|      0|        return 0;
  198|      0|    }
  199|  12.7k|    if (neg) {
  ------------------
  |  Branch (199:9): [True: 3.45k, False: 9.29k]
  ------------------
  200|  3.45k|        if (utmp > ABS_INT32_MIN) {
  ------------------
  |  |  169|  3.45k|#define ABS_INT32_MIN ((uint32_t)INT32_MAX + 1)
  ------------------
  |  Branch (200:13): [True: 66, False: 3.39k]
  ------------------
  201|     66|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|     66|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     66|    (ERR_new(),                                                 \
  |  |  |  |  404|     66|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     66|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     66|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     66|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     66|     ERR_set_error)
  |  |  ------------------
  ------------------
  202|     66|            return 0;
  203|     66|        }
  204|  3.39k|        utmp = 0 - utmp;
  205|  9.29k|    } else {
  206|  9.29k|        if (((it->size & INTxx_FLAG_SIGNED) != 0 && utmp > INT32_MAX)
  ------------------
  |  |   27|  9.29k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (206:14): [True: 9.29k, False: 0]
  |  Branch (206:53): [True: 68, False: 9.22k]
  ------------------
  207|  9.29k|            || ((it->size & INTxx_FLAG_SIGNED) == 0 && utmp > UINT32_MAX)) {
  ------------------
  |  |   27|  9.22k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (207:17): [True: 0, False: 9.22k]
  |  Branch (207:56): [True: 0, False: 0]
  ------------------
  208|     68|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|     68|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     68|    (ERR_new(),                                                 \
  |  |  |  |  404|     68|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     68|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     68|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     68|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     68|     ERR_set_error)
  |  |  ------------------
  ------------------
  209|     68|            return 0;
  210|     68|        }
  211|  9.29k|    }
  212|       |
  213|  15.6k| long_compat:
  214|  15.6k|    utmp2 = (uint32_t)utmp;
  215|  15.6k|    memcpy(cp, &utmp2, sizeof(utmp2));
  216|  15.6k|    return 1;
  217|  12.7k|}
x_int64.c:uint32_i2c:
  142|  39.3k|{
  143|  39.3k|    uint32_t utmp;
  144|  39.3k|    int neg = 0;
  145|       |    /* this exists to bypass broken gcc optimization */
  146|  39.3k|    char *cp = (char *)*pval;
  147|       |
  148|       |    /* use memcpy, because we may not be uint32_t aligned */
  149|  39.3k|    memcpy(&utmp, cp, sizeof(utmp));
  150|       |
  151|  39.3k|    if ((it->size & INTxx_FLAG_ZERO_DEFAULT) == INTxx_FLAG_ZERO_DEFAULT
  ------------------
  |  |   26|  39.3k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
                  if ((it->size & INTxx_FLAG_ZERO_DEFAULT) == INTxx_FLAG_ZERO_DEFAULT
  ------------------
  |  |   26|  78.7k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
  |  Branch (151:9): [True: 0, False: 39.3k]
  ------------------
  152|  39.3k|        && utmp == 0)
  ------------------
  |  Branch (152:12): [True: 0, False: 0]
  ------------------
  153|      0|        return -1;
  154|  39.3k|    if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  39.3k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
                  if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  78.7k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (154:9): [True: 39.3k, False: 0]
  ------------------
  155|  39.3k|        && (int32_t)utmp < 0) {
  ------------------
  |  Branch (155:12): [True: 10.5k, False: 28.8k]
  ------------------
  156|       |        /* ossl_i2c_uint64_int() assumes positive values */
  157|  10.5k|        utmp = 0 - utmp;
  158|  10.5k|        neg = 1;
  159|  10.5k|    }
  160|       |
  161|  39.3k|    return ossl_i2c_uint64_int(cont, (uint64_t)utmp, neg);
  162|  39.3k|}

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

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

BIO_meth_new:
   38|      1|{
   39|      1|    BIO_METHOD *biom = OPENSSL_zalloc(sizeof(BIO_METHOD));
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|       |
   41|      1|    if (biom == NULL
  ------------------
  |  Branch (41:9): [True: 0, False: 1]
  ------------------
   42|      1|            || (biom->name = OPENSSL_strdup(name)) == NULL) {
  ------------------
  |  |  119|      1|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (42:16): [True: 0, False: 1]
  ------------------
   43|      0|        OPENSSL_free(biom);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|      1|    biom->type = type;
   47|      1|    return biom;
   48|      1|}
BIO_meth_free:
   51|      1|{
   52|      1|    if (biom != NULL) {
  ------------------
  |  Branch (52:9): [True: 1, False: 0]
  ------------------
   53|      1|        OPENSSL_free(biom->name);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   54|      1|        OPENSSL_free(biom);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   55|      1|    }
   56|      1|}
bwrite_conv:
   71|  9.08k|{
   72|  9.08k|    int ret;
   73|       |
   74|  9.08k|    if (datal > INT_MAX)
  ------------------
  |  Branch (74:9): [True: 0, False: 9.08k]
  ------------------
   75|      0|        datal = INT_MAX;
   76|       |
   77|  9.08k|    ret = bio->method->bwrite_old(bio, data, (int)datal);
   78|       |
   79|  9.08k|    if (ret <= 0) {
  ------------------
  |  Branch (79:9): [True: 0, False: 9.08k]
  ------------------
   80|      0|        *written = 0;
   81|      0|        return ret;
   82|      0|    }
   83|       |
   84|  9.08k|    *written = (size_t)ret;
   85|       |
   86|  9.08k|    return 1;
   87|  9.08k|}
BIO_meth_set_write_ex:
   99|      1|{
  100|      1|    biom->bwrite_old = NULL;
  101|      1|    biom->bwrite = bwrite;
  102|      1|    return 1;
  103|      1|}
bread_conv:
  117|  8.56M|{
  118|  8.56M|    int ret;
  119|       |
  120|  8.56M|    if (datal > INT_MAX)
  ------------------
  |  Branch (120:9): [True: 0, False: 8.56M]
  ------------------
  121|      0|        datal = INT_MAX;
  122|       |
  123|  8.56M|    ret = bio->method->bread_old(bio, data, (int)datal);
  124|       |
  125|  8.56M|    if (ret <= 0) {
  ------------------
  |  Branch (125:9): [True: 55.3k, False: 8.50M]
  ------------------
  126|  55.3k|        *readbytes = 0;
  127|  55.3k|        return ret;
  128|  55.3k|    }
  129|       |
  130|  8.50M|    *readbytes = (size_t)ret;
  131|       |
  132|  8.50M|    return 1;
  133|  8.56M|}
BIO_meth_set_read_ex:
  145|      1|{
  146|      1|    biom->bread_old = NULL;
  147|      1|    biom->bread = bread;
  148|      1|    return 1;
  149|      1|}
BIO_meth_set_puts:
  158|      1|{
  159|      1|    biom->bputs = bputs;
  160|      1|    return 1;
  161|      1|}
BIO_meth_set_gets:
  170|      1|{
  171|      1|    biom->bgets = bgets;
  172|      1|    return 1;
  173|      1|}
BIO_meth_set_ctrl:
  182|      1|{
  183|      1|    biom->ctrl = ctrl;
  184|      1|    return 1;
  185|      1|}
BIO_meth_set_create:
  193|      1|{
  194|      1|    biom->create = create;
  195|      1|    return 1;
  196|      1|}
BIO_meth_set_destroy:
  204|      1|{
  205|      1|    biom->destroy = destroy;
  206|      1|    return 1;
  207|      1|}

BIO_snprintf:
  925|  34.7k|{
  926|  34.7k|    va_list args;
  927|  34.7k|    int ret;
  928|       |
  929|  34.7k|    va_start(args, format);
  930|       |
  931|  34.7k|    ret = BIO_vsnprintf(buf, n, format, args);
  932|       |
  933|  34.7k|    va_end(args);
  934|  34.7k|    return ret;
  935|  34.7k|}
BIO_vsnprintf:
  938|  60.2k|{
  939|  60.2k|    size_t retlen;
  940|  60.2k|    int truncated;
  941|       |
  942|  60.2k|    if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
  ------------------
  |  Branch (942:9): [True: 0, False: 60.2k]
  ------------------
  943|      0|        return -1;
  944|       |
  945|  60.2k|    if (truncated)
  ------------------
  |  Branch (945:9): [True: 0, False: 60.2k]
  ------------------
  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|  60.2k|    return (retlen <= INT_MAX) ? (int)retlen : -1;
  ------------------
  |  Branch (953:12): [True: 60.2k, False: 0]
  ------------------
  954|  60.2k|}
bio_print.c:_dopr:
   91|  60.2k|{
   92|  60.2k|    char ch;
   93|  60.2k|    int64_t value;
   94|  60.2k|#ifndef OPENSSL_SYS_UEFI
   95|  60.2k|    LDOUBLE fvalue;
  ------------------
  |  |   28|  60.2k|# define LDOUBLE double
  ------------------
   96|  60.2k|#endif
   97|  60.2k|    char *strvalue;
   98|  60.2k|    int min;
   99|  60.2k|    int max;
  100|  60.2k|    int state;
  101|  60.2k|    int flags;
  102|  60.2k|    int cflags;
  103|  60.2k|    size_t currlen;
  104|       |
  105|  60.2k|    state = DP_S_DEFAULT;
  ------------------
  |  |   45|  60.2k|#define DP_S_DEFAULT    0
  ------------------
  106|  60.2k|    flags = currlen = cflags = min = 0;
  107|  60.2k|    max = -1;
  108|  60.2k|    ch = *format++;
  109|       |
  110|  2.21M|    while (state != DP_S_DONE) {
  ------------------
  |  |   52|  2.21M|#define DP_S_DONE       7
  ------------------
  |  Branch (110:12): [True: 2.15M, False: 60.2k]
  ------------------
  111|  2.15M|        if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
  ------------------
  |  Branch (111:13): [True: 60.2k, False: 2.09M]
  |  Branch (111:28): [True: 2.09M, False: 0]
  |  Branch (111:46): [True: 0, False: 2.09M]
  ------------------
  112|  60.2k|            state = DP_S_DONE;
  ------------------
  |  |   52|  60.2k|#define DP_S_DONE       7
  ------------------
  113|       |
  114|  2.15M|        switch (state) {
  115|  1.28M|        case DP_S_DEFAULT:
  ------------------
  |  |   45|  1.28M|#define DP_S_DEFAULT    0
  ------------------
  |  Branch (115:9): [True: 1.28M, False: 872k]
  ------------------
  116|  1.28M|            if (ch == '%')
  ------------------
  |  Branch (116:17): [True: 159k, False: 1.12M]
  ------------------
  117|   159k|                state = DP_S_FLAGS;
  ------------------
  |  |   46|   159k|#define DP_S_FLAGS      1
  ------------------
  118|  1.12M|            else
  119|  1.12M|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (119:21): [True: 0, False: 1.12M]
  ------------------
  120|      0|                    return 0;
  121|  1.28M|            ch = *format++;
  122|  1.28M|            break;
  123|   164k|        case DP_S_FLAGS:
  ------------------
  |  |   46|   164k|#define DP_S_FLAGS      1
  ------------------
  |  Branch (123:9): [True: 164k, False: 1.98M]
  ------------------
  124|   164k|            switch (ch) {
  125|      0|            case '-':
  ------------------
  |  Branch (125:13): [True: 0, False: 164k]
  ------------------
  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: 164k]
  ------------------
  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: 164k]
  ------------------
  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: 164k]
  ------------------
  138|      0|                flags |= DP_F_NUM;
  ------------------
  |  |   62|      0|#define DP_F_NUM        (1 << 3)
  ------------------
  139|      0|                ch = *format++;
  140|      0|                break;
  141|  4.84k|            case '0':
  ------------------
  |  Branch (141:13): [True: 4.84k, False: 159k]
  ------------------
  142|  4.84k|                flags |= DP_F_ZERO;
  ------------------
  |  |   64|  4.84k|#define DP_F_ZERO       (1 << 4)
  ------------------
  143|  4.84k|                ch = *format++;
  144|  4.84k|                break;
  145|   159k|            default:
  ------------------
  |  Branch (145:13): [True: 159k, False: 4.84k]
  ------------------
  146|   159k|                state = DP_S_MIN;
  ------------------
  |  |   47|   159k|#define DP_S_MIN        2
  ------------------
  147|   159k|                break;
  148|   164k|            }
  149|   164k|            break;
  150|   169k|        case DP_S_MIN:
  ------------------
  |  |   47|   169k|#define DP_S_MIN        2
  ------------------
  |  Branch (150:9): [True: 169k, False: 1.98M]
  ------------------
  151|   169k|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (151:17): [True: 9.69k, False: 159k]
  ------------------
  152|  9.69k|                min = 10 * min + char_to_int(ch);
  ------------------
  |  |   83|  9.69k|#define char_to_int(p) (p - '0')
  ------------------
  153|  9.69k|                ch = *format++;
  154|   159k|            } else if (ch == '*') {
  ------------------
  |  Branch (154:24): [True: 0, False: 159k]
  ------------------
  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|   159k|                state = DP_S_DOT;
  ------------------
  |  |   48|   159k|#define DP_S_DOT        3
  ------------------
  160|   169k|            break;
  161|   159k|        case DP_S_DOT:
  ------------------
  |  |   48|   159k|#define DP_S_DOT        3
  ------------------
  |  Branch (161:9): [True: 159k, False: 1.99M]
  ------------------
  162|   159k|            if (ch == '.') {
  ------------------
  |  Branch (162:17): [True: 0, False: 159k]
  ------------------
  163|      0|                state = DP_S_MAX;
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  164|      0|                ch = *format++;
  165|      0|            } else
  166|   159k|                state = DP_S_MOD;
  ------------------
  |  |   50|   159k|#define DP_S_MOD        5
  ------------------
  167|   159k|            break;
  168|      0|        case DP_S_MAX:
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  |  Branch (168:9): [True: 0, False: 2.15M]
  ------------------
  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|   159k|        case DP_S_MOD:
  ------------------
  |  |   50|   159k|#define DP_S_MOD        5
  ------------------
  |  Branch (181:9): [True: 159k, False: 1.99M]
  ------------------
  182|   159k|            switch (ch) {
  183|      0|            case 'h':
  ------------------
  |  Branch (183:13): [True: 0, False: 159k]
  ------------------
  184|      0|                cflags = DP_C_SHORT;
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  185|      0|                ch = *format++;
  186|      0|                break;
  187|  34.7k|            case 'l':
  ------------------
  |  Branch (187:13): [True: 34.7k, False: 124k]
  ------------------
  188|  34.7k|                if (*format == 'l') {
  ------------------
  |  Branch (188:21): [True: 0, False: 34.7k]
  ------------------
  189|      0|                    cflags = DP_C_LLONG;
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  190|      0|                    format++;
  191|      0|                } else
  192|  34.7k|                    cflags = DP_C_LONG;
  ------------------
  |  |   72|  34.7k|#define DP_C_LONG       2
  ------------------
  193|  34.7k|                ch = *format++;
  194|  34.7k|                break;
  195|      0|            case 'q':
  ------------------
  |  Branch (195:13): [True: 0, False: 159k]
  ------------------
  196|      0|            case 'j':
  ------------------
  |  Branch (196:13): [True: 0, False: 159k]
  ------------------
  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: 159k]
  ------------------
  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: 159k]
  ------------------
  205|      0|                cflags = DP_C_SIZE;
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  206|      0|                ch = *format++;
  207|      0|                break;
  208|   124k|            default:
  ------------------
  |  Branch (208:13): [True: 124k, False: 34.7k]
  ------------------
  209|   124k|                break;
  210|   159k|            }
  211|   159k|            state = DP_S_CONV;
  ------------------
  |  |   51|   159k|#define DP_S_CONV       6
  ------------------
  212|   159k|            break;
  213|   159k|        case DP_S_CONV:
  ------------------
  |  |   51|   159k|#define DP_S_CONV       6
  ------------------
  |  Branch (213:9): [True: 159k, False: 1.99M]
  ------------------
  214|   159k|            switch (ch) {
  215|      0|            case 'd':
  ------------------
  |  Branch (215:13): [True: 0, False: 159k]
  ------------------
  216|      0|            case 'i':
  ------------------
  |  Branch (216:13): [True: 0, False: 159k]
  ------------------
  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: 159k]
  ------------------
  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: 159k]
  ------------------
  242|      0|            case 'o':
  ------------------
  |  Branch (242:13): [True: 0, False: 159k]
  ------------------
  243|  34.7k|            case 'u':
  ------------------
  |  Branch (243:13): [True: 34.7k, False: 124k]
  ------------------
  244|  34.7k|                flags |= DP_F_UNSIGNED;
  ------------------
  |  |   68|  34.7k|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  245|  34.7k|                switch (cflags) {
  246|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (246:17): [True: 0, False: 34.7k]
  ------------------
  247|      0|                    value = (unsigned short int)va_arg(args, unsigned int);
  248|      0|                    break;
  249|  34.7k|                case DP_C_LONG:
  ------------------
  |  |   72|  34.7k|#define DP_C_LONG       2
  ------------------
  |  Branch (249:17): [True: 34.7k, False: 0]
  ------------------
  250|  34.7k|                    value = va_arg(args, unsigned long int);
  251|  34.7k|                    break;
  252|      0|                case DP_C_LLONG:
  ------------------
  |  |   74|      0|#define DP_C_LLONG      4
  ------------------
  |  Branch (252:17): [True: 0, False: 34.7k]
  ------------------
  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: 34.7k]
  ------------------
  256|      0|                    value = va_arg(args, size_t);
  257|      0|                    break;
  258|      0|                default:
  ------------------
  |  Branch (258:17): [True: 0, False: 34.7k]
  ------------------
  259|      0|                    value = va_arg(args, unsigned int);
  260|      0|                    break;
  261|  34.7k|                }
  262|  34.7k|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value,
  ------------------
  |  Branch (262:21): [True: 0, False: 34.7k]
  ------------------
  263|  34.7k|                            ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
  ------------------
  |  Branch (263:29): [True: 0, False: 34.7k]
  |  Branch (263:46): [True: 34.7k, False: 0]
  ------------------
  264|  34.7k|                            min, max, flags))
  265|      0|                    return 0;
  266|  34.7k|                break;
  267|  34.7k|#ifndef OPENSSL_SYS_UEFI
  268|  34.7k|            case 'f':
  ------------------
  |  Branch (268:13): [True: 0, False: 159k]
  ------------------
  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: 159k]
  ------------------
  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: 159k]
  ------------------
  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: 159k]
  ------------------
  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: 159k]
  ------------------
  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: 159k]
  ------------------
  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|   124k|            case 's':
  ------------------
  |  Branch (316:13): [True: 124k, False: 34.7k]
  ------------------
  317|   124k|                strvalue = va_arg(args, char *);
  318|   124k|                if (max < 0) {
  ------------------
  |  Branch (318:21): [True: 124k, False: 0]
  ------------------
  319|   124k|                    if (buffer)
  ------------------
  |  Branch (319:25): [True: 0, False: 124k]
  ------------------
  320|      0|                        max = INT_MAX;
  321|   124k|                    else
  322|   124k|                        max = *maxlen;
  323|   124k|                }
  324|   124k|                if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
  ------------------
  |  Branch (324:21): [True: 0, False: 124k]
  ------------------
  325|   124k|                            flags, min, max))
  326|      0|                    return 0;
  327|   124k|                break;
  328|   124k|            case 'p':
  ------------------
  |  Branch (328:13): [True: 0, False: 159k]
  ------------------
  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: 159k]
  ------------------
  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: 159k]
  ------------------
  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: 159k]
  ------------------
  346|       |                /* not supported yet, treat as next char */
  347|      0|                format++;
  348|      0|                break;
  349|      0|            default:
  ------------------
  |  Branch (349:13): [True: 0, False: 159k]
  ------------------
  350|       |                /* unknown, skip */
  351|      0|                break;
  352|   159k|            }
  353|   159k|            ch = *format++;
  354|   159k|            state = DP_S_DEFAULT;
  ------------------
  |  |   45|   159k|#define DP_S_DEFAULT    0
  ------------------
  355|   159k|            flags = cflags = min = 0;
  356|   159k|            max = -1;
  357|   159k|            break;
  358|  60.2k|        case DP_S_DONE:
  ------------------
  |  |   52|  60.2k|#define DP_S_DONE       7
  ------------------
  |  Branch (358:9): [True: 60.2k, False: 2.09M]
  ------------------
  359|  60.2k|            break;
  360|      0|        default:
  ------------------
  |  Branch (360:9): [True: 0, False: 2.15M]
  ------------------
  361|      0|            break;
  362|  2.15M|        }
  363|  2.15M|    }
  364|       |    /*
  365|       |     * We have to truncate if there is no dynamic buffer and we have filled the
  366|       |     * static buffer.
  367|       |     */
  368|  60.2k|    if (buffer == NULL) {
  ------------------
  |  Branch (368:9): [True: 60.2k, False: 0]
  ------------------
  369|  60.2k|        *truncated = (currlen > *maxlen - 1);
  370|  60.2k|        if (*truncated)
  ------------------
  |  Branch (370:13): [True: 0, False: 60.2k]
  ------------------
  371|      0|            currlen = *maxlen - 1;
  372|  60.2k|    }
  373|  60.2k|    if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
  ------------------
  |  Branch (373:9): [True: 0, False: 60.2k]
  ------------------
  374|      0|        return 0;
  375|  60.2k|    *retlen = currlen - 1;
  376|  60.2k|    return 1;
  377|  60.2k|}
bio_print.c:doapr_outch:
  833|  2.49M|{
  834|       |    /* If we haven't at least one buffer, someone has done a big booboo */
  835|  2.49M|    if (!ossl_assert(*sbuffer != NULL || buffer != NULL))
  ------------------
  |  |   52|  2.49M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2.49M, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  2.49M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (835:9): [True: 0, False: 2.49M]
  ------------------
  836|      0|        return 0;
  837|       |
  838|       |    /* |currlen| must always be <= |*maxlen| */
  839|  2.49M|    if (!ossl_assert(*currlen <= *maxlen))
  ------------------
  |  |   52|  2.49M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.49M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (839:9): [True: 0, False: 2.49M]
  ------------------
  840|      0|        return 0;
  841|       |
  842|  2.49M|    if (buffer && *currlen == *maxlen) {
  ------------------
  |  Branch (842:9): [True: 0, False: 2.49M]
  |  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)
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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.49M|    if (*currlen < *maxlen) {
  ------------------
  |  Branch (866:9): [True: 2.49M, False: 0]
  ------------------
  867|  2.49M|        if (*sbuffer)
  ------------------
  |  Branch (867:13): [True: 2.49M, False: 0]
  ------------------
  868|  2.49M|            (*sbuffer)[(*currlen)++] = (char)c;
  869|      0|        else
  870|      0|            (*buffer)[(*currlen)++] = (char)c;
  871|  2.49M|    }
  872|       |
  873|  2.49M|    return 1;
  874|  2.49M|}
bio_print.c:fmtint:
  436|  34.7k|{
  437|  34.7k|    int signvalue = 0;
  438|  34.7k|    const char *prefix = "";
  439|  34.7k|    uint64_t uvalue;
  440|  34.7k|    char convert[DECIMAL_SIZE(value) + 3];
  441|  34.7k|    int place = 0;
  442|  34.7k|    int spadlen = 0;
  443|  34.7k|    int zpadlen = 0;
  444|  34.7k|    int caps = 0;
  445|       |
  446|  34.7k|    if (max < 0)
  ------------------
  |  Branch (446:9): [True: 34.7k, False: 0]
  ------------------
  447|  34.7k|        max = 0;
  448|  34.7k|    uvalue = value;
  449|  34.7k|    if (!(flags & DP_F_UNSIGNED)) {
  ------------------
  |  |   68|  34.7k|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  |  Branch (449:9): [True: 0, False: 34.7k]
  ------------------
  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|  34.7k|    if (flags & DP_F_NUM) {
  ------------------
  |  |   62|  34.7k|#define DP_F_NUM        (1 << 3)
  ------------------
  |  Branch (458:9): [True: 0, False: 34.7k]
  ------------------
  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|  34.7k|    if (flags & DP_F_UP)
  ------------------
  |  |   66|  34.7k|#define DP_F_UP         (1 << 5)
  ------------------
  |  Branch (464:9): [True: 0, False: 34.7k]
  ------------------
  465|      0|        caps = 1;
  466|   171k|    do {
  467|   171k|        convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
  ------------------
  |  Branch (467:29): [True: 0, False: 171k]
  ------------------
  468|   171k|            [uvalue % (unsigned)base];
  469|   171k|        uvalue = (uvalue / (unsigned)base);
  470|   171k|    } while (uvalue && (place < (int)sizeof(convert)));
  ------------------
  |  Branch (470:14): [True: 136k, False: 34.7k]
  |  Branch (470:24): [True: 136k, False: 0]
  ------------------
  471|  34.7k|    if (place == sizeof(convert))
  ------------------
  |  Branch (471:9): [True: 0, False: 34.7k]
  ------------------
  472|      0|        place--;
  473|  34.7k|    convert[place] = 0;
  474|       |
  475|  34.7k|    zpadlen = max - place;
  476|  34.7k|    spadlen =
  477|  34.7k|        min - OSSL_MAX(max, place) - (signvalue ? 1 : 0) - strlen(prefix);
  ------------------
  |  |   84|  34.7k|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 34.7k]
  |  |  ------------------
  ------------------
  |  Branch (477:39): [True: 0, False: 34.7k]
  ------------------
  478|  34.7k|    if (zpadlen < 0)
  ------------------
  |  Branch (478:9): [True: 34.7k, False: 0]
  ------------------
  479|  34.7k|        zpadlen = 0;
  480|  34.7k|    if (spadlen < 0)
  ------------------
  |  Branch (480:9): [True: 29.8k, False: 4.84k]
  ------------------
  481|  29.8k|        spadlen = 0;
  482|  34.7k|    if (flags & DP_F_ZERO) {
  ------------------
  |  |   64|  34.7k|#define DP_F_ZERO       (1 << 4)
  ------------------
  |  Branch (482:9): [True: 4.84k, False: 29.8k]
  ------------------
  483|  4.84k|        zpadlen = OSSL_MAX(zpadlen, spadlen);
  ------------------
  |  |   84|  4.84k|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 4.19k, False: 647]
  |  |  ------------------
  ------------------
  484|  4.84k|        spadlen = 0;
  485|  4.84k|    }
  486|  34.7k|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  34.7k|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (486:9): [True: 0, False: 34.7k]
  ------------------
  487|      0|        spadlen = -spadlen;
  488|       |
  489|       |    /* spaces */
  490|  34.7k|    while (spadlen > 0) {
  ------------------
  |  Branch (490:12): [True: 0, False: 34.7k]
  ------------------
  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|  34.7k|    if (signvalue)
  ------------------
  |  Branch (497:9): [True: 0, False: 34.7k]
  ------------------
  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|  34.7k|    while (*prefix) {
  ------------------
  |  Branch (502:12): [True: 0, False: 34.7k]
  ------------------
  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|  34.7k|    if (zpadlen > 0) {
  ------------------
  |  Branch (509:9): [True: 647, False: 34.0k]
  ------------------
  510|  1.49k|        while (zpadlen > 0) {
  ------------------
  |  Branch (510:16): [True: 847, False: 647]
  ------------------
  511|    847|            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
  ------------------
  |  Branch (511:17): [True: 0, False: 847]
  ------------------
  512|      0|                return 0;
  513|    847|            --zpadlen;
  514|    847|        }
  515|    647|    }
  516|       |    /* digits */
  517|   206k|    while (place > 0) {
  ------------------
  |  Branch (517:12): [True: 171k, False: 34.7k]
  ------------------
  518|   171k|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]))
  ------------------
  |  Branch (518:13): [True: 0, False: 171k]
  ------------------
  519|      0|            return 0;
  520|   171k|    }
  521|       |
  522|       |    /* left justified spaces */
  523|  34.7k|    while (spadlen < 0) {
  ------------------
  |  Branch (523:12): [True: 0, False: 34.7k]
  ------------------
  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|  34.7k|    return 1;
  529|  34.7k|}
bio_print.c:fmtstr:
  384|   124k|{
  385|   124k|    int padlen;
  386|   124k|    size_t strln;
  387|   124k|    int cnt = 0;
  388|       |
  389|   124k|    if (value == 0)
  ------------------
  |  Branch (389:9): [True: 0, False: 124k]
  ------------------
  390|      0|        value = "<NULL>";
  391|       |
  392|   124k|    strln = OPENSSL_strnlen(value, max < 0 ? SIZE_MAX : (size_t)max);
  ------------------
  |  Branch (392:36): [True: 0, False: 124k]
  ------------------
  393|       |
  394|   124k|    padlen = min - strln;
  395|   124k|    if (min < 0 || padlen < 0)
  ------------------
  |  Branch (395:9): [True: 0, False: 124k]
  |  Branch (395:20): [True: 124k, False: 0]
  ------------------
  396|   124k|        padlen = 0;
  397|   124k|    if (max >= 0) {
  ------------------
  |  Branch (397:9): [True: 124k, False: 0]
  ------------------
  398|       |        /*
  399|       |         * Calculate the maximum output including padding.
  400|       |         * Make sure max doesn't overflow into negativity
  401|       |         */
  402|   124k|        if (max < INT_MAX - padlen)
  ------------------
  |  Branch (402:13): [True: 124k, False: 0]
  ------------------
  403|   124k|            max += padlen;
  404|      0|        else
  405|      0|            max = INT_MAX;
  406|   124k|    }
  407|   124k|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|   124k|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (407:9): [True: 0, False: 124k]
  ------------------
  408|      0|        padlen = -padlen;
  409|       |
  410|   124k|    while ((padlen > 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (410:12): [True: 0, False: 124k]
  |  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.26M|    while (strln > 0 && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (416:12): [True: 1.14M, False: 124k]
  |  Branch (416:26): [True: 0, False: 1.14M]
  |  Branch (416:37): [True: 1.14M, False: 0]
  ------------------
  417|  1.14M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
  ------------------
  |  Branch (417:13): [True: 0, False: 1.14M]
  ------------------
  418|      0|            return 0;
  419|  1.14M|        --strln;
  420|  1.14M|        ++cnt;
  421|  1.14M|    }
  422|   124k|    while ((padlen < 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (422:12): [True: 0, False: 124k]
  |  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|   124k|    return 1;
  429|   124k|}

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

ossl_bio_core_globals_free:
   26|      2|{
   27|      2|    OPENSSL_free(vbcg);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   28|      2|}
ossl_bio_core_globals_new:
   31|      2|{
   32|      2|    return OPENSSL_zalloc(sizeof(BIO_CORE_GLOBALS));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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;
  ------------------
  |  |   83|      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;
  ------------------
  |  |  217|      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),     \
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  564|      0|# define BIO_set_fp(b,fp,c)      BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)(fp))
  |  |  ------------------
  |  |  |  |  436|      0|# define BIO_C_SET_FILE_PTR                      106
  |  |  ------------------
  ------------------
   88|      0|    return ret;
   89|      0|}

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

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

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

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

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

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

BN_bn2dec:
   51|  2.17k|{
   52|  2.17k|    int i = 0, num, ok = 0, n, tbytes;
   53|  2.17k|    char *buf = NULL;
   54|  2.17k|    char *p;
   55|  2.17k|    BIGNUM *t = NULL;
   56|  2.17k|    BN_ULONG *bn_data = NULL, *lp;
  ------------------
  |  |   37|  2.17k|#  define BN_ULONG        unsigned long
  ------------------
   57|  2.17k|    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|  2.17k|    i = BN_num_bits(a) * 3;
   66|  2.17k|    num = (i / 10 + i / 1000 + 1) + 1;
   67|  2.17k|    tbytes = num + 3;   /* negative and terminator and one spare? */
   68|  2.17k|    bn_data_num = num / BN_DEC_NUM + 1;
  ------------------
  |  |   99|  2.17k|#  define BN_DEC_NUM      19
  ------------------
   69|  2.17k|    bn_data = OPENSSL_malloc(bn_data_num * sizeof(BN_ULONG));
  ------------------
  |  |  102|  2.17k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.17k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.17k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   70|  2.17k|    buf = OPENSSL_malloc(tbytes);
  ------------------
  |  |  102|  2.17k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.17k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.17k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   71|  2.17k|    if (buf == NULL || bn_data == NULL)
  ------------------
  |  Branch (71:9): [True: 0, False: 2.17k]
  |  Branch (71:24): [True: 0, False: 2.17k]
  ------------------
   72|      0|        goto err;
   73|  2.17k|    if ((t = BN_dup(a)) == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 2.17k]
  ------------------
   74|      0|        goto err;
   75|       |
   76|  2.17k|    p = buf;
   77|  2.17k|    lp = bn_data;
   78|  2.17k|    if (BN_is_zero(t)) {
  ------------------
  |  Branch (78:9): [True: 0, False: 2.17k]
  ------------------
   79|      0|        *p++ = '0';
   80|      0|        *p++ = '\0';
   81|  2.17k|    } else {
   82|  2.17k|        if (BN_is_negative(t))
  ------------------
  |  Branch (82:13): [True: 0, False: 2.17k]
  ------------------
   83|      0|            *p++ = '-';
   84|       |
   85|  9.19k|        while (!BN_is_zero(t)) {
  ------------------
  |  Branch (85:16): [True: 7.01k, False: 2.17k]
  ------------------
   86|  7.01k|            if (lp - bn_data >= bn_data_num)
  ------------------
  |  Branch (86:17): [True: 0, False: 7.01k]
  ------------------
   87|      0|                goto err;
   88|  7.01k|            *lp = BN_div_word(t, BN_DEC_CONV);
  ------------------
  |  |   98|  7.01k|#  define BN_DEC_CONV     (10000000000000000000UL)
  ------------------
   89|  7.01k|            if (*lp == (BN_ULONG)-1)
  ------------------
  |  Branch (89:17): [True: 0, False: 7.01k]
  ------------------
   90|      0|                goto err;
   91|  7.01k|            lp++;
   92|  7.01k|        }
   93|  2.17k|        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|  2.17k|        n = BIO_snprintf(p, tbytes - (size_t)(p - buf), BN_DEC_FMT1, *lp);
  ------------------
  |  |  100|  2.17k|#  define BN_DEC_FMT1     "%lu"
  ------------------
  100|  2.17k|        if (n < 0)
  ------------------
  |  Branch (100:13): [True: 0, False: 2.17k]
  ------------------
  101|      0|            goto err;
  102|  2.17k|        p += n;
  103|  7.01k|        while (lp != bn_data) {
  ------------------
  |  Branch (103:16): [True: 4.84k, False: 2.17k]
  ------------------
  104|  4.84k|            lp--;
  105|  4.84k|            n = BIO_snprintf(p, tbytes - (size_t)(p - buf), BN_DEC_FMT2, *lp);
  ------------------
  |  |  101|  4.84k|#  define BN_DEC_FMT2     "%019lu"
  ------------------
  106|  4.84k|            if (n < 0)
  ------------------
  |  Branch (106:17): [True: 0, False: 4.84k]
  ------------------
  107|      0|                goto err;
  108|  4.84k|            p += n;
  109|  4.84k|        }
  110|  2.17k|    }
  111|  2.17k|    ok = 1;
  112|  2.17k| err:
  113|  2.17k|    OPENSSL_free(bn_data);
  ------------------
  |  |  115|  2.17k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.17k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.17k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  114|  2.17k|    BN_free(t);
  115|  2.17k|    if (ok)
  ------------------
  |  Branch (115:9): [True: 2.17k, False: 0]
  ------------------
  116|  2.17k|        return buf;
  117|      0|    OPENSSL_free(buf);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  118|      0|    return NULL;
  119|  2.17k|}

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

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

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

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

BN_GF2m_add:
  253|  5.22M|{
  254|  5.22M|    int i;
  255|  5.22M|    const BIGNUM *at, *bt;
  256|       |
  257|  5.22M|    bn_check_top(a);
  258|  5.22M|    bn_check_top(b);
  259|       |
  260|  5.22M|    if (a->top < b->top) {
  ------------------
  |  Branch (260:9): [True: 92.4k, False: 5.13M]
  ------------------
  261|  92.4k|        at = b;
  262|  92.4k|        bt = a;
  263|  5.13M|    } else {
  264|  5.13M|        at = a;
  265|  5.13M|        bt = b;
  266|  5.13M|    }
  267|       |
  268|  5.22M|    if (bn_wexpand(r, at->top) == NULL)
  ------------------
  |  Branch (268:9): [True: 0, False: 5.22M]
  ------------------
  269|      0|        return 0;
  270|       |
  271|  34.3M|    for (i = 0; i < bt->top; i++) {
  ------------------
  |  Branch (271:17): [True: 29.1M, False: 5.22M]
  ------------------
  272|  29.1M|        r->d[i] = at->d[i] ^ bt->d[i];
  273|  29.1M|    }
  274|  5.40M|    for (; i < at->top; i++) {
  ------------------
  |  Branch (274:12): [True: 182k, False: 5.22M]
  ------------------
  275|   182k|        r->d[i] = at->d[i];
  276|   182k|    }
  277|       |
  278|  5.22M|    r->top = at->top;
  279|  5.22M|    bn_correct_top(r);
  280|       |
  281|  5.22M|    return 1;
  282|  5.22M|}
BN_GF2m_mod_arr:
  293|  8.33M|{
  294|  8.33M|    int j, k;
  295|  8.33M|    int n, dN, d0, d1;
  296|  8.33M|    BN_ULONG zz, *z;
  ------------------
  |  |   37|  8.33M|#  define BN_ULONG        unsigned long
  ------------------
  297|       |
  298|  8.33M|    bn_check_top(a);
  299|       |
  300|  8.33M|    if (p[0] == 0) {
  ------------------
  |  Branch (300:9): [True: 0, False: 8.33M]
  ------------------
  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|  8.33M|    if (a != r) {
  ------------------
  |  Branch (310:9): [True: 8.33M, False: 6.18k]
  ------------------
  311|  8.33M|        if (!bn_wexpand(r, a->top))
  ------------------
  |  Branch (311:13): [True: 0, False: 8.33M]
  ------------------
  312|      0|            return 0;
  313|  97.4M|        for (j = 0; j < a->top; j++) {
  ------------------
  |  Branch (313:21): [True: 89.0M, False: 8.33M]
  ------------------
  314|  89.0M|            r->d[j] = a->d[j];
  315|  89.0M|        }
  316|  8.33M|        r->top = a->top;
  317|  8.33M|    }
  318|  8.33M|    z = r->d;
  319|       |
  320|       |    /* start reduction */
  321|  8.33M|    dN = p[0] / BN_BITS2;
  ------------------
  |  |   54|  8.33M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  8.33M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  322|  95.7M|    for (j = r->top - 1; j > dN;) {
  ------------------
  |  Branch (322:26): [True: 87.4M, False: 8.33M]
  ------------------
  323|  87.4M|        zz = z[j];
  324|  87.4M|        if (z[j] == 0) {
  ------------------
  |  Branch (324:13): [True: 43.7M, False: 43.7M]
  ------------------
  325|  43.7M|            j--;
  326|  43.7M|            continue;
  327|  43.7M|        }
  328|  43.7M|        z[j] = 0;
  329|       |
  330|   174M|        for (k = 1; p[k] != 0; k++) {
  ------------------
  |  Branch (330:21): [True: 130M, False: 43.7M]
  ------------------
  331|       |            /* reducing component t^p[k] */
  332|   130M|            n = p[0] - p[k];
  333|   130M|            d0 = n % BN_BITS2;
  ------------------
  |  |   54|   130M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   130M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  334|   130M|            d1 = BN_BITS2 - d0;
  ------------------
  |  |   54|   130M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   130M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  335|   130M|            n /= BN_BITS2;
  ------------------
  |  |   54|   130M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   130M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  336|   130M|            z[j - n] ^= (zz >> d0);
  337|   130M|            if (d0)
  ------------------
  |  Branch (337:17): [True: 128M, False: 2.25M]
  ------------------
  338|   128M|                z[j - n - 1] ^= (zz << d1);
  339|   130M|        }
  340|       |
  341|       |        /* reducing component t^0 */
  342|  43.7M|        n = dN;
  343|  43.7M|        d0 = p[0] % BN_BITS2;
  ------------------
  |  |   54|  43.7M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  43.7M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  344|  43.7M|        d1 = BN_BITS2 - d0;
  ------------------
  |  |   54|  43.7M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  43.7M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  345|  43.7M|        z[j - n] ^= (zz >> d0);
  346|  43.7M|        if (d0)
  ------------------
  |  Branch (346:13): [True: 43.7M, False: 0]
  ------------------
  347|  43.7M|            z[j - n - 1] ^= (zz << d1);
  348|  43.7M|    }
  349|       |
  350|       |    /* final round of reduction */
  351|  16.5M|    while (j == dN) {
  ------------------
  |  Branch (351:12): [True: 16.5M, False: 29.9k]
  ------------------
  352|       |
  353|  16.5M|        d0 = p[0] % BN_BITS2;
  ------------------
  |  |   54|  16.5M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  16.5M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  354|  16.5M|        zz = z[dN] >> d0;
  355|  16.5M|        if (zz == 0)
  ------------------
  |  Branch (355:13): [True: 8.30M, False: 8.23M]
  ------------------
  356|  8.30M|            break;
  357|  8.23M|        d1 = BN_BITS2 - d0;
  ------------------
  |  |   54|  8.23M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  8.23M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  358|       |
  359|       |        /* clear up the top d1 bits */
  360|  8.23M|        if (d0)
  ------------------
  |  Branch (360:13): [True: 8.23M, False: 0]
  ------------------
  361|  8.23M|            z[dN] = (z[dN] << d1) >> d1;
  362|      0|        else
  363|      0|            z[dN] = 0;
  364|  8.23M|        z[0] ^= zz;             /* reduction t^0 component */
  365|       |
  366|  32.6M|        for (k = 1; p[k] != 0; k++) {
  ------------------
  |  Branch (366:21): [True: 24.4M, False: 8.23M]
  ------------------
  367|  24.4M|            BN_ULONG tmp_ulong;
  ------------------
  |  |   37|  24.4M|#  define BN_ULONG        unsigned long
  ------------------
  368|       |
  369|       |            /* reducing component t^p[k] */
  370|  24.4M|            n = p[k] / BN_BITS2;
  ------------------
  |  |   54|  24.4M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  24.4M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  371|  24.4M|            d0 = p[k] % BN_BITS2;
  ------------------
  |  |   54|  24.4M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  24.4M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  372|  24.4M|            d1 = BN_BITS2 - d0;
  ------------------
  |  |   54|  24.4M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  24.4M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  373|  24.4M|            z[n] ^= (zz << d0);
  374|  24.4M|            if (d0 && (tmp_ulong = zz >> d1))
  ------------------
  |  Branch (374:17): [True: 24.4M, False: 0]
  |  Branch (374:23): [True: 948k, False: 23.4M]
  ------------------
  375|   948k|                z[n + 1] ^= tmp_ulong;
  376|  24.4M|        }
  377|       |
  378|  8.23M|    }
  379|       |
  380|  8.33M|    bn_correct_top(r);
  381|  8.33M|    return 1;
  382|  8.33M|}
BN_GF2m_mod:
  391|  14.3k|{
  392|  14.3k|    int ret = 0;
  393|  14.3k|    int arr[6];
  394|  14.3k|    bn_check_top(a);
  395|  14.3k|    bn_check_top(p);
  396|  14.3k|    ret = BN_GF2m_poly2arr(p, arr, OSSL_NELEM(arr));
  ------------------
  |  |   14|  14.3k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  397|  14.3k|    if (!ret || ret > (int)OSSL_NELEM(arr)) {
  ------------------
  |  |   14|  14.3k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (397:9): [True: 0, False: 14.3k]
  |  Branch (397:17): [True: 0, False: 14.3k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  399|      0|        return 0;
  400|      0|    }
  401|  14.3k|    ret = BN_GF2m_mod_arr(r, a, arr);
  402|  14.3k|    bn_check_top(r);
  403|  14.3k|    return ret;
  404|  14.3k|}
BN_GF2m_mod_mul_arr:
  412|  2.38M|{
  413|  2.38M|    int zlen, i, j, k, ret = 0;
  414|  2.38M|    BIGNUM *s;
  415|  2.38M|    BN_ULONG x1, x0, y1, y0, zz[4];
  ------------------
  |  |   37|  2.38M|#  define BN_ULONG        unsigned long
  ------------------
  416|       |
  417|  2.38M|    bn_check_top(a);
  418|  2.38M|    bn_check_top(b);
  419|       |
  420|  2.38M|    if (a == b) {
  ------------------
  |  Branch (420:9): [True: 0, False: 2.38M]
  ------------------
  421|      0|        return BN_GF2m_mod_sqr_arr(r, a, p, ctx);
  422|      0|    }
  423|       |
  424|  2.38M|    BN_CTX_start(ctx);
  425|  2.38M|    if ((s = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (425:9): [True: 0, False: 2.38M]
  ------------------
  426|      0|        goto err;
  427|       |
  428|  2.38M|    zlen = a->top + b->top + 4;
  429|  2.38M|    if (!bn_wexpand(s, zlen))
  ------------------
  |  Branch (429:9): [True: 0, False: 2.38M]
  ------------------
  430|      0|        goto err;
  431|  2.38M|    s->top = zlen;
  432|       |
  433|  39.8M|    for (i = 0; i < zlen; i++)
  ------------------
  |  Branch (433:17): [True: 37.5M, False: 2.38M]
  ------------------
  434|  37.5M|        s->d[i] = 0;
  435|       |
  436|  9.41M|    for (j = 0; j < b->top; j += 2) {
  ------------------
  |  Branch (436:17): [True: 7.02M, False: 2.38M]
  ------------------
  437|  7.02M|        y0 = b->d[j];
  438|  7.02M|        y1 = ((j + 1) == b->top) ? 0 : b->d[j + 1];
  ------------------
  |  Branch (438:14): [True: 66.8k, False: 6.96M]
  ------------------
  439|  27.9M|        for (i = 0; i < a->top; i += 2) {
  ------------------
  |  Branch (439:21): [True: 20.9M, False: 7.02M]
  ------------------
  440|  20.9M|            x0 = a->d[i];
  441|  20.9M|            x1 = ((i + 1) == a->top) ? 0 : a->d[i + 1];
  ------------------
  |  Branch (441:18): [True: 120k, False: 20.7M]
  ------------------
  442|  20.9M|            bn_GF2m_mul_2x2(zz, x1, x0, y1, y0);
  443|   104M|            for (k = 0; k < 4; k++)
  ------------------
  |  Branch (443:25): [True: 83.6M, False: 20.9M]
  ------------------
  444|  83.6M|                s->d[i + j + k] ^= zz[k];
  445|  20.9M|        }
  446|  7.02M|    }
  447|       |
  448|  2.38M|    bn_correct_top(s);
  449|  2.38M|    if (BN_GF2m_mod_arr(r, s, p))
  ------------------
  |  Branch (449:9): [True: 2.38M, False: 0]
  ------------------
  450|  2.38M|        ret = 1;
  451|  2.38M|    bn_check_top(r);
  452|       |
  453|  2.38M| err:
  454|  2.38M|    BN_CTX_end(ctx);
  455|  2.38M|    return ret;
  456|  2.38M|}
BN_GF2m_mod_mul:
  467|  43.1k|{
  468|  43.1k|    int ret = 0;
  469|  43.1k|    const int max = BN_num_bits(p) + 1;
  470|  43.1k|    int *arr;
  471|       |
  472|  43.1k|    bn_check_top(a);
  473|  43.1k|    bn_check_top(b);
  474|  43.1k|    bn_check_top(p);
  475|       |
  476|  43.1k|    arr = OPENSSL_malloc(sizeof(*arr) * max);
  ------------------
  |  |  102|  43.1k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  43.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  43.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  477|  43.1k|    if (arr == NULL)
  ------------------
  |  Branch (477:9): [True: 0, False: 43.1k]
  ------------------
  478|      0|        return 0;
  479|  43.1k|    ret = BN_GF2m_poly2arr(p, arr, max);
  480|  43.1k|    if (!ret || ret > max) {
  ------------------
  |  Branch (480:9): [True: 0, False: 43.1k]
  |  Branch (480:17): [True: 0, False: 43.1k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  482|      0|        goto err;
  483|      0|    }
  484|  43.1k|    ret = BN_GF2m_mod_mul_arr(r, a, b, arr, ctx);
  485|  43.1k|    bn_check_top(r);
  486|  43.1k| err:
  487|  43.1k|    OPENSSL_free(arr);
  ------------------
  |  |  115|  43.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  43.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  43.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  488|  43.1k|    return ret;
  489|  43.1k|}
BN_GF2m_mod_sqr_arr:
  494|  5.86M|{
  495|  5.86M|    int i, ret = 0;
  496|  5.86M|    BIGNUM *s;
  497|       |
  498|  5.86M|    bn_check_top(a);
  499|  5.86M|    BN_CTX_start(ctx);
  500|  5.86M|    if ((s = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (500:9): [True: 0, False: 5.86M]
  ------------------
  501|      0|        goto err;
  502|  5.86M|    if (!bn_wexpand(s, 2 * a->top))
  ------------------
  |  Branch (502:9): [True: 0, False: 5.86M]
  ------------------
  503|      0|        goto err;
  504|       |
  505|  36.8M|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (505:26): [True: 30.9M, False: 5.86M]
  ------------------
  506|  30.9M|        s->d[2 * i + 1] = SQR1(a->d[i]);
  ------------------
  |  |   34|  30.9M|    SQR_nibble((w) >> 60) << 56 | SQR_nibble((w) >> 56) << 48 | \
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 60) << 56 | SQR_nibble((w) >> 56) << 48 | \
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   35|  30.9M|    SQR_nibble((w) >> 52) << 40 | SQR_nibble((w) >> 48) << 32 | \
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 52) << 40 | SQR_nibble((w) >> 48) << 32 | \
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   36|  30.9M|    SQR_nibble((w) >> 44) << 24 | SQR_nibble((w) >> 40) << 16 | \
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 44) << 24 | SQR_nibble((w) >> 40) << 16 | \
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   37|  30.9M|    SQR_nibble((w) >> 36) <<  8 | SQR_nibble((w) >> 32)
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 36) <<  8 | SQR_nibble((w) >> 32)
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  ------------------
  507|  30.9M|        s->d[2 * i] = SQR0(a->d[i]);
  ------------------
  |  |   39|  30.9M|    SQR_nibble((w) >> 28) << 56 | SQR_nibble((w) >> 24) << 48 | \
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 28) << 56 | SQR_nibble((w) >> 24) << 48 | \
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   40|  30.9M|    SQR_nibble((w) >> 20) << 40 | SQR_nibble((w) >> 16) << 32 | \
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 20) << 40 | SQR_nibble((w) >> 16) << 32 | \
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   41|  30.9M|    SQR_nibble((w) >> 12) << 24 | SQR_nibble((w) >>  8) << 16 | \
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >> 12) << 24 | SQR_nibble((w) >>  8) << 16 | \
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |   42|  30.9M|    SQR_nibble((w) >>  4) <<  8 | SQR_nibble((w)      )
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  |  |                   SQR_nibble((w) >>  4) <<  8 | SQR_nibble((w)      )
  |  |  ------------------
  |  |  |  |   25|  30.9M|# define SQR_nibble(w)   ((((w) & 8) << 3) \
  |  |  |  |   26|  30.9M|                       |  (((w) & 4) << 2) \
  |  |  |  |   27|  30.9M|                       |  (((w) & 2) << 1) \
  |  |  |  |   28|  30.9M|                       |   ((w) & 1))
  |  |  ------------------
  ------------------
  508|  30.9M|    }
  509|       |
  510|  5.86M|    s->top = 2 * a->top;
  511|  5.86M|    bn_correct_top(s);
  512|  5.86M|    if (!BN_GF2m_mod_arr(r, s, p))
  ------------------
  |  Branch (512:9): [True: 0, False: 5.86M]
  ------------------
  513|      0|        goto err;
  514|  5.86M|    bn_check_top(r);
  515|  5.86M|    ret = 1;
  516|  5.86M| err:
  517|  5.86M|    BN_CTX_end(ctx);
  518|  5.86M|    return ret;
  519|  5.86M|}
BN_GF2m_mod_inv:
  730|  14.3k|{
  731|  14.3k|    BIGNUM *b = NULL;
  732|  14.3k|    int ret = 0;
  733|  14.3k|    int numbits;
  734|       |
  735|  14.3k|    BN_CTX_start(ctx);
  736|  14.3k|    if ((b = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (736:9): [True: 0, False: 14.3k]
  ------------------
  737|      0|        goto err;
  738|       |
  739|       |    /* Fail on a non-sensical input p value */
  740|  14.3k|    numbits = BN_num_bits(p);
  741|  14.3k|    if (numbits <= 1)
  ------------------
  |  Branch (741:9): [True: 0, False: 14.3k]
  ------------------
  742|      0|        goto err;
  743|       |
  744|       |    /* generate blinding value */
  745|  14.3k|    do {
  746|  14.3k|        if (!BN_priv_rand_ex(b, numbits - 1,
  ------------------
  |  Branch (746:13): [True: 0, False: 14.3k]
  ------------------
  747|  14.3k|                             BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx))
  ------------------
  |  |   80|  14.3k|#define BN_RAND_TOP_ANY    -1
  ------------------
                                           BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx))
  ------------------
  |  |   85|  14.3k|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  748|      0|            goto err;
  749|  14.3k|    } while (BN_is_zero(b));
  ------------------
  |  Branch (749:14): [True: 0, False: 14.3k]
  ------------------
  750|       |
  751|       |    /* r := a * b */
  752|  14.3k|    if (!BN_GF2m_mod_mul(r, a, b, p, ctx))
  ------------------
  |  Branch (752:9): [True: 0, False: 14.3k]
  ------------------
  753|      0|        goto err;
  754|       |
  755|       |    /* r := 1/(a * b) */
  756|  14.3k|    if (!BN_GF2m_mod_inv_vartime(r, r, p, ctx))
  ------------------
  |  Branch (756:9): [True: 0, False: 14.3k]
  ------------------
  757|      0|        goto err;
  758|       |
  759|       |    /* r := b/(a * b) = 1/a */
  760|  14.3k|    if (!BN_GF2m_mod_mul(r, r, b, p, ctx))
  ------------------
  |  Branch (760:9): [True: 0, False: 14.3k]
  ------------------
  761|      0|        goto err;
  762|       |
  763|  14.3k|    ret = 1;
  764|       |
  765|  14.3k| err:
  766|  14.3k|    BN_CTX_end(ctx);
  767|  14.3k|    return ret;
  768|  14.3k|}
BN_GF2m_mod_div:
  803|  14.3k|{
  804|  14.3k|    BIGNUM *xinv = NULL;
  805|  14.3k|    int ret = 0;
  806|       |
  807|  14.3k|    bn_check_top(y);
  808|  14.3k|    bn_check_top(x);
  809|  14.3k|    bn_check_top(p);
  810|       |
  811|  14.3k|    BN_CTX_start(ctx);
  812|  14.3k|    xinv = BN_CTX_get(ctx);
  813|  14.3k|    if (xinv == NULL)
  ------------------
  |  Branch (813:9): [True: 0, False: 14.3k]
  ------------------
  814|      0|        goto err;
  815|       |
  816|  14.3k|    if (!BN_GF2m_mod_inv(xinv, x, p, ctx))
  ------------------
  |  Branch (816:9): [True: 0, False: 14.3k]
  ------------------
  817|      0|        goto err;
  818|  14.3k|    if (!BN_GF2m_mod_mul(r, y, xinv, p, ctx))
  ------------------
  |  Branch (818:9): [True: 0, False: 14.3k]
  ------------------
  819|      0|        goto err;
  820|  14.3k|    bn_check_top(r);
  821|  14.3k|    ret = 1;
  822|       |
  823|  14.3k| err:
  824|  14.3k|    BN_CTX_end(ctx);
  825|  14.3k|    return ret;
  826|  14.3k|}
BN_GF2m_mod_exp_arr:
  864|  1.78k|{
  865|  1.78k|    int ret = 0, i, n;
  866|  1.78k|    BIGNUM *u;
  867|       |
  868|  1.78k|    bn_check_top(a);
  869|  1.78k|    bn_check_top(b);
  870|       |
  871|  1.78k|    if (BN_is_zero(b))
  ------------------
  |  Branch (871:9): [True: 0, False: 1.78k]
  ------------------
  872|      0|        return BN_one(r);
  ------------------
  |  |  197|      0|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  873|       |
  874|  1.78k|    if (BN_abs_is_word(b, 1))
  ------------------
  |  Branch (874:9): [True: 0, False: 1.78k]
  ------------------
  875|      0|        return (BN_copy(r, a) != NULL);
  876|       |
  877|  1.78k|    BN_CTX_start(ctx);
  878|  1.78k|    if ((u = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (878:9): [True: 0, False: 1.78k]
  ------------------
  879|      0|        goto err;
  880|       |
  881|  1.78k|    if (!BN_GF2m_mod_arr(u, a, p))
  ------------------
  |  Branch (881:9): [True: 0, False: 1.78k]
  ------------------
  882|      0|        goto err;
  883|       |
  884|  1.78k|    n = BN_num_bits(b) - 1;
  885|   235k|    for (i = n - 1; i >= 0; i--) {
  ------------------
  |  Branch (885:21): [True: 233k, False: 1.78k]
  ------------------
  886|   233k|        if (!BN_GF2m_mod_sqr_arr(u, u, p, ctx))
  ------------------
  |  Branch (886:13): [True: 0, False: 233k]
  ------------------
  887|      0|            goto err;
  888|   233k|        if (BN_is_bit_set(b, i)) {
  ------------------
  |  Branch (888:13): [True: 0, False: 233k]
  ------------------
  889|      0|            if (!BN_GF2m_mod_mul_arr(u, u, a, p, ctx))
  ------------------
  |  Branch (889:17): [True: 0, False: 0]
  ------------------
  890|      0|                goto err;
  891|      0|        }
  892|   233k|    }
  893|  1.78k|    if (!BN_copy(r, u))
  ------------------
  |  Branch (893:9): [True: 0, False: 1.78k]
  ------------------
  894|      0|        goto err;
  895|  1.78k|    bn_check_top(r);
  896|  1.78k|    ret = 1;
  897|  1.78k| err:
  898|  1.78k|    BN_CTX_end(ctx);
  899|  1.78k|    return ret;
  900|  1.78k|}
BN_GF2m_mod_sqrt_arr:
  940|  1.78k|{
  941|  1.78k|    int ret = 0;
  942|  1.78k|    BIGNUM *u;
  943|       |
  944|  1.78k|    bn_check_top(a);
  945|       |
  946|  1.78k|    if (p[0] == 0) {
  ------------------
  |  Branch (946:9): [True: 0, False: 1.78k]
  ------------------
  947|       |        /* reduction mod 1 => return 0 */
  948|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  949|      0|        return 1;
  950|      0|    }
  951|       |
  952|  1.78k|    BN_CTX_start(ctx);
  953|  1.78k|    if ((u = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (953:9): [True: 0, False: 1.78k]
  ------------------
  954|      0|        goto err;
  955|       |
  956|  1.78k|    if (!BN_set_bit(u, p[0] - 1))
  ------------------
  |  Branch (956:9): [True: 0, False: 1.78k]
  ------------------
  957|      0|        goto err;
  958|  1.78k|    ret = BN_GF2m_mod_exp_arr(r, a, u, p, ctx);
  959|  1.78k|    bn_check_top(r);
  960|       |
  961|  1.78k| err:
  962|  1.78k|    BN_CTX_end(ctx);
  963|  1.78k|    return ret;
  964|  1.78k|}
BN_GF2m_mod_solve_quad_arr:
 1002|  11.1k|{
 1003|  11.1k|    int ret = 0, count = 0, j;
 1004|  11.1k|    BIGNUM *a, *z, *rho, *w, *w2, *tmp;
 1005|       |
 1006|  11.1k|    bn_check_top(a_);
 1007|       |
 1008|  11.1k|    if (p[0] == 0) {
  ------------------
  |  Branch (1008:9): [True: 0, False: 11.1k]
  ------------------
 1009|       |        /* reduction mod 1 => return 0 */
 1010|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1011|      0|        return 1;
 1012|      0|    }
 1013|       |
 1014|  11.1k|    BN_CTX_start(ctx);
 1015|  11.1k|    a = BN_CTX_get(ctx);
 1016|  11.1k|    z = BN_CTX_get(ctx);
 1017|  11.1k|    w = BN_CTX_get(ctx);
 1018|  11.1k|    if (w == NULL)
  ------------------
  |  Branch (1018:9): [True: 0, False: 11.1k]
  ------------------
 1019|      0|        goto err;
 1020|       |
 1021|  11.1k|    if (!BN_GF2m_mod_arr(a, a_, p))
  ------------------
  |  Branch (1021:9): [True: 0, False: 11.1k]
  ------------------
 1022|      0|        goto err;
 1023|       |
 1024|  11.1k|    if (BN_is_zero(a)) {
  ------------------
  |  Branch (1024:9): [True: 1, False: 11.1k]
  ------------------
 1025|      1|        BN_zero(r);
  ------------------
  |  |  202|      1|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1026|      1|        ret = 1;
 1027|      1|        goto err;
 1028|      1|    }
 1029|       |
 1030|  11.1k|    if (p[0] & 0x1) {           /* m is odd */
  ------------------
  |  Branch (1030:9): [True: 8.13k, False: 3.04k]
  ------------------
 1031|       |        /* compute half-trace of a */
 1032|  8.13k|        if (!BN_copy(z, a))
  ------------------
  |  Branch (1032:13): [True: 0, False: 8.13k]
  ------------------
 1033|      0|            goto err;
 1034|   530k|        for (j = 1; j <= (p[0] - 1) / 2; j++) {
  ------------------
  |  Branch (1034:21): [True: 522k, False: 8.13k]
  ------------------
 1035|   522k|            if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
  ------------------
  |  Branch (1035:17): [True: 0, False: 522k]
  ------------------
 1036|      0|                goto err;
 1037|   522k|            if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
  ------------------
  |  Branch (1037:17): [True: 0, False: 522k]
  ------------------
 1038|      0|                goto err;
 1039|   522k|            if (!BN_GF2m_add(z, z, a))
  ------------------
  |  Branch (1039:17): [True: 0, False: 522k]
  ------------------
 1040|      0|                goto err;
 1041|   522k|        }
 1042|       |
 1043|  8.13k|    } else {                    /* m is even */
 1044|       |
 1045|  3.04k|        rho = BN_CTX_get(ctx);
 1046|  3.04k|        w2 = BN_CTX_get(ctx);
 1047|  3.04k|        tmp = BN_CTX_get(ctx);
 1048|  3.04k|        if (tmp == NULL)
  ------------------
  |  Branch (1048:13): [True: 0, False: 3.04k]
  ------------------
 1049|      0|            goto err;
 1050|  6.18k|        do {
 1051|  6.18k|            if (!BN_priv_rand_ex(rho, p[0], BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   81|  6.18k|#define BN_RAND_TOP_ONE     0
  ------------------
                          if (!BN_priv_rand_ex(rho, p[0], BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   85|  6.18k|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  |  Branch (1051:17): [True: 0, False: 6.18k]
  ------------------
 1052|  6.18k|                                 0, ctx))
 1053|      0|                goto err;
 1054|  6.18k|            if (!BN_GF2m_mod_arr(rho, rho, p))
  ------------------
  |  Branch (1054:17): [True: 0, False: 6.18k]
  ------------------
 1055|      0|                goto err;
 1056|  6.18k|            BN_zero(z);
  ------------------
  |  |  202|  6.18k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
 1057|  6.18k|            if (!BN_copy(w, rho))
  ------------------
  |  Branch (1057:17): [True: 0, False: 6.18k]
  ------------------
 1058|      0|                goto err;
 1059|  2.27M|            for (j = 1; j <= p[0] - 1; j++) {
  ------------------
  |  Branch (1059:25): [True: 2.26M, False: 6.18k]
  ------------------
 1060|  2.26M|                if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
  ------------------
  |  Branch (1060:21): [True: 0, False: 2.26M]
  ------------------
 1061|      0|                    goto err;
 1062|  2.26M|                if (!BN_GF2m_mod_sqr_arr(w2, w, p, ctx))
  ------------------
  |  Branch (1062:21): [True: 0, False: 2.26M]
  ------------------
 1063|      0|                    goto err;
 1064|  2.26M|                if (!BN_GF2m_mod_mul_arr(tmp, w2, a, p, ctx))
  ------------------
  |  Branch (1064:21): [True: 0, False: 2.26M]
  ------------------
 1065|      0|                    goto err;
 1066|  2.26M|                if (!BN_GF2m_add(z, z, tmp))
  ------------------
  |  Branch (1066:21): [True: 0, False: 2.26M]
  ------------------
 1067|      0|                    goto err;
 1068|  2.26M|                if (!BN_GF2m_add(w, w2, rho))
  ------------------
  |  Branch (1068:21): [True: 0, False: 2.26M]
  ------------------
 1069|      0|                    goto err;
 1070|  2.26M|            }
 1071|  6.18k|            count++;
 1072|  6.18k|        } while (BN_is_zero(w) && (count < MAX_ITERATIONS));
  ------------------
  |  |   23|  3.13k|# define MAX_ITERATIONS 50
  ------------------
  |  Branch (1072:18): [True: 3.13k, False: 3.04k]
  |  Branch (1072:35): [True: 3.13k, False: 0]
  ------------------
 1073|  3.04k|        if (BN_is_zero(w)) {
  ------------------
  |  Branch (1073:13): [True: 0, False: 3.04k]
  ------------------
 1074|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1075|      0|            goto err;
 1076|      0|        }
 1077|  3.04k|    }
 1078|       |
 1079|  11.1k|    if (!BN_GF2m_mod_sqr_arr(w, z, p, ctx))
  ------------------
  |  Branch (1079:9): [True: 0, False: 11.1k]
  ------------------
 1080|      0|        goto err;
 1081|  11.1k|    if (!BN_GF2m_add(w, z, w))
  ------------------
  |  Branch (1081:9): [True: 0, False: 11.1k]
  ------------------
 1082|      0|        goto err;
 1083|  11.1k|    if (BN_GF2m_cmp(w, a)) {
  ------------------
  |  |  504|  11.1k|#  define BN_GF2m_cmp(a, b) BN_ucmp((a), (b))
  |  |  ------------------
  |  |  |  Branch (504:29): [True: 2.76k, False: 8.42k]
  |  |  ------------------
  ------------------
 1084|  2.76k|        ERR_raise(ERR_LIB_BN, BN_R_NO_SOLUTION);
  ------------------
  |  |  401|  2.76k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.76k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.76k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.76k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.76k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  2.76k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.76k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1085|  2.76k|        goto err;
 1086|  2.76k|    }
 1087|       |
 1088|  8.42k|    if (!BN_copy(r, z))
  ------------------
  |  Branch (1088:9): [True: 0, False: 8.42k]
  ------------------
 1089|      0|        goto err;
 1090|  8.42k|    bn_check_top(r);
 1091|       |
 1092|  8.42k|    ret = 1;
 1093|       |
 1094|  11.1k| err:
 1095|  11.1k|    BN_CTX_end(ctx);
 1096|  11.1k|    return ret;
 1097|  8.42k|}
BN_GF2m_poly2arr:
 1138|  77.2k|{
 1139|  77.2k|    int i, j, k = 0;
 1140|  77.2k|    BN_ULONG mask;
  ------------------
  |  |   37|  77.2k|#  define BN_ULONG        unsigned long
  ------------------
 1141|       |
 1142|  77.2k|    if (BN_is_zero(a))
  ------------------
  |  Branch (1142:9): [True: 0, False: 77.2k]
  ------------------
 1143|      0|        return 0;
 1144|       |
 1145|   354k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (1145:26): [True: 277k, False: 77.2k]
  ------------------
 1146|   277k|        if (!a->d[i])
  ------------------
  |  Branch (1146:13): [True: 106k, False: 170k]
  ------------------
 1147|       |            /* skip word if a->d[i] == 0 */
 1148|   106k|            continue;
 1149|   170k|        mask = BN_TBIT;
  ------------------
  |  |   56|   170k|# define BN_TBIT        ((BN_ULONG)1 << (BN_BITS2 - 1))
  |  |  ------------------
  |  |  |  |   54|   170k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|   170k|#  define BN_BYTES        8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1150|  11.1M|        for (j = BN_BITS2 - 1; j >= 0; j--) {
  ------------------
  |  |   54|   170k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   170k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (1150:32): [True: 10.9M, False: 170k]
  ------------------
 1151|  10.9M|            if (a->d[i] & mask) {
  ------------------
  |  Branch (1151:17): [True: 372k, False: 10.5M]
  ------------------
 1152|   372k|                if (k < max)
  ------------------
  |  Branch (1152:21): [True: 372k, False: 0]
  ------------------
 1153|   372k|                    p[k] = BN_BITS2 * i + j;
  ------------------
  |  |   54|   372k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   372k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
 1154|   372k|                k++;
 1155|   372k|            }
 1156|  10.9M|            mask >>= 1;
 1157|  10.9M|        }
 1158|   170k|    }
 1159|       |
 1160|  77.2k|    if (k < max) {
  ------------------
  |  Branch (1160:9): [True: 77.2k, False: 0]
  ------------------
 1161|  77.2k|        p[k] = -1;
 1162|  77.2k|        k++;
 1163|  77.2k|    }
 1164|       |
 1165|  77.2k|    return k;
 1166|  77.2k|}
bn_gf2m.c:BN_GF2m_mod_inv_vartime:
  559|  14.3k|{
  560|  14.3k|    BIGNUM *b, *c = NULL, *u = NULL, *v = NULL, *tmp;
  561|  14.3k|    int ret = 0;
  562|       |
  563|  14.3k|    bn_check_top(a);
  564|  14.3k|    bn_check_top(p);
  565|       |
  566|  14.3k|    BN_CTX_start(ctx);
  567|       |
  568|  14.3k|    b = BN_CTX_get(ctx);
  569|  14.3k|    c = BN_CTX_get(ctx);
  570|  14.3k|    u = BN_CTX_get(ctx);
  571|  14.3k|    v = BN_CTX_get(ctx);
  572|  14.3k|    if (v == NULL)
  ------------------
  |  Branch (572:9): [True: 0, False: 14.3k]
  ------------------
  573|      0|        goto err;
  574|       |
  575|  14.3k|    if (!BN_GF2m_mod(u, a, p))
  ------------------
  |  Branch (575:9): [True: 0, False: 14.3k]
  ------------------
  576|      0|        goto err;
  577|  14.3k|    if (BN_is_zero(u))
  ------------------
  |  Branch (577:9): [True: 0, False: 14.3k]
  ------------------
  578|      0|        goto err;
  579|       |
  580|  14.3k|    if (!BN_copy(v, p))
  ------------------
  |  Branch (580:9): [True: 0, False: 14.3k]
  ------------------
  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|  14.3k|    {
  619|  14.3k|        int i;
  620|  14.3k|        int ubits = BN_num_bits(u);
  621|  14.3k|        int vbits = BN_num_bits(v); /* v is copy of p */
  622|  14.3k|        int top = p->top;
  623|  14.3k|        BN_ULONG *udp, *bdp, *vdp, *cdp;
  ------------------
  |  |   37|  14.3k|#  define BN_ULONG        unsigned long
  ------------------
  624|       |
  625|  14.3k|        if (!bn_wexpand(u, top))
  ------------------
  |  Branch (625:13): [True: 0, False: 14.3k]
  ------------------
  626|      0|            goto err;
  627|  14.3k|        udp = u->d;
  628|  15.2k|        for (i = u->top; i < top; i++)
  ------------------
  |  Branch (628:26): [True: 861, False: 14.3k]
  ------------------
  629|    861|            udp[i] = 0;
  630|  14.3k|        u->top = top;
  631|  14.3k|        if (!bn_wexpand(b, top))
  ------------------
  |  Branch (631:13): [True: 0, False: 14.3k]
  ------------------
  632|      0|          goto err;
  633|  14.3k|        bdp = b->d;
  634|  14.3k|        bdp[0] = 1;
  635|  51.2k|        for (i = 1; i < top; i++)
  ------------------
  |  Branch (635:21): [True: 36.8k, False: 14.3k]
  ------------------
  636|  36.8k|            bdp[i] = 0;
  637|  14.3k|        b->top = top;
  638|  14.3k|        if (!bn_wexpand(c, top))
  ------------------
  |  Branch (638:13): [True: 0, False: 14.3k]
  ------------------
  639|      0|          goto err;
  640|  14.3k|        cdp = c->d;
  641|  65.5k|        for (i = 0; i < top; i++)
  ------------------
  |  Branch (641:21): [True: 51.2k, False: 14.3k]
  ------------------
  642|  51.2k|            cdp[i] = 0;
  643|  14.3k|        c->top = top;
  644|  14.3k|        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|  2.22M|        while (1) {
  ------------------
  |  Branch (648:16): [Folded - Ignored]
  ------------------
  649|  6.66M|            while (ubits && !(udp[0] & 1)) {
  ------------------
  |  Branch (649:20): [True: 6.66M, False: 0]
  |  Branch (649:29): [True: 4.43M, False: 2.22M]
  ------------------
  650|  4.43M|                BN_ULONG u0, u1, b0, b1, mask;
  ------------------
  |  |   37|  4.43M|#  define BN_ULONG        unsigned long
  ------------------
  651|       |
  652|  4.43M|                u0 = udp[0];
  653|  4.43M|                b0 = bdp[0];
  654|  4.43M|                mask = (BN_ULONG)0 - (b0 & 1);
  655|  4.43M|                b0 ^= p->d[0] & mask;
  656|  18.6M|                for (i = 0; i < top - 1; i++) {
  ------------------
  |  Branch (656:29): [True: 14.2M, False: 4.43M]
  ------------------
  657|  14.2M|                    u1 = udp[i + 1];
  658|  14.2M|                    udp[i] = ((u0 >> 1) | (u1 << (BN_BITS2 - 1))) & BN_MASK2;
  ------------------
  |  |   54|  14.2M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  14.2M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                                  udp[i] = ((u0 >> 1) | (u1 << (BN_BITS2 - 1))) & BN_MASK2;
  ------------------
  |  |   94|  14.2M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  659|  14.2M|                    u0 = u1;
  660|  14.2M|                    b1 = bdp[i + 1] ^ (p->d[i + 1] & mask);
  661|  14.2M|                    bdp[i] = ((b0 >> 1) | (b1 << (BN_BITS2 - 1))) & BN_MASK2;
  ------------------
  |  |   54|  14.2M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  14.2M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                                  bdp[i] = ((b0 >> 1) | (b1 << (BN_BITS2 - 1))) & BN_MASK2;
  ------------------
  |  |   94|  14.2M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  662|  14.2M|                    b0 = b1;
  663|  14.2M|                }
  664|  4.43M|                udp[i] = u0 >> 1;
  665|  4.43M|                bdp[i] = b0 >> 1;
  666|  4.43M|                ubits--;
  667|  4.43M|            }
  668|       |
  669|  2.22M|            if (ubits <= BN_BITS2) {
  ------------------
  |  |   54|  2.22M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.22M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (669:17): [True: 751k, False: 1.47M]
  ------------------
  670|   751k|                if (udp[0] == 0) /* poly was reducible */
  ------------------
  |  Branch (670:21): [True: 0, False: 751k]
  ------------------
  671|      0|                    goto err;
  672|   751k|                if (udp[0] == 1)
  ------------------
  |  Branch (672:21): [True: 14.3k, False: 736k]
  ------------------
  673|  14.3k|                    break;
  674|   751k|            }
  675|       |
  676|  2.21M|            if (ubits < vbits) {
  ------------------
  |  Branch (676:17): [True: 889k, False: 1.32M]
  ------------------
  677|   889k|                i = ubits;
  678|   889k|                ubits = vbits;
  679|   889k|                vbits = i;
  680|   889k|                tmp = u;
  681|   889k|                u = v;
  682|   889k|                v = tmp;
  683|   889k|                tmp = b;
  684|   889k|                b = c;
  685|   889k|                c = tmp;
  686|   889k|                udp = vdp;
  687|   889k|                vdp = v->d;
  688|   889k|                bdp = cdp;
  689|   889k|                cdp = c->d;
  690|   889k|            }
  691|  11.5M|            for (i = 0; i < top; i++) {
  ------------------
  |  Branch (691:25): [True: 9.33M, False: 2.21M]
  ------------------
  692|  9.33M|                udp[i] ^= vdp[i];
  693|  9.33M|                bdp[i] ^= cdp[i];
  694|  9.33M|            }
  695|  2.21M|            if (ubits == vbits) {
  ------------------
  |  Branch (695:17): [True: 443k, False: 1.77M]
  ------------------
  696|   443k|                BN_ULONG ul;
  ------------------
  |  |   37|   443k|#  define BN_ULONG        unsigned long
  ------------------
  697|   443k|                int utop = (ubits - 1) / BN_BITS2;
  ------------------
  |  |   54|   443k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   443k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  698|       |
  699|   455k|                while ((ul = udp[utop]) == 0 && utop)
  ------------------
  |  Branch (699:24): [True: 12.1k, False: 443k]
  |  Branch (699:49): [True: 12.1k, False: 0]
  ------------------
  700|  12.1k|                    utop--;
  701|   443k|                ubits = utop * BN_BITS2 + BN_num_bits_word(ul);
  ------------------
  |  |   54|   443k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   443k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  702|   443k|            }
  703|  2.21M|        }
  704|  14.3k|        bn_correct_top(b);
  705|  14.3k|    }
  706|      0|# endif
  707|       |
  708|  14.3k|    if (!BN_copy(r, b))
  ------------------
  |  Branch (708:9): [True: 0, False: 14.3k]
  ------------------
  709|      0|        goto err;
  710|  14.3k|    bn_check_top(r);
  711|  14.3k|    ret = 1;
  712|       |
  713|  14.3k| 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|  14.3k|    BN_CTX_end(ctx);
  721|  14.3k|    return ret;
  722|  14.3k|}

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

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

BN_value_one:
   83|  61.9k|{
   84|  61.9k|    static const BN_ULONG data_one = 1L;
   85|  61.9k|    static const BIGNUM const_one = {
   86|  61.9k|        (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|  61.9k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
   87|  61.9k|    };
   88|       |
   89|  61.9k|    return &const_one;
   90|  61.9k|}
BN_num_bits_word:
  102|  5.49M|{
  103|  5.49M|    BN_ULONG x, mask;
  ------------------
  |  |   37|  5.49M|#  define BN_ULONG        unsigned long
  ------------------
  104|  5.49M|    int bits = (l != 0);
  105|       |
  106|  5.49M|#if BN_BITS2 > 32
  107|  5.49M|    x = l >> 32;
  108|  5.49M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  5.49M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  109|  5.49M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  5.49M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  5.49M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  110|  5.49M|    bits += 32 & mask;
  111|  5.49M|    l ^= (x ^ l) & mask;
  112|  5.49M|#endif
  113|       |
  114|  5.49M|    x = l >> 16;
  115|  5.49M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  5.49M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  116|  5.49M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  5.49M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  5.49M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  117|  5.49M|    bits += 16 & mask;
  118|  5.49M|    l ^= (x ^ l) & mask;
  119|       |
  120|  5.49M|    x = l >> 8;
  121|  5.49M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  5.49M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  122|  5.49M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  5.49M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  5.49M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  123|  5.49M|    bits += 8 & mask;
  124|  5.49M|    l ^= (x ^ l) & mask;
  125|       |
  126|  5.49M|    x = l >> 4;
  127|  5.49M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  5.49M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  128|  5.49M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  5.49M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  5.49M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  129|  5.49M|    bits += 4 & mask;
  130|  5.49M|    l ^= (x ^ l) & mask;
  131|       |
  132|  5.49M|    x = l >> 2;
  133|  5.49M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  5.49M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  134|  5.49M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  5.49M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  5.49M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  135|  5.49M|    bits += 2 & mask;
  136|  5.49M|    l ^= (x ^ l) & mask;
  137|       |
  138|  5.49M|    x = l >> 1;
  139|  5.49M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  5.49M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  140|  5.49M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  5.49M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  5.49M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  141|  5.49M|    bits += 1 & mask;
  142|       |
  143|  5.49M|    return bits;
  144|  5.49M|}
BN_num_bits:
  180|   402k|{
  181|   402k|    int i = a->top - 1;
  182|   402k|    bn_check_top(a);
  183|       |
  184|   402k|    if (a->flags & BN_FLG_CONSTTIME) {
  ------------------
  |  |   67|   402k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (184:9): [True: 0, False: 402k]
  ------------------
  185|       |        /*
  186|       |         * We assume that BIGNUMs flagged as CONSTTIME have also been expanded
  187|       |         * so that a->dmax is not leaking secret information.
  188|       |         *
  189|       |         * In other words, it's the caller's responsibility to ensure `a` has
  190|       |         * been preallocated in advance to a public length if we hit this
  191|       |         * branch.
  192|       |         *
  193|       |         */
  194|      0|        return bn_num_bits_consttime(a);
  195|      0|    }
  196|       |
  197|   402k|    if (BN_is_zero(a))
  ------------------
  |  Branch (197:9): [True: 1.89k, False: 400k]
  ------------------
  198|  1.89k|        return 0;
  199|       |
  200|   400k|    return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
  ------------------
  |  |   54|   400k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   400k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  201|   402k|}
BN_clear_free:
  215|  1.19M|{
  216|  1.19M|    if (a == NULL)
  ------------------
  |  Branch (216:9): [True: 42.3k, False: 1.15M]
  ------------------
  217|  42.3k|        return;
  218|  1.15M|    if (a->d != NULL && !BN_get_flags(a, BN_FLG_STATIC_DATA))
  ------------------
  |  |   59|  1.06M|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (218:9): [True: 1.06M, False: 90.4k]
  |  Branch (218:25): [True: 1.06M, False: 0]
  ------------------
  219|  1.06M|        bn_free_d(a, 1);
  220|  1.15M|    if (BN_get_flags(a, BN_FLG_MALLOCED)) {
  ------------------
  |  |   58|  1.15M|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (220:9): [True: 52, False: 1.15M]
  ------------------
  221|     52|        OPENSSL_cleanse(a, sizeof(*a));
  222|     52|        OPENSSL_free(a);
  ------------------
  |  |  115|     52|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     52|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     52|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  223|     52|    }
  224|  1.15M|}
BN_free:
  227|   938k|{
  228|   938k|    if (a == NULL)
  ------------------
  |  Branch (228:9): [True: 18.7k, False: 919k]
  ------------------
  229|  18.7k|        return;
  230|   919k|    if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  ------------------
  |  |   59|   919k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (230:9): [True: 919k, False: 0]
  ------------------
  231|   919k|        bn_free_d(a, 0);
  232|   919k|    if (a->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|   919k|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (232:9): [True: 919k, False: 0]
  ------------------
  233|   919k|        OPENSSL_free(a);
  ------------------
  |  |  115|   919k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   919k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   919k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  234|   919k|}
bn_init:
  237|  1.94M|{
  238|  1.94M|    static BIGNUM nilbn;
  239|       |
  240|  1.94M|    *a = nilbn;
  241|  1.94M|    bn_check_top(a);
  242|  1.94M|}
BN_new:
  245|   920k|{
  246|   920k|    BIGNUM *ret;
  247|       |
  248|   920k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|   920k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   920k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   920k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (248:9): [True: 0, False: 920k]
  ------------------
  249|      0|        return NULL;
  250|   920k|    ret->flags = BN_FLG_MALLOCED;
  ------------------
  |  |   58|   920k|# define BN_FLG_MALLOCED         0x01
  ------------------
  251|   920k|    bn_check_top(ret);
  252|   920k|    return ret;
  253|   920k|}
bn_expand2:
  300|  2.61M|{
  301|  2.61M|    if (words > b->dmax) {
  ------------------
  |  Branch (301:9): [True: 2.61M, False: 0]
  ------------------
  302|  2.61M|        BN_ULONG *a = bn_expand_internal(b, words);
  ------------------
  |  |   37|  2.61M|#  define BN_ULONG        unsigned long
  ------------------
  303|  2.61M|        if (!a)
  ------------------
  |  Branch (303:13): [True: 0, False: 2.61M]
  ------------------
  304|      0|            return NULL;
  305|  2.61M|        if (b->d != NULL)
  ------------------
  |  Branch (305:13): [True: 688k, False: 1.93M]
  ------------------
  306|   688k|            bn_free_d(b, 1);
  307|  2.61M|        b->d = a;
  308|  2.61M|        b->dmax = words;
  309|  2.61M|    }
  310|       |
  311|  2.61M|    return b;
  312|  2.61M|}
BN_dup:
  315|  9.56k|{
  316|  9.56k|    BIGNUM *t;
  317|       |
  318|  9.56k|    if (a == NULL)
  ------------------
  |  Branch (318:9): [True: 0, False: 9.56k]
  ------------------
  319|      0|        return NULL;
  320|  9.56k|    bn_check_top(a);
  321|       |
  322|  9.56k|    t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();
  ------------------
  |  |   68|  9.56k|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (322:9): [True: 0, False: 9.56k]
  ------------------
  323|  9.56k|    if (t == NULL)
  ------------------
  |  Branch (323:9): [True: 0, False: 9.56k]
  ------------------
  324|      0|        return NULL;
  325|  9.56k|    if (!BN_copy(t, a)) {
  ------------------
  |  Branch (325:9): [True: 0, False: 9.56k]
  ------------------
  326|      0|        BN_free(t);
  327|      0|        return NULL;
  328|      0|    }
  329|  9.56k|    bn_check_top(t);
  330|  9.56k|    return t;
  331|  9.56k|}
BN_copy:
  334|  5.74M|{
  335|  5.74M|    int bn_words;
  336|       |
  337|  5.74M|    bn_check_top(b);
  338|       |
  339|  5.74M|    bn_words = BN_get_flags(b, BN_FLG_CONSTTIME) ? b->dmax : b->top;
  ------------------
  |  |   67|  5.74M|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (339:16): [True: 0, False: 5.74M]
  ------------------
  340|       |
  341|  5.74M|    if (a == b)
  ------------------
  |  Branch (341:9): [True: 0, False: 5.74M]
  ------------------
  342|      0|        return a;
  343|  5.74M|    if (bn_wexpand(a, bn_words) == NULL)
  ------------------
  |  Branch (343:9): [True: 0, False: 5.74M]
  ------------------
  344|      0|        return NULL;
  345|       |
  346|  5.74M|    if (b->top > 0)
  ------------------
  |  Branch (346:9): [True: 5.69M, False: 50.5k]
  ------------------
  347|  5.69M|        memcpy(a->d, b->d, sizeof(b->d[0]) * bn_words);
  348|       |
  349|  5.74M|    a->neg = b->neg;
  350|  5.74M|    a->top = b->top;
  351|  5.74M|    a->flags |= b->flags & BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  5.74M|#  define BN_FLG_FIXED_TOP 0
  ------------------
  352|  5.74M|    bn_check_top(a);
  353|  5.74M|    return a;
  354|  5.74M|}
BN_clear:
  396|     34|{
  397|     34|    if (a == NULL)
  ------------------
  |  Branch (397:9): [True: 0, False: 34]
  ------------------
  398|      0|        return;
  399|     34|    bn_check_top(a);
  400|     34|    if (a->d != NULL)
  ------------------
  |  Branch (400:9): [True: 0, False: 34]
  ------------------
  401|      0|        OPENSSL_cleanse(a->d, sizeof(*a->d) * a->dmax);
  402|     34|    a->neg = 0;
  403|     34|    a->top = 0;
  404|     34|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|     34|#  define BN_FLG_FIXED_TOP 0
  ------------------
  405|     34|}
BN_set_word:
  418|   112k|{
  419|   112k|    bn_check_top(a);
  420|   112k|    if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
  ------------------
  |  Branch (420:9): [True: 0, False: 112k]
  ------------------
  421|      0|        return 0;
  422|   112k|    a->neg = 0;
  423|   112k|    a->d[0] = w;
  424|   112k|    a->top = (w ? 1 : 0);
  ------------------
  |  Branch (424:15): [True: 112k, False: 0]
  ------------------
  425|   112k|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   112k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  426|   112k|    bn_check_top(a);
  427|   112k|    return 1;
  428|   112k|}
BN_bin2bn:
  536|   261k|{
  537|   261k|    return bin2bn(s, len, ret, BIG, UNSIGNED);
  538|   261k|}
BN_ucmp:
  708|  3.14M|{
  709|  3.14M|    int i;
  710|  3.14M|    BN_ULONG t1, t2, *ap, *bp;
  ------------------
  |  |   37|  3.14M|#  define BN_ULONG        unsigned long
  ------------------
  711|       |
  712|  3.14M|    ap = a->d;
  713|  3.14M|    bp = b->d;
  714|       |
  715|  3.14M|    if (BN_get_flags(a, BN_FLG_CONSTTIME)
  ------------------
  |  |   67|  3.14M|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (715:9): [True: 0, False: 3.14M]
  ------------------
  716|  3.14M|            && a->top == b->top) {
  ------------------
  |  Branch (716:16): [True: 0, False: 0]
  ------------------
  717|      0|        int res = 0;
  718|       |
  719|      0|        for (i = 0; i < b->top; i++) {
  ------------------
  |  Branch (719:21): [True: 0, False: 0]
  ------------------
  720|      0|            res = constant_time_select_int(constant_time_lt_bn(ap[i], bp[i]),
  721|      0|                                           -1, res);
  722|      0|            res = constant_time_select_int(constant_time_lt_bn(bp[i], ap[i]),
  723|      0|                                           1, res);
  724|      0|        }
  725|      0|        return res;
  726|      0|    }
  727|       |
  728|  3.14M|    bn_check_top(a);
  729|  3.14M|    bn_check_top(b);
  730|       |
  731|  3.14M|    i = a->top - b->top;
  732|  3.14M|    if (i != 0)
  ------------------
  |  Branch (732:9): [True: 126k, False: 3.02M]
  ------------------
  733|   126k|        return i;
  734|       |
  735|  3.16M|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (735:26): [True: 3.09M, False: 73.5k]
  ------------------
  736|  3.09M|        t1 = ap[i];
  737|  3.09M|        t2 = bp[i];
  738|  3.09M|        if (t1 != t2)
  ------------------
  |  Branch (738:13): [True: 2.94M, False: 144k]
  ------------------
  739|  2.94M|            return ((t1 > t2) ? 1 : -1);
  ------------------
  |  Branch (739:21): [True: 1.13M, False: 1.81M]
  ------------------
  740|  3.09M|    }
  741|  73.5k|    return 0;
  742|  3.02M|}
BN_cmp:
  745|  43.1k|{
  746|  43.1k|    int i;
  747|  43.1k|    int gt, lt;
  748|  43.1k|    BN_ULONG t1, t2;
  ------------------
  |  |   37|  43.1k|#  define BN_ULONG        unsigned long
  ------------------
  749|       |
  750|  43.1k|    if ((a == NULL) || (b == NULL)) {
  ------------------
  |  Branch (750:9): [True: 0, False: 43.1k]
  |  Branch (750:24): [True: 0, False: 43.1k]
  ------------------
  751|      0|        if (a != NULL)
  ------------------
  |  Branch (751:13): [True: 0, False: 0]
  ------------------
  752|      0|            return -1;
  753|      0|        else if (b != NULL)
  ------------------
  |  Branch (753:18): [True: 0, False: 0]
  ------------------
  754|      0|            return 1;
  755|      0|        else
  756|      0|            return 0;
  757|      0|    }
  758|       |
  759|  43.1k|    bn_check_top(a);
  760|  43.1k|    bn_check_top(b);
  761|       |
  762|  43.1k|    if (a->neg != b->neg) {
  ------------------
  |  Branch (762:9): [True: 0, False: 43.1k]
  ------------------
  763|      0|        if (a->neg)
  ------------------
  |  Branch (763:13): [True: 0, False: 0]
  ------------------
  764|      0|            return -1;
  765|      0|        else
  766|      0|            return 1;
  767|      0|    }
  768|  43.1k|    if (a->neg == 0) {
  ------------------
  |  Branch (768:9): [True: 43.1k, False: 0]
  ------------------
  769|  43.1k|        gt = 1;
  770|  43.1k|        lt = -1;
  771|  43.1k|    } else {
  772|      0|        gt = -1;
  773|      0|        lt = 1;
  774|      0|    }
  775|       |
  776|  43.1k|    if (a->top > b->top)
  ------------------
  |  Branch (776:9): [True: 2.93k, False: 40.2k]
  ------------------
  777|  2.93k|        return gt;
  778|  40.2k|    if (a->top < b->top)
  ------------------
  |  Branch (778:9): [True: 5.68k, False: 34.5k]
  ------------------
  779|  5.68k|        return lt;
  780|   176k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (780:26): [True: 148k, False: 28.8k]
  ------------------
  781|   148k|        t1 = a->d[i];
  782|   148k|        t2 = b->d[i];
  783|   148k|        if (t1 > t2)
  ------------------
  |  Branch (783:13): [True: 882, False: 147k]
  ------------------
  784|    882|            return gt;
  785|   147k|        if (t1 < t2)
  ------------------
  |  Branch (785:13): [True: 4.85k, False: 142k]
  ------------------
  786|  4.85k|            return lt;
  787|   147k|    }
  788|  28.8k|    return 0;
  789|  34.5k|}
BN_set_bit:
  792|   103k|{
  793|   103k|    int i, j, k;
  794|       |
  795|   103k|    if (n < 0)
  ------------------
  |  Branch (795:9): [True: 0, False: 103k]
  ------------------
  796|      0|        return 0;
  797|       |
  798|   103k|    i = n / BN_BITS2;
  ------------------
  |  |   54|   103k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   103k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  799|   103k|    j = n % BN_BITS2;
  ------------------
  |  |   54|   103k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   103k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  800|   103k|    if (a->top <= i) {
  ------------------
  |  Branch (800:9): [True: 103k, False: 0]
  ------------------
  801|   103k|        if (bn_wexpand(a, i + 1) == NULL)
  ------------------
  |  Branch (801:13): [True: 0, False: 103k]
  ------------------
  802|      0|            return 0;
  803|   604k|        for (k = a->top; k < i + 1; k++)
  ------------------
  |  Branch (803:26): [True: 500k, False: 103k]
  ------------------
  804|   500k|            a->d[k] = 0;
  805|   103k|        a->top = i + 1;
  806|   103k|        a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   103k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  807|   103k|    }
  808|       |
  809|   103k|    a->d[i] |= (((BN_ULONG)1) << j);
  810|   103k|    bn_check_top(a);
  811|   103k|    return 1;
  812|   103k|}
BN_is_bit_set:
  833|  11.0M|{
  834|  11.0M|    int i, j;
  835|       |
  836|  11.0M|    bn_check_top(a);
  837|  11.0M|    if (n < 0)
  ------------------
  |  Branch (837:9): [True: 0, False: 11.0M]
  ------------------
  838|      0|        return 0;
  839|  11.0M|    i = n / BN_BITS2;
  ------------------
  |  |   54|  11.0M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.0M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  840|  11.0M|    j = n % BN_BITS2;
  ------------------
  |  |   54|  11.0M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  11.0M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  841|  11.0M|    if (a->top <= i)
  ------------------
  |  Branch (841:9): [True: 0, False: 11.0M]
  ------------------
  842|      0|        return 0;
  843|  11.0M|    return (int)(((a->d[i]) >> j) & ((BN_ULONG)1));
  844|  11.0M|}
BN_set_negative:
  879|   107k|{
  880|   107k|    if (b && !BN_is_zero(a))
  ------------------
  |  Branch (880:9): [True: 9, False: 107k]
  |  Branch (880:14): [True: 9, False: 0]
  ------------------
  881|      9|        a->neg = 1;
  882|   107k|    else
  883|   107k|        a->neg = 0;
  884|   107k|}
BN_security_bits:
 1002|     22|{
 1003|     22|    int secbits, bits;
 1004|     22|    if (L >= 15360)
  ------------------
  |  Branch (1004:9): [True: 0, False: 22]
  ------------------
 1005|      0|        secbits = 256;
 1006|     22|    else if (L >= 7680)
  ------------------
  |  Branch (1006:14): [True: 0, False: 22]
  ------------------
 1007|      0|        secbits = 192;
 1008|     22|    else if (L >= 3072)
  ------------------
  |  Branch (1008:14): [True: 0, False: 22]
  ------------------
 1009|      0|        secbits = 128;
 1010|     22|    else if (L >= 2048)
  ------------------
  |  Branch (1010:14): [True: 0, False: 22]
  ------------------
 1011|      0|        secbits = 112;
 1012|     22|    else if (L >= 1024)
  ------------------
  |  Branch (1012:14): [True: 0, False: 22]
  ------------------
 1013|      0|        secbits = 80;
 1014|     22|    else
 1015|     22|        return 0;
 1016|      0|    if (N == -1)
  ------------------
  |  Branch (1016:9): [True: 0, False: 0]
  ------------------
 1017|      0|        return secbits;
 1018|      0|    bits = N / 2;
 1019|      0|    if (bits < 80)
  ------------------
  |  Branch (1019:9): [True: 0, False: 0]
  ------------------
 1020|      0|        return 0;
 1021|      0|    return bits >= secbits ? secbits : bits;
  ------------------
  |  Branch (1021:12): [True: 0, False: 0]
  ------------------
 1022|      0|}
BN_zero_ex:
 1025|  35.8M|{
 1026|  35.8M|    a->neg = 0;
 1027|  35.8M|    a->top = 0;
 1028|  35.8M|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  35.8M|#  define BN_FLG_FIXED_TOP 0
  ------------------
 1029|  35.8M|}
BN_abs_is_word:
 1032|  3.95M|{
 1033|  3.95M|    return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
  ------------------
  |  Branch (1033:13): [True: 260k, False: 3.69M]
  |  Branch (1033:30): [True: 162k, False: 97.7k]
  |  Branch (1033:50): [True: 0, False: 3.79M]
  |  Branch (1033:62): [True: 0, False: 0]
  ------------------
 1034|  3.95M|}
BN_is_zero:
 1037|  11.5M|{
 1038|  11.5M|    return a->top == 0;
 1039|  11.5M|}
BN_is_one:
 1042|  3.89M|{
 1043|  3.89M|    return BN_abs_is_word(a, 1) && !a->neg;
  ------------------
  |  Branch (1043:12): [True: 162k, False: 3.73M]
  |  Branch (1043:36): [True: 162k, False: 0]
  ------------------
 1044|  3.89M|}
BN_is_odd:
 1068|  3.09M|{
 1069|  3.09M|    return (a->top > 0) && (a->d[0] & 1);
  ------------------
  |  Branch (1069:12): [True: 3.09M, False: 87]
  |  Branch (1069:28): [True: 1.72M, False: 1.37M]
  ------------------
 1070|  3.09M|}
BN_is_negative:
 1073|   164k|{
 1074|   164k|    return (a->neg != 0);
 1075|   164k|}
BN_to_montgomery:
 1079|  46.9k|{
 1080|  46.9k|    return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx);
 1081|  46.9k|}
BN_get_flags:
 1117|  20.2M|{
 1118|  20.2M|    return b->flags & n;
 1119|  20.2M|}
bn_wexpand:
 1147|  60.8M|{
 1148|  60.8M|    return (words <= a->dmax) ? a : bn_expand2(a, words);
  ------------------
  |  Branch (1148:12): [True: 58.2M, False: 2.57M]
  ------------------
 1149|  60.8M|}
bn_correct_top:
 1174|  34.5M|{
 1175|  34.5M|    BN_ULONG *ftl;
  ------------------
  |  |   37|  34.5M|#  define BN_ULONG        unsigned long
  ------------------
 1176|  34.5M|    int tmp_top = a->top;
 1177|       |
 1178|  34.5M|    if (tmp_top > 0) {
  ------------------
  |  Branch (1178:9): [True: 34.5M, False: 25.4k]
  ------------------
 1179|  93.8M|        for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) {
  ------------------
  |  Branch (1179:38): [True: 93.7M, False: 79.7k]
  ------------------
 1180|  93.7M|            ftl--;
 1181|  93.7M|            if (*ftl != 0)
  ------------------
  |  Branch (1181:17): [True: 34.4M, False: 59.2M]
  ------------------
 1182|  34.4M|                break;
 1183|  93.7M|        }
 1184|  34.5M|        a->top = tmp_top;
 1185|  34.5M|    }
 1186|  34.5M|    if (a->top == 0)
  ------------------
  |  Branch (1186:9): [True: 105k, False: 34.4M]
  ------------------
 1187|   105k|        a->neg = 0;
 1188|  34.5M|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  34.5M|#  define BN_FLG_FIXED_TOP 0
  ------------------
 1189|  34.5M|    bn_pollute(a);
 1190|  34.5M|}
bn_lib.c:bn_free_d:
  204|  2.67M|{
  205|  2.67M|    if (BN_get_flags(a, BN_FLG_SECURE))
  ------------------
  |  |   68|  2.67M|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (205:9): [True: 0, False: 2.67M]
  ------------------
  206|      0|        OPENSSL_secure_clear_free(a->d, a->dmax * sizeof(a->d[0]));
  ------------------
  |  |  129|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  207|  2.67M|    else if (clear != 0)
  ------------------
  |  Branch (207:14): [True: 1.75M, False: 919k]
  ------------------
  208|  1.75M|        OPENSSL_clear_free(a->d, a->dmax * sizeof(a->d[0]));
  ------------------
  |  |  113|  1.75M|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.75M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.75M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  209|   919k|    else
  210|   919k|        OPENSSL_free(a->d);
  ------------------
  |  |  115|   919k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   919k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   919k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  211|  2.67M|}
bn_lib.c:bn_expand_internal:
  266|  2.61M|{
  267|  2.61M|    BN_ULONG *a = NULL;
  ------------------
  |  |   37|  2.61M|#  define BN_ULONG        unsigned long
  ------------------
  268|       |
  269|  2.61M|    if (words > (INT_MAX / (4 * BN_BITS2))) {
  ------------------
  |  |   54|  2.61M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.61M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (269:9): [True: 0, False: 2.61M]
  ------------------
  270|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  271|      0|        return NULL;
  272|      0|    }
  273|  2.61M|    if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
  ------------------
  |  |   59|  2.61M|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (273:9): [True: 0, False: 2.61M]
  ------------------
  274|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  275|      0|        return NULL;
  276|      0|    }
  277|  2.61M|    if (BN_get_flags(b, BN_FLG_SECURE))
  ------------------
  |  |   68|  2.61M|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (277:9): [True: 0, False: 2.61M]
  ------------------
  278|      0|        a = OPENSSL_secure_zalloc(words * sizeof(*a));
  ------------------
  |  |  125|      0|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  279|  2.61M|    else
  280|  2.61M|        a = OPENSSL_zalloc(words * sizeof(*a));
  ------------------
  |  |  104|  2.61M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.61M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.61M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|  2.61M|    if (a == NULL)
  ------------------
  |  Branch (281:9): [True: 0, False: 2.61M]
  ------------------
  282|      0|        return NULL;
  283|       |
  284|  2.61M|    assert(b->top <= words);
  285|  2.61M|    if (b->top > 0)
  ------------------
  |  Branch (285:9): [True: 269k, False: 2.35M]
  ------------------
  286|   269k|        memcpy(a, b->d, sizeof(*a) * b->top);
  287|       |
  288|  2.61M|    return a;
  289|  2.61M|}
bn_lib.c:bin2bn:
  435|   261k|{
  436|   261k|    int inc;
  437|   261k|    const unsigned char *s2;
  438|   261k|    int inc2;
  439|   261k|    int neg = 0, xor = 0, carry = 0;
  440|   261k|    unsigned int i;
  441|   261k|    unsigned int n;
  442|   261k|    BIGNUM *bn = NULL;
  443|       |
  444|       |    /* Negative length is not acceptable */
  445|   261k|    if (len < 0)
  ------------------
  |  Branch (445:9): [True: 0, False: 261k]
  ------------------
  446|      0|        return NULL;
  447|       |
  448|   261k|    if (ret == NULL)
  ------------------
  |  Branch (448:9): [True: 193k, False: 68.1k]
  ------------------
  449|   193k|        ret = bn = BN_new();
  450|   261k|    if (ret == NULL)
  ------------------
  |  Branch (450:9): [True: 0, False: 261k]
  ------------------
  451|      0|        return NULL;
  452|   261k|    bn_check_top(ret);
  453|       |
  454|       |    /*
  455|       |     * If the input has no bits, the number is considered zero.
  456|       |     * This makes calls with s==NULL and len==0 safe.
  457|       |     */
  458|   261k|    if (len == 0) {
  ------------------
  |  Branch (458:9): [True: 34, False: 261k]
  ------------------
  459|     34|        BN_clear(ret);
  460|     34|        return ret;
  461|     34|    }
  462|       |
  463|       |    /*
  464|       |     * The loop that does the work iterates from least to most
  465|       |     * significant BIGNUM chunk, so we adapt parameters to transfer
  466|       |     * input bytes accordingly.
  467|       |     */
  468|   261k|    if (endianness == LITTLE) {
  ------------------
  |  Branch (468:9): [True: 0, False: 261k]
  ------------------
  469|      0|        s2 = s + len - 1;
  470|      0|        inc2 = -1;
  471|      0|        inc = 1;
  472|   261k|    } else {
  473|   261k|        s2 = s;
  474|   261k|        inc2 = 1;
  475|   261k|        inc = -1;
  476|   261k|        s += len - 1;
  477|   261k|    }
  478|       |
  479|       |    /* Take note of the signedness of the input bytes*/
  480|   261k|    if (signedness == SIGNED) {
  ------------------
  |  Branch (480:9): [True: 0, False: 261k]
  ------------------
  481|      0|        neg = !!(*s2 & 0x80);
  482|      0|        xor = neg ? 0xff : 0x00;
  ------------------
  |  Branch (482:15): [True: 0, False: 0]
  ------------------
  483|      0|        carry = neg;
  484|      0|    }
  485|       |
  486|       |    /*
  487|       |     * Skip leading sign extensions (the value of |xor|).
  488|       |     * This is the only spot where |s2| and |inc2| are used.
  489|       |     */
  490|   933k|    for ( ; len > 0 && *s2 == xor; s2 += inc2, len--)
  ------------------
  |  Branch (490:13): [True: 924k, False: 8.34k]
  |  Branch (490:24): [True: 671k, False: 253k]
  ------------------
  491|   671k|        continue;
  492|       |
  493|       |    /*
  494|       |     * If there was a set of 0xff, we backtrack one byte unless the next
  495|       |     * one has a sign bit, as the last 0xff is then part of the actual
  496|       |     * number, rather then a mere sign extension.
  497|       |     */
  498|   261k|    if (xor == 0xff) {
  ------------------
  |  Branch (498:9): [True: 0, False: 261k]
  ------------------
  499|      0|        if (len == 0 || !(*s2 & 0x80))
  ------------------
  |  Branch (499:13): [True: 0, False: 0]
  |  Branch (499:25): [True: 0, False: 0]
  ------------------
  500|      0|            len++;
  501|      0|    }
  502|       |    /* If it was all zeros, we're done */
  503|   261k|    if (len == 0) {
  ------------------
  |  Branch (503:9): [True: 8.34k, False: 253k]
  ------------------
  504|  8.34k|        ret->top = 0;
  505|  8.34k|        return ret;
  506|  8.34k|    }
  507|   253k|    n = ((len - 1) / BN_BYTES) + 1; /* Number of resulting bignum chunks */
  ------------------
  |  |   38|   253k|#  define BN_BYTES        8
  ------------------
  508|   253k|    if (bn_wexpand(ret, (int)n) == NULL) {
  ------------------
  |  Branch (508:9): [True: 0, False: 253k]
  ------------------
  509|      0|        BN_free(bn);
  510|      0|        return NULL;
  511|      0|    }
  512|   253k|    ret->top = n;
  513|   253k|    ret->neg = neg;
  514|  1.17M|    for (i = 0; n-- > 0; i++) {
  ------------------
  |  Branch (514:17): [True: 919k, False: 253k]
  ------------------
  515|   919k|        BN_ULONG l = 0;        /* Accumulator */
  ------------------
  |  |   37|   919k|#  define BN_ULONG        unsigned long
  ------------------
  516|   919k|        unsigned int m = 0;    /* Offset in a bignum chunk, in bits */
  517|       |
  518|  7.23M|        for (; len > 0 && m < BN_BYTES * 8; len--, s += inc, m += 8) {
  ------------------
  |  |   38|  6.98M|#  define BN_BYTES        8
  ------------------
  |  Branch (518:16): [True: 6.98M, False: 253k]
  |  Branch (518:27): [True: 6.31M, False: 666k]
  ------------------
  519|  6.31M|            BN_ULONG byte_xored = *s ^ xor;
  ------------------
  |  |   37|  6.31M|#  define BN_ULONG        unsigned long
  ------------------
  520|  6.31M|            BN_ULONG byte = (byte_xored + carry) & 0xff;
  ------------------
  |  |   37|  6.31M|#  define BN_ULONG        unsigned long
  ------------------
  521|       |
  522|  6.31M|            carry = byte_xored > byte; /* Implicit 1 or 0 */
  523|  6.31M|            l |= (byte << m);
  524|  6.31M|        }
  525|   919k|        ret->d[i] = l;
  526|   919k|    }
  527|       |    /*
  528|       |     * need to call this due to clear byte at top if avoiding having the top
  529|       |     * bit set (-ve number)
  530|       |     */
  531|   253k|    bn_correct_top(ret);
  532|   253k|    return ret;
  533|   253k|}

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

BN_nnmod:
   15|  4.05M|{
   16|       |    /*
   17|       |     * like BN_mod, but returns non-negative remainder (i.e., 0 <= r < |d|
   18|       |     * always holds)
   19|       |     */
   20|       |
   21|  4.05M|    if (r == d) {
  ------------------
  |  Branch (21:9): [True: 0, False: 4.05M]
  ------------------
   22|      0|        ERR_raise(ERR_LIB_BN, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   23|      0|        return 0;
   24|      0|    }
   25|       |
   26|  4.05M|    if (!(BN_mod(r, m, d, ctx)))
  ------------------
  |  |  277|  4.05M|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  ------------------
  |  Branch (26:9): [True: 0, False: 4.05M]
  ------------------
   27|      0|        return 0;
   28|  4.05M|    if (!r->neg)
  ------------------
  |  Branch (28:9): [True: 4.01M, False: 44.2k]
  ------------------
   29|  4.01M|        return 1;
   30|       |    /* now   -|d| < r < 0,  so we have to set  r := r + |d| */
   31|  44.2k|    return (d->neg ? BN_sub : BN_add) (r, r, d);
  ------------------
  |  Branch (31:13): [True: 0, False: 44.2k]
  ------------------
   32|  4.05M|}
bn_mod_add_fixed_top:
   56|  56.1k|{
   57|  56.1k|    size_t i, ai, bi, mtop = m->top;
   58|  56.1k|    BN_ULONG storage[1024 / BN_BITS2];
  ------------------
  |  |   37|  56.1k|#  define BN_ULONG        unsigned long
  ------------------
   59|  56.1k|    BN_ULONG carry, temp, mask, *rp, *tp = storage;
  ------------------
  |  |   37|  56.1k|#  define BN_ULONG        unsigned long
  ------------------
   60|  56.1k|    const BN_ULONG *ap, *bp;
   61|       |
   62|  56.1k|    if (bn_wexpand(r, mtop) == NULL)
  ------------------
  |  Branch (62:9): [True: 0, False: 56.1k]
  ------------------
   63|      0|        return 0;
   64|       |
   65|  56.1k|    if (mtop > OSSL_NELEM(storage)) {
  ------------------
  |  |   14|  56.1k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (65:9): [True: 0, False: 56.1k]
  ------------------
   66|      0|        tp = OPENSSL_malloc(mtop * sizeof(BN_ULONG));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|      0|        if (tp == NULL)
  ------------------
  |  Branch (67:13): [True: 0, False: 0]
  ------------------
   68|      0|            return 0;
   69|      0|    }
   70|       |
   71|  56.1k|    ap = a->d != NULL ? a->d : tp;
  ------------------
  |  Branch (71:10): [True: 56.1k, False: 0]
  ------------------
   72|  56.1k|    bp = b->d != NULL ? b->d : tp;
  ------------------
  |  Branch (72:10): [True: 55.2k, False: 889]
  ------------------
   73|       |
   74|   254k|    for (i = 0, ai = 0, bi = 0, carry = 0; i < mtop;) {
  ------------------
  |  Branch (74:44): [True: 198k, False: 56.1k]
  ------------------
   75|   198k|        mask = (BN_ULONG)0 - ((i - a->top) >> (8 * sizeof(i) - 1));
   76|   198k|        temp = ((ap[ai] & mask) + carry) & BN_MASK2;
  ------------------
  |  |   94|   198k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   77|   198k|        carry = (temp < carry);
   78|       |
   79|   198k|        mask = (BN_ULONG)0 - ((i - b->top) >> (8 * sizeof(i) - 1));
   80|   198k|        tp[i] = ((bp[bi] & mask) + temp) & BN_MASK2;
  ------------------
  |  |   94|   198k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   81|   198k|        carry += (tp[i] < temp);
   82|       |
   83|   198k|        i++;
   84|   198k|        ai += (i - a->dmax) >> (8 * sizeof(i) - 1);
   85|   198k|        bi += (i - b->dmax) >> (8 * sizeof(i) - 1);
   86|   198k|    }
   87|  56.1k|    rp = r->d;
   88|  56.1k|    carry -= bn_sub_words(rp, tp, m->d, mtop);
   89|   254k|    for (i = 0; i < mtop; i++) {
  ------------------
  |  Branch (89:17): [True: 198k, False: 56.1k]
  ------------------
   90|   198k|        rp[i] = (carry & tp[i]) | (~carry & rp[i]);
   91|   198k|        ((volatile BN_ULONG *)tp)[i] = 0;
   92|   198k|    }
   93|  56.1k|    r->top = mtop;
   94|  56.1k|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  56.1k|#  define BN_FLG_FIXED_TOP 0
  ------------------
   95|  56.1k|    r->neg = 0;
   96|       |
   97|  56.1k|    if (tp != storage)
  ------------------
  |  Branch (97:9): [True: 0, False: 56.1k]
  ------------------
   98|      0|        OPENSSL_free(tp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   99|       |
  100|  56.1k|    return 1;
  101|  56.1k|}
BN_mod_add_quick:
  105|  56.1k|{
  106|  56.1k|    int ret = bn_mod_add_fixed_top(r, a, b, m);
  107|       |
  108|  56.1k|    if (ret)
  ------------------
  |  Branch (108:9): [True: 56.1k, False: 0]
  ------------------
  109|  56.1k|        bn_correct_top(r);
  110|       |
  111|  56.1k|    return ret;
  112|  56.1k|}
BN_mod_sub_quick:
  192|  5.61k|{
  193|  5.61k|    if (r == m) {
  ------------------
  |  Branch (193:9): [True: 0, False: 5.61k]
  ------------------
  194|      0|        ERR_raise(ERR_LIB_BN, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  195|      0|        return 0;
  196|      0|    }
  197|       |
  198|  5.61k|    if (!BN_sub(r, a, b))
  ------------------
  |  Branch (198:9): [True: 0, False: 5.61k]
  ------------------
  199|      0|        return 0;
  200|  5.61k|    if (r->neg)
  ------------------
  |  Branch (200:9): [True: 1.90k, False: 3.70k]
  ------------------
  201|  1.90k|        return BN_add(r, r, m);
  202|  3.70k|    return 1;
  203|  5.61k|}
BN_mod_mul:
  208|  3.83M|{
  209|  3.83M|    BIGNUM *t;
  210|  3.83M|    int ret = 0;
  211|       |
  212|  3.83M|    bn_check_top(a);
  213|  3.83M|    bn_check_top(b);
  214|  3.83M|    bn_check_top(m);
  215|       |
  216|  3.83M|    BN_CTX_start(ctx);
  217|  3.83M|    if ((t = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 3.83M]
  ------------------
  218|      0|        goto err;
  219|  3.83M|    if (a == b) {
  ------------------
  |  Branch (219:9): [True: 3.67M, False: 161k]
  ------------------
  220|  3.67M|        if (!BN_sqr(t, a, ctx))
  ------------------
  |  Branch (220:13): [True: 0, False: 3.67M]
  ------------------
  221|      0|            goto err;
  222|  3.67M|    } else {
  223|   161k|        if (!BN_mul(t, a, b, ctx))
  ------------------
  |  Branch (223:13): [True: 0, False: 161k]
  ------------------
  224|      0|            goto err;
  225|   161k|    }
  226|  3.83M|    if (!BN_nnmod(r, t, m, ctx))
  ------------------
  |  Branch (226:9): [True: 0, False: 3.83M]
  ------------------
  227|      0|        goto err;
  228|  3.83M|    bn_check_top(r);
  229|  3.83M|    ret = 1;
  230|  3.83M| err:
  231|  3.83M|    BN_CTX_end(ctx);
  232|  3.83M|    return ret;
  233|  3.83M|}
BN_mod_sqr:
  236|   161k|{
  237|   161k|    if (!BN_sqr(r, a, ctx))
  ------------------
  |  Branch (237:9): [True: 0, False: 161k]
  ------------------
  238|      0|        return 0;
  239|       |    /* r->neg == 0,  thus we don't need BN_nnmod */
  240|   161k|    return BN_mod(r, r, m, ctx);
  ------------------
  |  |  277|   161k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  ------------------
  241|   161k|}
BN_mod_lshift1_quick:
  256|  5.75k|{
  257|  5.75k|    if (!BN_lshift1(r, a))
  ------------------
  |  Branch (257:9): [True: 0, False: 5.75k]
  ------------------
  258|      0|        return 0;
  259|  5.75k|    bn_check_top(r);
  260|  5.75k|    if (BN_cmp(r, m) >= 0)
  ------------------
  |  Branch (260:9): [True: 427, False: 5.32k]
  ------------------
  261|    427|        return BN_sub(r, r, m);
  262|  5.32k|    return 1;
  263|  5.75k|}

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

BN_mul:
  498|   173k|{
  499|   173k|    int ret = bn_mul_fixed_top(r, a, b, ctx);
  500|       |
  501|   173k|    bn_correct_top(r);
  502|   173k|    bn_check_top(r);
  503|       |
  504|   173k|    return ret;
  505|   173k|}
bn_mul_fixed_top:
  508|   213k|{
  509|   213k|    int ret = 0;
  510|   213k|    int top, al, bl;
  511|   213k|    BIGNUM *rr;
  512|   213k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  513|   213k|    int i;
  514|   213k|#endif
  515|   213k|#ifdef BN_RECURSION
  516|   213k|    BIGNUM *t = NULL;
  517|   213k|    int j = 0, k;
  518|   213k|#endif
  519|       |
  520|   213k|    bn_check_top(a);
  521|   213k|    bn_check_top(b);
  522|   213k|    bn_check_top(r);
  523|       |
  524|   213k|    al = a->top;
  525|   213k|    bl = b->top;
  526|       |
  527|   213k|    if ((al == 0) || (bl == 0)) {
  ------------------
  |  Branch (527:9): [True: 8.91k, False: 204k]
  |  Branch (527:22): [True: 205, False: 203k]
  ------------------
  528|  9.12k|        BN_zero(r);
  ------------------
  |  |  202|  9.12k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  529|  9.12k|        return 1;
  530|  9.12k|    }
  531|   203k|    top = al + bl;
  532|       |
  533|   203k|    BN_CTX_start(ctx);
  534|   203k|    if ((r == a) || (r == b)) {
  ------------------
  |  Branch (534:9): [True: 8.75k, False: 195k]
  |  Branch (534:21): [True: 0, False: 195k]
  ------------------
  535|  8.75k|        if ((rr = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (535:13): [True: 0, False: 8.75k]
  ------------------
  536|      0|            goto err;
  537|  8.75k|    } else
  538|   195k|        rr = r;
  539|       |
  540|   203k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  541|   203k|    i = al - bl;
  542|   203k|#endif
  543|   203k|#ifdef BN_MUL_COMBA
  544|   203k|    if (i == 0) {
  ------------------
  |  Branch (544:9): [True: 171k, False: 32.6k]
  ------------------
  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|   171k|        if (al == 8) {
  ------------------
  |  Branch (554:13): [True: 20, False: 171k]
  ------------------
  555|     20|            if (bn_wexpand(rr, 16) == NULL)
  ------------------
  |  Branch (555:17): [True: 0, False: 20]
  ------------------
  556|      0|                goto err;
  557|     20|            rr->top = 16;
  558|     20|            bn_mul_comba8(rr->d, a->d, b->d);
  559|     20|            goto end;
  560|     20|        }
  561|   171k|    }
  562|   203k|#endif                          /* BN_MUL_COMBA */
  563|   203k|#ifdef BN_RECURSION
  564|   203k|    if ((al >= BN_MULL_SIZE_NORMAL) && (bl >= BN_MULL_SIZE_NORMAL)) {
  ------------------
  |  |  364|   203k|# 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: 203k]
  |  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|   203k|#endif                          /* BN_RECURSION */
  602|   203k|    if (bn_wexpand(rr, top) == NULL)
  ------------------
  |  Branch (602:9): [True: 0, False: 203k]
  ------------------
  603|      0|        goto err;
  604|   203k|    rr->top = top;
  605|   203k|    bn_mul_normal(rr->d, a->d, al, b->d, bl);
  606|       |
  607|   203k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  608|   203k| end:
  609|   203k|#endif
  610|   203k|    rr->neg = a->neg ^ b->neg;
  611|   203k|    rr->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   203k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  612|   203k|    if (r != rr && BN_copy(r, rr) == NULL)
  ------------------
  |  Branch (612:9): [True: 8.75k, False: 195k]
  |  Branch (612:20): [True: 0, False: 8.75k]
  ------------------
  613|      0|        goto err;
  614|       |
  615|   203k|    ret = 1;
  616|   203k| err:
  617|   203k|    bn_check_top(r);
  618|   203k|    BN_CTX_end(ctx);
  619|   203k|    return ret;
  620|   203k|}
bn_mul_normal:
  623|   203k|{
  624|   203k|    BN_ULONG *rr;
  ------------------
  |  |   37|   203k|#  define BN_ULONG        unsigned long
  ------------------
  625|       |
  626|   203k|    if (na < nb) {
  ------------------
  |  Branch (626:9): [True: 30.3k, False: 173k]
  ------------------
  627|  30.3k|        int itmp;
  628|  30.3k|        BN_ULONG *ltmp;
  ------------------
  |  |   37|  30.3k|#  define BN_ULONG        unsigned long
  ------------------
  629|       |
  630|  30.3k|        itmp = na;
  631|  30.3k|        na = nb;
  632|  30.3k|        nb = itmp;
  633|  30.3k|        ltmp = a;
  634|  30.3k|        a = b;
  635|  30.3k|        b = ltmp;
  636|       |
  637|  30.3k|    }
  638|   203k|    rr = &(r[na]);
  639|   203k|    if (nb <= 0) {
  ------------------
  |  Branch (639:9): [True: 0, False: 203k]
  ------------------
  640|      0|        (void)bn_mul_words(r, a, na, 0);
  641|      0|        return;
  642|      0|    } else
  643|   203k|        rr[0] = bn_mul_words(r, a, na, b[0]);
  644|       |
  645|   210k|    for (;;) {
  646|   210k|        if (--nb <= 0)
  ------------------
  |  Branch (646:13): [True: 39.8k, False: 170k]
  ------------------
  647|  39.8k|            return;
  648|   170k|        rr[1] = bn_mul_add_words(&(r[1]), a, na, b[1]);
  649|   170k|        if (--nb <= 0)
  ------------------
  |  Branch (649:13): [True: 5.94k, False: 164k]
  ------------------
  650|  5.94k|            return;
  651|   164k|        rr[2] = bn_mul_add_words(&(r[2]), a, na, b[2]);
  652|   164k|        if (--nb <= 0)
  ------------------
  |  Branch (652:13): [True: 514, False: 164k]
  ------------------
  653|    514|            return;
  654|   164k|        rr[3] = bn_mul_add_words(&(r[3]), a, na, b[3]);
  655|   164k|        if (--nb <= 0)
  ------------------
  |  Branch (655:13): [True: 157k, False: 6.95k]
  ------------------
  656|   157k|            return;
  657|  6.95k|        rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]);
  658|  6.95k|        rr += 4;
  659|  6.95k|        r += 4;
  660|  6.95k|        b += 4;
  661|  6.95k|    }
  662|   203k|}

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

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

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

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

BN_mod_sqrt:
   20|  9.42k|{
   21|  9.42k|    BIGNUM *ret = in;
   22|  9.42k|    int err = 1;
   23|  9.42k|    int r;
   24|  9.42k|    BIGNUM *A, *b, *q, *t, *x, *y;
   25|  9.42k|    int e, i, j;
   26|  9.42k|    int used_ctx = 0;
   27|       |
   28|  9.42k|    if (!BN_is_odd(p) || BN_abs_is_word(p, 1)) {
  ------------------
  |  Branch (28:9): [True: 0, False: 9.42k]
  |  Branch (28:26): [True: 0, False: 9.42k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|       |
   47|  9.42k|    if (BN_is_zero(a) || BN_is_one(a)) {
  ------------------
  |  Branch (47:9): [True: 0, False: 9.42k]
  |  Branch (47:26): [True: 0, False: 9.42k]
  ------------------
   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|  9.42k|    BN_CTX_start(ctx);
   62|  9.42k|    used_ctx = 1;
   63|  9.42k|    A = BN_CTX_get(ctx);
   64|  9.42k|    b = BN_CTX_get(ctx);
   65|  9.42k|    q = BN_CTX_get(ctx);
   66|  9.42k|    t = BN_CTX_get(ctx);
   67|  9.42k|    x = BN_CTX_get(ctx);
   68|  9.42k|    y = BN_CTX_get(ctx);
   69|  9.42k|    if (y == NULL)
  ------------------
  |  Branch (69:9): [True: 0, False: 9.42k]
  ------------------
   70|      0|        goto end;
   71|       |
   72|  9.42k|    if (ret == NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 9.42k]
  ------------------
   73|      0|        ret = BN_new();
   74|  9.42k|    if (ret == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 9.42k]
  ------------------
   75|      0|        goto end;
   76|       |
   77|       |    /* A = a mod p */
   78|  9.42k|    if (!BN_nnmod(A, a, p, ctx))
  ------------------
  |  Branch (78:9): [True: 0, False: 9.42k]
  ------------------
   79|      0|        goto end;
   80|       |
   81|       |    /* now write  |p| - 1  as  2^e*q  where  q  is odd */
   82|  9.42k|    e = 1;
   83|   181k|    while (!BN_is_bit_set(p, e))
  ------------------
  |  Branch (83:12): [True: 171k, False: 9.42k]
  ------------------
   84|   171k|        e++;
   85|       |    /* we'll set  q  later (if needed) */
   86|       |
   87|  9.42k|    if (e == 1) {
  ------------------
  |  Branch (87:9): [True: 7.47k, False: 1.95k]
  ------------------
   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|  7.47k|        if (!BN_rshift(q, p, 2))
  ------------------
  |  Branch (96:13): [True: 0, False: 7.47k]
  ------------------
   97|      0|            goto end;
   98|  7.47k|        q->neg = 0;
   99|  7.47k|        if (!BN_add_word(q, 1))
  ------------------
  |  Branch (99:13): [True: 0, False: 7.47k]
  ------------------
  100|      0|            goto end;
  101|  7.47k|        if (!BN_mod_exp(ret, A, q, p, ctx))
  ------------------
  |  Branch (101:13): [True: 0, False: 7.47k]
  ------------------
  102|      0|            goto end;
  103|  7.47k|        err = 0;
  104|  7.47k|        goto vrfy;
  105|  7.47k|    }
  106|       |
  107|  1.95k|    if (e == 2) {
  ------------------
  |  Branch (107:9): [True: 144, False: 1.80k]
  ------------------
  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|    144|        if (!BN_mod_lshift1_quick(t, A, p))
  ------------------
  |  Branch (137:13): [True: 0, False: 144]
  ------------------
  138|      0|            goto end;
  139|       |
  140|       |        /* b := (2*a)^((|p|-5)/8) */
  141|    144|        if (!BN_rshift(q, p, 3))
  ------------------
  |  Branch (141:13): [True: 0, False: 144]
  ------------------
  142|      0|            goto end;
  143|    144|        q->neg = 0;
  144|    144|        if (!BN_mod_exp(b, t, q, p, ctx))
  ------------------
  |  Branch (144:13): [True: 0, False: 144]
  ------------------
  145|      0|            goto end;
  146|       |
  147|       |        /* y := b^2 */
  148|    144|        if (!BN_mod_sqr(y, b, p, ctx))
  ------------------
  |  Branch (148:13): [True: 0, False: 144]
  ------------------
  149|      0|            goto end;
  150|       |
  151|       |        /* t := (2*a)*b^2 - 1 */
  152|    144|        if (!BN_mod_mul(t, t, y, p, ctx))
  ------------------
  |  Branch (152:13): [True: 0, False: 144]
  ------------------
  153|      0|            goto end;
  154|    144|        if (!BN_sub_word(t, 1))
  ------------------
  |  Branch (154:13): [True: 0, False: 144]
  ------------------
  155|      0|            goto end;
  156|       |
  157|       |        /* x = a*b*t */
  158|    144|        if (!BN_mod_mul(x, A, b, p, ctx))
  ------------------
  |  Branch (158:13): [True: 0, False: 144]
  ------------------
  159|      0|            goto end;
  160|    144|        if (!BN_mod_mul(x, x, t, p, ctx))
  ------------------
  |  Branch (160:13): [True: 0, False: 144]
  ------------------
  161|      0|            goto end;
  162|       |
  163|    144|        if (!BN_copy(ret, x))
  ------------------
  |  Branch (163:13): [True: 0, False: 144]
  ------------------
  164|      0|            goto end;
  165|    144|        err = 0;
  166|    144|        goto vrfy;
  167|    144|    }
  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|  1.80k|    if (!BN_copy(q, p))
  ------------------
  |  Branch (173:9): [True: 0, False: 1.80k]
  ------------------
  174|      0|        goto end;               /* use 'q' as temp */
  175|  1.80k|    q->neg = 0;
  176|  1.80k|    i = 2;
  177|  18.0k|    do {
  178|       |        /*
  179|       |         * For efficiency, try small numbers first; if this fails, try random
  180|       |         * numbers.
  181|       |         */
  182|  18.0k|        if (i < 22) {
  ------------------
  |  Branch (182:13): [True: 18.0k, False: 0]
  ------------------
  183|  18.0k|            if (!BN_set_word(y, i))
  ------------------
  |  Branch (183:17): [True: 0, False: 18.0k]
  ------------------
  184|      0|                goto end;
  185|  18.0k|        } 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|  18.0k|        r = BN_kronecker(y, q, ctx); /* here 'q' is |p| */
  199|  18.0k|        if (r < -1)
  ------------------
  |  Branch (199:13): [True: 0, False: 18.0k]
  ------------------
  200|      0|            goto end;
  201|  18.0k|        if (r == 0) {
  ------------------
  |  Branch (201:13): [True: 0, False: 18.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  204|      0|            goto end;
  205|      0|        }
  206|  18.0k|    }
  207|  18.0k|    while (r == 1 && ++i < 82);
  ------------------
  |  Branch (207:12): [True: 16.2k, False: 1.80k]
  |  Branch (207:22): [True: 16.2k, False: 0]
  ------------------
  208|       |
  209|  1.80k|    if (r != -1) {
  ------------------
  |  Branch (209:9): [True: 0, False: 1.80k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  216|      0|        goto end;
  217|      0|    }
  218|       |
  219|       |    /* Here's our actual 'q': */
  220|  1.80k|    if (!BN_rshift(q, q, e))
  ------------------
  |  Branch (220:9): [True: 0, False: 1.80k]
  ------------------
  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|  1.80k|    if (!BN_mod_exp(y, y, q, p, ctx))
  ------------------
  |  Branch (227:9): [True: 0, False: 1.80k]
  ------------------
  228|      0|        goto end;
  229|  1.80k|    if (BN_is_one(y)) {
  ------------------
  |  Branch (229:9): [True: 0, False: 1.80k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  1.80k|    if (!BN_rshift1(t, q))
  ------------------
  |  Branch (254:9): [True: 0, False: 1.80k]
  ------------------
  255|      0|        goto end;
  256|       |
  257|       |    /* x := a^((q-1)/2) */
  258|  1.80k|    if (BN_is_zero(t)) {        /* special case: p = 2^e + 1 */
  ------------------
  |  Branch (258:9): [True: 0, False: 1.80k]
  ------------------
  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|  1.80k|    } else {
  269|  1.80k|        if (!BN_mod_exp(x, A, t, p, ctx))
  ------------------
  |  Branch (269:13): [True: 0, False: 1.80k]
  ------------------
  270|      0|            goto end;
  271|  1.80k|        if (BN_is_zero(x)) {
  ------------------
  |  Branch (271:13): [True: 0, False: 1.80k]
  ------------------
  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|  1.80k|    }
  278|       |
  279|       |    /* b := a*x^2  (= a^q) */
  280|  1.80k|    if (!BN_mod_sqr(b, x, p, ctx))
  ------------------
  |  Branch (280:9): [True: 0, False: 1.80k]
  ------------------
  281|      0|        goto end;
  282|  1.80k|    if (!BN_mod_mul(b, b, A, p, ctx))
  ------------------
  |  Branch (282:9): [True: 0, False: 1.80k]
  ------------------
  283|      0|        goto end;
  284|       |
  285|       |    /* x := a*x    (= a^((q+1)/2)) */
  286|  1.80k|    if (!BN_mod_mul(x, x, A, p, ctx))
  ------------------
  |  Branch (286:9): [True: 0, False: 1.80k]
  ------------------
  287|      0|        goto end;
  288|       |
  289|  75.5k|    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|  75.5k|        if (BN_is_one(b)) {
  ------------------
  |  Branch (300:13): [True: 1.54k, False: 74.0k]
  ------------------
  301|  1.54k|            if (!BN_copy(ret, x))
  ------------------
  |  Branch (301:17): [True: 0, False: 1.54k]
  ------------------
  302|      0|                goto end;
  303|  1.54k|            err = 0;
  304|  1.54k|            goto vrfy;
  305|  1.54k|        }
  306|       |
  307|       |        /* Find the smallest i, 0 < i < e, such that b^(2^i) = 1. */
  308|  3.67M|        for (i = 1; i < e; i++) {
  ------------------
  |  Branch (308:21): [True: 3.67M, False: 264]
  ------------------
  309|  3.67M|            if (i == 1) {
  ------------------
  |  Branch (309:17): [True: 74.0k, False: 3.59M]
  ------------------
  310|  74.0k|                if (!BN_mod_sqr(t, b, p, ctx))
  ------------------
  |  Branch (310:21): [True: 0, False: 74.0k]
  ------------------
  311|      0|                    goto end;
  312|       |
  313|  3.59M|            } else {
  314|  3.59M|                if (!BN_mod_mul(t, t, t, p, ctx))
  ------------------
  |  Branch (314:21): [True: 0, False: 3.59M]
  ------------------
  315|      0|                    goto end;
  316|  3.59M|            }
  317|  3.67M|            if (BN_is_one(t))
  ------------------
  |  Branch (317:17): [True: 73.7k, False: 3.60M]
  ------------------
  318|  73.7k|                break;
  319|  3.67M|        }
  320|       |        /* If not found, a is not a square or p is not prime. */
  321|  74.0k|        if (i >= e) {
  ------------------
  |  Branch (321:13): [True: 264, False: 73.7k]
  ------------------
  322|    264|            ERR_raise(ERR_LIB_BN, BN_R_NOT_A_SQUARE);
  ------------------
  |  |  401|    264|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    264|    (ERR_new(),                                                 \
  |  |  |  |  404|    264|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    264|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    264|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    264|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    264|     ERR_set_error)
  |  |  ------------------
  ------------------
  323|    264|            goto end;
  324|    264|        }
  325|       |
  326|       |        /* t := y^2^(e - i - 1) */
  327|  73.7k|        if (!BN_copy(t, y))
  ------------------
  |  Branch (327:13): [True: 0, False: 73.7k]
  ------------------
  328|      0|            goto end;
  329|   144k|        for (j = e - i - 1; j > 0; j--) {
  ------------------
  |  Branch (329:29): [True: 70.3k, False: 73.7k]
  ------------------
  330|  70.3k|            if (!BN_mod_sqr(t, t, p, ctx))
  ------------------
  |  Branch (330:17): [True: 0, False: 70.3k]
  ------------------
  331|      0|                goto end;
  332|  70.3k|        }
  333|  73.7k|        if (!BN_mod_mul(y, t, t, p, ctx))
  ------------------
  |  Branch (333:13): [True: 0, False: 73.7k]
  ------------------
  334|      0|            goto end;
  335|  73.7k|        if (!BN_mod_mul(x, x, t, p, ctx))
  ------------------
  |  Branch (335:13): [True: 0, False: 73.7k]
  ------------------
  336|      0|            goto end;
  337|  73.7k|        if (!BN_mod_mul(b, b, y, p, ctx))
  ------------------
  |  Branch (337:13): [True: 0, False: 73.7k]
  ------------------
  338|      0|            goto end;
  339|  73.7k|        e = i;
  340|  73.7k|    }
  341|       |
  342|  9.15k| vrfy:
  343|  9.15k|    if (!err) {
  ------------------
  |  Branch (343:9): [True: 9.15k, 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|  9.15k|        if (!BN_mod_sqr(x, ret, p, ctx))
  ------------------
  |  Branch (349:13): [True: 0, False: 9.15k]
  ------------------
  350|      0|            err = 1;
  351|       |
  352|  9.15k|        if (!err && 0 != BN_cmp(x, A)) {
  ------------------
  |  Branch (352:13): [True: 9.15k, False: 0]
  |  Branch (352:21): [True: 3.77k, False: 5.38k]
  ------------------
  353|  3.77k|            ERR_raise(ERR_LIB_BN, BN_R_NOT_A_SQUARE);
  ------------------
  |  |  401|  3.77k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  3.77k|    (ERR_new(),                                                 \
  |  |  |  |  404|  3.77k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  3.77k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  3.77k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  3.77k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  3.77k|     ERR_set_error)
  |  |  ------------------
  ------------------
  354|  3.77k|            err = 1;
  355|  3.77k|        }
  356|  9.15k|    }
  357|       |
  358|  9.42k| end:
  359|  9.42k|    if (err) {
  ------------------
  |  Branch (359:9): [True: 4.04k, False: 5.38k]
  ------------------
  360|  4.04k|        if (ret != in)
  ------------------
  |  Branch (360:13): [True: 0, False: 4.04k]
  ------------------
  361|      0|            BN_clear_free(ret);
  362|  4.04k|        ret = NULL;
  363|  4.04k|    }
  364|  9.42k|    if (used_ctx)
  ------------------
  |  Branch (364:9): [True: 9.42k, False: 0]
  ------------------
  365|  9.42k|        BN_CTX_end(ctx);
  366|  9.42k|    bn_check_top(ret);
  367|  9.42k|    return ret;
  368|  9.15k|}

BN_div_word:
   62|  7.01k|{
   63|  7.01k|    BN_ULONG ret = 0;
  ------------------
  |  |   37|  7.01k|#  define BN_ULONG        unsigned long
  ------------------
   64|  7.01k|    int i, j;
   65|       |
   66|  7.01k|    bn_check_top(a);
   67|  7.01k|    w &= BN_MASK2;
  ------------------
  |  |   94|  7.01k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   68|       |
   69|  7.01k|    if (!w)
  ------------------
  |  Branch (69:9): [True: 0, False: 7.01k]
  ------------------
   70|       |        /* actually this an error (division by zero) */
   71|      0|        return (BN_ULONG)-1;
   72|  7.01k|    if (a->top == 0)
  ------------------
  |  Branch (72:9): [True: 0, False: 7.01k]
  ------------------
   73|      0|        return 0;
   74|       |
   75|       |    /* normalize input (so bn_div_words doesn't complain) */
   76|  7.01k|    j = BN_BITS2 - BN_num_bits_word(w);
  ------------------
  |  |   54|  7.01k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.01k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
   77|  7.01k|    w <<= j;
   78|  7.01k|    if (!BN_lshift(a, a, j))
  ------------------
  |  Branch (78:9): [True: 0, False: 7.01k]
  ------------------
   79|      0|        return (BN_ULONG)-1;
   80|       |
   81|  26.3k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (81:26): [True: 19.3k, False: 7.01k]
  ------------------
   82|  19.3k|        BN_ULONG l, d;
  ------------------
  |  |   37|  19.3k|#  define BN_ULONG        unsigned long
  ------------------
   83|       |
   84|  19.3k|        l = a->d[i];
   85|  19.3k|        d = bn_div_words(ret, l, w);
   86|  19.3k|        ret = (l - ((d * w) & BN_MASK2)) & BN_MASK2;
  ------------------
  |  |   94|  19.3k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
                      ret = (l - ((d * w) & BN_MASK2)) & BN_MASK2;
  ------------------
  |  |   94|  19.3k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   87|  19.3k|        a->d[i] = d;
   88|  19.3k|    }
   89|  7.01k|    if ((a->top > 0) && (a->d[a->top - 1] == 0))
  ------------------
  |  Branch (89:9): [True: 7.01k, False: 0]
  |  Branch (89:25): [True: 6.99k, False: 28]
  ------------------
   90|  6.99k|        a->top--;
   91|  7.01k|    ret >>= j;
   92|  7.01k|    if (!a->top)
  ------------------
  |  Branch (92:9): [True: 2.17k, False: 4.84k]
  ------------------
   93|  2.17k|        a->neg = 0; /* don't allow negative zero */
   94|  7.01k|    bn_check_top(a);
   95|  7.01k|    return ret;
   96|  7.01k|}
BN_add_word:
   99|  52.9k|{
  100|  52.9k|    BN_ULONG l;
  ------------------
  |  |   37|  52.9k|#  define BN_ULONG        unsigned long
  ------------------
  101|  52.9k|    int i;
  102|       |
  103|  52.9k|    bn_check_top(a);
  104|  52.9k|    w &= BN_MASK2;
  ------------------
  |  |   94|  52.9k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  105|       |
  106|       |    /* degenerate case: w is zero */
  107|  52.9k|    if (!w)
  ------------------
  |  Branch (107:9): [True: 1.51k, False: 51.4k]
  ------------------
  108|  1.51k|        return 1;
  109|       |    /* degenerate case: a is zero */
  110|  51.4k|    if (BN_is_zero(a))
  ------------------
  |  Branch (110:9): [True: 4.18k, False: 47.2k]
  ------------------
  111|  4.18k|        return BN_set_word(a, w);
  112|       |    /* handle 'a' when negative */
  113|  47.2k|    if (a->neg) {
  ------------------
  |  Branch (113:9): [True: 0, False: 47.2k]
  ------------------
  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|  98.6k|    for (i = 0; w != 0 && i < a->top; i++) {
  ------------------
  |  Branch (120:17): [True: 51.4k, False: 47.2k]
  |  Branch (120:27): [True: 51.4k, False: 0]
  ------------------
  121|  51.4k|        a->d[i] = l = (a->d[i] + w) & BN_MASK2;
  ------------------
  |  |   94|  51.4k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  122|  51.4k|        w = (w > l) ? 1 : 0;
  ------------------
  |  Branch (122:13): [True: 4.13k, False: 47.2k]
  ------------------
  123|  51.4k|    }
  124|  47.2k|    if (w && i == a->top) {
  ------------------
  |  Branch (124:9): [True: 0, False: 47.2k]
  |  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|  47.2k|    bn_check_top(a);
  131|  47.2k|    return 1;
  132|  47.2k|}
BN_sub_word:
  135|  47.9k|{
  136|  47.9k|    int i;
  137|       |
  138|  47.9k|    bn_check_top(a);
  139|  47.9k|    w &= BN_MASK2;
  ------------------
  |  |   94|  47.9k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  140|       |
  141|       |    /* degenerate case: w is zero */
  142|  47.9k|    if (!w)
  ------------------
  |  Branch (142:9): [True: 0, False: 47.9k]
  ------------------
  143|      0|        return 1;
  144|       |    /* degenerate case: a is zero */
  145|  47.9k|    if (BN_is_zero(a)) {
  ------------------
  |  Branch (145:9): [True: 0, False: 47.9k]
  ------------------
  146|      0|        i = BN_set_word(a, w);
  147|      0|        if (i != 0)
  ------------------
  |  Branch (147:13): [True: 0, False: 0]
  ------------------
  148|      0|            BN_set_negative(a, 1);
  149|      0|        return i;
  150|      0|    }
  151|       |    /* handle 'a' when negative */
  152|  47.9k|    if (a->neg) {
  ------------------
  |  Branch (152:9): [True: 0, False: 47.9k]
  ------------------
  153|      0|        a->neg = 0;
  154|      0|        i = BN_add_word(a, w);
  155|      0|        a->neg = 1;
  156|      0|        return i;
  157|      0|    }
  158|       |
  159|  47.9k|    if ((a->top == 1) && (a->d[0] < w)) {
  ------------------
  |  Branch (159:9): [True: 53, False: 47.9k]
  |  Branch (159:26): [True: 0, False: 53]
  ------------------
  160|      0|        a->d[0] = w - a->d[0];
  161|      0|        a->neg = 1;
  162|      0|        return 1;
  163|      0|    }
  164|  47.9k|    i = 0;
  165|  95.1k|    for (;;) {
  166|  95.1k|        if (a->d[i] >= w) {
  ------------------
  |  Branch (166:13): [True: 47.9k, False: 47.2k]
  ------------------
  167|  47.9k|            a->d[i] -= w;
  168|  47.9k|            break;
  169|  47.9k|        } else {
  170|  47.2k|            a->d[i] = (a->d[i] - w) & BN_MASK2;
  ------------------
  |  |   94|  47.2k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  171|  47.2k|            i++;
  172|  47.2k|            w = 1;
  173|  47.2k|        }
  174|  95.1k|    }
  175|  47.9k|    if ((a->d[i] == 0) && (i == (a->top - 1)))
  ------------------
  |  Branch (175:9): [True: 2.42k, False: 45.5k]
  |  Branch (175:27): [True: 2.42k, False: 4]
  ------------------
  176|  2.42k|        a->top--;
  177|  47.9k|    bn_check_top(a);
  178|  47.9k|    return 1;
  179|  47.9k|}
BN_mul_word:
  182|   325k|{
  183|   325k|    BN_ULONG ll;
  ------------------
  |  |   37|   325k|#  define BN_ULONG        unsigned long
  ------------------
  184|       |
  185|   325k|    bn_check_top(a);
  186|   325k|    w &= BN_MASK2;
  ------------------
  |  |   94|   325k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  187|   325k|    if (a->top) {
  ------------------
  |  Branch (187:9): [True: 325k, False: 0]
  ------------------
  188|   325k|        if (w == 0)
  ------------------
  |  Branch (188:13): [True: 0, False: 325k]
  ------------------
  189|      0|            BN_zero(a);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  190|   325k|        else {
  191|   325k|            ll = bn_mul_words(a->d, a->d, a->top, w);
  192|   325k|            if (ll) {
  ------------------
  |  Branch (192:17): [True: 323k, False: 1.26k]
  ------------------
  193|   323k|                if (bn_wexpand(a, a->top + 1) == NULL)
  ------------------
  |  Branch (193:21): [True: 0, False: 323k]
  ------------------
  194|      0|                    return 0;
  195|   323k|                a->d[a->top++] = ll;
  196|   323k|            }
  197|   325k|        }
  198|   325k|    }
  199|   325k|    bn_check_top(a);
  200|   325k|    return 1;
  201|   325k|}

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

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

ossl_err_load_CMP_strings:
  193|      2|{
  194|      2|# ifndef OPENSSL_NO_ERR
  195|      2|    if (ERR_reason_error_string(CMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (195:9): [True: 2, False: 0]
  ------------------
  196|      2|        ERR_load_strings_const(CMP_str_reasons);
  197|      2|# endif
  198|      2|    return 1;
  199|      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|  21.6k|{
   49|  21.6k|    if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  21.6k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (49:9): [True: 2.14k, False: 19.5k]
  ------------------
   50|  2.14k|        CMS_SignerInfo *si = (CMS_SignerInfo *)*pval;
   51|  2.14k|        EVP_PKEY_free(si->pkey);
   52|  2.14k|        X509_free(si->signer);
   53|  2.14k|        EVP_MD_CTX_free(si->mctx);
   54|  2.14k|        EVP_PKEY_CTX_free(si->pctx);
   55|  2.14k|    }
   56|  21.6k|    return 1;
   57|  21.6k|}
cms_asn1.c:cms_ec_cb:
   96|  9.52k|{
   97|  9.52k|    CMS_EncryptedContentInfo *ec = (CMS_EncryptedContentInfo *)*pval;
   98|       |
   99|  9.52k|    if (operation == ASN1_OP_FREE_POST)
  ------------------
  |  |  745|  9.52k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (99:9): [True: 1.42k, False: 8.09k]
  ------------------
  100|  1.42k|        OPENSSL_clear_free(ec->key, ec->keylen);
  ------------------
  |  |  113|  1.42k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.42k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.42k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  101|  9.52k|    return 1;
  102|  9.52k|}
cms_asn1.c:cms_rek_cb:
  135|  14.1k|{
  136|  14.1k|    CMS_RecipientEncryptedKey *rek = (CMS_RecipientEncryptedKey *)*pval;
  137|  14.1k|    if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  14.1k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (137:9): [True: 1.62k, False: 12.5k]
  ------------------
  138|  1.62k|        EVP_PKEY_free(rek->pkey);
  139|  1.62k|    }
  140|  14.1k|    return 1;
  141|  14.1k|}
cms_asn1.c:cms_kari_cb:
  161|  20.8k|{
  162|  20.8k|    CMS_KeyAgreeRecipientInfo *kari = (CMS_KeyAgreeRecipientInfo *)*pval;
  163|  20.8k|    if (operation == ASN1_OP_NEW_POST) {
  ------------------
  |  |  743|  20.8k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (163:9): [True: 1.90k, False: 18.9k]
  ------------------
  164|  1.90k|        kari->ctx = EVP_CIPHER_CTX_new();
  165|  1.90k|        if (kari->ctx == NULL)
  ------------------
  |  Branch (165:13): [True: 0, False: 1.90k]
  ------------------
  166|      0|            return 0;
  167|  1.90k|        EVP_CIPHER_CTX_set_flags(kari->ctx, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW);
  ------------------
  |  |  365|  1.90k|# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1
  ------------------
  168|  1.90k|        kari->pctx = NULL;
  169|  18.9k|    } else if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  18.9k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (169:16): [True: 1.90k, False: 17.0k]
  ------------------
  170|  1.90k|        EVP_PKEY_CTX_free(kari->pctx);
  171|  1.90k|        EVP_CIPHER_CTX_free(kari->ctx);
  172|  1.90k|    }
  173|  20.8k|    return 1;
  174|  20.8k|}
cms_asn1.c:cms_ri_cb:
  212|  97.0k|{
  213|  97.0k|    if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  97.0k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (213:9): [True: 11.2k, False: 85.8k]
  ------------------
  214|  11.2k|        CMS_RecipientInfo *ri = (CMS_RecipientInfo *)*pval;
  215|  11.2k|        if (ri->type == CMS_RECIPINFO_TRANS) {
  ------------------
  |  |  164|  11.2k|# define CMS_RECIPINFO_TRANS             0
  ------------------
  |  Branch (215:13): [True: 1.83k, False: 9.42k]
  ------------------
  216|  1.83k|            CMS_KeyTransRecipientInfo *ktri = ri->d.ktri;
  217|  1.83k|            EVP_PKEY_free(ktri->pkey);
  218|  1.83k|            X509_free(ktri->recip);
  219|  1.83k|            EVP_PKEY_CTX_free(ktri->pctx);
  220|  9.42k|        } else if (ri->type == CMS_RECIPINFO_KEK) {
  ------------------
  |  |  166|  9.42k|# define CMS_RECIPINFO_KEK               2
  ------------------
  |  Branch (220:20): [True: 525, False: 8.90k]
  ------------------
  221|    525|            CMS_KEKRecipientInfo *kekri = ri->d.kekri;
  222|    525|            OPENSSL_clear_free(kekri->key, kekri->keylen);
  ------------------
  |  |  113|    525|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    525|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    525|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  223|  8.90k|        } else if (ri->type == CMS_RECIPINFO_PASS) {
  ------------------
  |  |  167|  8.90k|# define CMS_RECIPINFO_PASS              3
  ------------------
  |  Branch (223:20): [True: 1.99k, False: 6.90k]
  ------------------
  224|  1.99k|            CMS_PasswordRecipientInfo *pwri = ri->d.pwri;
  225|  1.99k|            OPENSSL_clear_free(pwri->pass, pwri->passlen);
  ------------------
  |  |  113|  1.99k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.99k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.99k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  226|  1.99k|        }
  227|  11.2k|    }
  228|  97.0k|    return 1;
  229|  97.0k|}
cms_asn1.c:cms_cb:
  307|  41.9k|{
  308|  41.9k|    ASN1_STREAM_ARG *sarg = exarg;
  309|  41.9k|    CMS_ContentInfo *cms = NULL;
  310|  41.9k|    if (pval)
  ------------------
  |  Branch (310:9): [True: 41.9k, False: 0]
  ------------------
  311|  41.9k|        cms = (CMS_ContentInfo *)*pval;
  312|      0|    else
  313|      0|        return 1;
  314|  41.9k|    switch (operation) {
  ------------------
  |  Branch (314:13): [True: 34.4k, False: 7.51k]
  ------------------
  315|       |
  316|      0|    case ASN1_OP_STREAM_PRE:
  ------------------
  |  |  752|      0|# define ASN1_OP_STREAM_PRE      10
  ------------------
  |  Branch (316:5): [True: 0, False: 41.9k]
  ------------------
  317|      0|        if (CMS_stream(&sarg->boundary, cms) <= 0)
  ------------------
  |  Branch (317:13): [True: 0, False: 0]
  ------------------
  318|      0|            return 0;
  319|       |        /* fall through */
  320|      0|    case ASN1_OP_DETACHED_PRE:
  ------------------
  |  |  754|      0|# define ASN1_OP_DETACHED_PRE    12
  ------------------
  |  Branch (320:5): [True: 0, False: 41.9k]
  ------------------
  321|      0|        sarg->ndef_bio = CMS_dataInit(cms, sarg->out);
  322|      0|        if (!sarg->ndef_bio)
  ------------------
  |  Branch (322:13): [True: 0, False: 0]
  ------------------
  323|      0|            return 0;
  324|      0|        break;
  325|       |
  326|      0|    case ASN1_OP_STREAM_POST:
  ------------------
  |  |  753|      0|# define ASN1_OP_STREAM_POST     11
  ------------------
  |  Branch (326:5): [True: 0, False: 41.9k]
  ------------------
  327|      0|    case ASN1_OP_DETACHED_POST:
  ------------------
  |  |  755|      0|# define ASN1_OP_DETACHED_POST   13
  ------------------
  |  Branch (327:5): [True: 0, False: 41.9k]
  ------------------
  328|      0|        if (CMS_dataFinal(cms, sarg->ndef_bio) <= 0)
  ------------------
  |  Branch (328:13): [True: 0, False: 0]
  ------------------
  329|      0|            return 0;
  330|      0|        break;
  331|       |
  332|  7.51k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  7.51k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (332:5): [True: 7.51k, False: 34.4k]
  ------------------
  333|  7.51k|        OPENSSL_free(cms->ctx.propq);
  ------------------
  |  |  115|  7.51k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  7.51k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  7.51k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  334|  7.51k|        break;
  335|       |
  336|  41.9k|    }
  337|  41.9k|    return 1;
  338|  41.9k|}

CMS_get0_RecipientInfos:
  166|  1.08k|{
  167|  1.08k|    switch (cms_get_enveloped_type(cms)) {
  168|    302|    case CMS_ENVELOPED_STANDARD:
  ------------------
  |  |   26|    302|#define CMS_ENVELOPED_STANDARD 1
  ------------------
  |  Branch (168:5): [True: 302, False: 784]
  ------------------
  169|    302|        return cms->d.envelopedData->recipientInfos;
  170|       |
  171|      0|    case CMS_ENVELOPED_AUTH:
  ------------------
  |  |   27|      0|#define CMS_ENVELOPED_AUTH     2
  ------------------
  |  Branch (171:5): [True: 0, False: 1.08k]
  ------------------
  172|      0|        return cms->d.authEnvelopedData->recipientInfos;
  173|       |
  174|    784|    default:
  ------------------
  |  Branch (174:5): [True: 784, False: 302]
  ------------------
  175|    784|        return NULL;
  176|  1.08k|    }
  177|  1.08k|}
ossl_cms_RecipientInfos_set_cmsctx:
  180|  1.08k|{
  181|  1.08k|    int i;
  182|  1.08k|    CMS_RecipientInfo *ri;
  183|  1.08k|    const CMS_CTX *ctx = ossl_cms_get0_cmsctx(cms);
  184|  1.08k|    STACK_OF(CMS_RecipientInfo) *rinfos = CMS_get0_RecipientInfos(cms);
  ------------------
  |  |   31|  1.08k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  185|       |
  186|  4.51k|    for (i = 0; i < sk_CMS_RecipientInfo_num(rinfos); i++) {
  ------------------
  |  |   99|  4.51k|#define sk_CMS_RecipientInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RecipientInfo_sk_type(sk))
  ------------------
  |  Branch (186:17): [True: 3.42k, False: 1.08k]
  ------------------
  187|  3.42k|        ri = sk_CMS_RecipientInfo_value(rinfos, i);
  ------------------
  |  |  100|  3.42k|#define sk_CMS_RecipientInfo_value(sk, idx) ((CMS_RecipientInfo *)OPENSSL_sk_value(ossl_check_const_CMS_RecipientInfo_sk_type(sk), (idx)))
  ------------------
  188|  3.42k|        if (ri != NULL) {
  ------------------
  |  Branch (188:13): [True: 3.42k, False: 0]
  ------------------
  189|  3.42k|            switch (ri->type) {
  190|    656|            case CMS_RECIPINFO_AGREE:
  ------------------
  |  |  165|    656|# define CMS_RECIPINFO_AGREE             1
  ------------------
  |  Branch (190:13): [True: 656, False: 2.77k]
  ------------------
  191|    656|                ri->d.kari->cms_ctx = ctx;
  192|    656|                break;
  193|    573|            case CMS_RECIPINFO_TRANS:
  ------------------
  |  |  164|    573|# define CMS_RECIPINFO_TRANS             0
  ------------------
  |  Branch (193:13): [True: 573, False: 2.85k]
  ------------------
  194|    573|                ri->d.ktri->cms_ctx = ctx;
  195|    573|                ossl_x509_set0_libctx(ri->d.ktri->recip,
  196|    573|                                      ossl_cms_ctx_get0_libctx(ctx),
  197|    573|                                      ossl_cms_ctx_get0_propq(ctx));
  198|    573|                break;
  199|     64|            case CMS_RECIPINFO_KEK:
  ------------------
  |  |  166|     64|# define CMS_RECIPINFO_KEK               2
  ------------------
  |  Branch (199:13): [True: 64, False: 3.36k]
  ------------------
  200|     64|                ri->d.kekri->cms_ctx = ctx;
  201|     64|                break;
  202|    861|            case CMS_RECIPINFO_PASS:
  ------------------
  |  |  167|    861|# define CMS_RECIPINFO_PASS              3
  ------------------
  |  Branch (202:13): [True: 861, False: 2.56k]
  ------------------
  203|    861|                ri->d.pwri->cms_ctx = ctx;
  204|    861|                break;
  205|  1.27k|            default:
  ------------------
  |  Branch (205:13): [True: 1.27k, False: 2.15k]
  ------------------
  206|  1.27k|                break;
  207|  3.42k|            }
  208|  3.42k|        }
  209|  3.42k|    }
  210|  1.08k|}
cms_env.c:cms_get_enveloped_type:
   46|  1.08k|{
   47|  1.08k|    int ret = cms_get_enveloped_type_simple(cms);
   48|       |
   49|  1.08k|    if (ret == 0)
  ------------------
  |  Branch (49:9): [True: 784, False: 302]
  ------------------
   50|  1.08k|        ERR_raise(ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA);
  ------------------
  |  |  401|    784|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    784|    (ERR_new(),                                                 \
  |  |  |  |  404|    784|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    784|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    784|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    784|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    784|     ERR_set_error)
  |  |  ------------------
  ------------------
   51|  1.08k|    return ret;
   52|  1.08k|}
cms_env.c:cms_get_enveloped_type_simple:
   30|  1.08k|{
   31|  1.08k|    int nid = OBJ_obj2nid(cms->contentType);
   32|       |
   33|  1.08k|    switch (nid) {
   34|    302|    case NID_pkcs7_enveloped:
  ------------------
  |  |  683|    302|#define NID_pkcs7_enveloped             23
  ------------------
  |  Branch (34:5): [True: 302, False: 784]
  ------------------
   35|    302|        return CMS_ENVELOPED_STANDARD;
  ------------------
  |  |   26|    302|#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: 1.08k]
  ------------------
   38|      0|        return CMS_ENVELOPED_AUTH;
  ------------------
  |  |   27|      0|#define CMS_ENVELOPED_AUTH     2
  ------------------
   39|       |
   40|    784|    default:
  ------------------
  |  Branch (40:5): [True: 784, False: 302]
  ------------------
   41|    784|        return 0;
   42|  1.08k|    }
   43|  1.08k|}

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

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

ossl_cms_get0_cmsctx:
   71|  11.2k|{
   72|  11.2k|    return cms != NULL ? &cms->ctx : NULL;
  ------------------
  |  Branch (72:12): [True: 3.25k, False: 7.99k]
  ------------------
   73|  11.2k|}
ossl_cms_ctx_get0_libctx:
   76|  9.65k|{
   77|  9.65k|    return ctx != NULL ? ctx->libctx : NULL;
  ------------------
  |  Branch (77:12): [True: 1.65k, False: 7.99k]
  ------------------
   78|  9.65k|}
ossl_cms_ctx_get0_propq:
   81|  9.65k|{
   82|  9.65k|    return ctx != NULL ? ctx->propq : NULL;
  ------------------
  |  Branch (82:12): [True: 1.65k, False: 7.99k]
  ------------------
   83|  9.65k|}
ossl_cms_resolve_libctx:
   86|  1.08k|{
   87|  1.08k|    int i;
   88|  1.08k|    CMS_CertificateChoices *cch;
   89|  1.08k|    STACK_OF(CMS_CertificateChoices) **pcerts;
  ------------------
  |  |   31|  1.08k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   90|  1.08k|    const CMS_CTX *ctx = ossl_cms_get0_cmsctx(ci);
   91|  1.08k|    OSSL_LIB_CTX *libctx = ossl_cms_ctx_get0_libctx(ctx);
   92|  1.08k|    const char *propq = ossl_cms_ctx_get0_propq(ctx);
   93|       |
   94|  1.08k|    ossl_cms_SignerInfos_set_cmsctx(ci);
   95|  1.08k|    ossl_cms_RecipientInfos_set_cmsctx(ci);
   96|       |
   97|  1.08k|    pcerts = cms_get0_certificate_choices(ci);
   98|  1.08k|    if (pcerts != NULL) {
  ------------------
  |  Branch (98:9): [True: 234, False: 852]
  ------------------
   99|  28.6k|        for (i = 0; i < sk_CMS_CertificateChoices_num(*pcerts); i++) {
  ------------------
  |  Branch (99:21): [True: 28.3k, False: 234]
  ------------------
  100|  28.3k|            cch = sk_CMS_CertificateChoices_value(*pcerts, i);
  101|  28.3k|            if (cch->type == CMS_CERTCHOICE_CERT)
  ------------------
  |  |  318|  28.3k|# define CMS_CERTCHOICE_CERT             0
  ------------------
  |  Branch (101:17): [True: 69, False: 28.3k]
  ------------------
  102|     69|                ossl_x509_set0_libctx(cch->d.certificate, libctx, propq);
  103|  28.3k|        }
  104|    234|    }
  105|  1.08k|}
cms_lib.c:cms_get0_certificate_choices:
  471|  1.08k|{
  472|  1.08k|    switch (OBJ_obj2nid(cms->contentType)) {
  473|       |
  474|    233|    case NID_pkcs7_signed:
  ------------------
  |  |  679|    233|#define NID_pkcs7_signed                22
  ------------------
  |  Branch (474:5): [True: 233, False: 853]
  ------------------
  475|    233|        return &cms->d.signedData->certificates;
  476|       |
  477|    302|    case NID_pkcs7_enveloped:
  ------------------
  |  |  683|    302|#define NID_pkcs7_enveloped             23
  ------------------
  |  Branch (477:5): [True: 302, False: 784]
  ------------------
  478|    302|        if (cms->d.envelopedData->originatorInfo == NULL)
  ------------------
  |  Branch (478:13): [True: 301, False: 1]
  ------------------
  479|    301|            return NULL;
  480|      1|        return &cms->d.envelopedData->originatorInfo->certificates;
  481|       |
  482|      0|    case NID_id_smime_ct_authEnvelopedData:
  ------------------
  |  |  854|      0|#define NID_id_smime_ct_authEnvelopedData               1059
  ------------------
  |  Branch (482:5): [True: 0, False: 1.08k]
  ------------------
  483|      0|        if (cms->d.authEnvelopedData->originatorInfo == NULL)
  ------------------
  |  Branch (483:13): [True: 0, False: 0]
  ------------------
  484|      0|            return NULL;
  485|      0|        return &cms->d.authEnvelopedData->originatorInfo->certificates;
  486|       |
  487|    551|    default:
  ------------------
  |  Branch (487:5): [True: 551, False: 535]
  ------------------
  488|    551|        ERR_raise(ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_TYPE);
  ------------------
  |  |  401|    551|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    551|    (ERR_new(),                                                 \
  |  |  |  |  404|    551|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    551|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    551|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    551|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    551|     ERR_set_error)
  |  |  ------------------
  ------------------
  489|    551|        return NULL;
  490|       |
  491|  1.08k|    }
  492|  1.08k|}

ossl_cms_SignerInfos_set_cmsctx:
  539|  1.08k|{
  540|  1.08k|    int i;
  541|  1.08k|    CMS_SignerInfo *si;
  542|  1.08k|    STACK_OF(CMS_SignerInfo) *sinfos;
  ------------------
  |  |   31|  1.08k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  543|  1.08k|    const CMS_CTX *ctx = ossl_cms_get0_cmsctx(cms);
  544|       |
  545|  1.08k|    ERR_set_mark();
  546|  1.08k|    sinfos = CMS_get0_SignerInfos(cms);
  547|  1.08k|    ERR_pop_to_mark(); /* removes error in case sinfos == NULL */
  548|       |
  549|  2.34k|    for (i = 0; i < sk_CMS_SignerInfo_num(sinfos); i++) {
  ------------------
  |  |   47|  2.34k|#define sk_CMS_SignerInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_SignerInfo_sk_type(sk))
  ------------------
  |  Branch (549:17): [True: 1.26k, False: 1.08k]
  ------------------
  550|  1.26k|        si = sk_CMS_SignerInfo_value(sinfos, i);
  ------------------
  |  |   48|  1.26k|#define sk_CMS_SignerInfo_value(sk, idx) ((CMS_SignerInfo *)OPENSSL_sk_value(ossl_check_const_CMS_SignerInfo_sk_type(sk), (idx)))
  ------------------
  551|  1.26k|        if (si != NULL)
  ------------------
  |  Branch (551:13): [True: 1.26k, False: 0]
  ------------------
  552|  1.26k|            si->cms_ctx = ctx;
  553|  1.26k|    }
  554|  1.08k|}
CMS_get0_SignerInfos:
  597|  1.08k|{
  598|  1.08k|    CMS_SignedData *sd = cms_get0_signed(cms);
  599|       |
  600|  1.08k|    return sd != NULL ? sd->signerInfos : NULL;
  ------------------
  |  Branch (600:12): [True: 233, False: 853]
  ------------------
  601|  1.08k|}
cms_sd.c:cms_get0_signed:
   28|  1.08k|{
   29|  1.08k|    if (OBJ_obj2nid(cms->contentType) != NID_pkcs7_signed) {
  ------------------
  |  |  679|  1.08k|#define NID_pkcs7_signed                22
  ------------------
  |  Branch (29:9): [True: 853, False: 233]
  ------------------
   30|    853|        ERR_raise(ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA);
  ------------------
  |  |  401|    853|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    853|    (ERR_new(),                                                 \
  |  |  |  |  404|    853|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    853|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    853|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    853|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    853|     ERR_set_error)
  |  |  ------------------
  ------------------
   31|    853|        return NULL;
   32|    853|    }
   33|    233|    return cms->d.signedData;
   34|  1.08k|}

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

COMP_zlib:
  311|      2|{
  312|      2|    COMP_METHOD *meth = NULL;
  313|       |
  314|       |#ifndef OPENSSL_NO_ZLIB
  315|       |    if (RUN_ONCE(&zlib_once, ossl_comp_zlib_init))
  316|       |        meth = &zlib_stateful_method;
  317|       |#endif
  318|       |
  319|      2|    return meth;
  320|      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|}

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

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

_CONF_free_data:
  137|      1|{
  138|      1|    if (conf == NULL)
  ------------------
  |  Branch (138:9): [True: 0, False: 1]
  ------------------
  139|      0|        return;
  140|       |
  141|      1|    OPENSSL_free(conf->includedir);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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));
  ------------------
  |  |  102|      1|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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:
   68|      2|{
   69|      2|#ifndef OPENSSL_NO_ERR
   70|      2|    if (ERR_reason_error_string(CONF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (70:9): [True: 2, False: 0]
  ------------------
   71|      2|        ERR_load_strings_const(CONF_str_reasons);
   72|      2|#endif
   73|      2|    return 1;
   74|      2|}

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

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

ossl_lib_ctx_write_lock:
   60|     16|{
   61|     16|    return CRYPTO_THREAD_write_lock(ossl_lib_ctx_get_concrete(ctx)->lock);
   62|     16|}
ossl_lib_ctx_read_lock:
   65|    220|{
   66|    220|    return CRYPTO_THREAD_read_lock(ossl_lib_ctx_get_concrete(ctx)->lock);
   67|    220|}
ossl_lib_ctx_unlock:
   70|    236|{
   71|    236|    return CRYPTO_THREAD_unlock(ossl_lib_ctx_get_concrete(ctx)->lock);
   72|    236|}
ossl_lib_ctx_default_deinit:
  417|      2|{
  418|      2|    if (!default_context_inited)
  ------------------
  |  Branch (418:9): [True: 0, False: 2]
  ------------------
  419|      0|        return;
  420|      2|    context_deinit(&default_context_int);
  421|      2|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  422|      2|    default_context_inited = 0;
  423|      2|}
OSSL_LIB_CTX_get0_global_default:
  517|      1|{
  518|      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 (518:9): [True: 0, False: 1]
  ------------------
  519|      0|        return NULL;
  520|       |
  521|      1|    return &default_context_int;
  522|      1|}
ossl_release_default_drbg_ctx:
  538|      1|{
  539|       |    /* early release of the DRBG in global default libctx */
  540|      1|    if (default_context_int.drbg != NULL) {
  ------------------
  |  Branch (540:9): [True: 1, False: 0]
  ------------------
  541|      1|        ossl_rand_ctx_free(default_context_int.drbg);
  542|      1|        default_context_int.drbg = NULL;
  543|      1|    }
  544|      1|}
ossl_lib_ctx_get_concrete:
  548|   966k|{
  549|   966k|#ifndef FIPS_MODULE
  550|   966k|    if (ctx == NULL)
  ------------------
  |  Branch (550:9): [True: 780k, False: 185k]
  ------------------
  551|   780k|        return get_default_context();
  552|   185k|#endif
  553|   185k|    return ctx;
  554|   966k|}
ossl_lib_ctx_is_default:
  557|  1.48k|{
  558|  1.48k|#ifndef FIPS_MODULE
  559|  1.48k|    if (ctx == NULL || ctx == get_default_context())
  ------------------
  |  Branch (559:9): [True: 1.47k, False: 7]
  |  Branch (559:24): [True: 7, False: 0]
  ------------------
  560|  1.48k|        return 1;
  561|      0|#endif
  562|      0|    return 0;
  563|  1.48k|}
ossl_lib_ctx_get_data:
  575|   313k|{
  576|   313k|    void *p;
  577|       |
  578|   313k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  579|   313k|    if (ctx == NULL)
  ------------------
  |  Branch (579:9): [True: 0, False: 313k]
  ------------------
  580|      0|        return NULL;
  581|       |
  582|   313k|    switch (index) {
  583|    734|    case OSSL_LIB_CTX_PROPERTY_STRING_INDEX:
  ------------------
  |  |   99|    734|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  |  Branch (583:5): [True: 734, False: 312k]
  ------------------
  584|    734|        return ctx->property_string_data;
  585|  22.4k|    case OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX:
  ------------------
  |  |   96|  22.4k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
  |  Branch (585:5): [True: 22.4k, False: 290k]
  ------------------
  586|  22.4k|        return ctx->evp_method_store;
  587|  1.48k|    case OSSL_LIB_CTX_PROVIDER_STORE_INDEX:
  ------------------
  |  |   97|  1.48k|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  |  Branch (587:5): [True: 1.48k, False: 311k]
  ------------------
  588|  1.48k|        return ctx->provider_store;
  589|   224k|    case OSSL_LIB_CTX_NAMEMAP_INDEX:
  ------------------
  |  |  100|   224k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  |  Branch (589:5): [True: 224k, False: 88.5k]
  ------------------
  590|   224k|        return ctx->namemap;
  591|    236|    case OSSL_LIB_CTX_PROPERTY_DEFN_INDEX:
  ------------------
  |  |   98|    236|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
  |  Branch (591:5): [True: 236, False: 312k]
  ------------------
  592|    236|        return ctx->property_defns;
  593|      5|    case OSSL_LIB_CTX_GLOBAL_PROPERTIES:
  ------------------
  |  |  112|      5|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  |  Branch (593:5): [True: 5, False: 313k]
  ------------------
  594|      5|        return ctx->global_properties;
  595|  20.5k|    case OSSL_LIB_CTX_DRBG_INDEX:
  ------------------
  |  |  101|  20.5k|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  |  Branch (595:5): [True: 20.5k, False: 292k]
  ------------------
  596|  20.5k|        return ctx->drbg;
  597|      0|    case OSSL_LIB_CTX_DRBG_NONCE_INDEX:
  ------------------
  |  |  102|      0|# define OSSL_LIB_CTX_DRBG_NONCE_INDEX               6
  ------------------
  |  Branch (597:5): [True: 0, False: 313k]
  ------------------
  598|      0|        return ctx->drbg_nonce;
  599|      0|#ifndef FIPS_MODULE
  600|      0|    case OSSL_LIB_CTX_PROVIDER_CONF_INDEX:
  ------------------
  |  |  114|      0|# define OSSL_LIB_CTX_PROVIDER_CONF_INDEX           16
  ------------------
  |  Branch (600:5): [True: 0, False: 313k]
  ------------------
  601|      0|        return ctx->provider_conf;
  602|      0|    case OSSL_LIB_CTX_BIO_CORE_INDEX:
  ------------------
  |  |  115|      0|# define OSSL_LIB_CTX_BIO_CORE_INDEX                17
  ------------------
  |  Branch (602:5): [True: 0, False: 313k]
  ------------------
  603|      0|        return ctx->bio_core;
  604|      0|    case OSSL_LIB_CTX_CHILD_PROVIDER_INDEX:
  ------------------
  |  |  116|      0|# define OSSL_LIB_CTX_CHILD_PROVIDER_INDEX          18
  ------------------
  |  Branch (604:5): [True: 0, False: 313k]
  ------------------
  605|      0|        return ctx->child_provider;
  606|  3.01k|    case OSSL_LIB_CTX_DECODER_STORE_INDEX:
  ------------------
  |  |  109|  3.01k|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  |  Branch (606:5): [True: 3.01k, False: 309k]
  ------------------
  607|  3.01k|        return ctx->decoder_store;
  608|  40.0k|    case OSSL_LIB_CTX_DECODER_CACHE_INDEX:
  ------------------
  |  |  118|  40.0k|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  |  Branch (608:5): [True: 40.0k, False: 272k]
  ------------------
  609|  40.0k|        return ctx->decoder_cache;
  610|      0|    case OSSL_LIB_CTX_ENCODER_STORE_INDEX:
  ------------------
  |  |  108|      0|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  |  Branch (610:5): [True: 0, False: 313k]
  ------------------
  611|      0|        return ctx->encoder_store;
  612|      0|    case OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX:
  ------------------
  |  |  113|      0|# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX      15
  ------------------
  |  Branch (612:5): [True: 0, False: 313k]
  ------------------
  613|      0|        return ctx->store_loader_store;
  614|      0|    case OSSL_LIB_CTX_SELF_TEST_CB_INDEX:
  ------------------
  |  |  110|      0|# define OSSL_LIB_CTX_SELF_TEST_CB_INDEX            12
  ------------------
  |  Branch (614:5): [True: 0, False: 313k]
  ------------------
  615|      0|        return ctx->self_test_cb;
  616|      0|    case OSSL_LIB_CTX_INDICATOR_CB_INDEX:
  ------------------
  |  |  120|      0|# define OSSL_LIB_CTX_INDICATOR_CB_INDEX            22
  ------------------
  |  Branch (616:5): [True: 0, False: 313k]
  ------------------
  617|      0|        return ctx->indicator_cb;
  618|      0|#endif
  619|      0|#ifndef OPENSSL_NO_THREAD_POOL
  620|      0|    case OSSL_LIB_CTX_THREAD_INDEX:
  ------------------
  |  |  117|      0|# define OSSL_LIB_CTX_THREAD_INDEX                  19
  ------------------
  |  Branch (620:5): [True: 0, False: 313k]
  ------------------
  621|      0|        return ctx->threads;
  622|      0|#endif
  623|       |
  624|      0|    case OSSL_LIB_CTX_RAND_CRNGT_INDEX: {
  ------------------
  |  |  103|      0|# define OSSL_LIB_CTX_RAND_CRNGT_INDEX               7
  ------------------
  |  Branch (624:5): [True: 0, False: 313k]
  ------------------
  625|       |
  626|       |        /*
  627|       |         * rand_crngt must be lazily initialized because it calls into
  628|       |         * libctx, so must not be called from context_init, else a deadlock
  629|       |         * will occur.
  630|       |         *
  631|       |         * We use a separate lock because code called by the instantiation
  632|       |         * of rand_crngt is liable to try and take the libctx lock.
  633|       |         */
  634|      0|        if (CRYPTO_THREAD_read_lock(ctx->rand_crngt_lock) != 1)
  ------------------
  |  Branch (634:13): [True: 0, False: 0]
  ------------------
  635|      0|            return NULL;
  636|       |
  637|      0|        if (ctx->rand_crngt == NULL) {
  ------------------
  |  Branch (637:13): [True: 0, False: 0]
  ------------------
  638|      0|            CRYPTO_THREAD_unlock(ctx->rand_crngt_lock);
  639|       |
  640|      0|            if (CRYPTO_THREAD_write_lock(ctx->rand_crngt_lock) != 1)
  ------------------
  |  Branch (640:17): [True: 0, False: 0]
  ------------------
  641|      0|                return NULL;
  642|       |
  643|      0|            if (ctx->rand_crngt == NULL)
  ------------------
  |  Branch (643:17): [True: 0, False: 0]
  ------------------
  644|      0|                ctx->rand_crngt = ossl_rand_crng_ctx_new(ctx);
  645|      0|        }
  646|       |
  647|      0|        p = ctx->rand_crngt;
  648|       |
  649|      0|        CRYPTO_THREAD_unlock(ctx->rand_crngt_lock);
  650|       |
  651|      0|        return p;
  652|      0|    }
  653|       |
  654|       |#ifdef FIPS_MODULE
  655|       |    case OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX:
  656|       |        return ctx->thread_event_handler;
  657|       |
  658|       |    case OSSL_LIB_CTX_FIPS_PROV_INDEX:
  659|       |        return ctx->fips_prov;
  660|       |#endif
  661|       |
  662|      0|    case OSSL_LIB_CTX_COMP_METHODS:
  ------------------
  |  |  119|      0|# define OSSL_LIB_CTX_COMP_METHODS                  21
  ------------------
  |  Branch (662:5): [True: 0, False: 313k]
  ------------------
  663|      0|        return (void *)&ctx->comp_methods;
  664|       |
  665|      0|    default:
  ------------------
  |  Branch (665:5): [True: 0, False: 313k]
  ------------------
  666|      0|        return NULL;
  667|   313k|    }
  668|   313k|}
ossl_lib_ctx_get_ex_data_global:
  676|   652k|{
  677|   652k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  678|   652k|    if (ctx == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 652k]
  ------------------
  679|      0|        return NULL;
  680|   652k|    return &ctx->global;
  681|   652k|}
OSSL_LIB_CTX_get_conf_diagnostics:
  705|      1|{
  706|      1|    libctx = ossl_lib_ctx_get_concrete(libctx);
  707|      1|    if (libctx == NULL)
  ------------------
  |  Branch (707:9): [True: 0, False: 1]
  ------------------
  708|      0|        return 0;
  709|      1|    return libctx->conf_diagnostics;
  710|      1|}
context.c:context_deinit:
  373|      2|{
  374|      2|    if (ctx == NULL)
  ------------------
  |  Branch (374:9): [True: 0, False: 2]
  ------------------
  375|      0|        return 1;
  376|       |
  377|      2|    ossl_ctx_thread_stop(ctx);
  378|       |
  379|      2|    context_deinit_objs(ctx);
  380|       |
  381|      2|    ossl_crypto_cleanup_all_ex_data_int(ctx);
  382|       |
  383|      2|    CRYPTO_THREAD_lock_free(ctx->rand_crngt_lock);
  384|      2|    CRYPTO_THREAD_lock_free(ctx->lock);
  385|      2|    ctx->rand_crngt_lock = NULL;
  386|      2|    ctx->lock = NULL;
  387|      2|    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
  388|      2|    return 1;
  389|      2|}
context.c:context_deinit_objs:
  233|      2|{
  234|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  235|      2|    if (ctx->evp_method_store != NULL) {
  ------------------
  |  Branch (235:9): [True: 2, False: 0]
  ------------------
  236|      2|        ossl_method_store_free(ctx->evp_method_store);
  237|      2|        ctx->evp_method_store = NULL;
  238|      2|    }
  239|       |
  240|       |    /* P2. */
  241|      2|    if (ctx->drbg != NULL) {
  ------------------
  |  Branch (241:9): [True: 1, False: 1]
  ------------------
  242|      1|        ossl_rand_ctx_free(ctx->drbg);
  243|      1|        ctx->drbg = NULL;
  244|      1|    }
  245|       |
  246|      2|#ifndef FIPS_MODULE
  247|       |    /* P2. */
  248|      2|    if (ctx->provider_conf != NULL) {
  ------------------
  |  Branch (248:9): [True: 2, False: 0]
  ------------------
  249|      2|        ossl_prov_conf_ctx_free(ctx->provider_conf);
  250|      2|        ctx->provider_conf = NULL;
  251|      2|    }
  252|       |
  253|       |    /*
  254|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  255|       |     * provider store
  256|       |     */
  257|      2|    if (ctx->decoder_store != NULL) {
  ------------------
  |  Branch (257:9): [True: 2, False: 0]
  ------------------
  258|      2|        ossl_method_store_free(ctx->decoder_store);
  259|      2|        ctx->decoder_store = NULL;
  260|      2|    }
  261|      2|    if (ctx->decoder_cache != NULL) {
  ------------------
  |  Branch (261:9): [True: 2, False: 0]
  ------------------
  262|      2|        ossl_decoder_cache_free(ctx->decoder_cache);
  263|      2|        ctx->decoder_cache = NULL;
  264|      2|    }
  265|       |
  266|       |
  267|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  268|      2|    if (ctx->encoder_store != NULL) {
  ------------------
  |  Branch (268:9): [True: 2, False: 0]
  ------------------
  269|      2|        ossl_method_store_free(ctx->encoder_store);
  270|      2|        ctx->encoder_store = NULL;
  271|      2|    }
  272|       |
  273|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  274|      2|    if (ctx->store_loader_store != NULL) {
  ------------------
  |  Branch (274:9): [True: 2, False: 0]
  ------------------
  275|      2|        ossl_method_store_free(ctx->store_loader_store);
  276|      2|        ctx->store_loader_store = NULL;
  277|      2|    }
  278|      2|#endif
  279|       |
  280|       |    /* P1. Needs to be freed before the child provider data is freed */
  281|      2|    if (ctx->provider_store != NULL) {
  ------------------
  |  Branch (281:9): [True: 2, False: 0]
  ------------------
  282|      2|        ossl_provider_store_free(ctx->provider_store);
  283|      2|        ctx->provider_store = NULL;
  284|      2|    }
  285|       |
  286|       |    /* Default priority. */
  287|      2|    if (ctx->property_string_data != NULL) {
  ------------------
  |  Branch (287:9): [True: 2, False: 0]
  ------------------
  288|      2|        ossl_property_string_data_free(ctx->property_string_data);
  289|      2|        ctx->property_string_data = NULL;
  290|      2|    }
  291|       |
  292|      2|    if (ctx->namemap != NULL) {
  ------------------
  |  Branch (292:9): [True: 2, False: 0]
  ------------------
  293|      2|        ossl_stored_namemap_free(ctx->namemap);
  294|      2|        ctx->namemap = NULL;
  295|      2|    }
  296|       |
  297|      2|    if (ctx->property_defns != NULL) {
  ------------------
  |  Branch (297:9): [True: 2, False: 0]
  ------------------
  298|      2|        ossl_property_defns_free(ctx->property_defns);
  299|      2|        ctx->property_defns = NULL;
  300|      2|    }
  301|       |
  302|      2|    if (ctx->global_properties != NULL) {
  ------------------
  |  Branch (302:9): [True: 2, False: 0]
  ------------------
  303|      2|        ossl_ctx_global_properties_free(ctx->global_properties);
  304|      2|        ctx->global_properties = NULL;
  305|      2|    }
  306|       |
  307|      2|#ifndef FIPS_MODULE
  308|      2|    if (ctx->bio_core != NULL) {
  ------------------
  |  Branch (308:9): [True: 2, False: 0]
  ------------------
  309|      2|        ossl_bio_core_globals_free(ctx->bio_core);
  310|      2|        ctx->bio_core = NULL;
  311|      2|    }
  312|      2|#endif
  313|       |
  314|      2|    if (ctx->drbg_nonce != NULL) {
  ------------------
  |  Branch (314:9): [True: 2, False: 0]
  ------------------
  315|      2|        ossl_prov_drbg_nonce_ctx_free(ctx->drbg_nonce);
  316|      2|        ctx->drbg_nonce = NULL;
  317|      2|    }
  318|       |
  319|      2|#ifndef FIPS_MODULE
  320|      2|    if (ctx->indicator_cb != NULL) {
  ------------------
  |  Branch (320:9): [True: 2, False: 0]
  ------------------
  321|      2|        ossl_indicator_set_callback_free(ctx->indicator_cb);
  322|      2|        ctx->indicator_cb = NULL;
  323|      2|    }
  324|       |
  325|      2|    if (ctx->self_test_cb != NULL) {
  ------------------
  |  Branch (325:9): [True: 2, False: 0]
  ------------------
  326|      2|        ossl_self_test_set_callback_free(ctx->self_test_cb);
  327|      2|        ctx->self_test_cb = NULL;
  328|      2|    }
  329|      2|#endif
  330|       |
  331|      2|    if (ctx->rand_crngt != NULL) {
  ------------------
  |  Branch (331:9): [True: 0, False: 2]
  ------------------
  332|      0|        ossl_rand_crng_ctx_free(ctx->rand_crngt);
  333|      0|        ctx->rand_crngt = NULL;
  334|      0|    }
  335|       |
  336|       |#ifdef FIPS_MODULE
  337|       |    if (ctx->thread_event_handler != NULL) {
  338|       |        ossl_thread_event_ctx_free(ctx->thread_event_handler);
  339|       |        ctx->thread_event_handler = NULL;
  340|       |    }
  341|       |
  342|       |    if (ctx->fips_prov != NULL) {
  343|       |        ossl_fips_prov_ossl_ctx_free(ctx->fips_prov);
  344|       |        ctx->fips_prov = NULL;
  345|       |    }
  346|       |#endif
  347|       |
  348|      2|#ifndef OPENSSL_NO_THREAD_POOL
  349|      2|    if (ctx->threads != NULL) {
  ------------------
  |  Branch (349:9): [True: 2, False: 0]
  ------------------
  350|      2|        ossl_threads_ctx_free(ctx->threads);
  351|      2|        ctx->threads = NULL;
  352|      2|    }
  353|      2|#endif
  354|       |
  355|       |    /* Low priority. */
  356|      2|#ifndef FIPS_MODULE
  357|      2|    if (ctx->child_provider != NULL) {
  ------------------
  |  Branch (357:9): [True: 2, False: 0]
  ------------------
  358|      2|        ossl_child_prov_ctx_free(ctx->child_provider);
  359|      2|        ctx->child_provider = NULL;
  360|      2|    }
  361|      2|#endif
  362|       |
  363|      2|#ifndef FIPS_MODULE
  364|      2|    if (ctx->comp_methods != NULL) {
  ------------------
  |  Branch (364:9): [True: 2, False: 0]
  ------------------
  365|      2|        ossl_free_compression_methods_int(ctx->comp_methods);
  366|      2|        ctx->comp_methods = NULL;
  367|      2|    }
  368|      2|#endif
  369|       |
  370|      2|}
context.c:context_init:
   86|      2|{
   87|      2|    int exdata_done = 0;
   88|       |
   89|      2|    if (!CRYPTO_THREAD_init_local(&ctx->rcu_local_key, NULL))
  ------------------
  |  Branch (89:9): [True: 0, False: 2]
  ------------------
   90|      0|        return 0;
   91|       |
   92|      2|    ctx->lock = CRYPTO_THREAD_lock_new();
   93|      2|    if (ctx->lock == NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 2]
  ------------------
   94|      0|        goto err;
   95|       |
   96|      2|    ctx->rand_crngt_lock = CRYPTO_THREAD_lock_new();
   97|      2|    if (ctx->rand_crngt_lock == NULL)
  ------------------
  |  Branch (97:9): [True: 0, False: 2]
  ------------------
   98|      0|        goto err;
   99|       |
  100|       |    /* Initialize ex_data. */
  101|      2|    if (!ossl_do_ex_data_init(ctx))
  ------------------
  |  Branch (101:9): [True: 0, False: 2]
  ------------------
  102|      0|        goto err;
  103|      2|    exdata_done = 1;
  104|       |
  105|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  106|      2|    ctx->evp_method_store = ossl_method_store_new(ctx);
  107|      2|    if (ctx->evp_method_store == NULL)
  ------------------
  |  Branch (107:9): [True: 0, False: 2]
  ------------------
  108|      0|        goto err;
  109|       |
  110|      2|#ifndef FIPS_MODULE
  111|       |    /* P2. Must be freed before the provider store is freed */
  112|      2|    ctx->provider_conf = ossl_prov_conf_ctx_new(ctx);
  113|      2|    if (ctx->provider_conf == NULL)
  ------------------
  |  Branch (113:9): [True: 0, False: 2]
  ------------------
  114|      0|        goto err;
  115|      2|#endif
  116|       |
  117|       |    /* P2. */
  118|      2|    ctx->drbg = ossl_rand_ctx_new(ctx);
  119|      2|    if (ctx->drbg == NULL)
  ------------------
  |  Branch (119:9): [True: 0, False: 2]
  ------------------
  120|      0|        goto err;
  121|       |
  122|      2|#ifndef FIPS_MODULE
  123|       |    /*
  124|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  125|       |     * provider store
  126|       |     */
  127|      2|    ctx->decoder_store = ossl_method_store_new(ctx);
  128|      2|    if (ctx->decoder_store == NULL)
  ------------------
  |  Branch (128:9): [True: 0, False: 2]
  ------------------
  129|      0|        goto err;
  130|      2|    ctx->decoder_cache = ossl_decoder_cache_new(ctx);
  131|      2|    if (ctx->decoder_cache == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 2]
  ------------------
  132|      0|        goto err;
  133|       |
  134|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  135|      2|    ctx->encoder_store = ossl_method_store_new(ctx);
  136|      2|    if (ctx->encoder_store == NULL)
  ------------------
  |  Branch (136:9): [True: 0, False: 2]
  ------------------
  137|      0|        goto err;
  138|       |
  139|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  140|      2|    ctx->store_loader_store = ossl_method_store_new(ctx);
  141|      2|    if (ctx->store_loader_store == NULL)
  ------------------
  |  Branch (141:9): [True: 0, False: 2]
  ------------------
  142|      0|        goto err;
  143|      2|#endif
  144|       |
  145|       |    /* P1. Needs to be freed before the child provider data is freed */
  146|      2|    ctx->provider_store = ossl_provider_store_new(ctx);
  147|      2|    if (ctx->provider_store == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|        goto err;
  149|       |
  150|       |    /* Default priority. */
  151|      2|    ctx->property_string_data = ossl_property_string_data_new(ctx);
  152|      2|    if (ctx->property_string_data == NULL)
  ------------------
  |  Branch (152:9): [True: 0, False: 2]
  ------------------
  153|      0|        goto err;
  154|       |
  155|      2|    ctx->namemap = ossl_stored_namemap_new(ctx);
  156|      2|    if (ctx->namemap == NULL)
  ------------------
  |  Branch (156:9): [True: 0, False: 2]
  ------------------
  157|      0|        goto err;
  158|       |
  159|      2|    ctx->property_defns = ossl_property_defns_new(ctx);
  160|      2|    if (ctx->property_defns == NULL)
  ------------------
  |  Branch (160:9): [True: 0, False: 2]
  ------------------
  161|      0|        goto err;
  162|       |
  163|      2|    ctx->global_properties = ossl_ctx_global_properties_new(ctx);
  164|      2|    if (ctx->global_properties == NULL)
  ------------------
  |  Branch (164:9): [True: 0, False: 2]
  ------------------
  165|      0|        goto err;
  166|       |
  167|      2|#ifndef FIPS_MODULE
  168|      2|    ctx->bio_core = ossl_bio_core_globals_new(ctx);
  169|      2|    if (ctx->bio_core == NULL)
  ------------------
  |  Branch (169:9): [True: 0, False: 2]
  ------------------
  170|      0|        goto err;
  171|      2|#endif
  172|       |
  173|      2|    ctx->drbg_nonce = ossl_prov_drbg_nonce_ctx_new(ctx);
  174|      2|    if (ctx->drbg_nonce == NULL)
  ------------------
  |  Branch (174:9): [True: 0, False: 2]
  ------------------
  175|      0|        goto err;
  176|       |
  177|      2|#ifndef FIPS_MODULE
  178|      2|    ctx->self_test_cb = ossl_self_test_set_callback_new(ctx);
  179|      2|    if (ctx->self_test_cb == NULL)
  ------------------
  |  Branch (179:9): [True: 0, False: 2]
  ------------------
  180|      0|        goto err;
  181|      2|    ctx->indicator_cb = ossl_indicator_set_callback_new(ctx);
  182|      2|    if (ctx->indicator_cb == NULL)
  ------------------
  |  Branch (182:9): [True: 0, False: 2]
  ------------------
  183|      0|        goto err;
  184|      2|#endif
  185|       |
  186|       |#ifdef FIPS_MODULE
  187|       |    ctx->thread_event_handler = ossl_thread_event_ctx_new(ctx);
  188|       |    if (ctx->thread_event_handler == NULL)
  189|       |        goto err;
  190|       |
  191|       |    ctx->fips_prov = ossl_fips_prov_ossl_ctx_new(ctx);
  192|       |    if (ctx->fips_prov == NULL)
  193|       |        goto err;
  194|       |#endif
  195|       |
  196|      2|#ifndef OPENSSL_NO_THREAD_POOL
  197|      2|    ctx->threads = ossl_threads_ctx_new(ctx);
  198|      2|    if (ctx->threads == NULL)
  ------------------
  |  Branch (198:9): [True: 0, False: 2]
  ------------------
  199|      0|        goto err;
  200|      2|#endif
  201|       |
  202|       |    /* Low priority. */
  203|      2|#ifndef FIPS_MODULE
  204|      2|    ctx->child_provider = ossl_child_prov_ctx_new(ctx);
  205|      2|    if (ctx->child_provider == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 2]
  ------------------
  206|      0|        goto err;
  207|      2|#endif
  208|       |
  209|       |    /* Everything depends on properties, so we also pre-initialise that */
  210|      2|    if (!ossl_property_parse_init(ctx))
  ------------------
  |  Branch (210:9): [True: 0, False: 2]
  ------------------
  211|      0|        goto err;
  212|       |
  213|      2|#ifndef FIPS_MODULE
  214|      2|    ctx->comp_methods = ossl_load_builtin_compressions();
  215|      2|#endif
  216|       |
  217|      2|    return 1;
  218|       |
  219|      0| err:
  220|      0|    context_deinit_objs(ctx);
  221|       |
  222|      0|    if (exdata_done)
  ------------------
  |  Branch (222:9): [True: 0, False: 0]
  ------------------
  223|      0|        ossl_crypto_cleanup_all_ex_data_int(ctx);
  224|       |
  225|      0|    CRYPTO_THREAD_lock_free(ctx->rand_crngt_lock);
  226|      0|    CRYPTO_THREAD_lock_free(ctx->lock);
  227|      0|    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
  228|      0|    memset(ctx, '\0', sizeof(*ctx));
  229|      0|    return 0;
  230|      2|}
context.c:default_context_do_init:
  400|      2|{
  401|      2|    if (!CRYPTO_THREAD_init_local(&default_context_thread_local, NULL))
  ------------------
  |  Branch (401:9): [True: 0, False: 2]
  ------------------
  402|      0|        goto err;
  403|       |
  404|      2|    if (!context_init(&default_context_int))
  ------------------
  |  Branch (404:9): [True: 0, False: 2]
  ------------------
  405|      0|        goto deinit_thread;
  406|       |
  407|      2|    default_context_inited = 1;
  408|      2|    return 1;
  409|       |
  410|      0|deinit_thread:
  411|      0|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  412|      0|err:
  413|      0|    return 0;
  414|      0|}
context.c:get_default_context:
  434|   780k|{
  435|   780k|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  436|       |
  437|   780k|    if (current_defctx == NULL)
  ------------------
  |  Branch (437:9): [True: 780k, False: 0]
  ------------------
  438|   780k|        current_defctx = &default_context_int;
  439|   780k|    return current_defctx;
  440|   780k|}
context.c:get_thread_default_context:
  426|   780k|{
  427|   780k|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|   780k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 780k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (427:9): [True: 0, False: 780k]
  ------------------
  428|      0|        return NULL;
  429|       |
  430|   780k|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  431|   780k|}

ossl_algorithm_do_all:
  149|  1.47k|{
  150|  1.47k|    struct algorithm_data_st cbdata = { 0, };
  151|       |
  152|  1.47k|    cbdata.libctx = libctx;
  153|  1.47k|    cbdata.operation_id = operation_id;
  154|  1.47k|    cbdata.pre = pre;
  155|  1.47k|    cbdata.reserve_store = reserve_store;
  156|  1.47k|    cbdata.fn = fn;
  157|  1.47k|    cbdata.unreserve_store = unreserve_store;
  158|  1.47k|    cbdata.post = post;
  159|  1.47k|    cbdata.data = data;
  160|       |
  161|  1.47k|    if (provider == NULL) {
  ------------------
  |  Branch (161:9): [True: 1.47k, False: 0]
  ------------------
  162|  1.47k|        ossl_provider_doall_activated(libctx, algorithm_do_this, &cbdata);
  163|  1.47k|    } 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.47k|}
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);
  ------------------
  |  |  121|    220|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    220|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    220|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  196|    220|    return ret;
  197|    220|}
core_algorithm.c:algorithm_do_this:
  103|  1.47k|{
  104|  1.47k|    struct algorithm_data_st *data = cbdata;
  105|  1.47k|    int first_operation = 1;
  106|  1.47k|    int last_operation = OSSL_OP__HIGHEST;
  ------------------
  |  |  290|  1.47k|# define OSSL_OP__HIGHEST                           22
  ------------------
  107|  1.47k|    int cur_operation;
  108|  1.47k|    int ok = 1;
  109|       |
  110|  1.47k|    if (data->operation_id != 0)
  ------------------
  |  Branch (110:9): [True: 1.47k, False: 0]
  ------------------
  111|  1.47k|        first_operation = last_operation = data->operation_id;
  112|       |
  113|  1.47k|    for (cur_operation = first_operation;
  114|  2.95k|         cur_operation <= last_operation;
  ------------------
  |  Branch (114:10): [True: 1.47k, False: 1.47k]
  ------------------
  115|  1.47k|         cur_operation++) {
  116|  1.47k|        int no_store = 0;        /* Assume caching is ok */
  117|  1.47k|        const OSSL_ALGORITHM *map = NULL;
  118|  1.47k|        int ret = 0;
  119|       |
  120|  1.47k|        map = ossl_provider_query_operation(provider, cur_operation,
  121|  1.47k|                                            &no_store);
  122|  1.47k|        ret = algorithm_do_map(provider, map, cur_operation, no_store, data);
  123|  1.47k|        ossl_provider_unquery_operation(provider, cur_operation, map);
  124|       |
  125|  1.47k|        if (ret < 0)
  ------------------
  |  Branch (125:13): [True: 0, False: 1.47k]
  ------------------
  126|       |            /* Hard error, bail out immediately! */
  127|      0|            return 0;
  128|       |
  129|       |        /* If post-condition not fulfilled, set general failure */
  130|  1.47k|        if (!ret)
  ------------------
  |  Branch (130:13): [True: 0, False: 1.47k]
  ------------------
  131|      0|            ok = 0;
  132|  1.47k|    }
  133|       |
  134|  1.47k|    return ok;
  135|  1.47k|}
core_algorithm.c:algorithm_do_map:
   44|  1.47k|{
   45|  1.47k|    struct algorithm_data_st *data = cbdata;
   46|  1.47k|    int ret = 0;
   47|       |
   48|  1.47k|    if (!data->reserve_store(no_store, data->data))
  ------------------
  |  Branch (48:9): [True: 0, False: 1.47k]
  ------------------
   49|       |        /* Error, bail out! */
   50|      0|        return -1;
   51|       |
   52|       |    /* Do we fulfill pre-conditions? */
   53|  1.47k|    if (data->pre == NULL) {
  ------------------
  |  Branch (53:9): [True: 0, False: 1.47k]
  ------------------
   54|       |        /* If there is no pre-condition function, assume "yes" */
   55|      0|        ret = 1;
   56|  1.47k|    } else if (!data->pre(provider, cur_operation, no_store, data->data,
  ------------------
  |  Branch (56:16): [True: 0, False: 1.47k]
  ------------------
   57|  1.47k|                          &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.47k|    if (ret == 0) {
  ------------------
  |  Branch (68:9): [True: 1.47k, False: 5]
  ------------------
   69|  1.47k|        ret = 1;
   70|  1.47k|        goto end;
   71|  1.47k|    }
   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.47k| end:
   91|  1.47k|    data->unreserve_store(data->data);
   92|       |
   93|  1.47k|    return ret;
   94|      5|}

ossl_method_construct:
  133|  1.47k|{
  134|  1.47k|    void *method = NULL;
  135|  1.47k|    OSSL_PROVIDER *provider = provider_rw != NULL ? *provider_rw : NULL;
  ------------------
  |  Branch (135:31): [True: 1.47k, False: 0]
  ------------------
  136|  1.47k|    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.47k|    cbdata.store = NULL;
  150|  1.47k|    cbdata.force_store = force_store;
  151|  1.47k|    cbdata.mcm = mcm;
  152|  1.47k|    cbdata.mcm_data = mcm_data;
  153|  1.47k|    ossl_algorithm_do_all(libctx, operation_id, provider,
  154|  1.47k|                          ossl_method_construct_precondition,
  155|  1.47k|                          ossl_method_construct_reserve_store,
  156|  1.47k|                          ossl_method_construct_this,
  157|  1.47k|                          ossl_method_construct_unreserve_store,
  158|  1.47k|                          ossl_method_construct_postcondition,
  159|  1.47k|                          &cbdata);
  160|       |
  161|       |    /* If there is a temporary store, try there first */
  162|  1.47k|    if (cbdata.store != NULL)
  ------------------
  |  Branch (162:9): [True: 0, False: 1.47k]
  ------------------
  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.47k|    if (method == NULL)
  ------------------
  |  Branch (167:9): [True: 1.47k, False: 0]
  ------------------
  168|  1.47k|        method = mcm->get(NULL, (const OSSL_PROVIDER **)provider_rw, mcm_data);
  169|       |
  170|  1.47k|    return method;
  171|  1.47k|}
core_fetch.c:ossl_method_construct_precondition:
   62|  1.47k|{
   63|  1.47k|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|  1.47k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  1.47k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (63:9): [True: 0, False: 1.47k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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.47k|    *result = 0;
   70|       |
   71|       |    /* No flag bits for temporary stores */
   72|  1.47k|    if (!is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (72:9): [True: 1.47k, False: 0]
  ------------------
   73|  1.47k|        && !ossl_provider_test_operation_bit(provider, operation_id, result))
  ------------------
  |  Branch (73:12): [True: 0, False: 1.47k]
  ------------------
   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.47k|    *result = !*result;
   82|       |
   83|  1.47k|    return 1;
   84|  1.47k|}
core_fetch.c:is_temporary_method_store:
   28|  2.96k|{
   29|  2.96k|    struct construct_data_st *data = cbdata;
   30|       |
   31|  2.96k|    return no_store && !data->force_store;
  ------------------
  |  Branch (31:12): [True: 0, False: 2.96k]
  |  Branch (31:24): [True: 0, False: 0]
  ------------------
   32|  2.96k|}
core_fetch.c:ossl_method_construct_reserve_store:
   35|  1.47k|{
   36|  1.47k|    struct construct_data_st *data = cbdata;
   37|       |
   38|  1.47k|    if (is_temporary_method_store(no_store, data) && data->store == NULL) {
  ------------------
  |  Branch (38:9): [True: 0, False: 1.47k]
  |  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.47k|    return data->mcm->lock_store(data->store, data->mcm_data);
   50|  1.47k|}
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.47k|{
   54|  1.47k|    struct construct_data_st *data = cbdata;
   55|       |
   56|  1.47k|    return data->mcm->unlock_store(data->store, data->mcm_data);
   57|  1.47k|}
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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|   224k|{
   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|   224k|    return namemap == NULL || tsan_load(&namemap->max_number) == 0;
  ------------------
  |  |   61|   224k|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (106:12): [True: 0, False: 224k]
  |  Branch (106:31): [True: 1, False: 224k]
  ------------------
  107|   224k|#endif
  108|   224k|}
ossl_namemap_doall_names:
  132|  16.1k|{
  133|  16.1k|    DOALL_NAMES_DATA cbdata;
  134|  16.1k|    size_t num_names;
  135|  16.1k|    int i;
  136|       |
  137|  16.1k|    cbdata.number = number;
  138|  16.1k|    cbdata.found = 0;
  139|       |
  140|  16.1k|    if (namemap == NULL)
  ------------------
  |  Branch (140:9): [True: 0, False: 16.1k]
  ------------------
  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|  16.1k|    if (!CRYPTO_THREAD_read_lock(namemap->lock))
  ------------------
  |  Branch (148:9): [True: 0, False: 16.1k]
  ------------------
  149|      0|        return 0;
  150|       |
  151|  16.1k|    num_names = lh_NAMENUM_ENTRY_num_items(namemap->namenum);
  152|  16.1k|    if (num_names == 0) {
  ------------------
  |  Branch (152:9): [True: 0, False: 16.1k]
  ------------------
  153|      0|        CRYPTO_THREAD_unlock(namemap->lock);
  154|      0|        return 0;
  155|      0|    }
  156|  16.1k|    cbdata.names = OPENSSL_malloc(sizeof(*cbdata.names) * num_names);
  ------------------
  |  |  102|  16.1k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  16.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  16.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  157|  16.1k|    if (cbdata.names == NULL) {
  ------------------
  |  Branch (157:9): [True: 0, False: 16.1k]
  ------------------
  158|      0|        CRYPTO_THREAD_unlock(namemap->lock);
  159|      0|        return 0;
  160|      0|    }
  161|  16.1k|    lh_NAMENUM_ENTRY_doall_DOALL_NAMES_DATA(namemap->namenum, do_name,
  162|  16.1k|                                            &cbdata);
  163|  16.1k|    CRYPTO_THREAD_unlock(namemap->lock);
  164|       |
  165|  64.4k|    for (i = 0; i < cbdata.found; i++)
  ------------------
  |  Branch (165:17): [True: 48.2k, False: 16.1k]
  ------------------
  166|  48.2k|        fn(cbdata.names[i], data);
  167|       |
  168|  16.1k|    OPENSSL_free(cbdata.names);
  ------------------
  |  |  115|  16.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  16.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  16.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  169|  16.1k|    return 1;
  170|  16.1k|}
ossl_namemap_name2num:
  186|   225k|{
  187|   225k|    int number;
  188|       |
  189|   225k|#ifndef FIPS_MODULE
  190|   225k|    if (namemap == NULL)
  ------------------
  |  Branch (190:9): [True: 0, False: 225k]
  ------------------
  191|      0|        namemap = ossl_namemap_stored(NULL);
  192|   225k|#endif
  193|       |
  194|   225k|    if (namemap == NULL)
  ------------------
  |  Branch (194:9): [True: 0, False: 225k]
  ------------------
  195|      0|        return 0;
  196|       |
  197|   225k|    if (!CRYPTO_THREAD_read_lock(namemap->lock))
  ------------------
  |  Branch (197:9): [True: 0, False: 225k]
  ------------------
  198|      0|        return 0;
  199|   225k|    number = namemap_name2num(namemap, name);
  200|   225k|    CRYPTO_THREAD_unlock(namemap->lock);
  201|       |
  202|   225k|    return number;
  203|   225k|}
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)
  ------------------
  |  |  121|    222|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    222|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    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);
  ------------------
  |  |  115|    222|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    222|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    222|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  216|    222|    return ret;
  217|    222|}
ossl_namemap_add_name:
  279|    648|{
  280|    648|    int tmp_number;
  281|       |
  282|    648|#ifndef FIPS_MODULE
  283|    648|    if (namemap == NULL)
  ------------------
  |  Branch (283:9): [True: 0, False: 648]
  ------------------
  284|      0|        namemap = ossl_namemap_stored(NULL);
  285|    648|#endif
  286|       |
  287|    648|    if (name == NULL || *name == 0 || namemap == NULL)
  ------------------
  |  Branch (287:9): [True: 0, False: 648]
  |  Branch (287:25): [True: 0, False: 648]
  |  Branch (287:39): [True: 0, False: 648]
  ------------------
  288|      0|        return 0;
  289|       |
  290|    648|    if (!CRYPTO_THREAD_write_lock(namemap->lock))
  ------------------
  |  Branch (290:9): [True: 0, False: 648]
  ------------------
  291|      0|        return 0;
  292|    648|    tmp_number = namemap_add_name(namemap, number, name);
  293|    648|    CRYPTO_THREAD_unlock(namemap->lock);
  294|    648|    return tmp_number;
  295|    648|}
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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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)
  ------------------
  |  |  119|    220|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    220|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      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),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      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);
  ------------------
  |  |  115|    220|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    220|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    220|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  372|    220|    return number;
  373|    220|}
ossl_namemap_stored:
  471|   224k|{
  472|   224k|#ifndef FIPS_MODULE
  473|   224k|    int nms;
  474|   224k|#endif
  475|   224k|    OSSL_NAMEMAP *namemap =
  476|   224k|        ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_NAMEMAP_INDEX);
  ------------------
  |  |  100|   224k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  477|       |
  478|   224k|    if (namemap == NULL)
  ------------------
  |  Branch (478:9): [True: 0, False: 224k]
  ------------------
  479|      0|        return NULL;
  480|       |
  481|   224k|#ifndef FIPS_MODULE
  482|   224k|    nms = ossl_namemap_empty(namemap);
  483|   224k|    if (nms < 0) {
  ------------------
  |  Branch (483:9): [True: 0, False: 224k]
  ------------------
  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|   224k|    if (nms == 1) {
  ------------------
  |  Branch (490:9): [True: 1, False: 224k]
  ------------------
  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
  ------------------
  |  |  464|      1|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
  495|      1|                            | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
  ------------------
  |  |  465|      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|     16|        for (i = 0, end = EVP_PKEY_asn1_get_count(); i < end; i++)
  ------------------
  |  Branch (503:54): [True: 15, False: 1]
  ------------------
  504|     15|            get_legacy_pkey_meth_names(EVP_PKEY_asn1_get0(i), namemap);
  505|      1|    }
  506|   224k|#endif
  507|       |
  508|   224k|    return namemap;
  509|   224k|}
ossl_namemap_new:
  512|      2|{
  513|      2|    OSSL_NAMEMAP *namemap;
  514|       |
  515|      2|    if ((namemap = OPENSSL_zalloc(sizeof(*namemap))) != NULL
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  535|      2|}
core_namemap.c:do_name:
  117|  6.50M|{
  118|  6.50M|    if (namenum->number == data->number)
  ------------------
  |  Branch (118:9): [True: 48.2k, False: 6.45M]
  ------------------
  119|  48.2k|        data->names[data->found++] = namenum->name;
  120|  6.50M|}
core_namemap.c:namemap_name2num:
  175|   227k|{
  176|   227k|    NAMENUM_ENTRY *namenum_entry, namenum_tmpl;
  177|       |
  178|   227k|    namenum_tmpl.name = (char *)name;
  179|   227k|    namenum_tmpl.number = 0;
  180|   227k|    namenum_entry =
  181|   227k|        lh_NAMENUM_ENTRY_retrieve(namemap->namenum, &namenum_tmpl);
  182|   227k|    return namenum_entry != NULL ? namenum_entry->number : 0;
  ------------------
  |  Branch (182:12): [True: 223k, False: 4.18k]
  ------------------
  183|   227k|}
core_namemap.c:namemap_add_name:
  249|  1.04k|{
  250|  1.04k|    NAMENUM_ENTRY *namenum = NULL;
  251|  1.04k|    int tmp_number;
  252|       |
  253|       |    /* If it already exists, we don't add it */
  254|  1.04k|    if ((tmp_number = namemap_name2num(namemap, name)) != 0)
  ------------------
  |  Branch (254:9): [True: 641, False: 404]
  ------------------
  255|    641|        return tmp_number;
  256|       |
  257|    404|    if ((namenum = OPENSSL_zalloc(sizeof(*namenum))) == NULL)
  ------------------
  |  |  104|    404|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    404|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    404|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (257:9): [True: 0, False: 404]
  ------------------
  258|      0|        return 0;
  259|       |
  260|    404|    if ((namenum->name = OPENSSL_strdup(name)) == NULL)
  ------------------
  |  |  119|    404|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    404|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    404|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (260:9): [True: 0, False: 404]
  ------------------
  261|      0|        goto err;
  262|       |
  263|       |    /* The tsan_counter use here is safe since we're under lock */
  264|    404|    namenum->number =
  265|    404|        number != 0 ? number : 1 + tsan_counter(&namemap->max_number);
  ------------------
  |  |  150|    198|# 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: 206, False: 198]
  ------------------
  266|    404|    (void)lh_NAMENUM_ENTRY_insert(namemap->namenum, namenum);
  267|       |
  268|    404|    if (lh_NAMENUM_ENTRY_error(namemap->namenum))
  ------------------
  |  Branch (268:9): [True: 0, False: 404]
  ------------------
  269|      0|        goto err;
  270|    404|    return namenum->number;
  271|       |
  272|      0| err:
  273|      0|    namenum_free(namenum);
  274|      0|    return 0;
  275|    404|}
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|    258|{
  387|    258|    int num = 0;
  388|    258|    ASN1_OBJECT *obj;
  389|       |
  390|    258|    if (base_nid != NID_undef) {
  ------------------
  |  |   18|    258|#define NID_undef                       0
  ------------------
  |  Branch (390:9): [True: 4, False: 254]
  ------------------
  391|      4|        num = ossl_namemap_add_name(arg, num, OBJ_nid2sn(base_nid));
  392|      4|        num = ossl_namemap_add_name(arg, num, OBJ_nid2ln(base_nid));
  393|      4|    }
  394|       |
  395|    258|    if (nid != NID_undef) {
  ------------------
  |  |   18|    258|#define NID_undef                       0
  ------------------
  |  Branch (395:9): [True: 210, False: 48]
  ------------------
  396|    210|        num = ossl_namemap_add_name(arg, num, OBJ_nid2sn(nid));
  397|    210|        num = ossl_namemap_add_name(arg, num, OBJ_nid2ln(nid));
  398|    210|        if ((obj = OBJ_nid2obj(nid)) != NULL) {
  ------------------
  |  Branch (398:13): [True: 210, False: 0]
  ------------------
  399|    210|            char txtoid[OSSL_MAX_NAME_SIZE];
  400|       |
  401|    210|            if (OBJ_obj2txt(txtoid, sizeof(txtoid), obj, 1) > 0)
  ------------------
  |  Branch (401:17): [True: 209, False: 1]
  ------------------
  402|    209|                num = ossl_namemap_add_name(arg, num, txtoid);
  403|    210|        }
  404|    210|    }
  405|    258|    if (pem_name != NULL)
  ------------------
  |  Branch (405:9): [True: 11, False: 247]
  ------------------
  406|     11|        num = ossl_namemap_add_name(arg, num, pem_name);
  407|    258|}
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|     15|{
  428|     15|    int nid = 0, base_nid = 0, flags = 0;
  429|     15|    const char *pem_name = NULL;
  430|       |
  431|     15|    EVP_PKEY_asn1_get0_info(&nid, &base_nid, &flags, NULL, &pem_name, ameth);
  432|     15|    if (nid != NID_undef) {
  ------------------
  |  |   18|     15|#define NID_undef                       0
  ------------------
  |  Branch (432:9): [True: 15, False: 0]
  ------------------
  433|     15|        if ((flags & ASN1_PKEY_ALIAS) == 0) {
  ------------------
  |  | 1554|     15|# define ASN1_PKEY_ALIAS         0x1
  ------------------
  |  Branch (433:13): [True: 10, False: 5]
  ------------------
  434|     10|            switch (nid) {
  435|      1|            case EVP_PKEY_DHX:
  ------------------
  |  |   69|      1|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5299|      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|      5|            switch (nid) {
  449|      1|            case EVP_PKEY_SM2:
  ------------------
  |  |   71|      1|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (449:13): [True: 1, False: 4]
  ------------------
  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|      4|            default:
  ------------------
  |  Branch (456:13): [True: 4, False: 1]
  ------------------
  457|       |                /* Use the short name of the base nid as the common reference */
  458|      4|                get_legacy_evp_names(base_nid, nid, pem_name, arg);
  459|      5|            }
  460|      5|        }
  461|     15|    }
  462|     15|}
core_namemap.c:namenum_hash:
   46|   227k|{
   47|   227k|    return ossl_lh_strcasehash(n->name);
   48|   227k|}
core_namemap.c:namenum_cmp:
   51|   223k|{
   52|   223k|    return OPENSSL_strcasecmp(a->name, b->name);
   53|   223k|}
core_namemap.c:namenum_free:
   56|    404|{
   57|    404|    if (n != NULL)
  ------------------
  |  Branch (57:9): [True: 404, False: 0]
  ------------------
   58|    404|        OPENSSL_free(n->name);
  ------------------
  |  |  115|    404|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    404|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    404|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   59|    404|    OPENSSL_free(n);
  ------------------
  |  |  115|    404|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    404|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    404|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   60|    404|}

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|   960k|{
  254|   960k|    const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
  255|   960k|    const int a = ossl_toascii(c);
  ------------------
  |  |   56|   960k|#  define ossl_toascii(c)       (c)
  ------------------
  256|       |
  257|   960k|    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
  ------------------
  |  Branch (257:12): [True: 960k, False: 0]
  |  Branch (257:22): [True: 956k, False: 3.85k]
  |  Branch (257:33): [True: 43.5k, False: 913k]
  ------------------
  258|   960k|}
ossl_isdigit:
  270|   169k|{
  271|   169k|    int a = ossl_toascii(c);
  ------------------
  |  |   56|   169k|#  define ossl_toascii(c)       (c)
  ------------------
  272|       |
  273|   169k|    return ASCII_IS_DIGIT(a);
  ------------------
  |  |  265|   169k|#define ASCII_IS_DIGIT(c)   (c >= 0x30 && c <= 0x39)
  |  |  ------------------
  |  |  |  Branch (265:30): [True: 169k, False: 0]
  |  |  |  Branch (265:43): [True: 9.69k, False: 159k]
  |  |  ------------------
  ------------------
  274|   169k|}
ossl_tolower:
  297|  10.0M|{
  298|  10.0M|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  10.0M|#  define ossl_toascii(c)       (c)
  ------------------
  299|       |
  300|  10.0M|    return ASCII_IS_UPPER(a) ? c ^ case_change : c;
  ------------------
  |  |  266|  10.0M|#define ASCII_IS_UPPER(c)   (c >= 0x41 && c <= 0x5A)
  |  |  ------------------
  |  |  |  Branch (266:30): [True: 8.19M, False: 1.81M]
  |  |  |  Branch (266:43): [True: 2.32M, False: 5.86M]
  |  |  ------------------
  ------------------
  301|  10.0M|}

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

d2i_DHxparams:
   94|     90|{
   95|     90|    FFC_PARAMS *params;
   96|     90|    int_dhx942_dh *dhx = NULL;
   97|     90|    DH *dh = NULL;
   98|       |
   99|     90|    dh = DH_new();
  100|     90|    if (dh == NULL)
  ------------------
  |  Branch (100:9): [True: 0, False: 90]
  ------------------
  101|      0|        return NULL;
  102|     90|    dhx = d2i_int_dhx(NULL, pp, length);
  103|     90|    if (dhx == NULL) {
  ------------------
  |  Branch (103:9): [True: 70, False: 20]
  ------------------
  104|     70|        DH_free(dh);
  105|     70|        return NULL;
  106|     70|    }
  107|       |
  108|     20|    if (a != NULL) {
  ------------------
  |  Branch (108:9): [True: 0, False: 20]
  ------------------
  109|      0|        DH_free(*a);
  110|      0|        *a = dh;
  111|      0|    }
  112|       |
  113|     20|    params = &dh->params;
  114|     20|    DH_set0_pqg(dh, dhx->p, dhx->q, dhx->g);
  115|     20|    ossl_ffc_params_set0_j(params, dhx->j);
  116|       |
  117|     20|    if (dhx->vparams != NULL) {
  ------------------
  |  Branch (117:9): [True: 0, False: 20]
  ------------------
  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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  126|      0|        dhx->vparams = NULL;
  127|      0|    }
  128|       |
  129|     20|    OPENSSL_free(dhx);
  ------------------
  |  |  115|     20|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     20|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     20|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|     20|    DH_clear_flags(dh, DH_FLAG_TYPE_MASK);
  ------------------
  |  |  110|     20|#  define DH_FLAG_TYPE_MASK             0xF000
  ------------------
  131|     20|    DH_set_flags(dh, DH_FLAG_TYPE_DHX);
  ------------------
  |  |  112|     20|#  define DH_FLAG_TYPE_DHX              0x1000
  ------------------
  132|     20|    return dh;
  133|     90|}
dh_asn1.c:dh_cb:
   27|      3|{
   28|      3|    if (operation == ASN1_OP_NEW_PRE) {
  ------------------
  |  |  742|      3|# define ASN1_OP_NEW_PRE         0
  ------------------
  |  Branch (28:9): [True: 1, False: 2]
  ------------------
   29|      1|        *pval = (ASN1_VALUE *)DH_new();
   30|      1|        if (*pval != NULL)
  ------------------
  |  Branch (30:13): [True: 1, False: 0]
  ------------------
   31|      1|            return 2;
   32|      0|        return 0;
   33|      2|    } else if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|      2|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (33:16): [True: 1, False: 1]
  ------------------
   34|      1|        DH_free((DH *)*pval);
   35|      1|        *pval = NULL;
   36|      1|        return 2;
   37|      1|    } else if (operation == ASN1_OP_D2I_POST) {
  ------------------
  |  |  747|      1|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (37:16): [True: 0, False: 1]
  ------------------
   38|      0|        DH *dh = (DH *)*pval;
   39|       |
   40|      0|        DH_clear_flags(dh, DH_FLAG_TYPE_MASK);
  ------------------
  |  |  110|      0|#  define DH_FLAG_TYPE_MASK             0xF000
  ------------------
   41|      0|        DH_set_flags(dh, DH_FLAG_TYPE_DH);
  ------------------
  |  |  111|      0|#  define DH_FLAG_TYPE_DH               0x0000
  ------------------
   42|      0|        ossl_dh_cache_named_group(dh);
   43|      0|        dh->dirty_cnt++;
   44|      0|    }
   45|      1|    return 1;
   46|      3|}

ossl_dh_params_todata:
   92|     18|{
   93|     18|    long l = DH_get_length(dh);
   94|       |
   95|     18|    if (!ossl_ffc_params_todata(ossl_dh_get0_params(dh), bld, params))
  ------------------
  |  Branch (95:9): [True: 0, False: 18]
  ------------------
   96|      0|        return 0;
   97|     18|    if (l > 0
  ------------------
  |  Branch (97:9): [True: 0, False: 18]
  ------------------
   98|     18|        && !ossl_param_build_set_long(bld, params, OSSL_PKEY_PARAM_DH_PRIV_LEN, l))
  ------------------
  |  |  338|      0|# define OSSL_PKEY_PARAM_DH_PRIV_LEN "priv_len"
  ------------------
  |  Branch (98:12): [True: 0, False: 0]
  ------------------
   99|      0|        return 0;
  100|     18|    return 1;
  101|     18|}
ossl_dh_key_todata:
  105|     18|{
  106|     18|    const BIGNUM *priv = NULL, *pub = NULL;
  107|       |
  108|     18|    if (dh == NULL)
  ------------------
  |  Branch (108:9): [True: 0, False: 18]
  ------------------
  109|      0|        return 0;
  110|       |
  111|     18|    DH_get0_key(dh, &pub, &priv);
  112|     18|    if (priv != NULL
  ------------------
  |  Branch (112:9): [True: 0, False: 18]
  ------------------
  113|     18|        && include_private
  ------------------
  |  Branch (113:12): [True: 0, False: 0]
  ------------------
  114|     18|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PRIV_KEY, priv))
  ------------------
  |  |  391|      0|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  |  Branch (114:12): [True: 0, False: 0]
  ------------------
  115|      0|        return 0;
  116|     18|    if (pub != NULL
  ------------------
  |  Branch (116:9): [True: 18, False: 0]
  ------------------
  117|     18|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PUB_KEY, pub))
  ------------------
  |  |  393|     18|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  |  Branch (117:12): [True: 0, False: 18]
  ------------------
  118|      0|        return 0;
  119|       |
  120|     18|    return 1;
  121|     18|}

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

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

DH_get_default_method:
  185|     91|{
  186|     91|    return default_DH_method;
  187|     91|}
dh_key.c:dh_init:
  201|     91|{
  202|     91|    dh->flags |= DH_FLAG_CACHE_MONT_P;
  ------------------
  |  |  108|     91|#  define DH_FLAG_CACHE_MONT_P     0x01
  ------------------
  203|     91|    dh->dirty_cnt++;
  204|     91|    return 1;
  205|     91|}
dh_key.c:dh_finish:
  208|     91|{
  209|     91|    BN_MONT_CTX_free(dh->method_mont_p);
  210|     91|    return 1;
  211|     91|}

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

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

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

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

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|     34|{
  130|     34|    return d->meth;
  131|     34|}
DSA_new:
  208|    167|{
  209|    167|    return dsa_new_intern(NULL, NULL);
  210|    167|}
DSA_free:
  214|  4.91k|{
  215|  4.91k|    int i;
  216|       |
  217|  4.91k|    if (r == NULL)
  ------------------
  |  Branch (217:9): [True: 4.71k, False: 201]
  ------------------
  218|  4.71k|        return;
  219|       |
  220|    201|    CRYPTO_DOWN_REF(&r->references, &i);
  221|    201|    REF_PRINT_COUNT("DSA", r);
  ------------------
  |  |  289|    201|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|    201|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|    201|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|    201|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  222|    201|    if (i > 0)
  ------------------
  |  Branch (222:9): [True: 34, False: 167]
  ------------------
  223|     34|        return;
  224|    167|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|    167|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 167]
  |  |  ------------------
  ------------------
  225|       |
  226|    167|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (226:9): [True: 167, False: 0]
  |  Branch (226:28): [True: 167, False: 0]
  ------------------
  227|    167|        r->meth->finish(r);
  228|    167|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
  229|    167|    ENGINE_finish(r->engine);
  230|    167|#endif
  231|       |
  232|    167|#ifndef FIPS_MODULE
  233|    167|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data);
  ------------------
  |  |  235|    167|# define CRYPTO_EX_INDEX_DSA              7
  ------------------
  234|    167|#endif
  235|       |
  236|    167|    CRYPTO_THREAD_lock_free(r->lock);
  237|    167|    CRYPTO_FREE_REF(&r->references);
  238|       |
  239|    167|    ossl_ffc_params_cleanup(&r->params);
  240|    167|    BN_clear_free(r->pub_key);
  241|    167|    BN_clear_free(r->priv_key);
  242|    167|    OPENSSL_free(r);
  ------------------
  |  |  115|    167|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    167|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    167|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  243|    167|}
DSA_up_ref:
  246|     34|{
  247|     34|    int i;
  248|       |
  249|     34|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (249:9): [True: 0, False: 34]
  ------------------
  250|      0|        return 0;
  251|       |
  252|     34|    REF_PRINT_COUNT("DSA", r);
  ------------------
  |  |  289|     34|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|     34|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|     34|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|     34|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|     34|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|     34|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 34]
  |  |  ------------------
  ------------------
  254|     34|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (254:13): [True: 34, False: 0]
  ------------------
  255|     34|}
ossl_dsa_set0_libctx:
  258|      4|{
  259|      4|    d->libctx = libctx;
  260|      4|}
DSA_get0_pqg:
  264|     34|{
  265|     34|    ossl_ffc_params_get0_pqg(&d->params, p, q, g);
  266|     34|}
DSA_get0_key:
  311|      4|{
  312|      4|    if (pub_key != NULL)
  ------------------
  |  Branch (312:9): [True: 4, False: 0]
  ------------------
  313|      4|        *pub_key = d->pub_key;
  314|      4|    if (priv_key != NULL)
  ------------------
  |  Branch (314:9): [True: 4, False: 0]
  ------------------
  315|      4|        *priv_key = d->priv_key;
  316|      4|}
DSA_security_bits:
  334|      4|{
  335|      4|    if (d->params.p != NULL && d->params.q != NULL)
  ------------------
  |  Branch (335:9): [True: 4, False: 0]
  |  Branch (335:32): [True: 4, False: 0]
  ------------------
  336|      4|        return BN_security_bits(BN_num_bits(d->params.p),
  337|      4|                                BN_num_bits(d->params.q));
  338|      0|    return -1;
  339|      4|}
DSA_bits:
  342|      4|{
  343|      4|    if (dsa->params.p != NULL)
  ------------------
  |  Branch (343:9): [True: 4, False: 0]
  ------------------
  344|      4|        return BN_num_bits(dsa->params.p);
  345|      0|    return -1;
  346|      4|}
ossl_dsa_get0_params:
  349|      4|{
  350|      4|    return &dsa->params;
  351|      4|}
dsa_lib.c:dsa_new_intern:
  134|    167|{
  135|    167|    DSA *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|    167|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    167|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    167|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|       |
  137|    167|    if (ret == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 167]
  ------------------
  138|      0|        return NULL;
  139|       |
  140|    167|    ret->lock = CRYPTO_THREAD_lock_new();
  141|    167|    if (ret->lock == NULL) {
  ------------------
  |  Branch (141:9): [True: 0, False: 167]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  143|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  144|      0|        return NULL;
  145|      0|    }
  146|       |
  147|    167|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 167]
  ------------------
  148|      0|        CRYPTO_THREAD_lock_free(ret->lock);
  149|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  150|      0|        return NULL;
  151|      0|    }
  152|       |
  153|    167|    ret->libctx = libctx;
  154|    167|    ret->meth = DSA_get_default_method();
  155|    167|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
  156|    167|    ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW; /* early default init */
  ------------------
  |  |   99|    167|#   define DSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
  157|    167|    if (engine) {
  ------------------
  |  Branch (157:9): [True: 0, False: 167]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|    167|        ret->engine = ENGINE_get_default_DSA();
  165|    167|    if (ret->engine) {
  ------------------
  |  Branch (165:9): [True: 0, False: 167]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  169|      0|            goto err;
  170|      0|        }
  171|      0|    }
  172|    167|#endif
  173|       |
  174|    167|    ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |   99|    167|#   define DSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
  175|       |
  176|    167|#ifndef FIPS_MODULE
  177|    167|    if (!ossl_crypto_new_ex_data_ex(libctx, CRYPTO_EX_INDEX_DSA, ret,
  ------------------
  |  |  235|    167|# define CRYPTO_EX_INDEX_DSA              7
  ------------------
  |  Branch (177:9): [True: 0, False: 167]
  ------------------
  178|    167|                                    &ret->ex_data))
  179|      0|        goto err;
  180|    167|#endif
  181|       |
  182|    167|    ossl_ffc_params_init(&ret->params);
  183|       |
  184|    167|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (184:9): [True: 167, False: 0]
  |  Branch (184:38): [True: 0, False: 167]
  ------------------
  185|      0|        ERR_raise(ERR_LIB_DSA, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  186|      0|        goto err;
  187|      0|    }
  188|       |
  189|    167|    return ret;
  190|       |
  191|      0| err:
  192|      0|    DSA_free(ret);
  193|      0|    return NULL;
  194|    167|}

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

i2d_DSA_SIG:
   79|      4|{
   80|      4|    BUF_MEM *buf = NULL;
   81|      4|    size_t encoded_len;
   82|      4|    WPACKET pkt;
   83|       |
   84|      4|    if (ppout == NULL) {
  ------------------
  |  Branch (84:9): [True: 4, False: 0]
  ------------------
   85|      4|        if (!WPACKET_init_null(&pkt, 0))
  ------------------
  |  Branch (85:13): [True: 0, False: 4]
  ------------------
   86|      0|            return -1;
   87|      4|    } 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|      4|    if (!ossl_encode_der_dsa_sig(&pkt, sig->r, sig->s)
  ------------------
  |  Branch (98:9): [True: 0, False: 4]
  ------------------
   99|      4|            || !WPACKET_get_total_written(&pkt, &encoded_len)
  ------------------
  |  Branch (99:16): [True: 0, False: 4]
  ------------------
  100|      4|            || !WPACKET_finish(&pkt)) {
  ------------------
  |  Branch (100:16): [True: 0, False: 4]
  ------------------
  101|      0|        BUF_MEM_free(buf);
  102|      0|        WPACKET_cleanup(&pkt);
  103|      0|        return -1;
  104|      0|    }
  105|       |
  106|      4|    if (ppout != NULL) {
  ------------------
  |  Branch (106:9): [True: 0, False: 4]
  ------------------
  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|      4|    return (int)encoded_len;
  117|      4|}
DSA_size:
  120|      4|{
  121|      4|    int ret = -1;
  122|      4|    DSA_SIG sig;
  123|       |
  124|      4|    if (dsa->params.q != NULL) {
  ------------------
  |  Branch (124:9): [True: 4, False: 0]
  ------------------
  125|      4|        sig.r = sig.s = dsa->params.q;
  126|      4|        ret = i2d_DSA_SIG(&sig, NULL);
  127|       |
  128|      4|        if (ret < 0)
  ------------------
  |  Branch (128:13): [True: 0, False: 4]
  ------------------
  129|      0|            ret = 0;
  130|      4|    }
  131|      4|    return ret;
  132|      4|}

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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  203|      0|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
   75|      0|    OPENSSL_free(dso->filename);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|      0|    OPENSSL_free(dso->loaded_filename);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|      0|    CRYPTO_FREE_REF(&dso->references);
   78|      0|    OPENSSL_free(dso);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|      0|    return 1;
   80|      0|}

ossl_ec_GF2m_simple_set_compressed_coordinates:
   43|  12.9k|{
   44|  12.9k|    BIGNUM *tmp, *x, *y, *z;
   45|  12.9k|    int ret = 0, z0;
   46|  12.9k|#ifndef FIPS_MODULE
   47|  12.9k|    BN_CTX *new_ctx = NULL;
   48|       |
   49|  12.9k|    if (ctx == NULL) {
  ------------------
  |  Branch (49:9): [True: 0, False: 12.9k]
  ------------------
   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|  12.9k|#endif
   55|       |
   56|  12.9k|    y_bit = (y_bit != 0) ? 1 : 0;
  ------------------
  |  Branch (56:13): [True: 11.7k, False: 1.18k]
  ------------------
   57|       |
   58|  12.9k|    BN_CTX_start(ctx);
   59|  12.9k|    tmp = BN_CTX_get(ctx);
   60|  12.9k|    x = BN_CTX_get(ctx);
   61|  12.9k|    y = BN_CTX_get(ctx);
   62|  12.9k|    z = BN_CTX_get(ctx);
   63|  12.9k|    if (z == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 12.9k]
  ------------------
   64|      0|        goto err;
   65|       |
   66|  12.9k|    if (!BN_GF2m_mod_arr(x, x_, group->poly))
  ------------------
  |  Branch (66:9): [True: 0, False: 12.9k]
  ------------------
   67|      0|        goto err;
   68|  12.9k|    if (BN_is_zero(x)) {
  ------------------
  |  Branch (68:9): [True: 1.78k, False: 11.1k]
  ------------------
   69|  1.78k|        if (!BN_GF2m_mod_sqrt_arr(y, group->b, group->poly, ctx))
  ------------------
  |  Branch (69:13): [True: 0, False: 1.78k]
  ------------------
   70|      0|            goto err;
   71|  11.1k|    } else {
   72|  11.1k|        if (!group->meth->field_sqr(group, tmp, x, ctx))
  ------------------
  |  Branch (72:13): [True: 0, False: 11.1k]
  ------------------
   73|      0|            goto err;
   74|  11.1k|        if (!group->meth->field_div(group, tmp, group->b, tmp, ctx))
  ------------------
  |  Branch (74:13): [True: 0, False: 11.1k]
  ------------------
   75|      0|            goto err;
   76|  11.1k|        if (!BN_GF2m_add(tmp, group->a, tmp))
  ------------------
  |  Branch (76:13): [True: 0, False: 11.1k]
  ------------------
   77|      0|            goto err;
   78|  11.1k|        if (!BN_GF2m_add(tmp, x, tmp))
  ------------------
  |  Branch (78:13): [True: 0, False: 11.1k]
  ------------------
   79|      0|            goto err;
   80|  11.1k|        ERR_set_mark();
   81|  11.1k|        if (!BN_GF2m_mod_solve_quad_arr(z, tmp, group->poly, ctx)) {
  ------------------
  |  Branch (81:13): [True: 2.76k, False: 8.42k]
  ------------------
   82|  2.76k|#ifndef FIPS_MODULE
   83|  2.76k|            unsigned long err = ERR_peek_last_error();
   84|       |
   85|  2.76k|            if (ERR_GET_LIB(err) == ERR_LIB_BN
  ------------------
  |  |   73|  5.52k|# define ERR_LIB_BN              3
  ------------------
  |  Branch (85:17): [True: 2.76k, False: 0]
  ------------------
   86|  2.76k|                && ERR_GET_REASON(err) == BN_R_NO_SOLUTION) {
  ------------------
  |  |   40|  2.76k|# define BN_R_NO_SOLUTION                                 116
  ------------------
  |  Branch (86:20): [True: 2.76k, False: 0]
  ------------------
   87|  2.76k|                ERR_pop_to_mark();
   88|  2.76k|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT);
  ------------------
  |  |  401|  2.76k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.76k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.76k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.76k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.76k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  2.76k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.76k|     ERR_set_error)
  |  |  ------------------
  ------------------
   89|  2.76k|            } 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   94|      0|            }
   95|  2.76k|            goto err;
   96|  2.76k|        }
   97|  8.42k|        ERR_clear_last_mark();
   98|  8.42k|        z0 = (BN_is_odd(z)) ? 1 : 0;
  ------------------
  |  Branch (98:14): [True: 1.58k, False: 6.83k]
  ------------------
   99|  8.42k|        if (!group->meth->field_mul(group, y, x, z, ctx))
  ------------------
  |  Branch (99:13): [True: 0, False: 8.42k]
  ------------------
  100|      0|            goto err;
  101|  8.42k|        if (z0 != y_bit) {
  ------------------
  |  Branch (101:13): [True: 5.77k, False: 2.65k]
  ------------------
  102|  5.77k|            if (!BN_GF2m_add(y, y, x))
  ------------------
  |  Branch (102:17): [True: 0, False: 5.77k]
  ------------------
  103|      0|                goto err;
  104|  5.77k|        }
  105|  8.42k|    }
  106|       |
  107|  10.2k|    if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (107:9): [True: 0, False: 10.2k]
  ------------------
  108|      0|        goto err;
  109|       |
  110|  10.2k|    ret = 1;
  111|       |
  112|  12.9k| err:
  113|  12.9k|    BN_CTX_end(ctx);
  114|  12.9k|#ifndef FIPS_MODULE
  115|  12.9k|    BN_CTX_free(new_ctx);
  116|  12.9k|#endif
  117|  12.9k|    return ret;
  118|  10.2k|}
ossl_ec_GF2m_simple_oct2point:
  259|  19.6k|{
  260|  19.6k|    point_conversion_form_t form;
  261|  19.6k|    int y_bit, m;
  262|  19.6k|    BIGNUM *x, *y, *yxi;
  263|  19.6k|    size_t field_len, enc_len;
  264|  19.6k|    int ret = 0;
  265|  19.6k|#ifndef FIPS_MODULE
  266|  19.6k|    BN_CTX *new_ctx = NULL;
  267|  19.6k|#endif
  268|       |
  269|  19.6k|    if (len == 0) {
  ------------------
  |  Branch (269:9): [True: 3, False: 19.6k]
  ------------------
  270|      3|        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
  271|      3|        return 0;
  272|      3|    }
  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|  19.6k|    y_bit = buf[0] & 1;
  286|  19.6k|    form = buf[0] & ~1U;
  287|       |
  288|  19.6k|    if ((form != 0) && (form != POINT_CONVERSION_COMPRESSED)
  ------------------
  |  Branch (288:9): [True: 19.3k, False: 326]
  |  Branch (288:24): [True: 5.31k, False: 14.0k]
  ------------------
  289|  19.6k|        && (form != POINT_CONVERSION_UNCOMPRESSED)
  ------------------
  |  Branch (289:12): [True: 5.28k, False: 28]
  ------------------
  290|  19.6k|        && (form != POINT_CONVERSION_HYBRID)) {
  ------------------
  |  Branch (290:12): [True: 378, False: 4.90k]
  ------------------
  291|    378|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|    378|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    378|    (ERR_new(),                                                 \
  |  |  |  |  404|    378|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    378|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    378|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    378|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    378|     ERR_set_error)
  |  |  ------------------
  ------------------
  292|    378|        return 0;
  293|    378|    }
  294|  19.2k|    if ((form == 0 || form == POINT_CONVERSION_UNCOMPRESSED) && y_bit) {
  ------------------
  |  Branch (294:10): [True: 326, False: 18.9k]
  |  Branch (294:23): [True: 28, False: 18.9k]
  |  Branch (294:65): [True: 13, False: 341]
  ------------------
  295|     13|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     13|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     13|    (ERR_new(),                                                 \
  |  |  |  |  404|     13|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     13|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     13|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     13|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     13|     ERR_set_error)
  |  |  ------------------
  ------------------
  296|     13|        return 0;
  297|     13|    }
  298|       |
  299|       |    /* The point at infinity is represented by a single zero octet. */
  300|  19.2k|    if (form == 0) {
  ------------------
  |  Branch (300:9): [True: 313, False: 18.9k]
  ------------------
  301|    313|        if (len != 1) {
  ------------------
  |  Branch (301:13): [True: 39, False: 274]
  ------------------
  302|     39|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     39|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     39|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     39|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     39|     ERR_set_error)
  |  |  ------------------
  ------------------
  303|     39|            return 0;
  304|     39|        }
  305|       |
  306|    274|        return EC_POINT_set_to_infinity(group, point);
  307|    313|    }
  308|       |
  309|  18.9k|    m = EC_GROUP_get_degree(group);
  310|  18.9k|    field_len = (m + 7) / 8;
  311|  18.9k|    enc_len =
  312|  18.9k|        (form ==
  ------------------
  |  Branch (312:9): [True: 14.0k, False: 4.93k]
  ------------------
  313|  18.9k|         POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;
  314|       |
  315|  18.9k|    if (len != enc_len) {
  ------------------
  |  Branch (315:9): [True: 1.43k, False: 17.5k]
  ------------------
  316|  1.43k|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|  1.43k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.43k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.43k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  1.43k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  1.43k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  1.43k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.43k|     ERR_set_error)
  |  |  ------------------
  ------------------
  317|  1.43k|        return 0;
  318|  1.43k|    }
  319|       |
  320|  17.5k|#ifndef FIPS_MODULE
  321|  17.5k|    if (ctx == NULL) {
  ------------------
  |  Branch (321:9): [True: 17.5k, False: 0]
  ------------------
  322|  17.5k|        ctx = new_ctx = BN_CTX_new();
  323|  17.5k|        if (ctx == NULL)
  ------------------
  |  Branch (323:13): [True: 0, False: 17.5k]
  ------------------
  324|      0|            return 0;
  325|  17.5k|    }
  326|  17.5k|#endif
  327|       |
  328|  17.5k|    BN_CTX_start(ctx);
  329|  17.5k|    x = BN_CTX_get(ctx);
  330|  17.5k|    y = BN_CTX_get(ctx);
  331|  17.5k|    yxi = BN_CTX_get(ctx);
  332|  17.5k|    if (yxi == NULL)
  ------------------
  |  Branch (332:9): [True: 0, False: 17.5k]
  ------------------
  333|      0|        goto err;
  334|       |
  335|  17.5k|    if (!BN_bin2bn(buf + 1, field_len, x))
  ------------------
  |  Branch (335:9): [True: 0, False: 17.5k]
  ------------------
  336|      0|        goto err;
  337|  17.5k|    if (BN_num_bits(x) > m) {
  ------------------
  |  Branch (337:9): [True: 1.07k, False: 16.4k]
  ------------------
  338|  1.07k|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|  1.07k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.07k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.07k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  1.07k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  1.07k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  1.07k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.07k|     ERR_set_error)
  |  |  ------------------
  ------------------
  339|  1.07k|        goto err;
  340|  1.07k|    }
  341|       |
  342|  16.4k|    if (form == POINT_CONVERSION_COMPRESSED) {
  ------------------
  |  Branch (342:9): [True: 12.9k, False: 3.48k]
  ------------------
  343|  12.9k|        if (!EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx))
  ------------------
  |  Branch (343:13): [True: 2.76k, False: 10.2k]
  ------------------
  344|  2.76k|            goto err;
  345|  12.9k|    } else {
  346|  3.48k|        if (!BN_bin2bn(buf + 1 + field_len, field_len, y))
  ------------------
  |  Branch (346:13): [True: 0, False: 3.48k]
  ------------------
  347|      0|            goto err;
  348|  3.48k|        if (BN_num_bits(y) > m) {
  ------------------
  |  Branch (348:13): [True: 248, False: 3.23k]
  ------------------
  349|    248|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|    248|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    248|    (ERR_new(),                                                 \
  |  |  |  |  404|    248|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    248|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    248|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    248|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    248|     ERR_set_error)
  |  |  ------------------
  ------------------
  350|    248|            goto err;
  351|    248|        }
  352|  3.23k|        if (form == POINT_CONVERSION_HYBRID) {
  ------------------
  |  Branch (352:13): [True: 3.21k, False: 20]
  ------------------
  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|  3.21k|            if (BN_is_zero(x)) {
  ------------------
  |  Branch (358:17): [True: 15, False: 3.19k]
  ------------------
  359|     15|                if (y_bit != 0) {
  ------------------
  |  Branch (359:21): [True: 2, False: 13]
  ------------------
  360|      2|                    ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|      2|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      2|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      2|     ERR_set_error)
  |  |  ------------------
  ------------------
  361|      2|                    goto err;
  362|      2|                }
  363|  3.19k|            } else {
  364|  3.19k|                if (!group->meth->field_div(group, yxi, y, x, ctx))
  ------------------
  |  Branch (364:21): [True: 0, False: 3.19k]
  ------------------
  365|      0|                    goto err;
  366|  3.19k|                if (y_bit != BN_is_odd(yxi)) {
  ------------------
  |  Branch (366:21): [True: 1.56k, False: 1.63k]
  ------------------
  367|  1.56k|                    ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|  1.56k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.56k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.56k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  1.56k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  1.56k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  1.56k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.56k|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|  1.56k|                    goto err;
  369|  1.56k|                }
  370|  3.19k|            }
  371|  3.21k|        }
  372|       |
  373|       |        /*
  374|       |         * EC_POINT_set_affine_coordinates is responsible for checking that
  375|       |         * the point is on the curve.
  376|       |         */
  377|  1.66k|        if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (377:13): [True: 1.66k, False: 1]
  ------------------
  378|  1.66k|            goto err;
  379|  1.66k|    }
  380|       |
  381|  10.2k|    ret = 1;
  382|       |
  383|  17.5k| err:
  384|  17.5k|    BN_CTX_end(ctx);
  385|  17.5k|#ifndef FIPS_MODULE
  386|  17.5k|    BN_CTX_free(new_ctx);
  387|  17.5k|#endif
  388|  17.5k|    return ret;
  389|  10.2k|}

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

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: 2.15k, False: 32.2k]
  ------------------
  115|  2.15k|        return 0;
  116|       |
  117|       |    /* We have parameters now set public key */
  118|  32.2k|    if (!o2i_ECPublicKey(&eckey, &p, pklen)) {
  ------------------
  |  Branch (118:9): [True: 16.2k, False: 15.9k]
  ------------------
  119|  16.2k|        ERR_raise(ERR_LIB_EC, EC_R_DECODE_ERROR);
  ------------------
  |  |  401|  16.2k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  16.2k|    (ERR_new(),                                                 \
  |  |  |  |  404|  16.2k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  16.2k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  16.2k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  16.2k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  16.2k|     ERR_set_error)
  |  |  ------------------
  ------------------
  120|  16.2k|        goto ecerr;
  121|  16.2k|    }
  122|       |
  123|  15.9k|    EVP_PKEY_assign_EC_KEY(pkey, eckey);
  ------------------
  |  |  517|  15.9k|        EVP_PKEY_assign((pkey), EVP_PKEY_EC, (eckey))
  |  |  ------------------
  |  |  |  |   70|  15.9k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  15.9k|#define NID_X9_62_id_ecPublicKey                408
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|  15.9k|    return 1;
  125|       |
  126|  16.2k| ecerr:
  127|  16.2k|    EC_KEY_free(eckey);
  128|  16.2k|    return 0;
  129|  32.2k|}
ec_ameth.c:int_ec_free:
  273|  34.3k|{
  274|  34.3k|    EC_KEY_free(pkey->pkey.ec);
  275|  34.3k|}

d2i_ECPKParameters:
  886|    856|{
  887|    856|    EC_GROUP *group = NULL;
  888|    856|    ECPKPARAMETERS *params = NULL;
  889|    856|    const unsigned char *p = *in;
  890|       |
  891|    856|    if ((params = d2i_ECPKPARAMETERS(NULL, &p, len)) == NULL) {
  ------------------
  |  Branch (891:9): [True: 856, False: 0]
  ------------------
  892|    856|        ECPKPARAMETERS_free(params);
  893|    856|        return NULL;
  894|    856|    }
  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|    428|{
 1099|    428|    EC_KEY *ret;
 1100|       |
 1101|    428|    if (in == NULL || *in == NULL) {
  ------------------
  |  Branch (1101:9): [True: 0, False: 428]
  |  Branch (1101:23): [True: 0, False: 428]
  ------------------
 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1103|      0|        return NULL;
 1104|      0|    }
 1105|       |
 1106|    428|    if (a == NULL || *a == NULL) {
  ------------------
  |  Branch (1106:9): [True: 0, False: 428]
  |  Branch (1106:22): [True: 0, False: 428]
  ------------------
 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1109|      0|            return NULL;
 1110|      0|        }
 1111|      0|    } else
 1112|    428|        ret = *a;
 1113|       |
 1114|    428|    if (!d2i_ECPKParameters(&ret->group, in, len)) {
  ------------------
  |  Branch (1114:9): [True: 428, False: 0]
  ------------------
 1115|    428|        if (a == NULL || *a != ret)
  ------------------
  |  Branch (1115:13): [True: 0, False: 428]
  |  Branch (1115:26): [True: 0, False: 428]
  ------------------
 1116|      0|             EC_KEY_free(ret);
 1117|    428|        else
 1118|    428|            ret->dirty_cnt++;
 1119|    428|        return NULL;
 1120|    428|    }
 1121|       |
 1122|      0|    if (EC_GROUP_get_curve_name(ret->group) == NID_sm2)
  ------------------
  |  | 1232|      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|    428|}
o2i_ECPublicKey:
 1134|  32.2k|{
 1135|  32.2k|    EC_KEY *ret = NULL;
 1136|       |
 1137|  32.2k|    if (a == NULL || (*a) == NULL || (*a)->group == NULL) {
  ------------------
  |  Branch (1137:9): [True: 0, False: 32.2k]
  |  Branch (1137:22): [True: 0, False: 32.2k]
  |  Branch (1137:38): [True: 0, False: 32.2k]
  ------------------
 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1142|      0|        return 0;
 1143|      0|    }
 1144|  32.2k|    ret = *a;
 1145|       |    /* EC_KEY_opt2key updates dirty_cnt */
 1146|  32.2k|    if (!EC_KEY_oct2key(ret, *in, len, NULL)) {
  ------------------
  |  Branch (1146:9): [True: 16.2k, False: 15.9k]
  ------------------
 1147|  16.2k|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|  16.2k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  16.2k|    (ERR_new(),                                                 \
  |  |  |  |  404|  16.2k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  16.2k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  16.2k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  16.2k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  16.2k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1148|  16.2k|        return 0;
 1149|  16.2k|    }
 1150|  15.9k|    *in += len;
 1151|  15.9k|    return ret;
 1152|  32.2k|}
i2d_ECDSA_SIG:
 1240|  15.9k|{
 1241|  15.9k|    BUF_MEM *buf = NULL;
 1242|  15.9k|    size_t encoded_len;
 1243|  15.9k|    WPACKET pkt;
 1244|       |
 1245|  15.9k|    if (ppout == NULL) {
  ------------------
  |  Branch (1245:9): [True: 15.9k, False: 0]
  ------------------
 1246|  15.9k|        if (!WPACKET_init_null(&pkt, 0))
  ------------------
  |  Branch (1246:13): [True: 0, False: 15.9k]
  ------------------
 1247|      0|            return -1;
 1248|  15.9k|    } 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|  15.9k|    if (!ossl_encode_der_dsa_sig(&pkt, sig->r, sig->s)
  ------------------
  |  Branch (1259:9): [True: 0, False: 15.9k]
  ------------------
 1260|  15.9k|            || !WPACKET_get_total_written(&pkt, &encoded_len)
  ------------------
  |  Branch (1260:16): [True: 0, False: 15.9k]
  ------------------
 1261|  15.9k|            || !WPACKET_finish(&pkt)) {
  ------------------
  |  Branch (1261:16): [True: 0, False: 15.9k]
  ------------------
 1262|      0|        BUF_MEM_free(buf);
 1263|      0|        WPACKET_cleanup(&pkt);
 1264|      0|        return -1;
 1265|      0|    }
 1266|       |
 1267|  15.9k|    if (ppout != NULL) {
  ------------------
  |  Branch (1267:9): [True: 0, False: 15.9k]
  ------------------
 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|  15.9k|    return (int)encoded_len;
 1278|  15.9k|}
ECDSA_size:
 1310|  15.9k|{
 1311|  15.9k|    int ret;
 1312|  15.9k|    ECDSA_SIG sig;
 1313|  15.9k|    const EC_GROUP *group;
 1314|  15.9k|    const BIGNUM *bn;
 1315|       |
 1316|  15.9k|    if (ec == NULL)
  ------------------
  |  Branch (1316:9): [True: 0, False: 15.9k]
  ------------------
 1317|      0|        return 0;
 1318|  15.9k|    group = EC_KEY_get0_group(ec);
 1319|  15.9k|    if (group == NULL)
  ------------------
  |  Branch (1319:9): [True: 0, False: 15.9k]
  ------------------
 1320|      0|        return 0;
 1321|       |
 1322|  15.9k|    bn = EC_GROUP_get0_order(group);
 1323|  15.9k|    if (bn == NULL)
  ------------------
  |  Branch (1323:9): [True: 0, False: 15.9k]
  ------------------
 1324|      0|        return 0;
 1325|       |
 1326|  15.9k|    sig.r = sig.s = (BIGNUM *)bn;
 1327|  15.9k|    ret = i2d_ECDSA_SIG(&sig, NULL);
 1328|       |
 1329|  15.9k|    if (ret < 0)
  ------------------
  |  Branch (1329:9): [True: 0, False: 15.9k]
  ------------------
 1330|      0|        ret = 0;
 1331|  15.9k|    return ret;
 1332|  15.9k|}

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

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

EC_GROUP_new_curve_GFp:
   23|  7.37k|{
   24|  7.37k|    const EC_METHOD *meth;
   25|  7.37k|    EC_GROUP *ret;
   26|       |
   27|  7.37k|#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|  7.37k|    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|  7.37k|    ret = ossl_ec_group_new_ex(ossl_bn_get_libctx(ctx), NULL, meth);
   58|  7.37k|    if (ret == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 7.37k]
  ------------------
   59|      0|        return NULL;
   60|       |
   61|  7.37k|    if (!EC_GROUP_set_curve(ret, p, a, b, ctx)) {
  ------------------
  |  Branch (61:9): [True: 0, False: 7.37k]
  ------------------
   62|      0|        EC_GROUP_free(ret);
   63|      0|        return NULL;
   64|      0|    }
   65|       |
   66|  7.37k|    return ret;
   67|  7.37k|}
EC_GROUP_new_curve_GF2m:
   72|  19.6k|{
   73|  19.6k|    const EC_METHOD *meth;
   74|  19.6k|    EC_GROUP *ret;
   75|       |
   76|  19.6k|    meth = EC_GF2m_simple_method();
   77|       |
   78|  19.6k|    ret = ossl_ec_group_new_ex(ossl_bn_get_libctx(ctx), NULL, meth);
   79|  19.6k|    if (ret == NULL)
  ------------------
  |  Branch (79:9): [True: 0, False: 19.6k]
  ------------------
   80|      0|        return NULL;
   81|       |
   82|  19.6k|    if (!EC_GROUP_set_curve(ret, p, a, b, ctx)) {
  ------------------
  |  Branch (82:9): [True: 0, False: 19.6k]
  ------------------
   83|      0|        EC_GROUP_free(ret);
   84|      0|        return NULL;
   85|      0|    }
   86|       |
   87|  19.6k|    return ret;
   88|  19.6k|}

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: 52.8k, False: 50.2k]
  ------------------
   76|  52.8k|        return;
   77|       |
   78|  50.2k|    CRYPTO_DOWN_REF(&r->references, &i);
   79|  50.2k|    REF_PRINT_COUNT("EC_KEY", r);
  ------------------
  |  |  289|  50.2k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  50.2k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  50.2k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  50.2k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|  50.2k|    if (i > 0)
  ------------------
  |  Branch (80:9): [True: 15.9k, False: 34.3k]
  ------------------
   81|  15.9k|        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: 32.2k, False: 2.15k]
  |  Branch (91:21): [True: 0, False: 32.2k]
  ------------------
   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);
  ------------------
  |  |  236|  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);
  ------------------
  |  |  115|  34.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  34.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  34.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|       |
  103|  34.3k|    OPENSSL_clear_free((void *)r, sizeof(EC_KEY));
  ------------------
  |  |  113|  34.3k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  34.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  34.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|  34.3k|}
EC_KEY_up_ref:
  194|  15.9k|{
  195|  15.9k|    int i;
  196|       |
  197|  15.9k|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (197:9): [True: 0, False: 15.9k]
  ------------------
  198|      0|        return 0;
  199|       |
  200|  15.9k|    REF_PRINT_COUNT("EC_KEY", r);
  ------------------
  |  |  289|  15.9k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  15.9k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  15.9k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  15.9k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  201|  15.9k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|  15.9k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 15.9k]
  |  |  ------------------
  ------------------
  202|  15.9k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (202:13): [True: 15.9k, False: 0]
  ------------------
  203|  15.9k|}
ossl_ec_key_get_libctx:
  752|  31.8k|{
  753|  31.8k|    return key->libctx;
  754|  31.8k|}
ossl_ec_key_get0_propq:
  757|  15.9k|{
  758|  15.9k|    return key->propq;
  759|  15.9k|}
ossl_ec_key_set0_libctx:
  762|  15.9k|{
  763|  15.9k|    key->libctx = libctx;
  764|       |    /* Do we need to propagate this to the group? */
  765|  15.9k|}
EC_KEY_get0_group:
  768|  79.6k|{
  769|  79.6k|    return key->group;
  770|  79.6k|}
EC_KEY_set_group:
  773|  32.2k|{
  774|  32.2k|    if (key->meth->set_group != NULL && key->meth->set_group(key, group) == 0)
  ------------------
  |  Branch (774:9): [True: 0, False: 32.2k]
  |  Branch (774:41): [True: 0, False: 0]
  ------------------
  775|      0|        return 0;
  776|  32.2k|    EC_GROUP_free(key->group);
  777|  32.2k|    key->group = EC_GROUP_dup(group);
  778|  32.2k|    if (key->group != NULL && EC_GROUP_get_curve_name(key->group) == NID_sm2)
  ------------------
  |  | 1232|  32.2k|#define NID_sm2         1172
  ------------------
  |  Branch (778:9): [True: 32.2k, False: 0]
  |  Branch (778:31): [True: 0, False: 32.2k]
  ------------------
  779|      0|        EC_KEY_set_flags(key, EC_FLAG_SM2_RANGE);
  ------------------
  |  |  962|      0|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
  780|       |
  781|  32.2k|    key->dirty_cnt++;
  782|  32.2k|    return (key->group == NULL) ? 0 : 1;
  ------------------
  |  Branch (782:12): [True: 0, False: 32.2k]
  ------------------
  783|  32.2k|}
EC_KEY_get0_private_key:
  786|  15.9k|{
  787|  15.9k|    return key->priv_key;
  788|  15.9k|}
EC_KEY_get0_public_key:
  886|  15.9k|{
  887|  15.9k|    return key->pub_key;
  888|  15.9k|}
EC_KEY_get_enc_flags:
  902|  15.9k|{
  903|  15.9k|    return key->enc_flag;
  904|  15.9k|}
EC_KEY_get_conv_form:
  912|  15.9k|{
  913|  15.9k|    return key->conv_form;
  914|  15.9k|}
EC_KEY_get_flags:
  939|  47.7k|{
  940|  47.7k|    return key->flags;
  941|  47.7k|}
EC_KEY_oct2key:
  972|  32.2k|{
  973|  32.2k|    if (key == NULL || key->group == NULL)
  ------------------
  |  Branch (973:9): [True: 0, False: 32.2k]
  |  Branch (973:24): [True: 0, False: 32.2k]
  ------------------
  974|      0|        return 0;
  975|  32.2k|    if (key->pub_key == NULL)
  ------------------
  |  Branch (975:9): [True: 32.2k, False: 0]
  ------------------
  976|  32.2k|        key->pub_key = EC_POINT_new(key->group);
  977|  32.2k|    if (key->pub_key == NULL)
  ------------------
  |  Branch (977:9): [True: 0, False: 32.2k]
  ------------------
  978|      0|        return 0;
  979|  32.2k|    if (EC_POINT_oct2point(key->group, key->pub_key, buf, len, ctx) == 0)
  ------------------
  |  Branch (979:9): [True: 16.2k, False: 15.9k]
  ------------------
  980|  16.2k|        return 0;
  981|  15.9k|    key->dirty_cnt++;
  982|       |    /*
  983|       |     * Save the point conversion form.
  984|       |     * For non-custom curves the first octet of the buffer (excluding
  985|       |     * the last significant bit) contains the point conversion form.
  986|       |     * EC_POINT_oct2point() has already performed sanity checking of
  987|       |     * the buffer so we know it is valid.
  988|       |     */
  989|  15.9k|    if ((key->group->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0)
  ------------------
  |  |   29|  15.9k|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (989:9): [True: 15.9k, False: 0]
  ------------------
  990|  15.9k|        key->conv_form = (point_conversion_form_t)(buf[0] & ~0x01);
  991|  15.9k|    return 1;
  992|  32.2k|}

EC_KEY_OpenSSL:
   41|  15.9k|{
   42|  15.9k|    return &openssl_ec_key_method;
   43|  15.9k|}
EC_KEY_get_default_method:
   46|  34.3k|{
   47|  34.3k|    return default_ec_key_meth;
   48|  34.3k|}
EC_KEY_get_method:
   59|  15.9k|{
   60|  15.9k|    return key->meth;
   61|  15.9k|}
ossl_ec_key_new_method_int:
   83|  34.3k|{
   84|  34.3k|    EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  34.3k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  34.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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)) {
  ------------------
  |  |  236|  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  64.4k|{
   32|  64.4k|    EC_GROUP *ret;
   33|       |
   34|  64.4k|    if (meth == NULL) {
  ------------------
  |  Branch (34:9): [True: 0, False: 64.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   36|      0|        return NULL;
   37|      0|    }
   38|  64.4k|    if (meth->group_init == 0) {
  ------------------
  |  Branch (38:9): [True: 0, False: 64.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   40|      0|        return NULL;
   41|      0|    }
   42|       |
   43|  64.4k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  64.4k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  64.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  64.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|  64.4k|    if (ret == NULL)
  ------------------
  |  Branch (44:9): [True: 0, False: 64.4k]
  ------------------
   45|      0|        return NULL;
   46|       |
   47|  64.4k|    ret->libctx = libctx;
   48|  64.4k|    if (propq != NULL) {
  ------------------
  |  Branch (48:9): [True: 0, False: 64.4k]
  ------------------
   49|      0|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|  64.4k|    ret->meth = meth;
   54|  64.4k|    if ((ret->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
  ------------------
  |  |   29|  64.4k|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (54:9): [True: 64.4k, False: 0]
  ------------------
   55|  64.4k|        ret->order = BN_new();
   56|  64.4k|        if (ret->order == NULL)
  ------------------
  |  Branch (56:13): [True: 0, False: 64.4k]
  ------------------
   57|      0|            goto err;
   58|  64.4k|        ret->cofactor = BN_new();
   59|  64.4k|        if (ret->cofactor == NULL)
  ------------------
  |  Branch (59:13): [True: 0, False: 64.4k]
  ------------------
   60|      0|            goto err;
   61|  64.4k|    }
   62|  64.4k|    ret->asn1_flag = OPENSSL_EC_EXPLICIT_CURVE;
  ------------------
  |  |   30|  64.4k|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
   63|  64.4k|    ret->asn1_form = POINT_CONVERSION_UNCOMPRESSED;
   64|  64.4k|    if (!meth->group_init(ret))
  ------------------
  |  Branch (64:9): [True: 0, False: 64.4k]
  ------------------
   65|      0|        goto err;
   66|  64.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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   72|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|      0|    return NULL;
   74|  64.4k|}
EC_pre_comp_free:
   86|  64.4k|{
   87|  64.4k|    switch (group->pre_comp_type) {
  ------------------
  |  Branch (87:13): [True: 0, False: 64.4k]
  ------------------
   88|  64.4k|    case PCT_none:
  ------------------
  |  Branch (88:5): [True: 64.4k, False: 0]
  ------------------
   89|  64.4k|        break;
   90|      0|    case PCT_nistz256:
  ------------------
  |  Branch (90:5): [True: 0, False: 64.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: 64.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: 64.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: 64.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: 64.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: 64.4k]
  ------------------
  116|      0|        EC_ec_pre_comp_free(group->pre_comp.ec);
  117|      0|        break;
  118|  64.4k|    }
  119|  64.4k|    group->pre_comp.ec = NULL;
  120|  64.4k|}
EC_GROUP_free:
  123|   101k|{
  124|   101k|    if (!group)
  ------------------
  |  Branch (124:9): [True: 36.9k, False: 64.4k]
  ------------------
  125|  36.9k|        return;
  126|       |
  127|  64.4k|    if (group->meth->group_finish != 0)
  ------------------
  |  Branch (127:9): [True: 64.4k, False: 0]
  ------------------
  128|  64.4k|        group->meth->group_finish(group);
  129|       |
  130|  64.4k|    EC_pre_comp_free(group);
  131|  64.4k|    BN_MONT_CTX_free(group->mont_data);
  132|  64.4k|    EC_POINT_free(group->generator);
  133|  64.4k|    BN_free(group->order);
  134|  64.4k|    BN_free(group->cofactor);
  135|  64.4k|    OPENSSL_free(group->seed);
  ------------------
  |  |  115|  64.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  64.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  64.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|  64.4k|    OPENSSL_free(group->propq);
  ------------------
  |  |  115|  64.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  64.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  64.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|  64.4k|    OPENSSL_free(group);
  ------------------
  |  |  115|  64.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  64.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  64.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  138|  64.4k|}
EC_GROUP_copy:
  162|  32.2k|{
  163|  32.2k|    if (dest->meth->group_copy == 0) {
  ------------------
  |  Branch (163:9): [True: 0, False: 32.2k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  165|      0|        return 0;
  166|      0|    }
  167|  32.2k|    if (dest->meth != src->meth) {
  ------------------
  |  Branch (167:9): [True: 0, False: 32.2k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  169|      0|        return 0;
  170|      0|    }
  171|  32.2k|    if (dest == src)
  ------------------
  |  Branch (171:9): [True: 0, False: 32.2k]
  ------------------
  172|      0|        return 1;
  173|       |
  174|  32.2k|    dest->libctx = src->libctx;
  175|  32.2k|    dest->curve_name = src->curve_name;
  176|       |
  177|       |    /* Copy precomputed */
  178|  32.2k|    dest->pre_comp_type = src->pre_comp_type;
  179|  32.2k|    switch (src->pre_comp_type) {
  ------------------
  |  Branch (179:13): [True: 0, False: 32.2k]
  ------------------
  180|  32.2k|    case PCT_none:
  ------------------
  |  Branch (180:5): [True: 32.2k, False: 0]
  ------------------
  181|  32.2k|        dest->pre_comp.ec = NULL;
  182|  32.2k|        break;
  183|      0|    case PCT_nistz256:
  ------------------
  |  Branch (183:5): [True: 0, False: 32.2k]
  ------------------
  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: 32.2k]
  ------------------
  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: 32.2k]
  ------------------
  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: 32.2k]
  ------------------
  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: 32.2k]
  ------------------
  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: 32.2k]
  ------------------
  209|      0|        dest->pre_comp.ec = EC_ec_pre_comp_dup(src->pre_comp.ec);
  210|      0|        break;
  211|  32.2k|    }
  212|       |
  213|  32.2k|    if (src->mont_data != NULL) {
  ------------------
  |  Branch (213:9): [True: 32.2k, False: 0]
  ------------------
  214|  32.2k|        if (dest->mont_data == NULL) {
  ------------------
  |  Branch (214:13): [True: 32.2k, False: 0]
  ------------------
  215|  32.2k|            dest->mont_data = BN_MONT_CTX_new();
  216|  32.2k|            if (dest->mont_data == NULL)
  ------------------
  |  Branch (216:17): [True: 0, False: 32.2k]
  ------------------
  217|      0|                return 0;
  218|  32.2k|        }
  219|  32.2k|        if (!BN_MONT_CTX_copy(dest->mont_data, src->mont_data))
  ------------------
  |  Branch (219:13): [True: 0, False: 32.2k]
  ------------------
  220|      0|            return 0;
  221|  32.2k|    } else {
  222|       |        /* src->generator == NULL */
  223|      0|        BN_MONT_CTX_free(dest->mont_data);
  224|      0|        dest->mont_data = NULL;
  225|      0|    }
  226|       |
  227|  32.2k|    if (src->generator != NULL) {
  ------------------
  |  Branch (227:9): [True: 32.2k, False: 0]
  ------------------
  228|  32.2k|        if (dest->generator == NULL) {
  ------------------
  |  Branch (228:13): [True: 32.2k, False: 0]
  ------------------
  229|  32.2k|            dest->generator = EC_POINT_new(dest);
  230|  32.2k|            if (dest->generator == NULL)
  ------------------
  |  Branch (230:17): [True: 0, False: 32.2k]
  ------------------
  231|      0|                return 0;
  232|  32.2k|        }
  233|  32.2k|        if (!EC_POINT_copy(dest->generator, src->generator))
  ------------------
  |  Branch (233:13): [True: 0, False: 32.2k]
  ------------------
  234|      0|            return 0;
  235|  32.2k|    } else {
  236|       |        /* src->generator == NULL */
  237|      0|        EC_POINT_clear_free(dest->generator);
  238|      0|        dest->generator = NULL;
  239|      0|    }
  240|       |
  241|  32.2k|    if ((src->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
  ------------------
  |  |   29|  32.2k|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (241:9): [True: 32.2k, False: 0]
  ------------------
  242|  32.2k|        if (!BN_copy(dest->order, src->order))
  ------------------
  |  Branch (242:13): [True: 0, False: 32.2k]
  ------------------
  243|      0|            return 0;
  244|  32.2k|        if (!BN_copy(dest->cofactor, src->cofactor))
  ------------------
  |  Branch (244:13): [True: 0, False: 32.2k]
  ------------------
  245|      0|            return 0;
  246|  32.2k|    }
  247|       |
  248|  32.2k|    dest->asn1_flag = src->asn1_flag;
  249|  32.2k|    dest->asn1_form = src->asn1_form;
  250|  32.2k|    dest->decoded_from_explicit_params = src->decoded_from_explicit_params;
  251|       |
  252|  32.2k|    if (src->seed) {
  ------------------
  |  Branch (252:9): [True: 19.5k, False: 12.6k]
  ------------------
  253|  19.5k|        OPENSSL_free(dest->seed);
  ------------------
  |  |  115|  19.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  19.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  19.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  254|  19.5k|        if ((dest->seed = OPENSSL_malloc(src->seed_len)) == NULL)
  ------------------
  |  |  102|  19.5k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  19.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  19.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (254:13): [True: 0, False: 19.5k]
  ------------------
  255|      0|            return 0;
  256|  19.5k|        if (!memcpy(dest->seed, src->seed, src->seed_len))
  ------------------
  |  Branch (256:13): [True: 0, False: 19.5k]
  ------------------
  257|      0|            return 0;
  258|  19.5k|        dest->seed_len = src->seed_len;
  259|  19.5k|    } else {
  260|  12.6k|        OPENSSL_free(dest->seed);
  ------------------
  |  |  115|  12.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  12.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  12.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|  12.6k|        dest->seed = NULL;
  262|  12.6k|        dest->seed_len = 0;
  263|  12.6k|    }
  264|       |
  265|  32.2k|    return dest->meth->group_copy(dest, src);
  266|  32.2k|}
EC_GROUP_dup:
  269|  32.2k|{
  270|  32.2k|    EC_GROUP *t = NULL;
  271|  32.2k|    int ok = 0;
  272|       |
  273|  32.2k|    if (a == NULL)
  ------------------
  |  Branch (273:9): [True: 0, False: 32.2k]
  ------------------
  274|      0|        return NULL;
  275|       |
  276|  32.2k|    if ((t = ossl_ec_group_new_ex(a->libctx, a->propq, a->meth)) == NULL)
  ------------------
  |  Branch (276:9): [True: 0, False: 32.2k]
  ------------------
  277|      0|        return NULL;
  278|  32.2k|    if (!EC_GROUP_copy(t, a))
  ------------------
  |  Branch (278:9): [True: 0, False: 32.2k]
  ------------------
  279|      0|        goto err;
  280|       |
  281|  32.2k|    ok = 1;
  282|       |
  283|  32.2k| err:
  284|  32.2k|    if (!ok) {
  ------------------
  |  Branch (284:9): [True: 0, False: 32.2k]
  ------------------
  285|      0|        EC_GROUP_free(t);
  286|      0|        return NULL;
  287|      0|    }
  288|  32.2k|        return t;
  289|  32.2k|}
EC_GROUP_set_generator:
  368|  32.1k|{
  369|  32.1k|    if (generator == NULL) {
  ------------------
  |  Branch (369:9): [True: 0, False: 32.1k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  371|      0|        return 0;
  372|      0|    }
  373|       |
  374|       |    /* require group->field >= 1 */
  375|  32.1k|    if (group->field == NULL || BN_is_zero(group->field)
  ------------------
  |  Branch (375:9): [True: 0, False: 32.1k]
  |  Branch (375:33): [True: 0, False: 32.1k]
  ------------------
  376|  32.1k|        || BN_is_negative(group->field)) {
  ------------------
  |  Branch (376:12): [True: 0, False: 32.1k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  32.1k|    if (order == NULL || BN_is_zero(order) || BN_is_negative(order)
  ------------------
  |  Branch (386:9): [True: 0, False: 32.1k]
  |  Branch (386:26): [True: 0, False: 32.1k]
  |  Branch (386:47): [True: 0, False: 32.1k]
  ------------------
  387|  32.1k|        || BN_num_bits(order) > BN_num_bits(group->field) + 1) {
  ------------------
  |  Branch (387:12): [True: 0, False: 32.1k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  32.1k|    if (cofactor != NULL && BN_is_negative(cofactor)) {
  ------------------
  |  Branch (397:9): [True: 32.1k, False: 0]
  |  Branch (397:29): [True: 0, False: 32.1k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  399|      0|        return 0;
  400|      0|    }
  401|       |
  402|  32.1k|    if (group->generator == NULL) {
  ------------------
  |  Branch (402:9): [True: 32.1k, False: 0]
  ------------------
  403|  32.1k|        group->generator = EC_POINT_new(group);
  404|  32.1k|        if (group->generator == NULL)
  ------------------
  |  Branch (404:13): [True: 0, False: 32.1k]
  ------------------
  405|      0|            return 0;
  406|  32.1k|    }
  407|  32.1k|    if (!EC_POINT_copy(group->generator, generator))
  ------------------
  |  Branch (407:9): [True: 0, False: 32.1k]
  ------------------
  408|      0|        return 0;
  409|       |
  410|  32.1k|    if (!BN_copy(group->order, order))
  ------------------
  |  Branch (410:9): [True: 0, False: 32.1k]
  ------------------
  411|      0|        return 0;
  412|       |
  413|       |    /* Either take the provided positive cofactor, or try to compute it */
  414|  32.1k|    if (cofactor != NULL && !BN_is_zero(cofactor)) {
  ------------------
  |  Branch (414:9): [True: 32.1k, False: 0]
  |  Branch (414:29): [True: 32.1k, False: 0]
  ------------------
  415|  32.1k|        if (!BN_copy(group->cofactor, cofactor))
  ------------------
  |  Branch (415:13): [True: 0, False: 32.1k]
  ------------------
  416|      0|            return 0;
  417|  32.1k|    } 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|  32.1k|    if (BN_is_odd(group->order)) {
  ------------------
  |  Branch (427:9): [True: 32.1k, False: 0]
  ------------------
  428|  32.1k|        return ec_precompute_mont_data(group);
  429|  32.1k|    }
  430|       |
  431|      0|    BN_MONT_CTX_free(group->mont_data);
  432|      0|    group->mont_data = NULL;
  433|      0|    return 1;
  434|  32.1k|}
EC_GROUP_get0_order:
  457|  15.9k|{
  458|  15.9k|    return group->order;
  459|  15.9k|}
EC_GROUP_order_bits:
  462|  31.8k|{
  463|  31.8k|    return group->meth->group_order_bits(group);
  464|  31.8k|}
EC_GROUP_set_curve_name:
  484|  32.2k|{
  485|  32.2k|    group->curve_name = nid;
  486|  32.2k|    group->asn1_flag =
  487|  32.2k|        (nid != NID_undef)
  ------------------
  |  |   18|  32.2k|#define NID_undef                       0
  ------------------
  |  Branch (487:9): [True: 32.2k, False: 0]
  ------------------
  488|  32.2k|        ? OPENSSL_EC_NAMED_CURVE
  ------------------
  |  |   31|  32.2k|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  489|  32.2k|        : OPENSSL_EC_EXPLICIT_CURVE;
  ------------------
  |  |   30|  32.2k|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
  490|  32.2k|}
EC_GROUP_get_curve_name:
  493|  79.9k|{
  494|  79.9k|    return group->curve_name;
  495|  79.9k|}
EC_GROUP_get_field_type:
  503|  52.8k|{
  504|  52.8k|    return group->meth->field_type;
  505|  52.8k|}
EC_GROUP_set_asn1_flag:
  508|  32.2k|{
  509|  32.2k|    group->asn1_flag = flag;
  510|  32.2k|}
EC_GROUP_get_asn1_flag:
  513|  48.1k|{
  514|  48.1k|    return group->asn1_flag;
  515|  48.1k|}
EC_GROUP_get_point_conversion_form:
  525|  15.9k|{
  526|  15.9k|    return group->asn1_form;
  527|  15.9k|}
EC_GROUP_set_seed:
  530|  19.5k|{
  531|  19.5k|    OPENSSL_free(group->seed);
  ------------------
  |  |  115|  19.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  19.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  19.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  532|  19.5k|    group->seed = NULL;
  533|  19.5k|    group->seed_len = 0;
  534|       |
  535|  19.5k|    if (!len || !p)
  ------------------
  |  Branch (535:9): [True: 0, False: 19.5k]
  |  Branch (535:17): [True: 0, False: 19.5k]
  ------------------
  536|      0|        return 1;
  537|       |
  538|  19.5k|    if ((group->seed = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  102|  19.5k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  19.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  19.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (538:9): [True: 0, False: 19.5k]
  ------------------
  539|      0|        return 0;
  540|  19.5k|    memcpy(group->seed, p, len);
  541|  19.5k|    group->seed_len = len;
  542|       |
  543|  19.5k|    return len;
  544|  19.5k|}
EC_GROUP_set_curve:
  558|  27.0k|{
  559|  27.0k|    if (group->meth->group_set_curve == 0) {
  ------------------
  |  Branch (559:9): [True: 0, False: 27.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  561|      0|        return 0;
  562|      0|    }
  563|  27.0k|    return group->meth->group_set_curve(group, p, a, b, ctx);
  564|  27.0k|}
EC_GROUP_get_degree:
  605|  29.4k|{
  606|  29.4k|    if (group->meth->group_get_degree == 0) {
  ------------------
  |  Branch (606:9): [True: 0, False: 29.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  608|      0|        return 0;
  609|      0|    }
  610|  29.4k|    return group->meth->group_get_degree(group);
  611|  29.4k|}
EC_POINT_new:
  717|   128k|{
  718|   128k|    EC_POINT *ret;
  719|       |
  720|   128k|    if (group == NULL) {
  ------------------
  |  Branch (720:9): [True: 0, False: 128k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  722|      0|        return NULL;
  723|      0|    }
  724|   128k|    if (group->meth->point_init == NULL) {
  ------------------
  |  Branch (724:9): [True: 0, False: 128k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  726|      0|        return NULL;
  727|      0|    }
  728|       |
  729|   128k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|   128k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   128k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   128k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  730|   128k|    if (ret == NULL)
  ------------------
  |  Branch (730:9): [True: 0, False: 128k]
  ------------------
  731|      0|        return NULL;
  732|       |
  733|   128k|    ret->meth = group->meth;
  734|   128k|    ret->curve_name = group->curve_name;
  735|       |
  736|   128k|    if (!ret->meth->point_init(ret)) {
  ------------------
  |  Branch (736:9): [True: 0, False: 128k]
  ------------------
  737|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  738|      0|        return NULL;
  739|      0|    }
  740|       |
  741|   128k|    return ret;
  742|   128k|}
EC_POINT_free:
  745|   130k|{
  746|   130k|    if (point == NULL)
  ------------------
  |  Branch (746:9): [True: 2.15k, False: 128k]
  ------------------
  747|  2.15k|        return;
  748|       |
  749|       |#ifdef FIPS_MODULE
  750|       |    EC_POINT_clear_free(point);
  751|       |#else
  752|   128k|    if (point->meth->point_finish != 0)
  ------------------
  |  Branch (752:9): [True: 128k, False: 0]
  ------------------
  753|   128k|        point->meth->point_finish(point);
  754|   128k|    OPENSSL_free(point);
  ------------------
  |  |  115|   128k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   128k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   128k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  755|   128k|#endif
  756|   128k|}
EC_POINT_copy:
  771|  64.4k|{
  772|  64.4k|    if (dest->meth->point_copy == 0) {
  ------------------
  |  Branch (772:9): [True: 0, False: 64.4k]
  ------------------
  773|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  774|      0|        return 0;
  775|      0|    }
  776|  64.4k|    if (dest->meth != src->meth
  ------------------
  |  Branch (776:9): [True: 0, False: 64.4k]
  ------------------
  777|  64.4k|            || (dest->curve_name != src->curve_name
  ------------------
  |  Branch (777:17): [True: 24, False: 64.3k]
  ------------------
  778|  64.4k|                 && dest->curve_name != 0
  ------------------
  |  Branch (778:21): [True: 24, False: 0]
  ------------------
  779|  64.4k|                 && src->curve_name != 0)) {
  ------------------
  |  Branch (779:21): [True: 0, False: 24]
  ------------------
  780|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  781|      0|        return 0;
  782|      0|    }
  783|  64.4k|    if (dest == src)
  ------------------
  |  Branch (783:9): [True: 0, False: 64.4k]
  ------------------
  784|      0|        return 1;
  785|  64.4k|    return dest->meth->point_copy(dest, src);
  786|  64.4k|}
EC_POINT_set_to_infinity:
  815|    328|{
  816|    328|    if (group->meth->point_set_to_infinity == 0) {
  ------------------
  |  Branch (816:9): [True: 0, False: 328]
  ------------------
  817|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  818|      0|        return 0;
  819|      0|    }
  820|    328|    if (group->meth != point->meth) {
  ------------------
  |  Branch (820:9): [True: 0, False: 328]
  ------------------
  821|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  822|      0|        return 0;
  823|      0|    }
  824|    328|    return group->meth->point_set_to_infinity(group, point);
  825|    328|}
EC_POINT_set_Jprojective_coordinates_GFp:
  832|  18.6k|{
  833|  18.6k|    if (group->meth->field_type != NID_X9_62_prime_field) {
  ------------------
  |  |  152|  18.6k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (833:9): [True: 0, False: 18.6k]
  ------------------
  834|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  835|      0|        return 0;
  836|      0|    }
  837|  18.6k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (837:9): [True: 0, False: 18.6k]
  ------------------
  838|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  839|      0|        return 0;
  840|      0|    }
  841|  18.6k|    return ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group, point,
  842|  18.6k|                                                              x, y, z, ctx);
  843|  18.6k|}
EC_POINT_set_affine_coordinates:
  866|  50.2k|{
  867|  50.2k|    if (group->meth->point_set_affine_coordinates == NULL) {
  ------------------
  |  Branch (867:9): [True: 0, False: 50.2k]
  ------------------
  868|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  869|      0|        return 0;
  870|      0|    }
  871|  50.2k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (871:9): [True: 0, False: 50.2k]
  ------------------
  872|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  873|      0|        return 0;
  874|      0|    }
  875|  50.2k|    if (!group->meth->point_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (875:9): [True: 0, False: 50.2k]
  ------------------
  876|      0|        return 0;
  877|       |
  878|  50.2k|    if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
  ------------------
  |  Branch (878:9): [True: 2.41k, False: 47.8k]
  ------------------
  879|  2.41k|        ERR_raise(ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE);
  ------------------
  |  |  401|  2.41k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.41k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.41k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.41k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.41k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  2.41k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.41k|     ERR_set_error)
  |  |  ------------------
  ------------------
  880|  2.41k|        return 0;
  881|  2.41k|    }
  882|  47.8k|    return 1;
  883|  50.2k|}
EC_POINT_is_at_infinity:
  983|  50.2k|{
  984|  50.2k|    if (group->meth->is_at_infinity == 0) {
  ------------------
  |  Branch (984:9): [True: 0, False: 50.2k]
  ------------------
  985|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  986|      0|        return 0;
  987|      0|    }
  988|  50.2k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (988:9): [True: 0, False: 50.2k]
  ------------------
  989|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  990|      0|        return 0;
  991|      0|    }
  992|  50.2k|    return group->meth->is_at_infinity(group, point);
  993|  50.2k|}
EC_POINT_is_on_curve:
 1004|  50.2k|{
 1005|  50.2k|    if (group->meth->is_on_curve == 0) {
  ------------------
  |  Branch (1005:9): [True: 0, False: 50.2k]
  ------------------
 1006|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1007|      0|        return 0;
 1008|      0|    }
 1009|  50.2k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (1009:9): [True: 0, False: 50.2k]
  ------------------
 1010|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1011|      0|        return 0;
 1012|      0|    }
 1013|  50.2k|    return group->meth->is_on_curve(group, point, ctx);
 1014|  50.2k|}
ossl_ec_group_simple_order_bits:
 1230|  31.8k|{
 1231|  31.8k|    if (group->order == NULL)
  ------------------
  |  Branch (1231:9): [True: 0, False: 31.8k]
  ------------------
 1232|      0|        return 0;
 1233|  31.8k|    return BN_num_bits(group->order);
 1234|  31.8k|}
EC_GROUP_get_basis_type:
 1326|  10.4k|{
 1327|  10.4k|    int i;
 1328|       |
 1329|  10.4k|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field)
  ------------------
  |  |  156|  10.4k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1329:9): [True: 0, False: 10.4k]
  ------------------
 1330|       |        /* everything else is currently not supported */
 1331|      0|        return 0;
 1332|       |
 1333|       |    /* Find the last non-zero element of group->poly[] */
 1334|  10.4k|    for (i = 0;
 1335|  50.2k|         i < (int)OSSL_NELEM(group->poly) && group->poly[i] != 0;
  ------------------
  |  |   14|   100k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1335:10): [True: 50.2k, False: 0]
  |  Branch (1335:46): [True: 39.7k, False: 10.4k]
  ------------------
 1336|  39.7k|         i++)
 1337|  39.7k|        continue;
 1338|       |
 1339|  10.4k|    if (i == 4)
  ------------------
  |  Branch (1339:9): [True: 9.40k, False: 1.08k]
  ------------------
 1340|  9.40k|        return NID_X9_62_ppBasis;
  ------------------
  |  |  172|  9.40k|#define NID_X9_62_ppBasis               683
  ------------------
 1341|  1.08k|    else if (i == 2)
  ------------------
  |  Branch (1341:14): [True: 1.08k, False: 0]
  ------------------
 1342|  1.08k|        return NID_X9_62_tpBasis;
  ------------------
  |  |  168|  1.08k|#define NID_X9_62_tpBasis               682
  ------------------
 1343|      0|    else
 1344|       |        /* everything else is currently not supported */
 1345|      0|        return 0;
 1346|  10.4k|}
EC_GROUP_get_trinomial_basis:
 1350|  1.08k|{
 1351|  1.08k|    if (group == NULL)
  ------------------
  |  Branch (1351:9): [True: 0, False: 1.08k]
  ------------------
 1352|      0|        return 0;
 1353|       |
 1354|  1.08k|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field
  ------------------
  |  |  156|  2.17k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1354:9): [True: 0, False: 1.08k]
  ------------------
 1355|  1.08k|        || !((group->poly[0] != 0) && (group->poly[1] != 0)
  ------------------
  |  Branch (1355:14): [True: 1.08k, False: 0]
  |  Branch (1355:39): [True: 1.08k, False: 0]
  ------------------
 1356|  1.08k|             && (group->poly[2] == 0))) {
  ------------------
  |  Branch (1356:17): [True: 1.08k, False: 0]
  ------------------
 1357|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1358|      0|        return 0;
 1359|      0|    }
 1360|       |
 1361|  1.08k|    if (k)
  ------------------
  |  Branch (1361:9): [True: 1.08k, False: 0]
  ------------------
 1362|  1.08k|        *k = group->poly[1];
 1363|       |
 1364|  1.08k|    return 1;
 1365|  1.08k|}
EC_GROUP_get_pentanomial_basis:
 1369|  9.40k|{
 1370|  9.40k|    if (group == NULL)
  ------------------
  |  Branch (1370:9): [True: 0, False: 9.40k]
  ------------------
 1371|      0|        return 0;
 1372|       |
 1373|  9.40k|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field
  ------------------
  |  |  156|  18.8k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1373:9): [True: 0, False: 9.40k]
  ------------------
 1374|  9.40k|        || !((group->poly[0] != 0) && (group->poly[1] != 0)
  ------------------
  |  Branch (1374:14): [True: 9.40k, False: 0]
  |  Branch (1374:39): [True: 9.40k, False: 0]
  ------------------
 1375|  9.40k|             && (group->poly[2] != 0) && (group->poly[3] != 0)
  ------------------
  |  Branch (1375:17): [True: 9.40k, False: 0]
  |  Branch (1375:42): [True: 9.40k, False: 0]
  ------------------
 1376|  9.40k|             && (group->poly[4] == 0))) {
  ------------------
  |  Branch (1376:17): [True: 9.40k, False: 0]
  ------------------
 1377|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1378|      0|        return 0;
 1379|      0|    }
 1380|       |
 1381|  9.40k|    if (k1)
  ------------------
  |  Branch (1381:9): [True: 9.40k, False: 0]
  ------------------
 1382|  9.40k|        *k1 = group->poly[3];
 1383|  9.40k|    if (k2)
  ------------------
  |  Branch (1383:9): [True: 9.40k, False: 0]
  ------------------
 1384|  9.40k|        *k2 = group->poly[2];
 1385|  9.40k|    if (k3)
  ------------------
  |  Branch (1385:9): [True: 9.40k, False: 0]
  ------------------
 1386|  9.40k|        *k3 = group->poly[1];
 1387|       |
 1388|  9.40k|    return 1;
 1389|  9.40k|}
ec_lib.c:ec_precompute_mont_data:
 1189|  32.1k|{
 1190|  32.1k|    BN_CTX *ctx = BN_CTX_new_ex(group->libctx);
 1191|  32.1k|    int ret = 0;
 1192|       |
 1193|  32.1k|    BN_MONT_CTX_free(group->mont_data);
 1194|  32.1k|    group->mont_data = NULL;
 1195|       |
 1196|  32.1k|    if (ctx == NULL)
  ------------------
  |  Branch (1196:9): [True: 0, False: 32.1k]
  ------------------
 1197|      0|        goto err;
 1198|       |
 1199|  32.1k|    group->mont_data = BN_MONT_CTX_new();
 1200|  32.1k|    if (group->mont_data == NULL)
  ------------------
  |  Branch (1200:9): [True: 0, False: 32.1k]
  ------------------
 1201|      0|        goto err;
 1202|       |
 1203|  32.1k|    if (!BN_MONT_CTX_set(group->mont_data, group->order, ctx)) {
  ------------------
  |  Branch (1203:9): [True: 0, False: 32.1k]
  ------------------
 1204|      0|        BN_MONT_CTX_free(group->mont_data);
 1205|      0|        group->mont_data = NULL;
 1206|      0|        goto err;
 1207|      0|    }
 1208|       |
 1209|  32.1k|    ret = 1;
 1210|       |
 1211|  32.1k| err:
 1212|       |
 1213|  32.1k|    BN_CTX_free(ctx);
 1214|  32.1k|    return ret;
 1215|  32.1k|}

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

EC_POINT_set_compressed_coordinates:
   26|  22.3k|{
   27|  22.3k|    if (group->meth->point_set_compressed_coordinates == NULL
  ------------------
  |  Branch (27:9): [True: 22.3k, False: 0]
  ------------------
   28|  22.3k|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|  22.3k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (28:12): [True: 0, False: 22.3k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   30|      0|        return 0;
   31|      0|    }
   32|  22.3k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (32:9): [True: 0, False: 22.3k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   34|      0|        return 0;
   35|      0|    }
   36|  22.3k|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|  22.3k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (36:9): [True: 22.3k, False: 0]
  ------------------
   37|  22.3k|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|  22.3k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (37:13): [True: 9.42k, False: 12.9k]
  ------------------
   38|  9.42k|            return ossl_ec_GFp_simple_set_compressed_coordinates(group, point, x,
   39|  9.42k|                                                                 y_bit, ctx);
   40|  12.9k|        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|  12.9k|            return ossl_ec_GF2m_simple_set_compressed_coordinates(group, point,
   48|  12.9k|                                                                  x, y_bit, ctx);
   49|  22.3k|#endif
   50|  22.3k|    }
   51|      0|    return group->meth->point_set_compressed_coordinates(group, point, x,
   52|      0|                                                         y_bit, ctx);
   53|  22.3k|}
EC_POINT_oct2point:
  107|  32.2k|{
  108|  32.2k|    if (group->meth->oct2point == 0
  ------------------
  |  Branch (108:9): [True: 32.2k, False: 0]
  ------------------
  109|  32.2k|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|  32.2k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (109:12): [True: 0, False: 32.2k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  111|      0|        return 0;
  112|      0|    }
  113|  32.2k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (113:9): [True: 0, False: 32.2k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  115|      0|        return 0;
  116|      0|    }
  117|  32.2k|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|  32.2k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (117:9): [True: 32.2k, False: 0]
  ------------------
  118|  32.2k|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|  32.2k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (118:13): [True: 12.5k, False: 19.6k]
  ------------------
  119|  12.5k|            return ossl_ec_GFp_simple_oct2point(group, point, buf, len, ctx);
  120|  19.6k|        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|  19.6k|            return ossl_ec_GF2m_simple_oct2point(group, point, buf, len, ctx);
  128|  32.2k|#endif
  129|  32.2k|    }
  130|      0|    return group->meth->oct2point(group, point, buf, len, ctx);
  131|  32.2k|}

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

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

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

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

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

EC_GFp_nistz256_method:
 1574|     24|{
 1575|     24|    static const EC_METHOD ret = {
 1576|     24|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|     24|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
 1577|     24|        NID_X9_62_prime_field,
  ------------------
  |  |  152|     24|#define NID_X9_62_prime_field           406
  ------------------
 1578|     24|        ossl_ec_GFp_mont_group_init,
 1579|     24|        ossl_ec_GFp_mont_group_finish,
 1580|     24|        ossl_ec_GFp_mont_group_clear_finish,
 1581|     24|        ossl_ec_GFp_mont_group_copy,
 1582|     24|        ossl_ec_GFp_mont_group_set_curve,
 1583|     24|        ossl_ec_GFp_simple_group_get_curve,
 1584|     24|        ossl_ec_GFp_simple_group_get_degree,
 1585|     24|        ossl_ec_group_simple_order_bits,
 1586|     24|        ossl_ec_GFp_simple_group_check_discriminant,
 1587|     24|        ossl_ec_GFp_simple_point_init,
 1588|     24|        ossl_ec_GFp_simple_point_finish,
 1589|     24|        ossl_ec_GFp_simple_point_clear_finish,
 1590|     24|        ossl_ec_GFp_simple_point_copy,
 1591|     24|        ossl_ec_GFp_simple_point_set_to_infinity,
 1592|     24|        ossl_ec_GFp_simple_point_set_affine_coordinates,
 1593|     24|        ecp_nistz256_get_affine,
 1594|     24|        0, 0, 0,
 1595|     24|        ossl_ec_GFp_simple_add,
 1596|     24|        ossl_ec_GFp_simple_dbl,
 1597|     24|        ossl_ec_GFp_simple_invert,
 1598|     24|        ossl_ec_GFp_simple_is_at_infinity,
 1599|     24|        ossl_ec_GFp_simple_is_on_curve,
 1600|     24|        ossl_ec_GFp_simple_cmp,
 1601|     24|        ossl_ec_GFp_simple_make_affine,
 1602|     24|        ossl_ec_GFp_simple_points_make_affine,
 1603|     24|        ecp_nistz256_points_mul,                    /* mul */
 1604|     24|        ecp_nistz256_mult_precompute,               /* precompute_mult */
 1605|     24|        ecp_nistz256_window_have_precompute_mult,   /* have_precompute_mult */
 1606|     24|        ossl_ec_GFp_mont_field_mul,
 1607|     24|        ossl_ec_GFp_mont_field_sqr,
 1608|     24|        0,                                          /* field_div */
 1609|     24|        ossl_ec_GFp_mont_field_inv,
 1610|     24|        ossl_ec_GFp_mont_field_encode,
 1611|     24|        ossl_ec_GFp_mont_field_decode,
 1612|     24|        ossl_ec_GFp_mont_field_set_to_one,
 1613|     24|        ossl_ec_key_simple_priv2oct,
 1614|     24|        ossl_ec_key_simple_oct2priv,
 1615|     24|        0, /* set private */
 1616|     24|        ossl_ec_key_simple_generate_key,
 1617|     24|        ossl_ec_key_simple_check_key,
 1618|     24|        ossl_ec_key_simple_generate_public_key,
 1619|     24|        0, /* keycopy */
 1620|     24|        0, /* keyfinish */
 1621|     24|        ossl_ecdh_simple_compute_key,
 1622|     24|        ossl_ecdsa_simple_sign_setup,
 1623|     24|        ossl_ecdsa_simple_sign_sig,
 1624|     24|        ossl_ecdsa_simple_verify_sig,
 1625|     24|        ecp_nistz256_inv_mod_ord,                   /* can be #define-d NULL */
 1626|     24|        0,                                          /* blind_coordinates */
 1627|     24|        0,                                          /* ladder_pre */
 1628|     24|        0,                                          /* ladder_step */
 1629|     24|        0,                                          /* ladder_post */
 1630|     24|        ecp_nistz256group_full_init
 1631|     24|    };
 1632|       |
 1633|     24|    return &ret;
 1634|     24|}
ecp_nistz256.c:ecp_nistz256group_full_init:
 1449|     24|                                       const unsigned char *params) {
 1450|     24|    BN_CTX *ctx = NULL;
 1451|     24|    BN_MONT_CTX *mont = NULL, *ordmont = NULL;
 1452|     24|    const int param_len = 32;
 1453|     24|    const int seed_len = 20;
 1454|     24|    int ok = 0;
 1455|     24|    uint32_t hi_order_n = 0xccd1c8aa;
 1456|     24|    uint32_t lo_order_n = 0xee00bc4f;
 1457|     24|    BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL, *one = NULL,
 1458|     24|        *order = NULL;
 1459|     24|    EC_POINT *P = NULL;
 1460|       |
 1461|     24|    if ((ctx = BN_CTX_new_ex(group->libctx)) == NULL) {
  ------------------
  |  Branch (1461:9): [True: 0, False: 24]
  ------------------
 1462|      0|        ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1463|      0|        return 0;
 1464|      0|    }
 1465|       |
 1466|     24|    if (!EC_GROUP_set_seed(group, params, seed_len)) {
  ------------------
  |  Branch (1466:9): [True: 0, False: 24]
  ------------------
 1467|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1468|      0|        goto err;
 1469|      0|    }
 1470|     24|    params += seed_len;
 1471|       |
 1472|     24|    if ((p = BN_bin2bn(params + 0 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1472:9): [True: 0, False: 24]
  ------------------
 1473|     24|        || (a = BN_bin2bn(params + 1 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1473:12): [True: 0, False: 24]
  ------------------
 1474|     24|        || (b = BN_bin2bn(params + 2 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (1474:12): [True: 0, False: 24]
  ------------------
 1475|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1476|      0|        goto err;
 1477|      0|    }
 1478|       |
 1479|       |    /*
 1480|       |     * Set up curve params and montgomery for field
 1481|       |     * Start by setting up montgomery and one
 1482|       |     */
 1483|     24|    mont = BN_MONT_CTX_new();
 1484|     24|    if (mont == NULL)
  ------------------
  |  Branch (1484:9): [True: 0, False: 24]
  ------------------
 1485|      0|        goto err;
 1486|       |
 1487|     24|    if (!ossl_bn_mont_ctx_set(mont, p, 256, params + 6 * param_len, param_len,
  ------------------
  |  Branch (1487:9): [True: 0, False: 24]
  ------------------
 1488|     24|                              1, 0))
 1489|      0|        goto err;
 1490|       |
 1491|     24|    one = BN_new();
 1492|     24|    if (one == NULL) {
  ------------------
  |  Branch (1492:9): [True: 0, False: 24]
  ------------------
 1493|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1494|      0|        goto err;
 1495|      0|    }
 1496|     24|    if (!BN_to_montgomery(one, BN_value_one(), mont, ctx)){
  ------------------
  |  Branch (1496:9): [True: 0, False: 24]
  ------------------
 1497|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1498|      0|        goto err;
 1499|      0|    }
 1500|     24|    group->field_data1 = mont;
 1501|     24|    mont = NULL;
 1502|     24|    group->field_data2 = one;
 1503|     24|    one = NULL;
 1504|       |
 1505|     24|    if (!ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx)) {
  ------------------
  |  Branch (1505:9): [True: 0, False: 24]
  ------------------
 1506|      0|         ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1507|      0|        goto err;
 1508|      0|    }
 1509|       |
 1510|     24|    if ((P = EC_POINT_new(group)) == NULL) {
  ------------------
  |  Branch (1510:9): [True: 0, False: 24]
  ------------------
 1511|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1512|      0|        goto err;
 1513|      0|    }
 1514|       |
 1515|     24|    if ((x = BN_bin2bn(params + 3 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1515:9): [True: 0, False: 24]
  ------------------
 1516|     24|        || (y = BN_bin2bn(params + 4 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (1516:12): [True: 0, False: 24]
  ------------------
 1517|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1518|      0|        goto err;
 1519|      0|    }
 1520|     24|    if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) {
  ------------------
  |  Branch (1520:9): [True: 0, False: 24]
  ------------------
 1521|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1522|      0|        goto err;
 1523|      0|    }
 1524|     24|    if ((order = BN_bin2bn(params + 5 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1524:9): [True: 0, False: 24]
  ------------------
 1525|     24|        || !BN_set_word(x, (BN_ULONG)1)) { // cofactor is 1
  ------------------
  |  Branch (1525:12): [True: 0, False: 24]
  ------------------
 1526|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1527|      0|        goto err;
 1528|      0|    }
 1529|       |
 1530|       |    /*
 1531|       |     * Set up generator and order and montgomery data
 1532|       |     */
 1533|     24|    group->generator = EC_POINT_new(group);
 1534|     24|    if (group->generator == NULL){
  ------------------
  |  Branch (1534:9): [True: 0, False: 24]
  ------------------
 1535|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1536|      0|        goto err;
 1537|      0|    }
 1538|     24|    if (!EC_POINT_copy(group->generator, P))
  ------------------
  |  Branch (1538:9): [True: 0, False: 24]
  ------------------
 1539|      0|        goto err;
 1540|     24|    if (!BN_copy(group->order, order))
  ------------------
  |  Branch (1540:9): [True: 0, False: 24]
  ------------------
 1541|      0|        goto err;
 1542|     24|    if (!BN_set_word(group->cofactor, 1))
  ------------------
  |  Branch (1542:9): [True: 0, False: 24]
  ------------------
 1543|      0|        goto err;
 1544|       |
 1545|     24|    ordmont = BN_MONT_CTX_new();
 1546|     24|    if (ordmont  == NULL)
  ------------------
  |  Branch (1546:9): [True: 0, False: 24]
  ------------------
 1547|      0|        goto err;
 1548|     24|    if (!ossl_bn_mont_ctx_set(ordmont, order, 256, params + 7 * param_len,
  ------------------
  |  Branch (1548:9): [True: 0, False: 24]
  ------------------
 1549|     24|                              param_len, lo_order_n, hi_order_n))
 1550|      0|        goto err;
 1551|       |
 1552|     24|    group->mont_data = ordmont;
 1553|     24|    ordmont = NULL;
 1554|       |
 1555|     24|    ok = 1;
 1556|       |
 1557|     24| err:
 1558|     24|    EC_POINT_free(P);
 1559|     24|    BN_CTX_free(ctx);
 1560|     24|    BN_MONT_CTX_free(mont);
 1561|     24|    BN_MONT_CTX_free(ordmont);
 1562|     24|    BN_free(p);
 1563|     24|    BN_free(one);
 1564|     24|    BN_free(a);
 1565|     24|    BN_free(b);
 1566|     24|    BN_free(order);
 1567|     24|    BN_free(x);
 1568|     24|    BN_free(y);
 1569|       |
 1570|     24|    return ok;
 1571|     24|}

ossl_ec_GFp_simple_set_compressed_coordinates:
   26|  9.42k|{
   27|  9.42k|    BN_CTX *new_ctx = NULL;
   28|  9.42k|    BIGNUM *tmp1, *tmp2, *x, *y;
   29|  9.42k|    int ret = 0;
   30|       |
   31|  9.42k|    if (ctx == NULL) {
  ------------------
  |  Branch (31:9): [True: 0, False: 9.42k]
  ------------------
   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|  9.42k|    y_bit = (y_bit != 0);
   38|       |
   39|  9.42k|    BN_CTX_start(ctx);
   40|  9.42k|    tmp1 = BN_CTX_get(ctx);
   41|  9.42k|    tmp2 = BN_CTX_get(ctx);
   42|  9.42k|    x = BN_CTX_get(ctx);
   43|  9.42k|    y = BN_CTX_get(ctx);
   44|  9.42k|    if (y == NULL)
  ------------------
  |  Branch (44:9): [True: 0, False: 9.42k]
  ------------------
   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|  9.42k|    if (!BN_nnmod(x, x_, group->field, ctx))
  ------------------
  |  Branch (54:9): [True: 0, False: 9.42k]
  ------------------
   55|      0|        goto err;
   56|  9.42k|    if (group->meth->field_decode == 0) {
  ------------------
  |  Branch (56:9): [True: 3.45k, False: 5.97k]
  ------------------
   57|       |        /* field_{sqr,mul} work on standard representation */
   58|  3.45k|        if (!group->meth->field_sqr(group, tmp2, x_, ctx))
  ------------------
  |  Branch (58:13): [True: 0, False: 3.45k]
  ------------------
   59|      0|            goto err;
   60|  3.45k|        if (!group->meth->field_mul(group, tmp1, tmp2, x_, ctx))
  ------------------
  |  Branch (60:13): [True: 0, False: 3.45k]
  ------------------
   61|      0|            goto err;
   62|  5.97k|    } else {
   63|  5.97k|        if (!BN_mod_sqr(tmp2, x_, group->field, ctx))
  ------------------
  |  Branch (63:13): [True: 0, False: 5.97k]
  ------------------
   64|      0|            goto err;
   65|  5.97k|        if (!BN_mod_mul(tmp1, tmp2, x_, group->field, ctx))
  ------------------
  |  Branch (65:13): [True: 0, False: 5.97k]
  ------------------
   66|      0|            goto err;
   67|  5.97k|    }
   68|       |
   69|       |    /* tmp1 := tmp1 + a*x */
   70|  9.42k|    if (group->a_is_minus3) {
  ------------------
  |  Branch (70:9): [True: 5.61k, False: 3.81k]
  ------------------
   71|  5.61k|        if (!BN_mod_lshift1_quick(tmp2, x, group->field))
  ------------------
  |  Branch (71:13): [True: 0, False: 5.61k]
  ------------------
   72|      0|            goto err;
   73|  5.61k|        if (!BN_mod_add_quick(tmp2, tmp2, x, group->field))
  ------------------
  |  Branch (73:13): [True: 0, False: 5.61k]
  ------------------
   74|      0|            goto err;
   75|  5.61k|        if (!BN_mod_sub_quick(tmp1, tmp1, tmp2, group->field))
  ------------------
  |  Branch (75:13): [True: 0, False: 5.61k]
  ------------------
   76|      0|            goto err;
   77|  5.61k|    } else {
   78|  3.81k|        if (group->meth->field_decode) {
  ------------------
  |  Branch (78:13): [True: 3.81k, False: 0]
  ------------------
   79|  3.81k|            if (!group->meth->field_decode(group, tmp2, group->a, ctx))
  ------------------
  |  Branch (79:17): [True: 0, False: 3.81k]
  ------------------
   80|      0|                goto err;
   81|  3.81k|            if (!BN_mod_mul(tmp2, tmp2, x, group->field, ctx))
  ------------------
  |  Branch (81:17): [True: 0, False: 3.81k]
  ------------------
   82|      0|                goto err;
   83|  3.81k|        } 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|  3.81k|        if (!BN_mod_add_quick(tmp1, tmp1, tmp2, group->field))
  ------------------
  |  Branch (89:13): [True: 0, False: 3.81k]
  ------------------
   90|      0|            goto err;
   91|  3.81k|    }
   92|       |
   93|       |    /* tmp1 := tmp1 + b */
   94|  9.42k|    if (group->meth->field_decode) {
  ------------------
  |  Branch (94:9): [True: 5.97k, False: 3.45k]
  ------------------
   95|  5.97k|        if (!group->meth->field_decode(group, tmp2, group->b, ctx))
  ------------------
  |  Branch (95:13): [True: 0, False: 5.97k]
  ------------------
   96|      0|            goto err;
   97|  5.97k|        if (!BN_mod_add_quick(tmp1, tmp1, tmp2, group->field))
  ------------------
  |  Branch (97:13): [True: 0, False: 5.97k]
  ------------------
   98|      0|            goto err;
   99|  5.97k|    } else {
  100|  3.45k|        if (!BN_mod_add_quick(tmp1, tmp1, group->b, group->field))
  ------------------
  |  Branch (100:13): [True: 0, False: 3.45k]
  ------------------
  101|      0|            goto err;
  102|  3.45k|    }
  103|       |
  104|  9.42k|    ERR_set_mark();
  105|  9.42k|    if (!BN_mod_sqrt(y, tmp1, group->field, ctx)) {
  ------------------
  |  Branch (105:9): [True: 4.04k, False: 5.38k]
  ------------------
  106|  4.04k|#ifndef FIPS_MODULE
  107|  4.04k|        unsigned long err = ERR_peek_last_error();
  108|       |
  109|  4.04k|        if (ERR_GET_LIB(err) == ERR_LIB_BN
  ------------------
  |  |   73|  8.08k|# define ERR_LIB_BN              3
  ------------------
  |  Branch (109:13): [True: 4.04k, False: 0]
  ------------------
  110|  4.04k|            && ERR_GET_REASON(err) == BN_R_NOT_A_SQUARE) {
  ------------------
  |  |   36|  4.04k|# define BN_R_NOT_A_SQUARE                                111
  ------------------
  |  Branch (110:16): [True: 4.04k, False: 0]
  ------------------
  111|  4.04k|            ERR_pop_to_mark();
  112|  4.04k|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT);
  ------------------
  |  |  401|  4.04k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  4.04k|    (ERR_new(),                                                 \
  |  |  |  |  404|  4.04k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  4.04k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  4.04k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  4.04k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  4.04k|     ERR_set_error)
  |  |  ------------------
  ------------------
  113|  4.04k|        } 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  118|      0|        }
  119|  4.04k|        goto err;
  120|  4.04k|    }
  121|  5.38k|    ERR_clear_last_mark();
  122|       |
  123|  5.38k|    if (y_bit != BN_is_odd(y)) {
  ------------------
  |  Branch (123:9): [True: 2.69k, False: 2.68k]
  ------------------
  124|  2.69k|        if (BN_is_zero(y)) {
  ------------------
  |  Branch (124:13): [True: 0, False: 2.69k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  138|      0|            goto err;
  139|      0|        }
  140|  2.69k|        if (!BN_usub(y, group->field, y))
  ------------------
  |  Branch (140:13): [True: 0, False: 2.69k]
  ------------------
  141|      0|            goto err;
  142|  2.69k|    }
  143|  5.38k|    if (y_bit != BN_is_odd(y)) {
  ------------------
  |  Branch (143:9): [True: 0, False: 5.38k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  145|      0|        goto err;
  146|      0|    }
  147|       |
  148|  5.38k|    if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (148:9): [True: 0, False: 5.38k]
  ------------------
  149|      0|        goto err;
  150|       |
  151|  5.38k|    ret = 1;
  152|       |
  153|  9.42k| err:
  154|  9.42k|    BN_CTX_end(ctx);
  155|  9.42k|    BN_CTX_free(new_ctx);
  156|  9.42k|    return ret;
  157|  5.38k|}
ossl_ec_GFp_simple_oct2point:
  277|  12.5k|{
  278|  12.5k|    point_conversion_form_t form;
  279|  12.5k|    int y_bit;
  280|  12.5k|    BN_CTX *new_ctx = NULL;
  281|  12.5k|    BIGNUM *x, *y;
  282|  12.5k|    size_t field_len, enc_len;
  283|  12.5k|    int ret = 0;
  284|       |
  285|  12.5k|    if (len == 0) {
  ------------------
  |  Branch (285:9): [True: 14, False: 12.5k]
  ------------------
  286|     14|        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|     14|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     14|    (ERR_new(),                                                 \
  |  |  |  |  404|     14|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     14|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     14|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     14|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     14|     ERR_set_error)
  |  |  ------------------
  ------------------
  287|     14|        return 0;
  288|     14|    }
  289|  12.5k|    form = buf[0];
  290|  12.5k|    y_bit = form & 1;
  291|  12.5k|    form = form & ~1U;
  292|  12.5k|    if ((form != 0) && (form != POINT_CONVERSION_COMPRESSED)
  ------------------
  |  Branch (292:9): [True: 12.2k, False: 232]
  |  Branch (292:24): [True: 2.71k, False: 9.57k]
  ------------------
  293|  12.5k|        && (form != POINT_CONVERSION_UNCOMPRESSED)
  ------------------
  |  Branch (293:12): [True: 2.58k, False: 131]
  ------------------
  294|  12.5k|        && (form != POINT_CONVERSION_HYBRID)) {
  ------------------
  |  Branch (294:12): [True: 263, False: 2.32k]
  ------------------
  295|    263|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|    263|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    263|    (ERR_new(),                                                 \
  |  |  |  |  404|    263|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    263|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    263|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    263|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    263|     ERR_set_error)
  |  |  ------------------
  ------------------
  296|    263|        return 0;
  297|    263|    }
  298|  12.2k|    if ((form == 0 || form == POINT_CONVERSION_UNCOMPRESSED) && y_bit) {
  ------------------
  |  Branch (298:10): [True: 232, False: 12.0k]
  |  Branch (298:23): [True: 131, False: 11.8k]
  |  Branch (298:65): [True: 132, False: 231]
  ------------------
  299|    132|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|    132|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    132|    (ERR_new(),                                                 \
  |  |  |  |  404|    132|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    132|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    132|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    132|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    132|     ERR_set_error)
  |  |  ------------------
  ------------------
  300|    132|        return 0;
  301|    132|    }
  302|       |
  303|  12.1k|    if (form == 0) {
  ------------------
  |  Branch (303:9): [True: 180, False: 11.9k]
  ------------------
  304|    180|        if (len != 1) {
  ------------------
  |  Branch (304:13): [True: 126, False: 54]
  ------------------
  305|    126|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|    126|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    126|    (ERR_new(),                                                 \
  |  |  |  |  404|    126|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    126|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    126|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    126|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    126|     ERR_set_error)
  |  |  ------------------
  ------------------
  306|    126|            return 0;
  307|    126|        }
  308|       |
  309|     54|        return EC_POINT_set_to_infinity(group, point);
  310|    180|    }
  311|       |
  312|  11.9k|    field_len = BN_num_bytes(group->field);
  ------------------
  |  |  189|  11.9k|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  313|  11.9k|    enc_len =
  314|  11.9k|        (form ==
  ------------------
  |  Branch (314:9): [True: 9.57k, False: 2.37k]
  ------------------
  315|  11.9k|         POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;
  316|       |
  317|  11.9k|    if (len != enc_len) {
  ------------------
  |  Branch (317:9): [True: 1.73k, False: 10.2k]
  ------------------
  318|  1.73k|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|  1.73k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.73k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.73k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  1.73k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  1.73k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  1.73k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.73k|     ERR_set_error)
  |  |  ------------------
  ------------------
  319|  1.73k|        return 0;
  320|  1.73k|    }
  321|       |
  322|  10.2k|    if (ctx == NULL) {
  ------------------
  |  Branch (322:9): [True: 10.2k, False: 0]
  ------------------
  323|  10.2k|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  324|  10.2k|        if (ctx == NULL)
  ------------------
  |  Branch (324:13): [True: 0, False: 10.2k]
  ------------------
  325|      0|            return 0;
  326|  10.2k|    }
  327|       |
  328|  10.2k|    BN_CTX_start(ctx);
  329|  10.2k|    x = BN_CTX_get(ctx);
  330|  10.2k|    y = BN_CTX_get(ctx);
  331|  10.2k|    if (y == NULL)
  ------------------
  |  Branch (331:9): [True: 0, False: 10.2k]
  ------------------
  332|      0|        goto err;
  333|       |
  334|  10.2k|    if (!BN_bin2bn(buf + 1, field_len, x))
  ------------------
  |  Branch (334:9): [True: 0, False: 10.2k]
  ------------------
  335|      0|        goto err;
  336|  10.2k|    if (BN_ucmp(x, group->field) >= 0) {
  ------------------
  |  Branch (336:9): [True: 26, False: 10.1k]
  ------------------
  337|     26|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     26|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     26|    (ERR_new(),                                                 \
  |  |  |  |  404|     26|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     26|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     26|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     26|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     26|     ERR_set_error)
  |  |  ------------------
  ------------------
  338|     26|        goto err;
  339|     26|    }
  340|       |
  341|  10.1k|    if (form == POINT_CONVERSION_COMPRESSED) {
  ------------------
  |  Branch (341:9): [True: 9.42k, False: 762]
  ------------------
  342|  9.42k|        if (!EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx))
  ------------------
  |  Branch (342:13): [True: 4.04k, False: 5.38k]
  ------------------
  343|  4.04k|            goto err;
  344|  9.42k|    } else {
  345|    762|        if (!BN_bin2bn(buf + 1 + field_len, field_len, y))
  ------------------
  |  Branch (345:13): [True: 0, False: 762]
  ------------------
  346|      0|            goto err;
  347|    762|        if (BN_ucmp(y, group->field) >= 0) {
  ------------------
  |  Branch (347:13): [True: 1, False: 761]
  ------------------
  348|      1|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
  349|      1|            goto err;
  350|      1|        }
  351|    761|        if (form == POINT_CONVERSION_HYBRID) {
  ------------------
  |  Branch (351:13): [True: 725, False: 36]
  ------------------
  352|    725|            if (y_bit != BN_is_odd(y)) {
  ------------------
  |  Branch (352:17): [True: 10, False: 715]
  ------------------
  353|     10|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     10|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     10|    (ERR_new(),                                                 \
  |  |  |  |  404|     10|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     10|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     10|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     10|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     10|     ERR_set_error)
  |  |  ------------------
  ------------------
  354|     10|                goto err;
  355|     10|            }
  356|    725|        }
  357|       |
  358|       |        /*
  359|       |         * EC_POINT_set_affine_coordinates is responsible for checking that
  360|       |         * the point is on the curve.
  361|       |         */
  362|    751|        if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (362:13): [True: 751, False: 0]
  ------------------
  363|    751|            goto err;
  364|    751|    }
  365|       |
  366|  5.38k|    ret = 1;
  367|       |
  368|  10.2k| err:
  369|  10.2k|    BN_CTX_end(ctx);
  370|  10.2k|    BN_CTX_free(new_ctx);
  371|  10.2k|    return ret;
  372|  5.38k|}

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

ossl_ecx_key_op:
  158|     68|{
  159|     68|    ECX_KEY *key = NULL;
  160|     68|    unsigned char *privkey, *pubkey;
  161|       |
  162|     68|    if (op != KEY_OP_KEYGEN) {
  ------------------
  |  Branch (162:9): [True: 68, False: 0]
  ------------------
  163|     68|        if (palg != NULL) {
  ------------------
  |  Branch (163:13): [True: 68, False: 0]
  ------------------
  164|     68|            int ptype;
  165|       |
  166|       |            /* Algorithm parameters must be absent */
  167|     68|            X509_ALGOR_get0(NULL, &ptype, NULL, palg);
  168|     68|            if (ptype != V_ASN1_UNDEF) {
  ------------------
  |  |   60|     68|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (168:17): [True: 54, False: 14]
  ------------------
  169|     54|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     54|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     54|    (ERR_new(),                                                 \
  |  |  |  |  404|     54|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     54|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     54|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     54|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     54|     ERR_set_error)
  |  |  ------------------
  ------------------
  170|     54|                return 0;
  171|     54|            }
  172|     14|            if (id == EVP_PKEY_NONE)
  ------------------
  |  |   59|     14|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|     14|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (172:17): [True: 0, False: 14]
  ------------------
  173|      0|                id = OBJ_obj2nid(palg->algorithm);
  174|     14|            else if (id != OBJ_obj2nid(palg->algorithm)) {
  ------------------
  |  Branch (174:22): [True: 0, False: 14]
  ------------------
  175|      0|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  176|      0|                return 0;
  177|      0|            }
  178|     14|        }
  179|       |
  180|     14|        if (p == NULL || id == EVP_PKEY_NONE || plen != KEYLENID(id)) {
  ------------------
  |  |   59|      4|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|     18|#define NID_undef                       0
  |  |  ------------------
  ------------------
                      if (p == NULL || id == EVP_PKEY_NONE || plen != KEYLENID(id)) {
  ------------------
  |  |   12|      4|#define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   11|      4|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|      4|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5496|      8|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      3|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5504|      3|#define NID_ED25519             1087
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (11:26): [True: 1, False: 3]
  |  |  |  |  |  Branch (11:53): [True: 1, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   26|      2|#  define X25519_KEYLEN         32
  |  |  ------------------
  |  |   13|      4|                                     : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   81|      2|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5500|      2|#define NID_X448                1035
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                                                    : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   27|      1|#  define X448_KEYLEN           56
  |  |  ------------------
  |  |  |  Branch (13:41): [True: 1, False: 1]
  |  |  ------------------
  |  |   14|      2|                                                              : ED448_KEYLEN))
  |  |  ------------------
  |  |  |  |   29|      1|#  define ED448_KEYLEN          57
  |  |  ------------------
  ------------------
  |  Branch (180:13): [True: 10, False: 4]
  |  Branch (180:26): [True: 0, False: 4]
  |  Branch (180:49): [True: 4, False: 0]
  ------------------
  181|     14|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     14|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     14|    (ERR_new(),                                                 \
  |  |  |  |  404|     14|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     14|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     14|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     14|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     14|     ERR_set_error)
  |  |  ------------------
  ------------------
  182|     14|            return 0;
  183|     14|        }
  184|     14|    }
  185|       |
  186|      0|    key = ossl_ecx_key_new(libctx, KEYNID2TYPE(id), 1, propq);
  ------------------
  |  |   16|      0|    (IS25519(id) ? ((id) == EVP_PKEY_X25519 ? ECX_KEY_TYPE_X25519 \
  |  |  ------------------
  |  |  |  |   11|      0|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|      0|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5496|      0|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5504|      0|#define NID_ED25519             1087
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (11:26): [True: 0, False: 0]
  |  |  |  |  |  Branch (11:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (IS25519(id) ? ((id) == EVP_PKEY_X25519 ? ECX_KEY_TYPE_X25519 \
  |  |  ------------------
  |  |  |  |   79|      0|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  ------------------
  |  |  |  |  |  | 5496|      0|#define NID_X25519              1034
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (16:21): [True: 0, False: 0]
  |  |  ------------------
  |  |   17|      0|                                            : ECX_KEY_TYPE_ED25519) \
  |  |   18|      0|                 : ((id) == EVP_PKEY_X448 ? ECX_KEY_TYPE_X448 \
  |  |  ------------------
  |  |  |  |   81|      0|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5500|      0|#define NID_X448                1035
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (18:21): [True: 0, False: 0]
  |  |  ------------------
  |  |   19|      0|                                          : ECX_KEY_TYPE_ED448))
  ------------------
  187|      0|    if (key == NULL) {
  ------------------
  |  Branch (187:9): [True: 0, False: 0]
  ------------------
  188|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  189|      0|        return 0;
  190|      0|    }
  191|      0|    pubkey = key->pubkey;
  192|       |
  193|      0|    if (op == KEY_OP_PUBLIC) {
  ------------------
  |  Branch (193:9): [True: 0, False: 0]
  ------------------
  194|      0|        memcpy(pubkey, p, plen);
  195|      0|    } else {
  196|      0|        privkey = ossl_ecx_key_allocate_privkey(key);
  197|      0|        if (privkey == NULL) {
  ------------------
  |  Branch (197:13): [True: 0, False: 0]
  ------------------
  198|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  199|      0|            goto err;
  200|      0|        }
  201|      0|        if (op == KEY_OP_KEYGEN) {
  ------------------
  |  Branch (201:13): [True: 0, False: 0]
  ------------------
  202|      0|            if (id != EVP_PKEY_NONE) {
  ------------------
  |  |   59|      0|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|      0|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (202:17): [True: 0, False: 0]
  ------------------
  203|      0|                if (RAND_priv_bytes_ex(libctx, privkey, KEYLENID(id), 0) <= 0)
  ------------------
  |  |   12|      0|#define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   11|      0|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|      0|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5496|      0|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5504|      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 \
  |  |  ------------------
  |  |  |  |   81|      0|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5500|      0|#define NID_X448                1035
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                                                    : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   27|      0|#  define X448_KEYLEN           56
  |  |  ------------------
  |  |  |  Branch (13:41): [True: 0, False: 0]
  |  |  ------------------
  |  |   14|      0|                                                              : ED448_KEYLEN))
  |  |  ------------------
  |  |  |  |   29|      0|#  define ED448_KEYLEN          57
  |  |  ------------------
  ------------------
  |  Branch (203:21): [True: 0, False: 0]
  ------------------
  204|      0|                    goto err;
  205|      0|                if (id == EVP_PKEY_X25519) {
  ------------------
  |  |   79|      0|# define EVP_PKEY_X25519 NID_X25519
  |  |  ------------------
  |  |  |  | 5496|      0|#define NID_X25519              1034
  |  |  ------------------
  ------------------
  |  Branch (205:21): [True: 0, False: 0]
  ------------------
  206|      0|                    privkey[0] &= 248;
  207|      0|                    privkey[X25519_KEYLEN - 1] &= 127;
  ------------------
  |  |   26|      0|#  define X25519_KEYLEN         32
  ------------------
  208|      0|                    privkey[X25519_KEYLEN - 1] |= 64;
  ------------------
  |  |   26|      0|#  define X25519_KEYLEN         32
  ------------------
  209|      0|                } else if (id == EVP_PKEY_X448) {
  ------------------
  |  |   81|      0|# define EVP_PKEY_X448 NID_X448
  |  |  ------------------
  |  |  |  | 5500|      0|#define NID_X448                1035
  |  |  ------------------
  ------------------
  |  Branch (209:28): [True: 0, False: 0]
  ------------------
  210|      0|                    privkey[0] &= 252;
  211|      0|                    privkey[X448_KEYLEN - 1] |= 128;
  ------------------
  |  |   27|      0|#  define X448_KEYLEN           56
  ------------------
  212|      0|                }
  213|      0|            }
  214|      0|        } else {
  215|      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)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|      0|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5496|      0|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      0|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5504|      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 \
  |  |  ------------------
  |  |  |  |   81|      0|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5500|      0|#define NID_X448                1035
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                                                    : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   27|      0|#  define X448_KEYLEN           56
  |  |  ------------------
  |  |  |  Branch (13:41): [True: 0, False: 0]
  |  |  ------------------
  |  |   14|      0|                                                              : ED448_KEYLEN))
  |  |  ------------------
  |  |  |  |   29|      0|#  define ED448_KEYLEN          57
  |  |  ------------------
  ------------------
  216|      0|        }
  217|      0|        if (!ossl_ecx_public_from_private(key)) {
  ------------------
  |  Branch (217:13): [True: 0, False: 0]
  ------------------
  218|      0|            ERR_raise(ERR_LIB_EC, EC_R_FAILED_MAKING_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  219|      0|            goto err;
  220|      0|        }
  221|      0|    }
  222|       |
  223|      0|    return key;
  224|      0| err:
  225|      0|    ossl_ecx_key_free(key);
  226|      0|    return NULL;
  227|      0|}

ossl_ecx_key_free:
   65|    150|{
   66|    150|    int i;
   67|       |
   68|    150|    if (key == NULL)
  ------------------
  |  Branch (68:9): [True: 150, False: 0]
  ------------------
   69|    150|        return;
   70|       |
   71|      0|    CRYPTO_DOWN_REF(&key->references, &i);
   72|      0|    REF_PRINT_COUNT("ECX_KEY", key);
  ------------------
  |  |  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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   73|      0|    if (i > 0)
  ------------------
  |  Branch (73:9): [True: 0, False: 0]
  ------------------
   74|      0|        return;
   75|      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]
  |  |  ------------------
  ------------------
   76|       |
   77|      0|    OPENSSL_free(key->propq);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   78|      0|    OPENSSL_secure_clear_free(key->privkey, key->keylen);
  ------------------
  |  |  129|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|      0|    CRYPTO_FREE_REF(&key->references);
   80|      0|    OPENSSL_free(key);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   81|      0|}

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

OSSL_DECODER_from_bio:
   48|  40.0k|{
   49|  40.0k|    struct decoder_process_data_st data;
   50|  40.0k|    int ok = 0;
   51|  40.0k|    BIO *new_bio = NULL;
   52|  40.0k|    unsigned long lasterr;
   53|       |
   54|  40.0k|    if (in == NULL) {
  ------------------
  |  Branch (54:9): [True: 0, False: 40.0k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   56|      0|        return 0;
   57|      0|    }
   58|       |
   59|  40.0k|    if (OSSL_DECODER_CTX_get_num_decoders(ctx) == 0) {
  ------------------
  |  Branch (59:9): [True: 3.50k, False: 36.5k]
  ------------------
   60|  3.50k|        ERR_raise_data(ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND,
  ------------------
  |  |  403|  3.50k|    (ERR_new(),                                                 \
  |  |  404|  3.50k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|  3.50k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|  3.50k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|  3.50k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|  3.50k|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND,
  ------------------
  |  |  121|  3.50k|# define ERR_LIB_OSSL_DECODER    60
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND,
  ------------------
  |  |   25|  3.50k|# define OSSL_DECODER_R_DECODER_NOT_FOUND                 102
  ------------------
   61|  3.50k|                       "No decoders were found. For standard decoders you need "
   62|  3.50k|                       "at least one of the default or base providers "
   63|  3.50k|                       "available. Did you forget to load them?");
   64|  3.50k|        return 0;
   65|  3.50k|    }
   66|       |
   67|  36.5k|    lasterr = ERR_peek_last_error();
   68|       |
   69|  36.5k|    if (BIO_tell(in) < 0) {
  ------------------
  |  |  569|  36.5k|# define BIO_tell(b)     (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
  |  |  ------------------
  |  |  |  |  464|  36.5k|# define BIO_C_FILE_TELL                         133
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 36.5k]
  ------------------
   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|  36.5k|    memset(&data, 0, sizeof(data));
   76|  36.5k|    data.ctx = ctx;
   77|  36.5k|    data.bio = in;
   78|       |
   79|       |    /* Enable passphrase caching */
   80|  36.5k|    (void)ossl_pw_enable_passphrase_caching(&ctx->pwdata);
   81|       |
   82|  36.5k|    ok = decoder_process(NULL, &data);
   83|       |
   84|  36.5k|    if (!data.flag_construct_called) {
  ------------------
  |  Branch (84:9): [True: 20.5k, False: 15.9k]
  ------------------
   85|  20.5k|        const char *spaces
   86|  20.5k|            = ctx->start_input_type != NULL && ctx->input_structure != NULL
  ------------------
  |  Branch (86:15): [True: 20.5k, False: 0]
  |  Branch (86:48): [True: 20.5k, False: 0]
  ------------------
   87|  20.5k|            ? " " : "";
   88|  20.5k|        const char *input_type_label
   89|  20.5k|            = ctx->start_input_type != NULL ? "Input type: " : "";
  ------------------
  |  Branch (89:15): [True: 20.5k, False: 0]
  ------------------
   90|  20.5k|        const char *input_structure_label
   91|  20.5k|            = ctx->input_structure != NULL ? "Input structure: " : "";
  ------------------
  |  Branch (91:15): [True: 20.5k, False: 0]
  ------------------
   92|  20.5k|        const char *comma
   93|  20.5k|            = ctx->start_input_type != NULL && ctx->input_structure != NULL
  ------------------
  |  Branch (93:15): [True: 20.5k, False: 0]
  |  Branch (93:48): [True: 20.5k, False: 0]
  ------------------
   94|  20.5k|            ? ", " : "";
   95|  20.5k|        const char *input_type
   96|  20.5k|            = ctx->start_input_type != NULL ? ctx->start_input_type : "";
  ------------------
  |  Branch (96:15): [True: 20.5k, False: 0]
  ------------------
   97|  20.5k|        const char *input_structure
   98|  20.5k|            = ctx->input_structure != NULL ? ctx->input_structure : "";
  ------------------
  |  Branch (98:15): [True: 20.5k, False: 0]
  ------------------
   99|       |
  100|  20.5k|        if (ERR_peek_last_error() == lasterr || ERR_peek_error() == 0)
  ------------------
  |  Branch (100:13): [True: 20.5k, False: 0]
  |  Branch (100:49): [True: 0, False: 0]
  ------------------
  101|       |            /* Prevent spurious decoding error but add at least something */
  102|  20.5k|            ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_UNSUPPORTED,
  ------------------
  |  |  403|  20.5k|    (ERR_new(),                                                 \
  |  |  404|  20.5k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|  20.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|  20.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|  20.5k|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|  20.5k|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_UNSUPPORTED,
  ------------------
  |  |  121|  20.5k|# define ERR_LIB_OSSL_DECODER    60
  ------------------
                          ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_UNSUPPORTED,
  ------------------
  |  |  363|  20.5k|# define ERR_R_UNSUPPORTED                       (268|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|  20.5k|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|  20.5k|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  103|  20.5k|                           "No supported data to decode. %s%s%s%s%s%s",
  104|  20.5k|                           spaces, input_type_label, input_type, comma,
  105|  20.5k|                           input_structure_label, input_structure);
  106|  20.5k|        ok = 0;
  107|  20.5k|    }
  108|       |
  109|       |    /* Clear any internally cached passphrase */
  110|  36.5k|    (void)ossl_pw_clear_passphrase_cache(&ctx->pwdata);
  111|       |
  112|  36.5k|    if (new_bio != NULL) {
  ------------------
  |  Branch (112:9): [True: 0, False: 36.5k]
  ------------------
  113|      0|        BIO_pop(new_bio);
  114|      0|        BIO_free(new_bio);
  115|      0|    }
  116|  36.5k|    return ok;
  117|  36.5k|}
OSSL_DECODER_from_data:
  147|  40.0k|{
  148|  40.0k|    BIO *membio;
  149|  40.0k|    int ret = 0;
  150|       |
  151|  40.0k|    if (pdata == NULL || *pdata == NULL || pdata_len == NULL) {
  ------------------
  |  Branch (151:9): [True: 0, False: 40.0k]
  |  Branch (151:26): [True: 0, False: 40.0k]
  |  Branch (151:44): [True: 0, False: 40.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  153|      0|        return 0;
  154|      0|    }
  155|       |
  156|  40.0k|    membio = BIO_new_mem_buf(*pdata, (int)*pdata_len);
  157|  40.0k|    if (OSSL_DECODER_from_bio(ctx, membio)) {
  ------------------
  |  Branch (157:9): [True: 15.9k, False: 24.0k]
  ------------------
  158|  15.9k|        *pdata_len = (size_t)BIO_get_mem_data(membio, pdata);
  ------------------
  |  |  611|  15.9k|# define BIO_get_mem_data(b,pp)  BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)(pp))
  |  |  ------------------
  |  |  |  |   90|  15.9k|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  |  |  ------------------
  ------------------
  159|  15.9k|        ret = 1;
  160|  15.9k|    }
  161|  40.0k|    BIO_free(membio);
  162|       |
  163|  40.0k|    return ret;
  164|  40.0k|}
OSSL_DECODER_CTX_set_selection:
  167|    731|{
  168|    731|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|    731|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    731|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (168:9): [True: 0, False: 731]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|    731|    ctx->selection = selection;
  178|    731|    return 1;
  179|    731|}
OSSL_DECODER_CTX_set_input_type:
  183|  40.7k|{
  184|  40.7k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  40.7k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  40.7k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (184:9): [True: 0, False: 40.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  186|      0|        return 0;
  187|      0|    }
  188|       |
  189|       |    /*
  190|       |     * NULL is a valid starting input type, and means that the caller leaves
  191|       |     * it to code to discover what the starting input type is.
  192|       |     */
  193|  40.7k|    ctx->start_input_type = input_type;
  194|  40.7k|    return 1;
  195|  40.7k|}
OSSL_DECODER_CTX_set_input_structure:
  199|  40.7k|{
  200|  40.7k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  40.7k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  40.7k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (200:9): [True: 0, False: 40.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  202|      0|        return 0;
  203|      0|    }
  204|       |
  205|       |    /*
  206|       |     * NULL is a valid starting input structure, and means that the caller
  207|       |     * leaves it to code to discover what the starting input structure is.
  208|       |     */
  209|  40.7k|    ctx->input_structure = input_structure;
  210|  40.7k|    return 1;
  211|  40.7k|}
ossl_decoder_instance_new:
  215|     82|{
  216|     82|    OSSL_DECODER_INSTANCE *decoder_inst = NULL;
  217|     82|    const OSSL_PROVIDER *prov;
  218|     82|    OSSL_LIB_CTX *libctx;
  219|     82|    const OSSL_PROPERTY_LIST *props;
  220|     82|    const OSSL_PROPERTY_DEFINITION *prop;
  221|       |
  222|     82|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|     82|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     82|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (222:9): [True: 0, False: 82]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  224|      0|        return 0;
  225|      0|    }
  226|       |
  227|     82|    if ((decoder_inst = OPENSSL_zalloc(sizeof(*decoder_inst))) == NULL)
  ------------------
  |  |  104|     82|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     82|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     82|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (227:9): [True: 0, False: 82]
  ------------------
  228|      0|        return 0;
  229|       |
  230|     82|    prov = OSSL_DECODER_get0_provider(decoder);
  231|     82|    libctx = ossl_provider_libctx(prov);
  232|     82|    props = ossl_decoder_parsed_properties(decoder);
  233|     82|    if (props == NULL) {
  ------------------
  |  Branch (233:9): [True: 0, False: 82]
  ------------------
  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),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      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|     82|    prop = ossl_property_find_property(props, libctx, "input");
  242|     82|    decoder_inst->input_type = ossl_property_get_string_value(libctx, prop);
  243|     82|    decoder_inst->input_type_id = 0;
  244|     82|    if (decoder_inst->input_type == NULL) {
  ------------------
  |  Branch (244:9): [True: 0, False: 82]
  ------------------
  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),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      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|     82|    prop = ossl_property_find_property(props, libctx, "structure");
  255|     82|    if (prop != NULL) {
  ------------------
  |  Branch (255:9): [True: 45, False: 37]
  ------------------
  256|     45|        decoder_inst->input_structure
  257|     45|            = ossl_property_get_string_value(libctx, prop);
  258|     45|    }
  259|       |
  260|     82|    if (!OSSL_DECODER_up_ref(decoder)) {
  ------------------
  |  Branch (260:9): [True: 0, False: 82]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  262|      0|        goto err;
  263|      0|    }
  264|     82|    decoder_inst->decoder = decoder;
  265|     82|    decoder_inst->decoderctx = decoderctx;
  266|     82|    return decoder_inst;
  267|      0| err:
  268|      0|    ossl_decoder_instance_free(decoder_inst);
  269|      0|    return NULL;
  270|     82|}
ossl_decoder_instance_free:
  273|   185k|{
  274|   185k|    if (decoder_inst != NULL) {
  ------------------
  |  Branch (274:9): [True: 185k, False: 0]
  ------------------
  275|   185k|        if (decoder_inst->decoder != NULL)
  ------------------
  |  Branch (275:13): [True: 185k, False: 0]
  ------------------
  276|   185k|            decoder_inst->decoder->freectx(decoder_inst->decoderctx);
  277|   185k|        decoder_inst->decoderctx = NULL;
  278|   185k|        OSSL_DECODER_free(decoder_inst->decoder);
  279|   185k|        decoder_inst->decoder = NULL;
  280|   185k|        OPENSSL_free(decoder_inst);
  ------------------
  |  |  115|   185k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   185k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   185k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|   185k|    }
  282|   185k|}
ossl_decoder_instance_dup:
  285|   185k|{
  286|   185k|    OSSL_DECODER_INSTANCE *dest;
  287|   185k|    const OSSL_PROVIDER *prov;
  288|   185k|    void *provctx;
  289|       |
  290|   185k|    if ((dest = OPENSSL_zalloc(sizeof(*dest))) == NULL)
  ------------------
  |  |  104|   185k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   185k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   185k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (290:9): [True: 0, False: 185k]
  ------------------
  291|      0|        return NULL;
  292|       |
  293|   185k|    *dest = *src;
  294|   185k|    if (!OSSL_DECODER_up_ref(dest->decoder)) {
  ------------------
  |  Branch (294:9): [True: 0, False: 185k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  296|      0|        goto err;
  297|      0|    }
  298|   185k|    prov = OSSL_DECODER_get0_provider(dest->decoder);
  299|   185k|    provctx = OSSL_PROVIDER_get0_provider_ctx(prov);
  300|       |
  301|   185k|    dest->decoderctx = dest->decoder->newctx(provctx);
  302|   185k|    if (dest->decoderctx == NULL) {
  ------------------
  |  Branch (302:9): [True: 0, False: 185k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|   185k|    return dest;
  309|       |
  310|      0| err:
  311|      0|    OPENSSL_free(dest);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  312|      0|    return NULL;
  313|   185k|}
ossl_decoder_ctx_add_decoder_inst:
  317|     61|{
  318|     61|    int ok;
  319|       |
  320|     61|    if (ctx->decoder_insts == NULL
  ------------------
  |  Branch (320:9): [True: 12, False: 49]
  ------------------
  321|     61|        && (ctx->decoder_insts =
  ------------------
  |  Branch (321:12): [True: 0, False: 12]
  ------------------
  322|     12|            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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  324|      0|        return 0;
  325|      0|    }
  326|       |
  327|     61|    ok = (sk_OSSL_DECODER_INSTANCE_push(ctx->decoder_insts, di) > 0);
  328|     61|    if (ok) {
  ------------------
  |  Branch (328:9): [True: 61, False: 0]
  ------------------
  329|     61|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|     61|    do {                                        \
  |  |  220|     61|        BIO *trc_out = NULL;                    \
  |  |  221|     61|        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|     61|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|     61|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  337|     61|    }
  338|     61|    return ok;
  339|     61|}
OSSL_DECODER_CTX_add_extra:
  490|    731|{
  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|    731|    struct collect_extra_decoder_data_st data;
  515|    731|    size_t depth = 0; /* Counts the number of iterations */
  516|    731|    size_t count; /* Calculates how many were added in each iteration */
  517|    731|    size_t numdecoders;
  518|    731|    STACK_OF(OSSL_DECODER) *skdecoders;
  ------------------
  |  |   31|    731|# define STACK_OF(type) struct stack_st_##type
  ------------------
  519|       |
  520|    731|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|    731|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    731|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (520:9): [True: 0, False: 731]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|    731|    if (ctx->decoder_insts == NULL)
  ------------------
  |  Branch (529:9): [True: 719, False: 12]
  ------------------
  530|    719|        return 1;
  531|       |
  532|     12|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|     12|    do {                                        \
  |  |  220|     12|        BIO *trc_out = NULL;                    \
  |  |  221|     12|        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|     12|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|     12|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  536|       |
  537|       |
  538|     12|    skdecoders = sk_OSSL_DECODER_new_null();
  539|     12|    if (skdecoders == NULL) {
  ------------------
  |  Branch (539:9): [True: 0, False: 12]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  541|      0|        return 0;
  542|      0|    }
  543|     12|    OSSL_DECODER_do_all_provided(libctx, collect_all_decoders, skdecoders);
  544|     12|    numdecoders = sk_OSSL_DECODER_num(skdecoders);
  545|       |
  546|     12|    memset(&data, 0, sizeof(data));
  547|     12|    data.ctx = ctx;
  548|     12|    data.w_prev_start = 0;
  549|     12|    data.w_prev_end = sk_OSSL_DECODER_INSTANCE_num(ctx->decoder_insts);
  550|     24|    do {
  551|     24|        size_t i, j;
  552|       |
  553|     24|        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|     24|        for (data.type_check = IS_SAME;
  563|     72|             data.type_check <= IS_DIFFERENT;
  ------------------
  |  Branch (563:14): [True: 48, False: 24]
  ------------------
  564|     48|             data.type_check++) {
  565|    170|            for (i = data.w_prev_start; i < data.w_prev_end; i++) {
  ------------------
  |  Branch (565:41): [True: 122, False: 48]
  ------------------
  566|    122|                OSSL_DECODER_INSTANCE *decoder_inst =
  567|    122|                    sk_OSSL_DECODER_INSTANCE_value(ctx->decoder_insts, i);
  568|       |
  569|    122|                data.output_type
  570|    122|                    = OSSL_DECODER_INSTANCE_get_input_type(decoder_inst);
  571|       |
  572|    122|                data.output_type_id = 0;
  573|       |
  574|  5.00k|                for (j = 0; j < numdecoders; j++)
  ------------------
  |  Branch (574:29): [True: 4.88k, False: 122]
  ------------------
  575|  4.88k|                    collect_extra_decoder(sk_OSSL_DECODER_value(skdecoders, j),
  576|  4.88k|                                          &data);
  577|    122|            }
  578|     48|        }
  579|       |        /* How many were added in this iteration */
  580|     24|        count = data.w_new_end - data.w_new_start;
  581|       |
  582|       |        /* Slide the "previous decoder" windows */
  583|     24|        data.w_prev_start = data.w_new_start;
  584|     24|        data.w_prev_end = data.w_new_end;
  585|       |
  586|     24|        depth++;
  587|     24|    } while (count != 0 && depth <= 10);
  ------------------
  |  Branch (587:14): [True: 12, False: 12]
  |  Branch (587:28): [True: 12, False: 0]
  ------------------
  588|       |
  589|     12|    sk_OSSL_DECODER_pop_free(skdecoders, OSSL_DECODER_free);
  590|     12|    return 1;
  591|     12|}
OSSL_DECODER_CTX_get_num_decoders:
  594|  77.2k|{
  595|  77.2k|    if (ctx == NULL || ctx->decoder_insts == NULL)
  ------------------
  |  Branch (595:9): [True: 0, False: 77.2k]
  |  Branch (595:24): [True: 4.22k, False: 73.0k]
  ------------------
  596|  4.22k|        return 0;
  597|  73.0k|    return sk_OSSL_DECODER_INSTANCE_num(ctx->decoder_insts);
  598|  77.2k|}
OSSL_DECODER_CTX_set_construct:
  602|  40.0k|{
  603|  40.0k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  40.0k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  40.0k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (603:9): [True: 0, False: 40.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  605|      0|        return 0;
  606|      0|    }
  607|  40.0k|    ctx->construct = construct;
  608|  40.0k|    return 1;
  609|  40.0k|}
OSSL_DECODER_CTX_set_construct_data:
  613|  36.5k|{
  614|  36.5k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  36.5k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  36.5k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (614:9): [True: 0, False: 36.5k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  616|      0|        return 0;
  617|      0|    }
  618|  36.5k|    ctx->construct_data = construct_data;
  619|  36.5k|    return 1;
  620|  36.5k|}
OSSL_DECODER_CTX_set_cleanup:
  624|  40.0k|{
  625|  40.0k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  40.0k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  40.0k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (625:9): [True: 0, False: 40.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  627|      0|        return 0;
  628|      0|    }
  629|  40.0k|    ctx->cleanup = cleanup;
  630|  40.0k|    return 1;
  631|  40.0k|}
OSSL_DECODER_CTX_get_construct:
  635|  40.0k|{
  636|  40.0k|    if (ctx == NULL)
  ------------------
  |  Branch (636:9): [True: 0, False: 40.0k]
  ------------------
  637|      0|        return NULL;
  638|  40.0k|    return ctx->construct;
  639|  40.0k|}
OSSL_DECODER_CTX_get_construct_data:
  642|  40.0k|{
  643|  40.0k|    if (ctx == NULL)
  ------------------
  |  Branch (643:9): [True: 0, False: 40.0k]
  ------------------
  644|      0|        return NULL;
  645|  40.0k|    return ctx->construct_data;
  646|  40.0k|}
OSSL_DECODER_CTX_get_cleanup:
  650|  40.0k|{
  651|  40.0k|    if (ctx == NULL)
  ------------------
  |  Branch (651:9): [True: 0, False: 40.0k]
  ------------------
  652|      0|        return NULL;
  653|  40.0k|    return ctx->cleanup;
  654|  40.0k|}
OSSL_DECODER_INSTANCE_get_decoder:
  679|   290k|{
  680|   290k|    if (decoder_inst == NULL)
  ------------------
  |  Branch (680:9): [True: 0, False: 290k]
  ------------------
  681|      0|        return NULL;
  682|   290k|    return decoder_inst->decoder;
  683|   290k|}
OSSL_DECODER_INSTANCE_get_decoder_ctx:
  687|   237k|{
  688|   237k|    if (decoder_inst == NULL)
  ------------------
  |  Branch (688:9): [True: 0, False: 237k]
  ------------------
  689|      0|        return NULL;
  690|   237k|    return decoder_inst->decoderctx;
  691|   237k|}
OSSL_DECODER_INSTANCE_get_input_type:
  695|   185k|{
  696|   185k|    if (decoder_inst == NULL)
  ------------------
  |  Branch (696:9): [True: 0, False: 185k]
  ------------------
  697|      0|        return NULL;
  698|   185k|    return decoder_inst->input_type;
  699|   185k|}
OSSL_DECODER_INSTANCE_get_input_structure:
  704|   185k|{
  705|   185k|    if (decoder_inst == NULL)
  ------------------
  |  Branch (705:9): [True: 0, False: 185k]
  ------------------
  706|      0|        return NULL;
  707|   185k|    *was_set = decoder_inst->flag_input_structure_was_set;
  708|   185k|    return decoder_inst->input_structure;
  709|   185k|}
decoder_lib.c:collect_all_decoders:
  391|    480|{
  392|    480|    STACK_OF(OSSL_DECODER) *skdecoders = arg;
  ------------------
  |  |   31|    480|# define STACK_OF(type) struct stack_st_##type
  ------------------
  393|       |
  394|    480|    if (OSSL_DECODER_up_ref(decoder)
  ------------------
  |  Branch (394:9): [True: 480, False: 0]
  ------------------
  395|    480|            && !sk_OSSL_DECODER_push(skdecoders, decoder))
  ------------------
  |  Branch (395:16): [True: 0, False: 480]
  ------------------
  396|      0|        OSSL_DECODER_free(decoder);
  397|    480|}
decoder_lib.c:collect_extra_decoder:
  400|  4.88k|{
  401|  4.88k|    struct collect_extra_decoder_data_st *data = arg;
  402|  4.88k|    size_t j;
  403|  4.88k|    const OSSL_PROVIDER *prov = OSSL_DECODER_get0_provider(decoder);
  404|  4.88k|    void *provctx = OSSL_PROVIDER_get0_provider_ctx(prov);
  405|       |
  406|  4.88k|    if (ossl_decoder_fast_is_a(decoder, data->output_type, &data->output_type_id)) {
  ------------------
  |  Branch (406:9): [True: 270, False: 4.61k]
  ------------------
  407|    270|        void *decoderctx = NULL;
  408|    270|        OSSL_DECODER_INSTANCE *di = NULL;
  409|       |
  410|    270|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|    270|    do {                                        \
  |  |  220|    270|        BIO *trc_out = NULL;                    \
  |  |  221|    270|        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|    270|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|    270|    } 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|    882|        for (j = data->w_prev_start; j < data->w_new_end; j++) {
  ------------------
  |  Branch (424:38): [True: 825, False: 57]
  ------------------
  425|    825|            OSSL_DECODER_INSTANCE *check_inst =
  426|    825|                sk_OSSL_DECODER_INSTANCE_value(data->ctx->decoder_insts, j);
  427|       |
  428|    825|            if (decoder->base.algodef == check_inst->decoder->base.algodef) {
  ------------------
  |  Branch (428:17): [True: 213, False: 612]
  ------------------
  429|       |                /* We found it, so don't do anything more */
  430|    213|                OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|    213|    do {                                        \
  |  |  220|    213|        BIO *trc_out = NULL;                    \
  |  |  221|    213|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  431|      0|                    BIO_printf(trc_out,
  432|      0|                               "    REJECTED: already exists in the chain\n");
  433|    213|                } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|    213|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  434|    213|                return;
  435|    213|            }
  436|    825|        }
  437|       |
  438|     57|        if ((decoderctx = decoder->newctx(provctx)) == NULL)
  ------------------
  |  Branch (438:13): [True: 0, False: 57]
  ------------------
  439|      0|            return;
  440|       |
  441|     57|        if ((di = ossl_decoder_instance_new(decoder, decoderctx)) == NULL) {
  ------------------
  |  Branch (441:13): [True: 0, False: 57]
  ------------------
  442|      0|            decoder->freectx(decoderctx);
  443|      0|            return;
  444|      0|        }
  445|       |
  446|     57|        switch (data->type_check) {
  ------------------
  |  Branch (446:17): [True: 0, False: 57]
  ------------------
  447|     45|        case IS_SAME:
  ------------------
  |  Branch (447:9): [True: 45, False: 12]
  ------------------
  448|       |            /* If it differs, this is not a decoder to add for now. */
  449|     45|            if (!ossl_decoder_fast_is_a(decoder,
  ------------------
  |  Branch (449:17): [True: 21, False: 24]
  ------------------
  450|     45|                                        OSSL_DECODER_INSTANCE_get_input_type(di),
  451|     45|                                        &di->input_type_id)) {
  452|     21|                ossl_decoder_instance_free(di);
  453|     21|                OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|     21|    do {                                        \
  |  |  220|     21|        BIO *trc_out = NULL;                    \
  |  |  221|     21|        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|     21|                } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|     21|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  457|     21|                return;
  458|     21|            }
  459|     24|            break;
  460|     24|        case IS_DIFFERENT:
  ------------------
  |  Branch (460:9): [True: 12, False: 45]
  ------------------
  461|       |            /* If it's the same, this is not a decoder to add for now. */
  462|     12|            if (ossl_decoder_fast_is_a(decoder,
  ------------------
  |  Branch (462:17): [True: 0, False: 12]
  ------------------
  463|     12|                                       OSSL_DECODER_INSTANCE_get_input_type(di),
  464|     12|                                       &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|     12|            break;
  473|     57|        }
  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|     36|        if (!ossl_decoder_ctx_add_decoder_inst(data->ctx, di)) {
  ------------------
  |  Branch (479:13): [True: 0, False: 36]
  ------------------
  480|      0|            ossl_decoder_instance_free(di);
  481|      0|            return;
  482|      0|        }
  483|       |
  484|     36|        data->w_new_end++;
  485|     36|    }
  486|  4.88k|}
decoder_lib.c:decoder_process:
  712|  88.9k|{
  713|  88.9k|    struct decoder_process_data_st *data = arg;
  714|  88.9k|    OSSL_DECODER_CTX *ctx = data->ctx;
  715|  88.9k|    OSSL_DECODER_INSTANCE *decoder_inst = NULL;
  716|  88.9k|    OSSL_DECODER *decoder = NULL;
  717|  88.9k|    OSSL_CORE_BIO *cbio = NULL;
  718|  88.9k|    BIO *bio = data->bio;
  719|  88.9k|    long loc;
  720|  88.9k|    size_t i;
  721|  88.9k|    int ok = 0;
  722|       |    /* For recursions */
  723|  88.9k|    struct decoder_process_data_st new_data;
  724|  88.9k|    const char *data_type = NULL;
  725|  88.9k|    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|  88.9k|    data->flag_next_level_called = 1;
  732|       |
  733|  88.9k|    memset(&new_data, 0, sizeof(new_data));
  734|  88.9k|    new_data.ctx = data->ctx;
  735|  88.9k|    new_data.recursion = data->recursion + 1;
  736|       |
  737|  88.9k|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  738|  88.9k|#define LEVEL (new_data.recursion < sizeof(LEVEL_STR)                   \
  739|  88.9k|               ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  740|  88.9k|               : LEVEL_STR "...")
  741|       |
  742|  88.9k|    if (params == NULL) {
  ------------------
  |  Branch (742:9): [True: 36.5k, False: 52.4k]
  ------------------
  743|       |        /* First iteration, where we prepare for what is to come */
  744|       |
  745|  36.5k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  36.5k|    do {                                        \
  |  |  220|  36.5k|        BIO *trc_out = NULL;                    \
  |  |  221|  36.5k|        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|  36.5k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  36.5k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  750|       |
  751|  36.5k|        data->current_decoder_inst_index =
  752|  36.5k|            OSSL_DECODER_CTX_get_num_decoders(ctx);
  753|       |
  754|  36.5k|        bio = data->bio;
  755|  52.4k|    } else {
  756|  52.4k|        const OSSL_PARAM *p;
  757|  52.4k|        const char *trace_data_structure;
  758|       |
  759|  52.4k|        decoder_inst =
  760|  52.4k|            sk_OSSL_DECODER_INSTANCE_value(ctx->decoder_insts,
  761|  52.4k|                                           data->current_decoder_inst_index);
  762|  52.4k|        decoder = OSSL_DECODER_INSTANCE_get_decoder(decoder_inst);
  763|       |
  764|  52.4k|        data->flag_construct_called = 0;
  765|  52.4k|        if (ctx->construct != NULL) {
  ------------------
  |  Branch (765:13): [True: 52.4k, False: 0]
  ------------------
  766|  52.4k|            int rv;
  767|       |
  768|  52.4k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  52.4k|    do {                                        \
  |  |  220|  52.4k|        BIO *trc_out = NULL;                    \
  |  |  221|  52.4k|        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|  52.4k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  52.4k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  773|       |
  774|  52.4k|            rv = ctx->construct(decoder_inst, params, ctx->construct_data);
  775|       |
  776|  52.4k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  52.4k|    do {                                        \
  |  |  220|  52.4k|        BIO *trc_out = NULL;                    \
  |  |  221|  52.4k|        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|  52.4k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  52.4k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  781|       |
  782|  52.4k|            ok = (rv > 0);
  783|  52.4k|            if (ok) {
  ------------------
  |  Branch (783:17): [True: 15.9k, False: 36.4k]
  ------------------
  784|  15.9k|                data->flag_construct_called = 1;
  785|  15.9k|                goto end;
  786|  15.9k|            }
  787|  52.4k|        }
  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|  36.4k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA);
  ------------------
  |  |  326|  36.4k|# define OSSL_OBJECT_PARAM_DATA "data"
  ------------------
  799|  36.4k|        if (p == NULL || p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|  36.4k|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (799:13): [True: 0, False: 36.4k]
  |  Branch (799:26): [True: 0, False: 36.4k]
  ------------------
  800|      0|            goto end;
  801|  36.4k|        new_data.bio = BIO_new_mem_buf(p->data, (int)p->data_size);
  802|  36.4k|        if (new_data.bio == NULL)
  ------------------
  |  Branch (802:13): [True: 0, False: 36.4k]
  ------------------
  803|      0|            goto end;
  804|  36.4k|        bio = new_data.bio;
  805|       |
  806|       |        /* Get the data type if there is one */
  807|  36.4k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_TYPE);
  ------------------
  |  |  328|  36.4k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  808|  36.4k|        if (p != NULL && !OSSL_PARAM_get_utf8_string_ptr(p, &data_type))
  ------------------
  |  Branch (808:13): [True: 36.4k, False: 0]
  |  Branch (808:26): [True: 0, False: 36.4k]
  ------------------
  809|      0|            goto end;
  810|       |
  811|       |        /* Get the data structure if there is one */
  812|  36.4k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_STRUCTURE);
  ------------------
  |  |  327|  36.4k|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  813|  36.4k|        if (p != NULL && !OSSL_PARAM_get_utf8_string_ptr(p, &data_structure))
  ------------------
  |  Branch (813:13): [True: 36.4k, False: 0]
  |  Branch (813:26): [True: 0, False: 36.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|  36.4k|        trace_data_structure = data_structure;
  829|  36.4k|        if (data_type != NULL && data_structure != NULL
  ------------------
  |  Branch (829:13): [True: 36.4k, False: 0]
  |  Branch (829:34): [True: 36.4k, False: 0]
  ------------------
  830|  36.4k|            && OPENSSL_strcasecmp(data_structure, "type-specific") == 0)
  ------------------
  |  Branch (830:16): [True: 0, False: 36.4k]
  ------------------
  831|      0|            data_structure = NULL;
  832|       |
  833|  36.4k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  36.4k|    do {                                        \
  |  |  220|  36.4k|        BIO *trc_out = NULL;                    \
  |  |  221|  36.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|  36.4k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  36.4k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  842|  36.4k|    }
  843|       |
  844|       |    /*
  845|       |     * If we have no more decoders to look through at this point,
  846|       |     * we failed
  847|       |     */
  848|  72.9k|    if (data->current_decoder_inst_index == 0)
  ------------------
  |  Branch (848:9): [True: 0, False: 72.9k]
  ------------------
  849|      0|        goto end;
  850|       |
  851|  72.9k|    if ((loc = BIO_tell(bio)) < 0) {
  ------------------
  |  |  569|  72.9k|# define BIO_tell(b)     (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
  |  |  ------------------
  |  |  |  |  464|  72.9k|# define BIO_C_FILE_TELL                         133
  |  |  ------------------
  ------------------
  |  Branch (851:9): [True: 0, False: 72.9k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  853|      0|        goto end;
  854|      0|    }
  855|       |
  856|  72.9k|    if ((cbio = ossl_core_bio_new_from_bio(bio)) == NULL) {
  ------------------
  |  Branch (856:9): [True: 0, False: 72.9k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  858|      0|        goto end;
  859|      0|    }
  860|       |
  861|   205k|    for (i = data->current_decoder_inst_index; i-- > 0;) {
  ------------------
  |  Branch (861:48): [True: 185k, False: 20.5k]
  ------------------
  862|   185k|        OSSL_DECODER_INSTANCE *new_decoder_inst =
  863|   185k|            sk_OSSL_DECODER_INSTANCE_value(ctx->decoder_insts, i);
  864|   185k|        OSSL_DECODER *new_decoder =
  865|   185k|            OSSL_DECODER_INSTANCE_get_decoder(new_decoder_inst);
  866|   185k|        void *new_decoderctx =
  867|   185k|            OSSL_DECODER_INSTANCE_get_decoder_ctx(new_decoder_inst);
  868|   185k|        const char *new_input_type =
  869|   185k|            OSSL_DECODER_INSTANCE_get_input_type(new_decoder_inst);
  870|   185k|        int n_i_s_was_set = 0;   /* We don't care here */
  871|   185k|        const char *new_input_structure =
  872|   185k|            OSSL_DECODER_INSTANCE_get_input_structure(new_decoder_inst,
  873|   185k|                                                      &n_i_s_was_set);
  874|       |
  875|   185k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|   185k|    do {                                        \
  |  |  220|   185k|        BIO *trc_out = NULL;                    \
  |  |  221|   185k|        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|   185k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|   185k|    } 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|   185k|        if (decoder == NULL && ctx->start_input_type != NULL
  ------------------
  |  Branch (890:13): [True: 109k, False: 75.6k]
  |  Branch (890:32): [True: 109k, False: 0]
  ------------------
  891|   185k|            && OPENSSL_strcasecmp(ctx->start_input_type, new_input_type) != 0) {
  ------------------
  |  Branch (891:16): [True: 36.5k, False: 73.1k]
  ------------------
  892|  36.5k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  36.5k|    do {                                        \
  |  |  220|  36.5k|        BIO *trc_out = NULL;                    \
  |  |  221|  36.5k|        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|  36.5k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  36.5k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  898|  36.5k|            continue;
  899|  36.5k|        }
  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|   148k|        if (decoder != NULL && !ossl_decoder_fast_is_a(decoder, new_input_type,
  ------------------
  |  Branch (907:13): [True: 75.6k, False: 73.1k]
  |  Branch (907:32): [True: 1.60k, False: 74.0k]
  ------------------
  908|  75.6k|                                                       &new_decoder_inst->input_type_id)) {
  909|  1.60k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  1.60k|    do {                                        \
  |  |  220|  1.60k|        BIO *trc_out = NULL;                    \
  |  |  221|  1.60k|        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|  1.60k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  1.60k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  915|  1.60k|            continue;
  916|  1.60k|        }
  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|   147k|        if (data_type != NULL && !OSSL_DECODER_is_a(new_decoder, data_type)) {
  ------------------
  |  Branch (922:13): [True: 74.0k, False: 73.1k]
  |  Branch (922:34): [True: 34.3k, False: 39.6k]
  ------------------
  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|   112k|        if (data_structure != NULL
  ------------------
  |  Branch (936:13): [True: 39.6k, False: 73.1k]
  ------------------
  937|   112k|            && (new_input_structure == NULL
  ------------------
  |  Branch (937:17): [True: 0, False: 39.6k]
  ------------------
  938|  39.6k|                || OPENSSL_strcasecmp(data_structure,
  ------------------
  |  Branch (938:20): [True: 3.21k, False: 36.4k]
  ------------------
  939|  39.6k|                                      new_input_structure) != 0)) {
  940|  3.21k|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  3.21k|    do {                                        \
  |  |  220|  3.21k|        BIO *trc_out = NULL;                    \
  |  |  221|  3.21k|        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|  3.21k|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  3.21k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  945|  3.21k|            continue;
  946|  3.21k|        }
  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|   109k|        if (!data->flag_input_structure_checked
  ------------------
  |  Branch (954:13): [True: 36.5k, False: 73.0k]
  ------------------
  955|   109k|            && ctx->input_structure != NULL
  ------------------
  |  Branch (955:16): [True: 36.5k, False: 0]
  ------------------
  956|   109k|            && new_input_structure != NULL) {
  ------------------
  |  Branch (956:16): [True: 36.5k, False: 0]
  ------------------
  957|  36.5k|            data->flag_input_structure_checked = 1;
  958|  36.5k|            if (OPENSSL_strcasecmp(new_input_structure,
  ------------------
  |  Branch (958:17): [True: 36.5k, False: 0]
  ------------------
  959|  36.5k|                                   ctx->input_structure) != 0) {
  960|  36.5k|                OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  36.5k|    do {                                        \
  |  |  220|  36.5k|        BIO *trc_out = NULL;                    \
  |  |  221|  36.5k|        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|  36.5k|                } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  36.5k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  965|  36.5k|                continue;
  966|  36.5k|            }
  967|  36.5k|        }
  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|  73.0k|        (void)BIO_seek(bio, loc);
  ------------------
  |  |  568|  73.0k|# define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)
  |  |  ------------------
  |  |  |  |  458|  73.0k|# define BIO_C_FILE_SEEK                         128
  |  |  ------------------
  ------------------
  980|  73.0k|        if (BIO_tell(bio) != loc)
  ------------------
  |  |  569|  73.0k|# define BIO_tell(b)     (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
  |  |  ------------------
  |  |  |  |  464|  73.0k|# define BIO_C_FILE_TELL                         133
  |  |  ------------------
  ------------------
  |  Branch (980:13): [True: 0, False: 73.0k]
  ------------------
  981|      0|            goto end;
  982|       |
  983|       |        /* Recurse */
  984|  73.0k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  73.0k|    do {                                        \
  |  |  220|  73.0k|        BIO *trc_out = NULL;                    \
  |  |  221|  73.0k|        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|  73.0k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  73.0k|    } 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|  73.0k|        ERR_set_mark();
  996|       |
  997|  73.0k|        new_data.current_decoder_inst_index = i;
  998|  73.0k|        new_data.flag_input_structure_checked
  999|  73.0k|            = data->flag_input_structure_checked;
 1000|  73.0k|        ok = new_decoder->decode(new_decoderctx, cbio,
 1001|  73.0k|                                 new_data.ctx->selection,
 1002|  73.0k|                                 decoder_process, &new_data,
 1003|  73.0k|                                 ossl_pw_passphrase_callback_dec,
 1004|  73.0k|                                 &new_data.ctx->pwdata);
 1005|       |
 1006|  73.0k|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  73.0k|    do {                                        \
  |  |  220|  73.0k|        BIO *trc_out = NULL;                    \
  |  |  221|  73.0k|        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|  73.0k|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  73.0k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1015|       |
 1016|  73.0k|        data->flag_construct_called = new_data.flag_construct_called;
 1017|       |
 1018|       |        /* Break on error or if we tried to construct an object already */
 1019|  73.0k|        if (!ok || data->flag_construct_called) {
  ------------------
  |  Branch (1019:13): [True: 0, False: 73.0k]
  |  Branch (1019:20): [True: 31.9k, False: 41.1k]
  ------------------
 1020|  31.9k|            ERR_clear_last_mark();
 1021|  31.9k|            break;
 1022|  31.9k|        }
 1023|  41.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|  41.1k|        if (new_data.flag_next_level_called)
  ------------------
  |  Branch (1029:13): [True: 20.4k, False: 20.6k]
  ------------------
 1030|  20.4k|            break;
 1031|  41.1k|    }
 1032|       |
 1033|  88.9k| end:
 1034|  88.9k|    ossl_core_bio_free(cbio);
 1035|  88.9k|    BIO_free(new_data.bio);
 1036|  88.9k|    return ok;
 1037|  72.9k|}

OSSL_DECODER_up_ref:
   43|   185k|{
   44|   185k|    int ref = 0;
   45|       |
   46|   185k|    CRYPTO_UP_REF(&decoder->base.refcnt, &ref);
   47|   185k|    return 1;
   48|   185k|}
OSSL_DECODER_free:
   51|   185k|{
   52|   185k|    int ref = 0;
   53|       |
   54|   185k|    if (decoder == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 185k]
  ------------------
   55|      0|        return;
   56|       |
   57|   185k|    CRYPTO_DOWN_REF(&decoder->base.refcnt, &ref);
   58|   185k|    if (ref > 0)
  ------------------
  |  Branch (58:9): [True: 185k, False: 40]
  ------------------
   59|   185k|        return;
   60|     40|    OPENSSL_free(decoder->base.name);
  ------------------
  |  |  115|     40|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     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);
  ------------------
  |  |  115|     40|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     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:
  ------------------
  |  |  916|     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:
  ------------------
  |  |  917|     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:
  ------------------
  |  |  918|      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:
  ------------------
  |  |  919|      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:
  ------------------
  |  |  920|     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:
  ------------------
  |  |  921|     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:
  ------------------
  |  |  922|     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:
  ------------------
  |  |  923|     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:
  ------------------
  |  |  924|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|   271k|{
  456|   271k|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|   271k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   271k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (456:9): [True: 0, False: 271k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  458|      0|        return 0;
  459|      0|    }
  460|       |
  461|   271k|    return decoder->base.prov;
  462|   271k|}
ossl_decoder_parsed_properties:
  476|     82|{
  477|     82|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|     82|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     82|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (477:9): [True: 0, False: 82]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  479|      0|        return 0;
  480|      0|    }
  481|       |
  482|     82|    return decoder->base.parsed_propdef;
  483|     82|}
ossl_decoder_get_number:
  486|  77.6k|{
  487|  77.6k|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|  77.6k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  77.6k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (487:9): [True: 0, False: 77.6k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  489|      0|        return 0;
  490|      0|    }
  491|       |
  492|  77.6k|    return decoder->base.id;
  493|  77.6k|}
OSSL_DECODER_is_a:
  506|  74.0k|{
  507|  74.0k|    if (decoder->base.prov != NULL) {
  ------------------
  |  Branch (507:9): [True: 74.0k, False: 0]
  ------------------
  508|  74.0k|        OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov);
  509|  74.0k|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  510|       |
  511|  74.0k|        return ossl_namemap_name2num(namemap, name) == decoder->base.id;
  512|  74.0k|    }
  513|      0|    return 0;
  514|  74.0k|}
ossl_decoder_fast_is_a:
  525|  80.5k|{
  526|  80.5k|    int id = *id_cache;
  527|       |
  528|  80.5k|    if (id <= 0)
  ------------------
  |  Branch (528:9): [True: 77.0k, False: 3.51k]
  ------------------
  529|  77.0k|        *id_cache = id = resolve_name(decoder, name);
  530|       |
  531|  80.5k|    return id > 0 && ossl_decoder_get_number(decoder) == id;
  ------------------
  |  Branch (531:12): [True: 77.6k, False: 2.92k]
  |  Branch (531:22): [True: 74.3k, False: 3.33k]
  ------------------
  532|  80.5k|}
OSSL_DECODER_do_all_provided:
  550|    743|{
  551|    743|    struct decoder_data_st methdata;
  552|    743|    struct do_one_data_st data;
  553|       |
  554|    743|    methdata.libctx = libctx;
  555|    743|    methdata.tmp_store = NULL;
  556|    743|    (void)inner_ossl_decoder_fetch(&methdata, NULL, NULL /* properties */);
  557|       |
  558|    743|    data.user_fn = user_fn;
  559|    743|    data.user_arg = user_arg;
  560|    743|    if (methdata.tmp_store != NULL)
  ------------------
  |  Branch (560:9): [True: 0, False: 743]
  ------------------
  561|      0|        ossl_method_store_do_all(methdata.tmp_store, &do_one, &data);
  562|    743|    ossl_method_store_do_all(get_decoder_store(libctx), &do_one, &data);
  563|    743|    dealloc_tmp_decoder_store(methdata.tmp_store);
  564|    743|}
OSSL_DECODER_CTX_new:
  623|  40.7k|{
  624|  40.7k|    OSSL_DECODER_CTX *ctx;
  625|       |
  626|  40.7k|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  40.7k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  40.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  40.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  627|  40.7k|    return ctx;
  628|  40.7k|}
OSSL_DECODER_CTX_free:
  663|  77.1k|{
  664|  77.1k|    if (ctx != NULL) {
  ------------------
  |  Branch (664:9): [True: 40.7k, False: 36.4k]
  ------------------
  665|  40.7k|        if (ctx->cleanup != NULL)
  ------------------
  |  Branch (665:13): [True: 36.5k, False: 4.22k]
  ------------------
  666|  36.5k|            ctx->cleanup(ctx->construct_data);
  667|  40.7k|        sk_OSSL_DECODER_INSTANCE_pop_free(ctx->decoder_insts,
  668|  40.7k|                                          ossl_decoder_instance_free);
  669|  40.7k|        ossl_pw_clear_passphrase_data(&ctx->pwdata);
  670|  40.7k|        OPENSSL_free(ctx);
  ------------------
  |  |  115|  40.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  40.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  40.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  671|  40.7k|    }
  672|  77.1k|}
decoder_meth.c:ossl_decoder_new:
   29|     40|{
   30|     40|    OSSL_DECODER *decoder = NULL;
   31|       |
   32|     40|    if ((decoder = OPENSSL_zalloc(sizeof(*decoder))) == NULL)
  ------------------
  |  |  104|     40|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     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|    743|{
  344|    743|    OSSL_METHOD_STORE *store = get_decoder_store(methdata->libctx);
  345|    743|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  346|    743|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (346:31): [True: 0, False: 743]
  ------------------
  347|    743|    void *method = NULL;
  348|    743|    int unsupported, id;
  349|       |
  350|    743|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (350:9): [True: 0, False: 743]
  |  Branch (350:26): [True: 0, False: 743]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  352|      0|        return NULL;
  353|      0|    }
  354|       |
  355|    743|    id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (355:10): [True: 0, False: 743]
  ------------------
  356|       |
  357|       |    /*
  358|       |     * If we haven't found the name yet, chances are that the algorithm to
  359|       |     * be fetched is unsupported.
  360|       |     */
  361|    743|    unsupported = id == 0;
  362|       |
  363|    743|    if (id == 0
  ------------------
  |  Branch (363:9): [True: 743, False: 0]
  ------------------
  364|    743|        || !ossl_method_store_cache_get(store, NULL, id, propq, &method)) {
  ------------------
  |  Branch (364:12): [True: 0, False: 0]
  ------------------
  365|    743|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  366|    743|            get_tmp_decoder_store,
  367|    743|            reserve_decoder_store,
  368|    743|            unreserve_decoder_store,
  369|    743|            get_decoder_from_store,
  370|    743|            put_decoder_in_store,
  371|    743|            construct_decoder,
  372|    743|            destruct_decoder
  373|    743|        };
  374|    743|        OSSL_PROVIDER *prov = NULL;
  375|       |
  376|    743|        methdata->id = id;
  377|    743|        methdata->names = name;
  378|    743|        methdata->propquery = propq;
  379|    743|        methdata->flag_construct_error_occurred = 0;
  380|    743|        if ((method = ossl_method_construct(methdata->libctx, OSSL_OP_DECODER,
  ------------------
  |  |  287|    743|# define OSSL_OP_DECODER                            21
  ------------------
  |  Branch (380:13): [True: 0, False: 743]
  ------------------
  381|    743|                                            &prov, 0 /* !force_cache */,
  382|    743|                                            &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|    743|        unsupported = !methdata->flag_construct_error_occurred;
  401|    743|    }
  402|       |
  403|    743|    if ((id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (403:10): [True: 0, False: 743]
  |  Branch (403:21): [True: 0, False: 743]
  |  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),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      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|    743|    return method;
  416|    743|}
decoder_meth.c:reserve_decoder_store:
  107|    743|{
  108|    743|    struct decoder_data_st *methdata = data;
  109|       |
  110|    743|    if (store == NULL
  ------------------
  |  Branch (110:9): [True: 743, False: 0]
  ------------------
  111|    743|        && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (111:12): [True: 0, False: 743]
  ------------------
  112|      0|        return 0;
  113|       |
  114|    743|    return ossl_method_lock_store(store);
  115|    743|}
decoder_meth.c:unreserve_decoder_store:
  118|    743|{
  119|    743|    struct decoder_data_st *methdata = data;
  120|       |
  121|    743|    if (store == NULL
  ------------------
  |  Branch (121:9): [True: 743, False: 0]
  ------------------
  122|    743|        && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (122:12): [True: 0, False: 743]
  ------------------
  123|      0|        return 0;
  124|       |
  125|    743|    return ossl_method_unlock_store(store);
  126|    743|}
decoder_meth.c:get_decoder_from_store:
  131|    743|{
  132|    743|    struct decoder_data_st *methdata = data;
  133|    743|    void *method = NULL;
  134|    743|    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|    743|    if ((id = methdata->id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (141:9): [True: 743, False: 0]
  |  Branch (141:37): [True: 0, False: 743]
  ------------------
  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|    743|    if (id == 0)
  ------------------
  |  Branch (152:9): [True: 743, False: 0]
  ------------------
  153|    743|        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|    743|{
   96|    743|    if (store != NULL)
  ------------------
  |  Branch (96:9): [True: 0, False: 743]
  ------------------
   97|      0|        ossl_method_store_free(store);
   98|    743|}
decoder_meth.c:get_decoder_store:
  102|  3.01k|{
  103|  3.01k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_STORE_INDEX);
  ------------------
  |  |  109|  3.01k|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  104|  3.01k|}
decoder_meth.c:resolve_name:
  517|  77.0k|{
  518|  77.0k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov);
  519|  77.0k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  520|       |
  521|  77.0k|    return ossl_namemap_name2num(namemap, name);
  522|  77.0k|}
decoder_meth.c:do_one:
  540|  29.7k|{
  541|  29.7k|    struct do_one_data_st *data = arg;
  542|       |
  543|  29.7k|    data->user_fn(method, data->user_arg);
  544|  29.7k|}

ossl_decoder_cache_new:
  683|      2|{
  684|      2|    DECODER_CACHE *cache = OPENSSL_malloc(sizeof(*cache));
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  118|      1|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  723|       |
  724|      1|    if (cache == NULL)
  ------------------
  |  Branch (724:9): [True: 1, False: 0]
  ------------------
  725|      1|        return 0;
  726|       |
  727|       |
  728|      0|    if (!CRYPTO_THREAD_write_lock(cache->lock)) {
  ------------------
  |  Branch (728:9): [True: 0, False: 0]
  ------------------
  729|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  730|      0|        return 0;
  731|      0|    }
  732|       |
  733|      0|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  734|      0|    lh_DECODER_CACHE_ENTRY_flush(cache->hashtable);
  735|       |
  736|      0|    CRYPTO_THREAD_unlock(cache->lock);
  737|      0|    return 1;
  738|      0|}
OSSL_DECODER_CTX_new_for_pkey:
  746|  40.0k|{
  747|  40.0k|    OSSL_DECODER_CTX *ctx = NULL;
  748|  40.0k|    OSSL_PARAM decoder_params[] = {
  749|  40.0k|        OSSL_PARAM_END,
  ------------------
  |  |   25|  40.0k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  750|  40.0k|        OSSL_PARAM_END
  ------------------
  |  |   25|  40.0k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  751|  40.0k|    };
  752|  40.0k|    DECODER_CACHE *cache
  753|  40.0k|        = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_CACHE_INDEX);
  ------------------
  |  |  118|  40.0k|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  754|  40.0k|    DECODER_CACHE_ENTRY cacheent, *res, *newcache = NULL;
  755|       |
  756|  40.0k|    if (cache == NULL) {
  ------------------
  |  Branch (756:9): [True: 0, False: 40.0k]
  ------------------
  757|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  758|      0|        return NULL;
  759|      0|    }
  760|  40.0k|    if (propquery != NULL)
  ------------------
  |  Branch (760:9): [True: 0, False: 40.0k]
  ------------------
  761|      0|        decoder_params[0] = OSSL_PARAM_construct_utf8_string(OSSL_DECODER_PARAM_PROPERTIES,
  ------------------
  |  |  198|      0|# define OSSL_DECODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  117|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  762|      0|                                                             (char *)propquery, 0);
  763|       |
  764|       |    /* It is safe to cast away the const here */
  765|  40.0k|    cacheent.input_type = (char *)input_type;
  766|  40.0k|    cacheent.input_structure = (char *)input_structure;
  767|  40.0k|    cacheent.keytype = (char *)keytype;
  768|  40.0k|    cacheent.selection = selection;
  769|  40.0k|    cacheent.propquery = (char *)propquery;
  770|       |
  771|  40.0k|    if (!CRYPTO_THREAD_read_lock(cache->lock)) {
  ------------------
  |  Branch (771:9): [True: 0, False: 40.0k]
  ------------------
  772|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  773|      0|        return NULL;
  774|      0|    }
  775|       |
  776|       |    /* First see if we have a template OSSL_DECODER_CTX */
  777|  40.0k|    res = lh_DECODER_CACHE_ENTRY_retrieve(cache->hashtable, &cacheent);
  778|       |
  779|  40.0k|    if (res == NULL) {
  ------------------
  |  Branch (779:9): [True: 731, False: 39.2k]
  ------------------
  780|       |        /*
  781|       |         * There is no template so we will have to construct one. This will be
  782|       |         * time consuming so release the lock and we will later upgrade it to a
  783|       |         * write lock.
  784|       |         */
  785|    731|        CRYPTO_THREAD_unlock(cache->lock);
  786|       |
  787|    731|        if ((ctx = OSSL_DECODER_CTX_new()) == NULL) {
  ------------------
  |  Branch (787:13): [True: 0, False: 731]
  ------------------
  788|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  789|      0|            return NULL;
  790|      0|        }
  791|       |
  792|    731|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|    731|    do {                                        \
  |  |  220|    731|        BIO *trc_out = NULL;                    \
  |  |  221|    731|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  793|      0|            BIO_printf(trc_out,
  794|      0|                    "(ctx %p) Looking for %s decoders with selection %d\n",
  795|      0|                    (void *)ctx, keytype, selection);
  796|      0|            BIO_printf(trc_out, "    input type: %s, input structure: %s\n",
  797|      0|                    input_type, input_structure);
  798|    731|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|    731|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  799|       |
  800|    731|        if (OSSL_DECODER_CTX_set_input_type(ctx, input_type)
  ------------------
  |  Branch (800:13): [True: 731, False: 0]
  ------------------
  801|    731|            && OSSL_DECODER_CTX_set_input_structure(ctx, input_structure)
  ------------------
  |  Branch (801:16): [True: 731, False: 0]
  ------------------
  802|    731|            && OSSL_DECODER_CTX_set_selection(ctx, selection)
  ------------------
  |  Branch (802:16): [True: 731, False: 0]
  ------------------
  803|    731|            && ossl_decoder_ctx_setup_for_pkey(ctx, keytype, libctx, propquery)
  ------------------
  |  Branch (803:16): [True: 731, False: 0]
  ------------------
  804|    731|            && OSSL_DECODER_CTX_add_extra(ctx, libctx, propquery)
  ------------------
  |  Branch (804:16): [True: 731, False: 0]
  ------------------
  805|    731|            && (propquery == NULL
  ------------------
  |  Branch (805:17): [True: 731, False: 0]
  ------------------
  806|    731|                || OSSL_DECODER_CTX_set_params(ctx, decoder_params))) {
  ------------------
  |  Branch (806:20): [True: 0, False: 0]
  ------------------
  807|    731|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|    731|    do {                                        \
  |  |  220|    731|        BIO *trc_out = NULL;                    \
  |  |  221|    731|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  808|      0|                BIO_printf(trc_out, "(ctx %p) Got %d decoders\n",
  809|      0|                        (void *)ctx, OSSL_DECODER_CTX_get_num_decoders(ctx));
  810|    731|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|    731|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  811|    731|        } else {
  812|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  813|      0|            OSSL_DECODER_CTX_free(ctx);
  814|      0|            return NULL;
  815|      0|        }
  816|       |
  817|    731|        newcache = OPENSSL_zalloc(sizeof(*newcache));
  ------------------
  |  |  104|    731|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    731|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    731|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  818|    731|        if (newcache == NULL) {
  ------------------
  |  Branch (818:13): [True: 0, False: 731]
  ------------------
  819|      0|            OSSL_DECODER_CTX_free(ctx);
  820|      0|            return NULL;
  821|      0|        }
  822|       |
  823|    731|        if (input_type != NULL) {
  ------------------
  |  Branch (823:13): [True: 731, False: 0]
  ------------------
  824|    731|            newcache->input_type = OPENSSL_strdup(input_type);
  ------------------
  |  |  119|    731|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    731|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    731|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  825|    731|            if (newcache->input_type == NULL)
  ------------------
  |  Branch (825:17): [True: 0, False: 731]
  ------------------
  826|      0|                goto err;
  827|    731|        }
  828|    731|        if (input_structure != NULL) {
  ------------------
  |  Branch (828:13): [True: 731, False: 0]
  ------------------
  829|    731|            newcache->input_structure = OPENSSL_strdup(input_structure);
  ------------------
  |  |  119|    731|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    731|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    731|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  830|    731|            if (newcache->input_structure == NULL)
  ------------------
  |  Branch (830:17): [True: 0, False: 731]
  ------------------
  831|      0|                goto err;
  832|    731|        }
  833|    731|        if (keytype != NULL) {
  ------------------
  |  Branch (833:13): [True: 731, False: 0]
  ------------------
  834|    731|            newcache->keytype = OPENSSL_strdup(keytype);
  ------------------
  |  |  119|    731|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    731|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    731|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  835|    731|            if (newcache->keytype == NULL)
  ------------------
  |  Branch (835:17): [True: 0, False: 731]
  ------------------
  836|      0|                goto err;
  837|    731|        }
  838|    731|        if (propquery != NULL) {
  ------------------
  |  Branch (838:13): [True: 0, False: 731]
  ------------------
  839|      0|            newcache->propquery = OPENSSL_strdup(propquery);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  840|      0|            if (newcache->propquery == NULL)
  ------------------
  |  Branch (840:17): [True: 0, False: 0]
  ------------------
  841|      0|                goto err;
  842|      0|        }
  843|    731|        newcache->selection = selection;
  844|    731|        newcache->template = ctx;
  845|       |
  846|    731|        if (!CRYPTO_THREAD_write_lock(cache->lock)) {
  ------------------
  |  Branch (846:13): [True: 0, False: 731]
  ------------------
  847|      0|            ctx = NULL;
  848|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  849|      0|            goto err;
  850|      0|        }
  851|    731|        res = lh_DECODER_CACHE_ENTRY_retrieve(cache->hashtable, &cacheent);
  852|    731|        if (res == NULL) {
  ------------------
  |  Branch (852:13): [True: 731, False: 0]
  ------------------
  853|    731|            (void)lh_DECODER_CACHE_ENTRY_insert(cache->hashtable, newcache);
  854|    731|            if (lh_DECODER_CACHE_ENTRY_error(cache->hashtable)) {
  ------------------
  |  Branch (854:17): [True: 0, False: 731]
  ------------------
  855|      0|                ctx = NULL;
  856|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  857|      0|                goto err;
  858|      0|            }
  859|    731|        } else {
  860|       |            /*
  861|       |             * We raced with another thread to construct this and lost. Free
  862|       |             * what we just created and use the entry from the hashtable instead
  863|       |             */
  864|      0|            decoder_cache_entry_free(newcache);
  865|      0|            ctx = res->template;
  866|      0|        }
  867|  39.2k|    } else {
  868|  39.2k|        ctx = res->template;
  869|  39.2k|    }
  870|       |
  871|  40.0k|    ctx = ossl_decoder_ctx_for_pkey_dup(ctx, pkey, input_type, input_structure);
  872|  40.0k|    CRYPTO_THREAD_unlock(cache->lock);
  873|       |
  874|  40.0k|    return ctx;
  875|      0| err:
  876|      0|    decoder_cache_entry_free(newcache);
  877|      0|    OSSL_DECODER_CTX_free(ctx);
  878|      0|    return NULL;
  879|  40.0k|}
decoder_pkey.c:decoder_cache_entry_hash:
  617|  41.4k|{
  618|  41.4k|    unsigned long hash = 17;
  619|       |
  620|  41.4k|    hash = (hash * 23)
  621|  41.4k|           + (cache->propquery == NULL
  ------------------
  |  Branch (621:15): [True: 41.4k, False: 0]
  ------------------
  622|  41.4k|              ? 0 : ossl_lh_strcasehash(cache->propquery));
  623|  41.4k|    hash = (hash * 23)
  624|  41.4k|           + (cache->input_structure == NULL
  ------------------
  |  Branch (624:15): [True: 0, False: 41.4k]
  ------------------
  625|  41.4k|              ? 0  : ossl_lh_strcasehash(cache->input_structure));
  626|  41.4k|    hash = (hash * 23)
  627|  41.4k|           + (cache->input_type == NULL
  ------------------
  |  Branch (627:15): [True: 0, False: 41.4k]
  ------------------
  628|  41.4k|              ? 0  : ossl_lh_strcasehash(cache->input_type));
  629|  41.4k|    hash = (hash * 23)
  630|  41.4k|           + (cache->keytype == NULL
  ------------------
  |  Branch (630:15): [True: 0, False: 41.4k]
  ------------------
  631|  41.4k|              ? 0  : ossl_lh_strcasehash(cache->keytype));
  632|       |
  633|  41.4k|    hash ^= cache->selection;
  634|       |
  635|  41.4k|    return hash;
  636|  41.4k|}
decoder_pkey.c:decoder_cache_entry_cmp:
  659|  39.2k|{
  660|  39.2k|    int cmp;
  661|       |
  662|  39.2k|    if (a->selection != b->selection)
  ------------------
  |  Branch (662:9): [True: 0, False: 39.2k]
  ------------------
  663|      0|        return (a->selection < b->selection) ? -1 : 1;
  ------------------
  |  Branch (663:16): [True: 0, False: 0]
  ------------------
  664|       |
  665|  39.2k|    cmp = nullstrcmp(a->keytype, b->keytype, 1);
  666|  39.2k|    if (cmp != 0)
  ------------------
  |  Branch (666:9): [True: 0, False: 39.2k]
  ------------------
  667|      0|        return cmp;
  668|       |
  669|  39.2k|    cmp = nullstrcmp(a->input_type, b->input_type, 1);
  670|  39.2k|    if (cmp != 0)
  ------------------
  |  Branch (670:9): [True: 0, False: 39.2k]
  ------------------
  671|      0|        return cmp;
  672|       |
  673|  39.2k|    cmp = nullstrcmp(a->input_structure, b->input_structure, 1);
  674|  39.2k|    if (cmp != 0)
  ------------------
  |  Branch (674:9): [True: 0, False: 39.2k]
  ------------------
  675|      0|        return cmp;
  676|       |
  677|  39.2k|    cmp = nullstrcmp(a->propquery, b->propquery, 0);
  678|       |
  679|  39.2k|    return cmp;
  680|  39.2k|}
decoder_pkey.c:nullstrcmp:
  639|   157k|{
  640|   157k|    if (a == NULL || b == NULL) {
  ------------------
  |  Branch (640:9): [True: 39.2k, False: 117k]
  |  Branch (640:22): [True: 0, False: 117k]
  ------------------
  641|  39.2k|        if (a == NULL) {
  ------------------
  |  Branch (641:13): [True: 39.2k, False: 0]
  ------------------
  642|  39.2k|            if (b == NULL)
  ------------------
  |  Branch (642:17): [True: 39.2k, False: 0]
  ------------------
  643|  39.2k|                return 0;
  644|      0|            else
  645|      0|                return 1;
  646|  39.2k|        } else {
  647|      0|            return -1;
  648|      0|        }
  649|   117k|    } else {
  650|   117k|        if (casecmp)
  ------------------
  |  Branch (650:13): [True: 117k, False: 0]
  ------------------
  651|   117k|            return OPENSSL_strcasecmp(a, b);
  652|      0|        else
  653|      0|            return strcmp(a, b);
  654|   117k|    }
  655|   157k|}
decoder_pkey.c:decoder_cache_entry_free:
  605|    731|{
  606|    731|    if (entry == NULL)
  ------------------
  |  Branch (606:9): [True: 0, False: 731]
  ------------------
  607|      0|        return;
  608|    731|    OPENSSL_free(entry->input_type);
  ------------------
  |  |  115|    731|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    731|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    731|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  609|    731|    OPENSSL_free(entry->input_structure);
  ------------------
  |  |  115|    731|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    731|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    731|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  610|    731|    OPENSSL_free(entry->keytype);
  ------------------
  |  |  115|    731|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    731|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    731|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  611|    731|    OPENSSL_free(entry->propquery);
  ------------------
  |  |  115|    731|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    731|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    731|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  612|    731|    OSSL_DECODER_CTX_free(entry->template);
  613|    731|    OPENSSL_free(entry);
  ------------------
  |  |  115|    731|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    731|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    731|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  614|    731|}
decoder_pkey.c:ossl_decoder_ctx_setup_for_pkey:
  382|    731|{
  383|    731|    int ok = 0;
  384|    731|    struct decoder_pkey_data_st *process_data = NULL;
  385|    731|    struct collect_data_st collect_data = { NULL };
  386|    731|    STACK_OF(EVP_KEYMGMT) *keymgmts = NULL;
  ------------------
  |  |   31|    731|# define STACK_OF(type) struct stack_st_##type
  ------------------
  387|       |
  388|    731|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|    731|    do {                                        \
  |  |  220|    731|        BIO *trc_out = NULL;                    \
  |  |  221|    731|        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|    731|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|    731|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  402|       |
  403|       |    /* Allocate data. */
  404|    731|    if ((process_data = OPENSSL_zalloc(sizeof(*process_data))) == NULL)
  ------------------
  |  |  104|    731|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    731|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    731|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (404:9): [True: 0, False: 731]
  ------------------
  405|      0|        goto err;
  406|    731|    if ((propquery != NULL
  ------------------
  |  Branch (406:10): [True: 0, False: 731]
  ------------------
  407|    731|            && (process_data->propq = OPENSSL_strdup(propquery)) == NULL))
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|    731|    keymgmts = sk_EVP_KEYMGMT_new_null();
  412|    731|    if (keymgmts == NULL) {
  ------------------
  |  Branch (412:9): [True: 0, False: 731]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  414|      0|        goto err;
  415|      0|    }
  416|       |
  417|    731|    process_data->object    = NULL;
  418|    731|    process_data->libctx    = libctx;
  419|    731|    process_data->selection = ctx->selection;
  420|    731|    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|    731|    collect_data.ctx        = ctx;
  438|    731|    collect_data.libctx     = libctx;
  439|    731|    collect_data.keymgmts   = keymgmts;
  440|    731|    collect_data.keytype    = keytype;
  441|    731|    EVP_KEYMGMT_do_all_provided(libctx, collect_keymgmt, &collect_data);
  442|       |
  443|    731|    if (collect_data.error_occurred)
  ------------------
  |  Branch (443:9): [True: 0, False: 731]
  ------------------
  444|      0|        goto err;
  445|       |
  446|       |    /* Enumerate all matching decoders. */
  447|    731|    OSSL_DECODER_do_all_provided(libctx, collect_decoder, &collect_data);
  448|       |
  449|    731|    if (collect_data.error_occurred)
  ------------------
  |  Branch (449:9): [True: 0, False: 731]
  ------------------
  450|      0|        goto err;
  451|       |
  452|    731|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|    731|    do {                                        \
  |  |  220|    731|        BIO *trc_out = NULL;                    \
  |  |  221|    731|        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|    731|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|    731|    } 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|    731|    if (OSSL_DECODER_CTX_get_num_decoders(ctx) != 0) {
  ------------------
  |  Branch (463:9): [True: 12, False: 719]
  ------------------
  464|     12|        if (!OSSL_DECODER_CTX_set_construct(ctx, decoder_construct_pkey)
  ------------------
  |  Branch (464:13): [True: 0, False: 12]
  ------------------
  465|     12|            || !OSSL_DECODER_CTX_set_construct_data(ctx, process_data)
  ------------------
  |  Branch (465:16): [True: 0, False: 12]
  ------------------
  466|     12|            || !OSSL_DECODER_CTX_set_cleanup(ctx,
  ------------------
  |  Branch (466:16): [True: 0, False: 12]
  ------------------
  467|     12|                                             decoder_clean_pkey_construct_arg))
  468|      0|            goto err;
  469|       |
  470|     12|        process_data = NULL; /* Avoid it being freed */
  471|     12|    }
  472|       |
  473|    731|    ok = 1;
  474|    731| err:
  475|    731|    decoder_clean_pkey_construct_arg(process_data);
  476|    731|    return ok;
  477|    731|}
decoder_pkey.c:collect_keymgmt:
  351|  13.1k|{
  352|  13.1k|    struct collect_data_st *data = arg;
  353|       |
  354|  13.1k|    if (!check_keymgmt(keymgmt, data))
  ------------------
  |  Branch (354:9): [True: 13.1k, False: 13]
  ------------------
  355|  13.1k|        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|     13|    if (!EVP_KEYMGMT_up_ref(keymgmt))
  ------------------
  |  Branch (364:9): [True: 0, False: 13]
  ------------------
  365|      0|        return;
  366|       |
  367|     13|    if (sk_EVP_KEYMGMT_push(data->keymgmts, keymgmt) <= 0) {
  ------------------
  |  Branch (367:9): [True: 0, False: 13]
  ------------------
  368|      0|        EVP_KEYMGMT_free(keymgmt);
  369|      0|        data->error_occurred = 1;
  370|      0|    }
  371|     13|}
decoder_pkey.c:check_keymgmt:
  312|  13.1k|{
  313|       |    /* If no keytype was specified, everything matches. */
  314|  13.1k|    if (data->keytype == NULL)
  ------------------
  |  Branch (314:9): [True: 0, False: 13.1k]
  ------------------
  315|      0|        return 1;
  316|       |
  317|  13.1k|    if (!data->keytype_resolved) {
  ------------------
  |  Branch (317:9): [True: 731, False: 12.4k]
  ------------------
  318|       |        /* We haven't cached the IDs from the keytype string yet. */
  319|    731|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(data->libctx);
  320|    731|        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|    731|        if (data->keytype_id != 0
  ------------------
  |  Branch (326:13): [True: 15, False: 716]
  ------------------
  327|    731|            && (strcmp(data->keytype, "id-ecPublicKey") == 0
  ------------------
  |  Branch (327:17): [True: 1, False: 14]
  ------------------
  328|     15|                || strcmp(data->keytype, "1.2.840.10045.2.1") == 0))
  ------------------
  |  Branch (328:20): [True: 0, False: 14]
  ------------------
  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|    731|        data->keytype_resolved = 1;
  336|    731|    }
  337|       |
  338|       |    /* Specified keytype could not be resolved, so nothing matches. */
  339|  13.1k|    if (data->keytype_id == 0)
  ------------------
  |  Branch (339:9): [True: 12.8k, False: 270]
  ------------------
  340|  12.8k|        return 0;
  341|       |
  342|       |    /* Does not match the keytype specified, so skip. */
  343|    270|    if (keymgmt->name_id != data->keytype_id
  ------------------
  |  Branch (343:9): [True: 258, False: 12]
  ------------------
  344|    270|        && keymgmt->name_id != data->sm2_id)
  ------------------
  |  Branch (344:12): [True: 257, False: 1]
  ------------------
  345|    257|        return 0;
  346|       |
  347|     13|    return 1;
  348|    270|}
decoder_pkey.c:collect_decoder:
  265|  29.2k|{
  266|  29.2k|    struct collect_data_st *data = arg;
  267|  29.2k|    STACK_OF(EVP_KEYMGMT) *keymgmts = data->keymgmts;
  ------------------
  |  |   31|  29.2k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  268|  29.2k|    int i, end_i;
  269|  29.2k|    EVP_KEYMGMT *keymgmt;
  270|  29.2k|    const OSSL_PROVIDER *prov;
  271|  29.2k|    void *provctx;
  272|       |
  273|  29.2k|    if (data->error_occurred)
  ------------------
  |  Branch (273:9): [True: 0, False: 29.2k]
  ------------------
  274|      0|        return;
  275|       |
  276|  29.2k|    prov = OSSL_DECODER_get0_provider(decoder);
  277|  29.2k|    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|  29.2k|    if (decoder->does_selection != NULL
  ------------------
  |  Branch (284:9): [True: 27.0k, False: 2.19k]
  ------------------
  285|  29.2k|            && !decoder->does_selection(provctx, data->ctx->selection))
  ------------------
  |  Branch (285:16): [True: 14.6k, False: 12.4k]
  ------------------
  286|  14.6k|        return;
  287|       |
  288|  14.6k|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  14.6k|    do {                                        \
  |  |  220|  14.6k|        BIO *trc_out = NULL;                    \
  |  |  221|  14.6k|        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|  14.6k|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  14.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  296|       |
  297|  14.6k|    end_i = sk_EVP_KEYMGMT_num(keymgmts);
  298|  14.8k|    for (i = 0; i < end_i; ++i) {
  ------------------
  |  Branch (298:17): [True: 260, False: 14.6k]
  ------------------
  299|    260|        keymgmt = sk_EVP_KEYMGMT_value(keymgmts, i);
  300|       |
  301|    260|        collect_decoder_keymgmt(keymgmt, decoder, provctx, data);
  302|    260|        if (data->error_occurred)
  ------------------
  |  Branch (302:13): [True: 0, False: 260]
  ------------------
  303|      0|            return;
  304|    260|    }
  305|  14.6k|}
decoder_pkey.c:collect_decoder_keymgmt:
  222|    260|{
  223|    260|    void *decoderctx = NULL;
  224|    260|    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|    260|    if (keymgmt->name_id != decoder->base.id)
  ------------------
  |  Branch (231:9): [True: 235, False: 25]
  ------------------
  232|       |        /* Mismatch is not an error, continue. */
  233|    235|        return;
  234|       |
  235|     25|    if ((decoderctx = decoder->newctx(provctx)) == NULL) {
  ------------------
  |  Branch (235:9): [True: 0, False: 25]
  ------------------
  236|      0|        data->error_occurred = 1;
  237|      0|        return;
  238|      0|    }
  239|       |
  240|     25|    if ((di = ossl_decoder_instance_new(decoder, decoderctx)) == NULL) {
  ------------------
  |  Branch (240:9): [True: 0, False: 25]
  ------------------
  241|      0|        decoder->freectx(decoderctx);
  242|      0|        data->error_occurred = 1;
  243|      0|        return;
  244|      0|    }
  245|       |
  246|     25|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|     25|    do {                                        \
  |  |  220|     25|        BIO *trc_out = NULL;                    \
  |  |  221|     25|        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|     25|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|     25|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  254|       |
  255|     25|    if (!ossl_decoder_ctx_add_decoder_inst(data->ctx, di)) {
  ------------------
  |  Branch (255:9): [True: 0, False: 25]
  ------------------
  256|      0|        ossl_decoder_instance_free(di);
  257|      0|        data->error_occurred = 1;
  258|      0|        return;
  259|      0|    }
  260|       |
  261|     25|    ++data->total;
  262|     25|}
decoder_pkey.c:decoder_construct_pkey:
   73|  52.4k|{
   74|  52.4k|    struct decoder_pkey_data_st *data = construct_data;
   75|  52.4k|    OSSL_DECODER *decoder = OSSL_DECODER_INSTANCE_get_decoder(decoder_inst);
   76|  52.4k|    void *decoderctx = OSSL_DECODER_INSTANCE_get_decoder_ctx(decoder_inst);
   77|  52.4k|    const OSSL_PROVIDER *decoder_prov = OSSL_DECODER_get0_provider(decoder);
   78|  52.4k|    EVP_KEYMGMT *keymgmt = NULL;
   79|  52.4k|    const OSSL_PROVIDER *keymgmt_prov = NULL;
   80|  52.4k|    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|  52.4k|    void *object_ref = NULL;
   90|  52.4k|    size_t object_ref_sz = 0;
   91|  52.4k|    const OSSL_PARAM *p;
   92|       |
   93|  52.4k|    p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_TYPE);
  ------------------
  |  |  328|  52.4k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
   94|  52.4k|    if (p != NULL) {
  ------------------
  |  Branch (94:9): [True: 52.4k, False: 0]
  ------------------
   95|  52.4k|        char *object_type = NULL;
   96|       |
   97|  52.4k|        if (!OSSL_PARAM_get_utf8_string(p, &object_type, 0))
  ------------------
  |  Branch (97:13): [True: 0, False: 52.4k]
  ------------------
   98|      0|            return 0;
   99|  52.4k|        OPENSSL_free(data->object_type);
  ------------------
  |  |  115|  52.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  52.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  52.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  100|  52.4k|        data->object_type = object_type;
  101|  52.4k|    }
  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|  52.4k|    p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_REFERENCE);
  ------------------
  |  |  330|  52.4k|# define OSSL_OBJECT_PARAM_REFERENCE "reference"
  ------------------
  109|  52.4k|    if (p == NULL || p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|  15.9k|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (109:9): [True: 36.4k, False: 15.9k]
  |  Branch (109:22): [True: 0, False: 15.9k]
  ------------------
  110|  36.4k|        return 0;
  111|  15.9k|    object_ref = p->data;
  112|  15.9k|    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|  15.9k|    end = sk_EVP_KEYMGMT_num(data->keymgmts);
  119|  15.9k|    for (i = 0; i < end; i++) {
  ------------------
  |  Branch (119:17): [True: 15.9k, False: 0]
  ------------------
  120|  15.9k|        keymgmt = sk_EVP_KEYMGMT_value(data->keymgmts, i);
  121|  15.9k|        keymgmt_prov = EVP_KEYMGMT_get0_provider(keymgmt);
  122|       |
  123|  15.9k|        if (keymgmt_prov == decoder_prov
  ------------------
  |  Branch (123:13): [True: 15.9k, False: 0]
  ------------------
  124|  15.9k|            && evp_keymgmt_has_load(keymgmt)
  ------------------
  |  Branch (124:16): [True: 15.9k, False: 0]
  ------------------
  125|  15.9k|            && EVP_KEYMGMT_is_a(keymgmt, data->object_type))
  ------------------
  |  Branch (125:16): [True: 15.9k, False: 0]
  ------------------
  126|  15.9k|            break;
  127|  15.9k|    }
  128|  15.9k|    if (i < end) {
  ------------------
  |  Branch (128:9): [True: 15.9k, False: 0]
  ------------------
  129|       |        /* To allow it to be freed further down */
  130|  15.9k|        if (!EVP_KEYMGMT_up_ref(keymgmt))
  ------------------
  |  Branch (130:13): [True: 0, False: 15.9k]
  ------------------
  131|      0|            return 0;
  132|  15.9k|    } 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|  15.9k|    if (keymgmt != NULL) {
  ------------------
  |  Branch (138:9): [True: 15.9k, False: 0]
  ------------------
  139|  15.9k|        EVP_PKEY *pkey = NULL;
  140|  15.9k|        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|  15.9k|        if (keymgmt_prov == decoder_prov) {
  ------------------
  |  Branch (150:13): [True: 15.9k, False: 0]
  ------------------
  151|  15.9k|            keydata = evp_keymgmt_load(keymgmt, object_ref, object_ref_sz);
  152|  15.9k|        } 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;
  ------------------
  |  |  579|      0|    ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  ------------------
  |  |  |  |  577|      0|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  567|      0|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  568|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  ------------------
  |  |  |  |  574|      0|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  569|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  ------------------
  |  |  |  |  575|      0|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  570|      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|  15.9k|        if (keydata != NULL
  ------------------
  |  Branch (175:13): [True: 15.9k, False: 0]
  ------------------
  176|  15.9k|            && (pkey = evp_keymgmt_util_make_pkey(keymgmt, keydata)) == NULL)
  ------------------
  |  Branch (176:16): [True: 0, False: 15.9k]
  ------------------
  177|      0|            evp_keymgmt_freedata(keymgmt, keydata);
  178|       |
  179|  15.9k|        *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|  15.9k|        EVP_KEYMGMT_free(keymgmt);
  186|  15.9k|    }
  187|       |    /*
  188|       |     * We successfully looked through, |*ctx->object| determines if we
  189|       |     * actually found something.
  190|       |     */
  191|  15.9k|    return (*data->object != NULL);
  192|  15.9k|}
decoder_pkey.c:decoder_clean_pkey_construct_arg:
  195|  37.2k|{
  196|  37.2k|    struct decoder_pkey_data_st *data = construct_data;
  197|       |
  198|  37.2k|    if (data != NULL) {
  ------------------
  |  Branch (198:9): [True: 37.2k, False: 12]
  ------------------
  199|  37.2k|        sk_EVP_KEYMGMT_pop_free(data->keymgmts, EVP_KEYMGMT_free);
  200|  37.2k|        OPENSSL_free(data->propq);
  ------------------
  |  |  115|  37.2k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  37.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  37.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  201|  37.2k|        OPENSSL_free(data->object_type);
  ------------------
  |  |  115|  37.2k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  37.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  37.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  202|  37.2k|        OPENSSL_free(data);
  ------------------
  |  |  115|  37.2k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  37.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  37.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  203|  37.2k|    }
  204|  37.2k|}
decoder_pkey.c:ossl_decoder_ctx_for_pkey_dup:
  499|  40.0k|{
  500|  40.0k|    OSSL_DECODER_CTX *dest;
  501|  40.0k|    struct decoder_pkey_data_st *process_data_src, *process_data_dest = NULL;
  502|       |
  503|  40.0k|    if (src == NULL)
  ------------------
  |  Branch (503:9): [True: 0, False: 40.0k]
  ------------------
  504|      0|        return NULL;
  505|       |
  506|  40.0k|    if ((dest = OSSL_DECODER_CTX_new()) == NULL) {
  ------------------
  |  Branch (506:9): [True: 0, False: 40.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  508|      0|        return NULL;
  509|      0|    }
  510|       |
  511|  40.0k|    if (!OSSL_DECODER_CTX_set_input_type(dest, input_type)
  ------------------
  |  Branch (511:9): [True: 0, False: 40.0k]
  ------------------
  512|  40.0k|            || !OSSL_DECODER_CTX_set_input_structure(dest, input_structure)) {
  ------------------
  |  Branch (512:16): [True: 0, False: 40.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  514|      0|        goto err;
  515|      0|    }
  516|  40.0k|    dest->selection = src->selection;
  517|       |
  518|  40.0k|    if (src->decoder_insts != NULL) {
  ------------------
  |  Branch (518:9): [True: 36.5k, False: 3.50k]
  ------------------
  519|  36.5k|        dest->decoder_insts
  520|  36.5k|            = sk_OSSL_DECODER_INSTANCE_deep_copy(src->decoder_insts,
  521|  36.5k|                                                 ossl_decoder_instance_dup,
  522|  36.5k|                                                 ossl_decoder_instance_free);
  523|  36.5k|        if (dest->decoder_insts == NULL) {
  ------------------
  |  Branch (523:13): [True: 0, False: 36.5k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  525|      0|            goto err;
  526|      0|        }
  527|  36.5k|    }
  528|       |
  529|  40.0k|    if (!OSSL_DECODER_CTX_set_construct(dest,
  ------------------
  |  Branch (529:9): [True: 0, False: 40.0k]
  ------------------
  530|  40.0k|                                        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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  532|      0|        goto err;
  533|      0|    }
  534|       |
  535|  40.0k|    process_data_src = OSSL_DECODER_CTX_get_construct_data(src);
  536|  40.0k|    if (process_data_src != NULL) {
  ------------------
  |  Branch (536:9): [True: 36.5k, False: 3.50k]
  ------------------
  537|  36.5k|        process_data_dest = OPENSSL_zalloc(sizeof(*process_data_dest));
  ------------------
  |  |  104|  36.5k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  36.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  36.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  538|  36.5k|        if (process_data_dest == NULL) {
  ------------------
  |  Branch (538:13): [True: 0, False: 36.5k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  540|      0|            goto err;
  541|      0|        }
  542|  36.5k|        if (process_data_src->propq != NULL) {
  ------------------
  |  Branch (542:13): [True: 0, False: 36.5k]
  ------------------
  543|      0|            process_data_dest->propq = OPENSSL_strdup(process_data_src->propq);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  546|      0|                goto err;
  547|      0|            }
  548|      0|        }
  549|       |
  550|  36.5k|        if (process_data_src->keymgmts != NULL) {
  ------------------
  |  Branch (550:13): [True: 36.5k, False: 0]
  ------------------
  551|  36.5k|            process_data_dest->keymgmts
  552|  36.5k|                = sk_EVP_KEYMGMT_deep_copy(process_data_src->keymgmts,
  553|  36.5k|                                           keymgmt_dup,
  554|  36.5k|                                           EVP_KEYMGMT_free);
  555|  36.5k|            if (process_data_dest->keymgmts == NULL) {
  ------------------
  |  Branch (555:17): [True: 0, False: 36.5k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  557|      0|                goto err;
  558|      0|            }
  559|  36.5k|        }
  560|       |
  561|  36.5k|        process_data_dest->object    = (void **)pkey;
  562|  36.5k|        process_data_dest->libctx    = process_data_src->libctx;
  563|  36.5k|        process_data_dest->selection = process_data_src->selection;
  564|  36.5k|        if (!OSSL_DECODER_CTX_set_construct_data(dest, process_data_dest)) {
  ------------------
  |  Branch (564:13): [True: 0, False: 36.5k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  566|      0|            goto err;
  567|      0|        }
  568|  36.5k|        process_data_dest = NULL;
  569|  36.5k|    }
  570|       |
  571|  40.0k|    if (!OSSL_DECODER_CTX_set_cleanup(dest,
  ------------------
  |  Branch (571:9): [True: 0, False: 40.0k]
  ------------------
  572|  40.0k|                                      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  574|      0|        goto err;
  575|      0|    }
  576|       |
  577|  40.0k|    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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  583|      0|    }
  584|      0|    OSSL_DECODER_CTX_free(dest);
  585|      0|    return NULL;
  586|  40.0k|}
decoder_pkey.c:keymgmt_dup:
  481|  70.9k|{
  482|  70.9k|    if (!EVP_KEYMGMT_up_ref((EVP_KEYMGMT *)keymgmt))
  ------------------
  |  Branch (482:9): [True: 0, False: 70.9k]
  ------------------
  483|      0|        return NULL;
  484|       |
  485|  70.9k|    return (EVP_KEYMGMT *)keymgmt;
  486|  70.9k|}

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

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

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

ENGINE_get_default_DH:
   60|     91|{
   61|     91|    return ossl_engine_table_select(&dh_table, dummy_nid,
   62|     91|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  291|     91|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  292|     91|#   define OPENSSL_LINE __LINE__
  ------------------
   63|     91|}

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

ENGINE_get_default_DSA:
   60|    167|{
   61|    167|    return ossl_engine_table_select(&dsa_table, dummy_nid,
   62|    167|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  291|    167|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  292|    167|#   define OPENSSL_LINE __LINE__
  ------------------
   63|    167|}

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);
  ------------------
  |  |  291|  34.3k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  292|  34.3k|#   define OPENSSL_LINE __LINE__
  ------------------
   63|  34.3k|}

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

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

ENGINE_get_default_RSA:
   60|     18|{
   61|     18|    return ossl_engine_table_select(&rsa_table, dummy_nid,
   62|     18|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  291|     18|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  292|     18|#   define OPENSSL_LINE __LINE__
  ------------------
   63|     18|}

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);
  ------------------
  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  ------------------
                  CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  292|      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.00k|{
  336|  8.00k|    int i;
  337|  8.00k|    ERR_STATE *es;
  338|       |
  339|  8.00k|    es = ossl_err_get_state_int();
  340|  8.00k|    if (es == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 8.00k]
  ------------------
  341|      0|        return;
  342|       |
  343|   136k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|   136k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (343:17): [True: 128k, False: 8.00k]
  ------------------
  344|   128k|        err_clear(es, i, 0);
  345|   128k|    }
  346|  8.00k|    es->top = es->bottom = 0;
  347|  8.00k|}
ERR_peek_last_error:
  410|   589k|{
  411|   589k|    return get_error_values(EV_PEEK_LAST, NULL, NULL, NULL, NULL, NULL);
  412|   589k|}
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|  4.58M|{
  674|  4.58M|    ERR_STATE *state;
  675|  4.58M|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  4.58M|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|  4.58M|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  4.58M|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 0, False: 4.58M]
  ------------------
  678|      0|        return NULL;
  679|       |
  680|  4.58M|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|  4.58M|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 4.58M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 4.58M]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|  4.58M|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|  4.58M|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 4.58M]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|  4.58M|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 2, False: 4.58M]
  ------------------
  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);
  ------------------
  |  |  463|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  706|      2|    }
  707|       |
  708|  4.58M|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  4.58M|# define set_sys_error(e)        errno=(e)
  ------------------
  709|  4.58M|    return state;
  710|  4.58M|}
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|  59.1k|{
  814|  59.1k|    va_list args;
  815|  59.1k|    va_start(args, num);
  816|  59.1k|    ERR_add_error_vdata(num, args);
  817|  59.1k|    va_end(args);
  818|  59.1k|}
ERR_add_error_vdata:
  821|  59.1k|{
  822|  59.1k|    int i, len, size;
  823|  59.1k|    int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   48|  59.1k|# define ERR_TXT_MALLOCED        0x01
  ------------------
                  int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   49|  59.1k|# define ERR_TXT_STRING          0x02
  ------------------
  824|  59.1k|    char *str, *arg;
  825|  59.1k|    ERR_STATE *es;
  826|       |
  827|       |    /* Get the current error data; if an allocated string get it. */
  828|  59.1k|    es = ossl_err_get_state_int();
  829|  59.1k|    if (es == NULL)
  ------------------
  |  Branch (829:9): [True: 0, False: 59.1k]
  ------------------
  830|      0|        return;
  831|  59.1k|    i = es->top;
  832|       |
  833|       |    /*
  834|       |     * If err_data is allocated already, reuse the space.
  835|       |     * Otherwise, allocate a small new buffer.
  836|       |     */
  837|  59.1k|    if ((es->err_data_flags[i] & flags) == flags
  ------------------
  |  Branch (837:9): [True: 0, False: 59.1k]
  ------------------
  838|  59.1k|            && ossl_assert(es->err_data[i] != NULL)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:26): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  839|      0|        str = es->err_data[i];
  840|      0|        size = es->err_data_size[i];
  841|       |
  842|       |        /*
  843|       |         * To protect the string we just grabbed from tampering by other
  844|       |         * functions we may call, or to protect them from freeing a pointer
  845|       |         * that may no longer be valid at that point, we clear away the
  846|       |         * data pointer and the flags.  We will set them again at the end
  847|       |         * of this function.
  848|       |         */
  849|      0|        es->err_data[i] = NULL;
  850|      0|        es->err_data_flags[i] = 0;
  851|  59.1k|    } else if ((str = OPENSSL_malloc(size = 81)) == NULL) {
  ------------------
  |  |  102|  59.1k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  59.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  59.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (851:16): [True: 0, False: 59.1k]
  ------------------
  852|      0|        return;
  853|  59.1k|    } else {
  854|  59.1k|        str[0] = '\0';
  855|  59.1k|    }
  856|  59.1k|    len = strlen(str);
  857|       |
  858|   283k|    while (--num >= 0) {
  ------------------
  |  Branch (858:12): [True: 224k, False: 59.1k]
  ------------------
  859|   224k|        arg = va_arg(args, char *);
  860|   224k|        if (arg == NULL)
  ------------------
  |  Branch (860:13): [True: 0, False: 224k]
  ------------------
  861|      0|            arg = "<NULL>";
  862|   224k|        len += strlen(arg);
  863|   224k|        if (len >= size) {
  ------------------
  |  Branch (863:13): [True: 0, False: 224k]
  ------------------
  864|      0|            char *p;
  865|       |
  866|      0|            size = len + 20;
  867|      0|            p = OPENSSL_realloc(str, size);
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  868|      0|            if (p == NULL) {
  ------------------
  |  Branch (868:17): [True: 0, False: 0]
  ------------------
  869|      0|                OPENSSL_free(str);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  870|      0|                return;
  871|      0|            }
  872|      0|            str = p;
  873|      0|        }
  874|   224k|        OPENSSL_strlcat(str, arg, (size_t)size);
  875|   224k|    }
  876|  59.1k|    if (!err_set_error_data_int(str, size, flags, 0))
  ------------------
  |  Branch (876:9): [True: 0, False: 59.1k]
  ------------------
  877|      0|        OPENSSL_free(str);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  878|  59.1k|}
err.c:do_err_strings_init:
  214|      2|{
  215|      2|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (215:9): [True: 0, False: 2]
  ------------------
  216|      0|        return 0;
  217|      2|    err_string_lock = CRYPTO_THREAD_lock_new();
  218|      2|    if (err_string_lock == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 2]
  ------------------
  219|      0|        return 0;
  220|      2|#ifndef OPENSSL_NO_ERR
  221|      2|    int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
  ------------------
  |  |  375|      2|#define lh_ERR_STRING_DATA_new(hfn, cmp) ((LHASH_OF(ERR_STRING_DATA) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)), lh_ERR_STRING_DATA_hash_thunk, lh_ERR_STRING_DATA_comp_thunk, lh_ERR_STRING_DATA_doall_thunk, lh_ERR_STRING_DATA_doall_arg_thunk))
  ------------------
  222|      2|                                            err_string_data_cmp);
  223|      2|    if (int_error_hash == NULL) {
  ------------------
  |  Branch (223:9): [True: 0, False: 2]
  ------------------
  224|      0|        CRYPTO_THREAD_lock_free(err_string_lock);
  225|      0|        err_string_lock = NULL;
  226|      0|        return 0;
  227|      0|    }
  228|      2|#endif
  229|      2|    return 1;
  230|      2|}
err.c:err_string_data_hash:
  172|  8.67k|{
  173|  8.67k|    unsigned long ret, l;
  174|       |
  175|  8.67k|    l = a->error;
  176|  8.67k|    ret = l ^ ERR_GET_LIB(l);
  177|  8.67k|    return (ret ^ ret % 19 * 13);
  178|  8.67k|}
err.c:err_string_data_cmp:
  182|  5.88k|{
  183|  5.88k|    if (a->error == b->error)
  ------------------
  |  Branch (183:9): [True: 5.57k, False: 304]
  ------------------
  184|  5.57k|        return 0;
  185|    304|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (185:12): [True: 164, False: 140]
  ------------------
  186|  5.88k|}
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.74k|    for (; str->error; str++)
  ------------------
  |  Branch (263:12): [True: 8.53k, False: 208]
  ------------------
  264|  8.53k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  378|  8.74k|#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|   589k|{
  449|   589k|    int i = 0;
  450|   589k|    ERR_STATE *es;
  451|   589k|    unsigned long ret;
  452|       |
  453|   589k|    es = ossl_err_get_state_int();
  454|   589k|    if (es == NULL)
  ------------------
  |  Branch (454:9): [True: 0, False: 589k]
  ------------------
  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|   589k|    while (es->bottom != es->top) {
  ------------------
  |  Branch (461:12): [True: 532k, False: 57.0k]
  ------------------
  462|   532k|        if (es->err_flags[es->top] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|   532k|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (462:13): [True: 0, False: 532k]
  ------------------
  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|   532k|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|   532k|#  define ERR_NUM_ERRORS  16
  ------------------
  468|   532k|        if (es->err_flags[i] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|   532k|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (468:13): [True: 0, False: 532k]
  ------------------
  469|      0|            es->bottom = i;
  470|      0|            err_clear(es, es->bottom, 0);
  471|      0|            continue;
  472|      0|        }
  473|   532k|        break;
  474|   532k|    }
  475|       |
  476|       |    /* If everything has been cleared, the stack is empty. */
  477|   589k|    if (es->bottom == es->top)
  ------------------
  |  Branch (477:9): [True: 57.0k, False: 532k]
  ------------------
  478|  57.0k|        return 0;
  479|       |
  480|       |    /* Which error, the top of stack (latest one) or the first one? */
  481|   532k|    if (g == EV_PEEK_LAST)
  ------------------
  |  Branch (481:9): [True: 532k, False: 0]
  ------------------
  482|   532k|        i = es->top;
  483|      0|    else
  484|      0|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
  485|       |
  486|   532k|    ret = es->err_buffer[i];
  487|   532k|    if (g == EV_POP) {
  ------------------
  |  Branch (487:9): [True: 0, False: 532k]
  ------------------
  488|      0|        es->bottom = i;
  489|      0|        es->err_buffer[i] = 0;
  490|      0|    }
  491|       |
  492|   532k|    if (file != NULL) {
  ------------------
  |  Branch (492:9): [True: 0, False: 532k]
  ------------------
  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|   532k|    if (line != NULL)
  ------------------
  |  Branch (497:9): [True: 0, False: 532k]
  ------------------
  498|      0|        *line = es->err_line[i];
  499|   532k|    if (func != NULL) {
  ------------------
  |  Branch (499:9): [True: 0, False: 532k]
  ------------------
  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|   532k|    if (flags != NULL)
  ------------------
  |  Branch (504:9): [True: 0, False: 532k]
  ------------------
  505|      0|        *flags = es->err_data_flags[i];
  506|   532k|    if (data == NULL) {
  ------------------
  |  Branch (506:9): [True: 532k, False: 0]
  ------------------
  507|   532k|        if (g == EV_POP) {
  ------------------
  |  Branch (507:13): [True: 0, False: 532k]
  ------------------
  508|      0|            err_clear_data(es, i, 0);
  509|      0|        }
  510|   532k|    } 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|   532k|    return ret;
  519|   589k|}
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|  59.1k|{
  781|  59.1k|    ERR_STATE *es;
  782|       |
  783|  59.1k|    es = ossl_err_get_state_int();
  784|  59.1k|    if (es == NULL)
  ------------------
  |  Branch (784:9): [True: 0, False: 59.1k]
  ------------------
  785|      0|        return 0;
  786|       |
  787|  59.1k|    err_clear_data(es, es->top, deallocate);
  788|  59.1k|    err_set_data(es, es->top, data, size, flags);
  789|       |
  790|  59.1k|    return 1;
  791|  59.1k|}

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

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

ERR_set_mark:
   16|   410k|{
   17|   410k|    ERR_STATE *es;
   18|       |
   19|   410k|    es = ossl_err_get_state_int();
   20|   410k|    if (es == NULL)
  ------------------
  |  Branch (20:9): [True: 0, False: 410k]
  ------------------
   21|      0|        return 0;
   22|       |
   23|   410k|    if (es->bottom == es->top)
  ------------------
  |  Branch (23:9): [True: 408k, False: 2.57k]
  ------------------
   24|   408k|        return 0;
   25|  2.57k|    es->err_marks[es->top]++;
   26|  2.57k|    return 1;
   27|   410k|}
ERR_pop_to_mark:
   43|   788k|{
   44|   788k|    ERR_STATE *es;
   45|       |
   46|   788k|    es = ossl_err_get_state_int();
   47|   788k|    if (es == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 788k]
  ------------------
   48|      0|        return 0;
   49|       |
   50|  1.53M|    while (es->bottom != es->top
  ------------------
  |  Branch (50:12): [True: 744k, False: 786k]
  ------------------
   51|  1.53M|           && es->err_marks[es->top] == 0) {
  ------------------
  |  Branch (51:15): [True: 741k, False: 2.14k]
  ------------------
   52|   741k|        err_clear(es, es->top, 0);
   53|   741k|        es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|      1|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (53:19): [True: 741k, False: 1]
  ------------------
   54|   741k|    }
   55|       |
   56|   788k|    if (es->bottom == es->top)
  ------------------
  |  Branch (56:9): [True: 786k, False: 2.14k]
  ------------------
   57|   786k|        return 0;
   58|  2.14k|    es->err_marks[es->top]--;
   59|  2.14k|    return 1;
   60|   788k|}
ERR_clear_last_mark:
   82|  66.7k|{
   83|  66.7k|    ERR_STATE *es;
   84|  66.7k|    int top;
   85|       |
   86|  66.7k|    es = ossl_err_get_state_int();
   87|  66.7k|    if (es == NULL)
  ------------------
  |  Branch (87:9): [True: 0, False: 66.7k]
  ------------------
   88|      0|        return 0;
   89|       |
   90|  66.7k|    top = es->top;
   91|  87.9k|    while (es->bottom != top
  ------------------
  |  Branch (91:12): [True: 21.6k, False: 66.3k]
  ------------------
   92|  87.9k|           && es->err_marks[top] == 0) {
  ------------------
  |  Branch (92:15): [True: 21.2k, False: 427]
  ------------------
   93|  21.2k|        top = top > 0 ? top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (93:15): [True: 21.2k, False: 0]
  ------------------
   94|  21.2k|    }
   95|       |
   96|  66.7k|    if (es->bottom == top)
  ------------------
  |  Branch (96:9): [True: 66.3k, False: 427]
  ------------------
   97|  66.3k|        return 0;
   98|    427|    es->err_marks[top]--;
   99|    427|    return 1;
  100|  66.7k|}

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());
  ------------------
  |  |  954|      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());
  ------------------
  |  |  958|      1|#  define EVP_des_ede_cfb EVP_des_ede_cfb64
  ------------------
   25|      1|    EVP_add_cipher(EVP_des_ede3_cfb());
  ------------------
  |  |  960|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  |  987|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1141|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1149|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  |  997|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1004|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1011|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1018|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1026|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1042|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1057|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1078|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1088|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1098|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1110|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1118|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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());
  ------------------
  |  | 1126|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  685|      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");
  ------------------
  |  |  687|      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");
  ------------------
  |  |  687|      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);
  ------------------
  |  |  687|      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");
  ------------------
  |  |  687|      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");
  ------------------
  |  |  687|      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|  19.3k|{
   45|  19.3k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (45:9): [True: 19.3k, False: 0]
  ------------------
   46|  19.3k|        if (ctx->digest != NULL && ctx->digest->freectx != NULL)
  ------------------
  |  Branch (46:13): [True: 19.3k, False: 0]
  |  Branch (46:36): [True: 19.3k, False: 0]
  ------------------
   47|  19.3k|            ctx->digest->freectx(ctx->algctx);
   48|  19.3k|        ctx->algctx = NULL;
   49|  19.3k|        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  202|  19.3k|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
   50|  19.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|  19.3k|    cleanup_old_md_data(ctx, force);
   59|  19.3k|    if (force)
  ------------------
  |  Branch (59:9): [True: 0, False: 19.3k]
  ------------------
   60|      0|        ctx->digest = NULL;
   61|       |
   62|  19.3k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   63|  19.3k|    ENGINE_finish(ctx->engine);
   64|  19.3k|    ctx->engine = NULL;
   65|  19.3k|#endif
   66|       |
   67|       |    /* Non legacy code, this has to be later than the ctx->digest cleaning */
   68|  19.3k|    if (!keep_fetched) {
  ------------------
  |  Branch (68:9): [True: 19.3k, False: 0]
  ------------------
   69|  19.3k|        EVP_MD_free(ctx->fetched_digest);
   70|  19.3k|        ctx->fetched_digest = NULL;
   71|  19.3k|        ctx->reqdigest = NULL;
   72|  19.3k|    }
   73|  19.3k|}
EVP_MD_CTX_reset:
  100|  19.3k|{
  101|  19.3k|    return evp_md_ctx_reset_ex(ctx, 0);
  102|  19.3k|}
EVP_MD_CTX_new:
  131|  19.3k|{
  132|  19.3k|    return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  ------------------
  |  |  104|  19.3k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  19.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  19.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  133|  19.3k|}
EVP_MD_CTX_free:
  136|  21.4k|{
  137|  21.4k|    if (ctx == NULL)
  ------------------
  |  Branch (137:9): [True: 2.14k, False: 19.3k]
  ------------------
  138|  2.14k|        return;
  139|       |
  140|  19.3k|    EVP_MD_CTX_reset(ctx);
  141|  19.3k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  19.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  19.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  19.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  142|  19.3k|}
evp_md_ctx_free_algctx:
  145|  19.3k|{
  146|  19.3k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (146:9): [True: 0, False: 19.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  19.3k|    return 1;
  156|  19.3k|}
EVP_DigestInit_ex:
  382|  19.3k|{
  383|  19.3k|    return evp_md_init_internal(ctx, type, NULL, impl);
  384|  19.3k|}
EVP_DigestUpdate:
  387|  19.3k|{
  388|  19.3k|    if (count == 0)
  ------------------
  |  Branch (388:9): [True: 0, False: 19.3k]
  ------------------
  389|      0|        return 1;
  390|       |
  391|  19.3k|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|  19.3k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (391:9): [True: 0, False: 19.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  393|      0|        return 0;
  394|      0|    }
  395|       |
  396|  19.3k|    if (ctx->pctx != NULL
  ------------------
  |  Branch (396:9): [True: 0, False: 19.3k]
  ------------------
  397|  19.3k|            && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  732|  19.3k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1710|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1696|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1697|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1698|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1711|      0|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1699|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1700|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (732:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  398|  19.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)
  ------------------
  |  | 1699|      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)
  ------------------
  |  | 1700|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  412|      0|        return 0;
  413|      0|    }
  414|       |
  415|  19.3k|    if (ctx->digest == NULL
  ------------------
  |  Branch (415:9): [True: 0, False: 19.3k]
  ------------------
  416|  19.3k|            || ctx->digest->prov == NULL
  ------------------
  |  Branch (416:16): [True: 0, False: 19.3k]
  ------------------
  417|  19.3k|            || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0)
  ------------------
  |  |  224|  19.3k|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (417:16): [True: 0, False: 19.3k]
  ------------------
  418|      0|        goto legacy;
  419|       |
  420|  19.3k|    if (ctx->digest->dupdate == NULL) {
  ------------------
  |  Branch (420:9): [True: 0, False: 19.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  422|      0|        return 0;
  423|      0|    }
  424|  19.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 != NULL ? ctx->update(ctx, data, count) : 0;
  ------------------
  |  Branch (428:12): [True: 0, False: 0]
  ------------------
  429|  19.3k|}
EVP_DigestFinal_ex:
  442|  19.3k|{
  443|  19.3k|    int ret, sz;
  444|  19.3k|    size_t size = 0;
  445|  19.3k|    size_t mdsize = 0;
  446|       |
  447|  19.3k|    if (ctx->digest == NULL)
  ------------------
  |  Branch (447:9): [True: 0, False: 19.3k]
  ------------------
  448|      0|        return 0;
  449|       |
  450|  19.3k|    sz = EVP_MD_get_size(ctx->digest);
  451|  19.3k|    if (sz < 0)
  ------------------
  |  Branch (451:9): [True: 0, False: 19.3k]
  ------------------
  452|      0|        return 0;
  453|  19.3k|    mdsize = sz;
  454|  19.3k|    if (ctx->digest->prov == NULL)
  ------------------
  |  Branch (454:9): [True: 0, False: 19.3k]
  ------------------
  455|      0|        goto legacy;
  456|       |
  457|  19.3k|    if (sz == 0) /* Assuming a xoflen must have been set. */
  ------------------
  |  Branch (457:9): [True: 0, False: 19.3k]
  ------------------
  458|      0|        mdsize = SIZE_MAX;
  459|  19.3k|    if (ctx->digest->gettable_ctx_params != NULL) {
  ------------------
  |  Branch (459:9): [True: 0, False: 19.3k]
  ------------------
  460|      0|        OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
  461|       |
  462|      0|        params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_SIZE,
  ------------------
  |  |  203|      0|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
  463|      0|                                                &mdsize);
  464|      0|        if (!EVP_MD_CTX_get_params(ctx, params))
  ------------------
  |  Branch (464:13): [True: 0, False: 0]
  ------------------
  465|      0|            return 0;
  466|      0|    }
  467|       |
  468|  19.3k|    if (ctx->digest->dfinal == NULL) {
  ------------------
  |  Branch (468:9): [True: 0, False: 19.3k]
  ------------------
  469|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  470|      0|        return 0;
  471|      0|    }
  472|       |
  473|  19.3k|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|  19.3k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (473:9): [True: 0, False: 19.3k]
  ------------------
  474|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  475|      0|        return 0;
  476|      0|    }
  477|       |
  478|  19.3k|    ret = ctx->digest->dfinal(ctx->algctx, md, &size, mdsize);
  479|       |
  480|  19.3k|    ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|  19.3k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  481|       |
  482|  19.3k|    if (isize != NULL) {
  ------------------
  |  Branch (482:9): [True: 0, False: 19.3k]
  ------------------
  483|      0|        if (size <= UINT_MAX) {
  ------------------
  |  Branch (483:13): [True: 0, False: 0]
  ------------------
  484|      0|            *isize = (unsigned int)size;
  485|      0|        } else {
  486|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  487|      0|            ret = 0;
  488|      0|        }
  489|      0|    }
  490|       |
  491|  19.3k|    return ret;
  492|       |
  493|       |    /* Code below to be removed when legacy support is dropped. */
  494|      0| legacy:
  495|      0|    OPENSSL_assert(mdsize <= EVP_MAX_MD_SIZE);
  ------------------
  |  |  434|      0|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (434:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  496|      0|    ret = ctx->digest->final(ctx, md);
  497|      0|    if (isize != NULL)
  ------------------
  |  Branch (497:9): [True: 0, False: 0]
  ------------------
  498|      0|        *isize = mdsize;
  499|      0|    if (ctx->digest->cleanup) {
  ------------------
  |  Branch (499:9): [True: 0, False: 0]
  ------------------
  500|      0|        ctx->digest->cleanup(ctx);
  501|      0|        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  202|      0|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  502|      0|    }
  503|      0|    OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
  504|      0|    return ret;
  505|  19.3k|}
EVP_Digest:
  726|  19.3k|{
  727|  19.3k|    EVP_MD_CTX *ctx = EVP_MD_CTX_new();
  728|  19.3k|    int ret;
  729|       |
  730|  19.3k|    if (ctx == NULL)
  ------------------
  |  Branch (730:9): [True: 0, False: 19.3k]
  ------------------
  731|      0|        return 0;
  732|  19.3k|    EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT);
  ------------------
  |  |  200|  19.3k|# define EVP_MD_CTX_FLAG_ONESHOT         0x0001/* digest update will be
  ------------------
  733|  19.3k|    ret = EVP_DigestInit_ex(ctx, type, impl)
  ------------------
  |  Branch (733:11): [True: 19.3k, False: 0]
  ------------------
  734|  19.3k|        && EVP_DigestUpdate(ctx, data, count)
  ------------------
  |  Branch (734:12): [True: 19.3k, False: 0]
  ------------------
  735|  19.3k|        && EVP_DigestFinal_ex(ctx, md, size);
  ------------------
  |  Branch (735:12): [True: 19.3k, False: 0]
  ------------------
  736|  19.3k|    EVP_MD_CTX_free(ctx);
  737|       |
  738|  19.3k|    return ret;
  739|  19.3k|}
evp_md_new:
  939|     27|{
  940|     27|    EVP_MD *md = OPENSSL_zalloc(sizeof(*md));
  ------------------
  |  |  104|     27|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  941|       |
  942|     27|    if (md != NULL && !CRYPTO_NEW_REF(&md->refcnt, 1)) {
  ------------------
  |  Branch (942:9): [True: 27, False: 0]
  |  Branch (942:23): [True: 0, False: 27]
  ------------------
  943|      0|        OPENSSL_free(md);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  944|      0|        return NULL;
  945|      0|    }
  946|     27|    return md;
  947|     27|}
EVP_MD_fetch:
 1150|  19.3k|{
 1151|  19.3k|    EVP_MD *md =
 1152|  19.3k|        evp_generic_fetch(ctx, OSSL_OP_DIGEST, algorithm, properties,
  ------------------
  |  |  275|  19.3k|# define OSSL_OP_DIGEST                              1
  ------------------
 1153|  19.3k|                          evp_md_from_algorithm, evp_md_up_ref, evp_md_free);
 1154|       |
 1155|  19.3k|    return md;
 1156|  19.3k|}
EVP_MD_up_ref:
 1159|  38.6k|{
 1160|  38.6k|    int ref = 0;
 1161|       |
 1162|  38.6k|    if (md->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  251|  38.6k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1162:9): [True: 38.6k, False: 0]
  ------------------
 1163|  38.6k|        CRYPTO_UP_REF(&md->refcnt, &ref);
 1164|  38.6k|    return 1;
 1165|  38.6k|}
EVP_MD_free:
 1168|  58.0k|{
 1169|  58.0k|    int i;
 1170|       |
 1171|  58.0k|    if (md == NULL || md->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  251|  38.7k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1171:9): [True: 19.3k, False: 38.7k]
  |  Branch (1171:23): [True: 0, False: 38.7k]
  ------------------
 1172|  19.3k|        return;
 1173|       |
 1174|  38.7k|    CRYPTO_DOWN_REF(&md->refcnt, &i);
 1175|  38.7k|    if (i > 0)
  ------------------
  |  Branch (1175:9): [True: 38.6k, False: 27]
  ------------------
 1176|  38.6k|        return;
 1177|     27|    evp_md_free_int(md);
 1178|     27|}
digest.c:cleanup_old_md_data:
   29|  38.6k|{
   30|  38.6k|    if (ctx->digest != NULL) {
  ------------------
  |  Branch (30:9): [True: 19.3k, False: 19.3k]
  ------------------
   31|  19.3k|        if (ctx->digest->cleanup != NULL
  ------------------
  |  Branch (31:13): [True: 0, False: 19.3k]
  ------------------
   32|  19.3k|                && !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_CLEANED))
  ------------------
  |  |  202|      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|  19.3k|        if (ctx->md_data != NULL && ctx->digest->ctx_size > 0
  ------------------
  |  Branch (34:13): [True: 0, False: 19.3k]
  |  Branch (34:37): [True: 0, False: 0]
  ------------------
   35|  19.3k|                && (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE)
  ------------------
  |  |  204|      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);
  ------------------
  |  |  113|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   38|      0|            ctx->md_data = NULL;
   39|      0|        }
   40|  19.3k|    }
   41|  38.6k|}
digest.c:evp_md_ctx_reset_ex:
   76|  19.3k|{
   77|  19.3k|    if (ctx == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 19.3k]
  ------------------
   78|      0|        return 1;
   79|       |
   80|  19.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|  19.3k|    if (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX)) {
  ------------------
  |  |   32|  19.3k|#define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX   0x0400
  ------------------
  |  Branch (85:9): [True: 19.3k, False: 0]
  ------------------
   86|  19.3k|        EVP_PKEY_CTX_free(ctx->pctx);
   87|  19.3k|        ctx->pctx = NULL;
   88|  19.3k|    }
   89|  19.3k|#endif
   90|       |
   91|  19.3k|    evp_md_ctx_clear_digest(ctx, 0, keep_fetched);
   92|  19.3k|    if (!keep_fetched)
  ------------------
  |  Branch (92:9): [True: 19.3k, False: 0]
  ------------------
   93|  19.3k|        OPENSSL_cleanse(ctx, sizeof(*ctx));
   94|       |
   95|  19.3k|    return 1;
   96|  19.3k|}
digest.c:evp_md_init_internal:
  160|  19.3k|{
  161|  19.3k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  162|  19.3k|    ENGINE *tmpimpl = NULL;
  163|  19.3k|#endif
  164|       |
  165|  19.3k|#if !defined(FIPS_MODULE)
  166|  19.3k|    if (ctx->pctx != NULL
  ------------------
  |  Branch (166:9): [True: 0, False: 19.3k]
  ------------------
  167|  19.3k|            && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  732|  19.3k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1710|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1696|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1697|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1698|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1711|      0|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1699|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1700|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (732:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  168|  19.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)
  ------------------
  |  | 1699|      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)
  ------------------
  |  | 1700|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  180|      0|        return 0;
  181|      0|    }
  182|  19.3k|#endif
  183|       |
  184|  19.3k|    EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED
  ------------------
  |  |  202|  19.3k|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  185|  19.3k|                                | EVP_MD_CTX_FLAG_FINALISED);
  ------------------
  |  |   33|  19.3k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  186|       |
  187|  19.3k|    if (type != NULL) {
  ------------------
  |  Branch (187:9): [True: 19.3k, False: 0]
  ------------------
  188|  19.3k|        ctx->reqdigest = type;
  189|  19.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  19.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|  19.3k|    if (ctx->engine != NULL
  ------------------
  |  Branch (205:9): [True: 0, False: 19.3k]
  ------------------
  206|  19.3k|            && ctx->digest != NULL
  ------------------
  |  Branch (206:16): [True: 0, False: 0]
  ------------------
  207|  19.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|  19.3k|    ENGINE_finish(ctx->engine);
  216|  19.3k|    ctx->engine = NULL;
  217|       |
  218|  19.3k|    if (impl == NULL)
  ------------------
  |  Branch (218:9): [True: 19.3k, False: 0]
  ------------------
  219|  19.3k|        tmpimpl = ENGINE_get_digest_engine(type->type);
  220|  19.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|  19.3k|    if (impl != NULL
  ------------------
  |  Branch (226:9): [True: 0, False: 19.3k]
  ------------------
  227|  19.3k|#if !defined(OPENSSL_NO_ENGINE)
  228|  19.3k|            || ctx->engine != NULL
  ------------------
  |  Branch (228:16): [True: 0, False: 19.3k]
  ------------------
  229|  19.3k|# if !defined(FIPS_MODULE)
  230|  19.3k|            || tmpimpl != NULL
  ------------------
  |  Branch (230:16): [True: 0, False: 19.3k]
  ------------------
  231|  19.3k|# endif
  232|  19.3k|#endif
  233|  19.3k|            || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0
  ------------------
  |  |  224|  19.3k|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (233:16): [True: 0, False: 19.3k]
  ------------------
  234|  19.3k|            || (type != NULL && type->origin == EVP_ORIG_METH)
  ------------------
  |  |  253|  19.3k|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (234:17): [True: 19.3k, False: 0]
  |  Branch (234:33): [True: 0, False: 19.3k]
  ------------------
  235|  19.3k|            || (type == NULL && ctx->digest != NULL
  ------------------
  |  Branch (235:17): [True: 0, False: 19.3k]
  |  Branch (235:33): [True: 0, False: 0]
  ------------------
  236|  19.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|  19.3k|    cleanup_old_md_data(ctx, 1);
  248|       |
  249|       |    /* Start of non-legacy code below */
  250|  19.3k|    if (ctx->digest == type) {
  ------------------
  |  Branch (250:9): [True: 0, False: 19.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  253|      0|            return 0;
  254|      0|        }
  255|  19.3k|    } else {
  256|  19.3k|        if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (256:13): [True: 0, False: 19.3k]
  ------------------
  257|      0|            return 0;
  258|  19.3k|    }
  259|       |
  260|  19.3k|    if (type->prov == NULL) {
  ------------------
  |  Branch (260:9): [True: 0, False: 19.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  19.3k|    if (type->prov != NULL && ctx->fetched_digest != type) {
  ------------------
  |  Branch (281:9): [True: 19.3k, False: 0]
  |  Branch (281:31): [True: 19.3k, False: 0]
  ------------------
  282|  19.3k|        if (!EVP_MD_up_ref((EVP_MD *)type)) {
  ------------------
  |  Branch (282:13): [True: 0, False: 19.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  284|      0|            return 0;
  285|      0|        }
  286|  19.3k|        EVP_MD_free(ctx->fetched_digest);
  287|  19.3k|        ctx->fetched_digest = (EVP_MD *)type;
  288|  19.3k|    }
  289|  19.3k|    ctx->digest = type;
  290|  19.3k|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (290:9): [True: 19.3k, False: 0]
  ------------------
  291|  19.3k|        ctx->algctx = ctx->digest->newctx(ossl_provider_ctx(type->prov));
  292|  19.3k|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (292:13): [True: 0, False: 19.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  294|      0|            return 0;
  295|      0|        }
  296|  19.3k|    }
  297|       |
  298|  19.3k|    if (ctx->digest->dinit == NULL) {
  ------------------
  |  Branch (298:9): [True: 0, False: 19.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  300|      0|        return 0;
  301|      0|    }
  302|       |
  303|  19.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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) {
  ------------------
  |  |  224|      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);
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  ------------------
  |  |  732|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1710|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1696|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1697|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1698|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1711|      0|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1699|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1700|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (355:17): [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,
  ------------------
  |  | 1710|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER  \
  |  |  ------------------
  |  |  |  | 1696|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  ------------------
  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER  \
  |  |  ------------------
  |  |  |  | 1697|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  ------------------
  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER  \
  |  |  ------------------
  |  |  |  | 1698|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  ------------------
  |  | 1711|      0|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1699|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  ------------------
  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1700|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  ------------------
  ------------------
  359|      0|                              EVP_PKEY_CTRL_DIGESTINIT, 0, ctx);
  ------------------
  |  | 1737|      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)
  ------------------
  |  |  224|      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:
 1010|     27|{
 1011|     27|    const OSSL_DISPATCH *fns = algodef->implementation;
 1012|     27|    EVP_MD *md = NULL;
 1013|     27|    int fncnt = 0;
 1014|       |
 1015|       |    /* EVP_MD_fetch() will set the legacy NID if available */
 1016|     27|    if ((md = evp_md_new()) == NULL) {
  ------------------
  |  Branch (1016:9): [True: 0, False: 27]
  ------------------
 1017|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1018|      0|        return NULL;
 1019|      0|    }
 1020|       |
 1021|     27|#ifndef FIPS_MODULE
 1022|     27|    md->type = NID_undef;
  ------------------
  |  |   18|     27|#define NID_undef                       0
  ------------------
 1023|     27|    if (!evp_names_do_all(prov, name_id, set_legacy_nid, &md->type)
  ------------------
  |  Branch (1023:9): [True: 0, False: 27]
  ------------------
 1024|     27|            || md->type == -1) {
  ------------------
  |  Branch (1024:16): [True: 0, False: 27]
  ------------------
 1025|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1026|      0|        EVP_MD_free(md);
 1027|      0|        return NULL;
 1028|      0|    }
 1029|     27|#endif
 1030|       |
 1031|     27|    md->name_id = name_id;
 1032|     27|    if ((md->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (1032:9): [True: 0, False: 27]
  ------------------
 1033|      0|        EVP_MD_free(md);
 1034|      0|        return NULL;
 1035|      0|    }
 1036|     27|    md->description = algodef->algorithm_description;
 1037|       |
 1038|    267|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (1038:12): [True: 240, False: 27]
  ------------------
 1039|    240|        switch (fns->function_id) {
  ------------------
  |  Branch (1039:17): [True: 0, False: 240]
  ------------------
 1040|     27|        case OSSL_FUNC_DIGEST_NEWCTX:
  ------------------
  |  |  294|     27|# define OSSL_FUNC_DIGEST_NEWCTX                     1
  ------------------
  |  Branch (1040:9): [True: 27, False: 213]
  ------------------
 1041|     27|            if (md->newctx == NULL) {
  ------------------
  |  Branch (1041:17): [True: 27, False: 0]
  ------------------
 1042|     27|                md->newctx = OSSL_FUNC_digest_newctx(fns);
 1043|     27|                fncnt++;
 1044|     27|            }
 1045|     27|            break;
 1046|     27|        case OSSL_FUNC_DIGEST_INIT:
  ------------------
  |  |  295|     27|# define OSSL_FUNC_DIGEST_INIT                       2
  ------------------
  |  Branch (1046:9): [True: 27, False: 213]
  ------------------
 1047|     27|            if (md->dinit == NULL) {
  ------------------
  |  Branch (1047:17): [True: 27, False: 0]
  ------------------
 1048|     27|                md->dinit = OSSL_FUNC_digest_init(fns);
 1049|     27|                fncnt++;
 1050|     27|            }
 1051|     27|            break;
 1052|     27|        case OSSL_FUNC_DIGEST_UPDATE:
  ------------------
  |  |  296|     27|# define OSSL_FUNC_DIGEST_UPDATE                     3
  ------------------
  |  Branch (1052:9): [True: 27, False: 213]
  ------------------
 1053|     27|            if (md->dupdate == NULL) {
  ------------------
  |  Branch (1053:17): [True: 27, False: 0]
  ------------------
 1054|     27|                md->dupdate = OSSL_FUNC_digest_update(fns);
 1055|     27|                fncnt++;
 1056|     27|            }
 1057|     27|            break;
 1058|     27|        case OSSL_FUNC_DIGEST_FINAL:
  ------------------
  |  |  297|     27|# define OSSL_FUNC_DIGEST_FINAL                      4
  ------------------
  |  Branch (1058:9): [True: 27, False: 213]
  ------------------
 1059|     27|            if (md->dfinal == NULL) {
  ------------------
  |  Branch (1059:17): [True: 27, False: 0]
  ------------------
 1060|     27|                md->dfinal = OSSL_FUNC_digest_final(fns);
 1061|     27|                fncnt++;
 1062|     27|            }
 1063|     27|            break;
 1064|      4|        case OSSL_FUNC_DIGEST_SQUEEZE:
  ------------------
  |  |  307|      4|# define OSSL_FUNC_DIGEST_SQUEEZE                   14
  ------------------
  |  Branch (1064:9): [True: 4, False: 236]
  ------------------
 1065|      4|            if (md->dsqueeze == NULL) {
  ------------------
  |  Branch (1065:17): [True: 4, False: 0]
  ------------------
 1066|      4|                md->dsqueeze = OSSL_FUNC_digest_squeeze(fns);
 1067|      4|                fncnt++;
 1068|      4|            }
 1069|      4|            break;
 1070|      0|        case OSSL_FUNC_DIGEST_DIGEST:
  ------------------
  |  |  298|      0|# define OSSL_FUNC_DIGEST_DIGEST                     5
  ------------------
  |  Branch (1070:9): [True: 0, False: 240]
  ------------------
 1071|      0|            if (md->digest == NULL)
  ------------------
  |  Branch (1071:17): [True: 0, False: 0]
  ------------------
 1072|      0|                md->digest = OSSL_FUNC_digest_digest(fns);
 1073|       |            /* We don't increment fnct for this as it is stand alone */
 1074|      0|            break;
 1075|     27|        case OSSL_FUNC_DIGEST_FREECTX:
  ------------------
  |  |  299|     27|# define OSSL_FUNC_DIGEST_FREECTX                    6
  ------------------
  |  Branch (1075:9): [True: 27, False: 213]
  ------------------
 1076|     27|            if (md->freectx == NULL) {
  ------------------
  |  Branch (1076:17): [True: 27, False: 0]
  ------------------
 1077|     27|                md->freectx = OSSL_FUNC_digest_freectx(fns);
 1078|     27|                fncnt++;
 1079|     27|            }
 1080|     27|            break;
 1081|     27|        case OSSL_FUNC_DIGEST_DUPCTX:
  ------------------
  |  |  300|     27|# define OSSL_FUNC_DIGEST_DUPCTX                     7
  ------------------
  |  Branch (1081:9): [True: 27, False: 213]
  ------------------
 1082|     27|            if (md->dupctx == NULL)
  ------------------
  |  Branch (1082:17): [True: 27, False: 0]
  ------------------
 1083|     27|                md->dupctx = OSSL_FUNC_digest_dupctx(fns);
 1084|     27|            break;
 1085|     27|        case OSSL_FUNC_DIGEST_GET_PARAMS:
  ------------------
  |  |  301|     27|# define OSSL_FUNC_DIGEST_GET_PARAMS                 8
  ------------------
  |  Branch (1085:9): [True: 27, False: 213]
  ------------------
 1086|     27|            if (md->get_params == NULL)
  ------------------
  |  Branch (1086:17): [True: 27, False: 0]
  ------------------
 1087|     27|                md->get_params = OSSL_FUNC_digest_get_params(fns);
 1088|     27|            break;
 1089|      8|        case OSSL_FUNC_DIGEST_SET_CTX_PARAMS:
  ------------------
  |  |  302|      8|# define OSSL_FUNC_DIGEST_SET_CTX_PARAMS             9
  ------------------
  |  Branch (1089:9): [True: 8, False: 232]
  ------------------
 1090|      8|            if (md->set_ctx_params == NULL)
  ------------------
  |  Branch (1090:17): [True: 8, False: 0]
  ------------------
 1091|      8|                md->set_ctx_params = OSSL_FUNC_digest_set_ctx_params(fns);
 1092|      8|            break;
 1093|      2|        case OSSL_FUNC_DIGEST_GET_CTX_PARAMS:
  ------------------
  |  |  303|      2|# define OSSL_FUNC_DIGEST_GET_CTX_PARAMS            10
  ------------------
  |  Branch (1093:9): [True: 2, False: 238]
  ------------------
 1094|      2|            if (md->get_ctx_params == NULL)
  ------------------
  |  Branch (1094:17): [True: 2, False: 0]
  ------------------
 1095|      2|                md->get_ctx_params = OSSL_FUNC_digest_get_ctx_params(fns);
 1096|      2|            break;
 1097|     27|        case OSSL_FUNC_DIGEST_GETTABLE_PARAMS:
  ------------------
  |  |  304|     27|# define OSSL_FUNC_DIGEST_GETTABLE_PARAMS           11
  ------------------
  |  Branch (1097:9): [True: 27, False: 213]
  ------------------
 1098|     27|            if (md->gettable_params == NULL)
  ------------------
  |  Branch (1098:17): [True: 27, False: 0]
  ------------------
 1099|     27|                md->gettable_params = OSSL_FUNC_digest_gettable_params(fns);
 1100|     27|            break;
 1101|      8|        case OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  305|      8|# define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS       12
  ------------------
  |  Branch (1101:9): [True: 8, False: 232]
  ------------------
 1102|      8|            if (md->settable_ctx_params == NULL)
  ------------------
  |  Branch (1102:17): [True: 8, False: 0]
  ------------------
 1103|      8|                md->settable_ctx_params =
 1104|      8|                    OSSL_FUNC_digest_settable_ctx_params(fns);
 1105|      8|            break;
 1106|      2|        case OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  306|      2|# define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS       13
  ------------------
  |  Branch (1106:9): [True: 2, False: 238]
  ------------------
 1107|      2|            if (md->gettable_ctx_params == NULL)
  ------------------
  |  Branch (1107:17): [True: 2, False: 0]
  ------------------
 1108|      2|                md->gettable_ctx_params =
 1109|      2|                    OSSL_FUNC_digest_gettable_ctx_params(fns);
 1110|      2|            break;
 1111|    240|        }
 1112|    240|    }
 1113|     27|    if ((fncnt != 0 && fncnt != 5 && fncnt != 6)
  ------------------
  |  Branch (1113:10): [True: 27, False: 0]
  |  Branch (1113:24): [True: 4, False: 23]
  |  Branch (1113:38): [True: 0, False: 4]
  ------------------
 1114|     27|        || (fncnt == 0 && md->digest == NULL)) {
  ------------------
  |  Branch (1114:13): [True: 0, False: 27]
  |  Branch (1114:27): [True: 0, False: 0]
  ------------------
 1115|       |        /*
 1116|       |         * In order to be a consistent set of functions we either need the
 1117|       |         * whole set of init/update/final etc functions or none of them.
 1118|       |         * The "digest" function can standalone. We at least need one way to
 1119|       |         * generate digests.
 1120|       |         */
 1121|      0|        EVP_MD_free(md);
 1122|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1123|      0|        return NULL;
 1124|      0|    }
 1125|     27|    md->prov = prov;
 1126|     27|    if (prov != NULL)
  ------------------
  |  Branch (1126:9): [True: 27, False: 0]
  ------------------
 1127|     27|        ossl_provider_up_ref(prov);
 1128|       |
 1129|     27|    if (!evp_md_cache_constants(md)) {
  ------------------
  |  Branch (1129:9): [True: 0, False: 27]
  ------------------
 1130|      0|        EVP_MD_free(md);
 1131|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1132|      0|        md = NULL;
 1133|      0|    }
 1134|       |
 1135|     27|    return md;
 1136|     27|}
digest.c:set_legacy_nid:
  956|     71|{
  957|     71|    int nid;
  958|     71|    int *legacy_nid = vlegacy_nid;
  959|       |    /*
  960|       |     * We use lowest level function to get the associated method, because
  961|       |     * higher level functions such as EVP_get_digestbyname() have changed
  962|       |     * to look at providers too.
  963|       |     */
  964|     71|    const void *legacy_method = OBJ_NAME_get(name, OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|     71|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  965|       |
  966|     71|    if (*legacy_nid == -1)       /* We found a clash already */
  ------------------
  |  Branch (966:9): [True: 0, False: 71]
  ------------------
  967|      0|        return;
  968|       |
  969|     71|    if (legacy_method == NULL)
  ------------------
  |  Branch (969:9): [True: 48, False: 23]
  ------------------
  970|     48|        return;
  971|     23|    nid = EVP_MD_nid(legacy_method);
  ------------------
  |  |  538|     23|# define EVP_MD_nid EVP_MD_get_type
  ------------------
  972|     23|    if (*legacy_nid != NID_undef && *legacy_nid != nid) {
  ------------------
  |  |   18|     46|#define NID_undef                       0
  ------------------
  |  Branch (972:9): [True: 4, False: 19]
  |  Branch (972:37): [True: 0, False: 4]
  ------------------
  973|      0|        *legacy_nid = -1;
  974|      0|        return;
  975|      0|    }
  976|     23|    *legacy_nid = nid;
  977|     23|}
digest.c:evp_md_cache_constants:
  981|     27|{
  982|     27|    int ok, xof = 0, algid_absent = 0;
  983|     27|    size_t blksz = 0;
  984|     27|    size_t mdsize = 0;
  985|     27|    OSSL_PARAM params[5];
  986|       |
  987|     27|    params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, &blksz);
  ------------------
  |  |  200|     27|# define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  988|     27|    params[1] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_SIZE, &mdsize);
  ------------------
  |  |  203|     27|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
  989|     27|    params[2] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_XOF, &xof);
  ------------------
  |  |  205|     27|# define OSSL_DIGEST_PARAM_XOF "xof"
  ------------------
  990|     27|    params[3] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_ALGID_ABSENT,
  ------------------
  |  |  199|     27|# define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent"
  ------------------
  991|     27|                                         &algid_absent);
  992|     27|    params[4] = OSSL_PARAM_construct_end();
  993|     27|    ok = evp_do_md_getparams(md, params) > 0;
  994|     27|    if (mdsize > INT_MAX || blksz > INT_MAX)
  ------------------
  |  Branch (994:9): [True: 0, False: 27]
  |  Branch (994:29): [True: 0, False: 27]
  ------------------
  995|      0|        ok = 0;
  996|     27|    if (ok) {
  ------------------
  |  Branch (996:9): [True: 27, False: 0]
  ------------------
  997|     27|        md->block_size = (int)blksz;
  998|     27|        md->md_size = (int)mdsize;
  999|     27|        if (xof)
  ------------------
  |  Branch (999:13): [True: 4, False: 23]
  ------------------
 1000|      4|            md->flags |= EVP_MD_FLAG_XOF;
  ------------------
  |  |  164|      4|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
 1001|     27|        if (algid_absent)
  ------------------
  |  Branch (1001:13): [True: 16, False: 11]
  ------------------
 1002|     16|            md->flags |= EVP_MD_FLAG_DIGALGID_ABSENT;
  ------------------
  |  |  176|     16|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
 1003|     27|    }
 1004|     27|    return ok;
 1005|     27|}
digest.c:evp_md_up_ref:
 1139|  19.3k|{
 1140|  19.3k|    return EVP_MD_up_ref(md);
 1141|  19.3k|}
digest.c:evp_md_free:
 1144|     55|{
 1145|     55|    EVP_MD_free(md);
 1146|     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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186:27): [True: 1, False: 0]
  |  |  ------------------
  ------------------
EVP_aes_128_wrap:
 3772|      1|{
 3773|      1|    return &aes_128_wrap;
 3774|      1|}
EVP_aes_192_wrap:
 3786|      1|{
 3787|      1|    return &aes_192_wrap;
 3788|      1|}
EVP_aes_256_wrap:
 3800|      1|{
 3801|      1|    return &aes_256_wrap;
 3802|      1|}
EVP_aes_128_wrap_pad:
 3814|      1|{
 3815|      1|    return &aes_128_wrap_pad;
 3816|      1|}
EVP_aes_192_wrap_pad:
 3828|      1|{
 3829|      1|    return &aes_192_wrap_pad;
 3830|      1|}
EVP_aes_256_wrap_pad:
 3842|      1|{
 3843|      1|    return &aes_256_wrap_pad;
 3844|      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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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; }
  ------------------
  |  |  186|      1|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (186: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:
  423|      1|{
  424|      1|    return &des3_wrap;
  425|      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|  15.9k|{
  120|  15.9k|    size_t i;
  121|       |
  122|  15.9k|    if (nid <= 0)
  ------------------
  |  Branch (122:9): [True: 0, False: 15.9k]
  ------------------
  123|      0|        return NULL;
  124|       |
  125|   403k|    for (i = 0; i < OSSL_NELEM(curve_list); i++) {
  ------------------
  |  |   14|   403k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (125:17): [True: 403k, False: 0]
  ------------------
  126|   403k|        if (curve_list[i].nid == nid)
  ------------------
  |  Branch (126:13): [True: 15.9k, False: 387k]
  ------------------
  127|  15.9k|            return curve_list[i].name;
  128|   403k|    }
  129|      0|    return NULL;
  130|  15.9k|}

EVP_CIPHER_CTX_reset:
   34|  1.90k|{
   35|  1.90k|    if (ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 1.90k]
  ------------------
   36|      0|        return 1;
   37|       |
   38|  1.90k|    if (ctx->cipher == NULL || ctx->cipher->prov == NULL)
  ------------------
  |  Branch (38:9): [True: 1.90k, False: 5]
  |  Branch (38:32): [True: 0, False: 5]
  ------------------
   39|  1.90k|        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.90k| legacy:
   55|       |
   56|  1.90k|    if (ctx->cipher != NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 1.90k]
  ------------------
   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.90k|    OPENSSL_free(ctx->cipher_data);
  ------------------
  |  |  115|  1.90k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.90k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.90k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|  1.90k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   65|  1.90k|    ENGINE_finish(ctx->engine);
   66|  1.90k|#endif
   67|  1.90k|    memset(ctx, 0, sizeof(*ctx));
   68|  1.90k|    ctx->iv_len = -1;
   69|  1.90k|    return 1;
   70|  1.90k|}
EVP_CIPHER_CTX_new:
   73|  1.90k|{
   74|  1.90k|    EVP_CIPHER_CTX *ctx;
   75|       |
   76|  1.90k|    ctx = OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
  ------------------
  |  |  104|  1.90k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.90k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.90k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|  1.90k|    if (ctx == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 1.90k]
  ------------------
   78|      0|        return NULL;
   79|       |
   80|  1.90k|    ctx->iv_len = -1;
   81|  1.90k|    return ctx;
   82|  1.90k|}
EVP_CIPHER_CTX_free:
   85|  1.90k|{
   86|  1.90k|    if (ctx == NULL)
  ------------------
  |  Branch (86:9): [True: 1, False: 1.90k]
  ------------------
   87|      1|        return;
   88|  1.90k|    EVP_CIPHER_CTX_reset(ctx);
   89|  1.90k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  1.90k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.90k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.90k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   90|  1.90k|}
EVP_CipherInit_ex:
  461|  61.7k|{
  462|  61.7k|    return evp_cipher_init_internal(ctx, cipher, impl, key, iv, enc, NULL);
  463|  61.7k|}
EVP_CipherUpdate:
  467|  41.1k|{
  468|  41.1k|    if (ctx->encrypt)
  ------------------
  |  Branch (468:9): [True: 41.1k, False: 0]
  ------------------
  469|  41.1k|        return EVP_EncryptUpdate(ctx, out, outl, in, inl);
  470|      0|    else
  471|      0|        return EVP_DecryptUpdate(ctx, out, outl, in, inl);
  472|  41.1k|}
EVP_EncryptUpdate:
  660|  41.1k|{
  661|  41.1k|    int ret;
  662|  41.1k|    size_t soutl, inl_ = (size_t)inl;
  663|  41.1k|    int blocksize;
  664|       |
  665|  41.1k|    if (ossl_likely(outl != NULL)) {
  ------------------
  |  |   22|  41.1k|#  define ossl_likely(x)     __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:30): [True: 41.1k, False: 0]
  |  |  ------------------
  ------------------
  666|  41.1k|        *outl = 0;
  667|  41.1k|    } else {
  668|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  669|      0|        return 0;
  670|      0|    }
  671|       |
  672|       |    /* Prevent accidental use of decryption context when encrypting */
  673|  41.1k|    if (ossl_unlikely(!ctx->encrypt)) {
  ------------------
  |  |   23|  41.1k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 41.1k]
  |  |  ------------------
  ------------------
  674|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  675|      0|        return 0;
  676|      0|    }
  677|       |
  678|  41.1k|    if (ossl_unlikely(ctx->cipher == NULL)) {
  ------------------
  |  |   23|  41.1k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 41.1k]
  |  |  ------------------
  ------------------
  679|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  680|      0|        return 0;
  681|      0|    }
  682|       |
  683|  41.1k|    if (ossl_unlikely(ctx->cipher->prov == NULL))
  ------------------
  |  |   23|  41.1k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 41.1k]
  |  |  ------------------
  ------------------
  684|      0|        goto legacy;
  685|       |
  686|  41.1k|    blocksize = ctx->cipher->block_size;
  687|       |
  688|  41.1k|    if (ossl_unlikely(ctx->cipher->cupdate == NULL || blocksize < 1)) {
  ------------------
  |  |   23|  82.3k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 41.1k]
  |  |  |  Branch (23:50): [True: 0, False: 41.1k]
  |  |  |  Branch (23:50): [True: 0, False: 41.1k]
  |  |  ------------------
  ------------------
  689|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  690|      0|        return 0;
  691|      0|    }
  692|       |
  693|  41.1k|    ret = ctx->cipher->cupdate(ctx->algctx, out, &soutl,
  694|  41.1k|                               inl_ + (size_t)(blocksize == 1 ? 0 : blocksize),
  ------------------
  |  Branch (694:48): [True: 20.5k, False: 20.5k]
  ------------------
  695|  41.1k|                               in, inl_);
  696|       |
  697|  41.1k|    if (ossl_likely(ret)) {
  ------------------
  |  |   22|  41.1k|#  define ossl_likely(x)     __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:30): [True: 41.1k, False: 0]
  |  |  ------------------
  ------------------
  698|  41.1k|        if (soutl > INT_MAX) {
  ------------------
  |  Branch (698:13): [True: 0, False: 41.1k]
  ------------------
  699|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  700|      0|            return 0;
  701|      0|        }
  702|  41.1k|        *outl = soutl;
  703|  41.1k|    }
  704|       |
  705|  41.1k|    return ret;
  706|       |
  707|       |    /* Code below to be removed when legacy support is dropped. */
  708|      0| legacy:
  709|       |
  710|      0|    return evp_EncryptDecryptUpdate(ctx, out, outl, in, inl);
  711|  41.1k|}
EVP_CIPHER_gettable_ctx_params:
 1380|    130|{
 1381|    130|    void *provctx;
 1382|       |
 1383|    130|    if (cipher != NULL && cipher->gettable_ctx_params != NULL) {
  ------------------
  |  Branch (1383:9): [True: 130, False: 0]
  |  Branch (1383:27): [True: 130, False: 0]
  ------------------
 1384|    130|        provctx = ossl_provider_ctx(EVP_CIPHER_get0_provider(cipher));
 1385|    130|        return cipher->gettable_ctx_params(NULL, provctx);
 1386|    130|    }
 1387|      0|    return NULL;
 1388|    130|}
evp_cipher_new:
 1523|    130|{
 1524|    130|    EVP_CIPHER *cipher = OPENSSL_zalloc(sizeof(EVP_CIPHER));
  ------------------
  |  |  104|    130|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    130|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    130|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1525|       |
 1526|    130|    if (cipher != NULL && !CRYPTO_NEW_REF(&cipher->refcnt, 1)) {
  ------------------
  |  Branch (1526:9): [True: 130, False: 0]
  |  Branch (1526:27): [True: 0, False: 130]
  ------------------
 1527|      0|        OPENSSL_free(cipher);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1528|      0|        return NULL;
 1529|      0|    }
 1530|    130|    return cipher;
 1531|    130|}
EVP_CIPHER_fetch:
 1714|      4|{
 1715|      4|    EVP_CIPHER *cipher =
 1716|      4|        evp_generic_fetch(ctx, OSSL_OP_CIPHER, algorithm, properties,
  ------------------
  |  |  276|      4|# define OSSL_OP_CIPHER                              2   /* Symmetric Ciphers */
  ------------------
 1717|      4|                          evp_cipher_from_algorithm, evp_cipher_up_ref,
 1718|      4|                          evp_cipher_free);
 1719|       |
 1720|      4|    return cipher;
 1721|      4|}
EVP_CIPHER_up_ref:
 1724|    141|{
 1725|    141|    int ref = 0;
 1726|       |
 1727|    141|    if (cipher->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  251|    141|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1727:9): [True: 141, False: 0]
  ------------------
 1728|    141|        CRYPTO_UP_REF(&cipher->refcnt, &ref);
 1729|    141|    return 1;
 1730|    141|}
evp_cipher_free_int:
 1733|    130|{
 1734|    130|    OPENSSL_free(cipher->type_name);
  ------------------
  |  |  115|    130|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    130|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    130|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1735|    130|    ossl_provider_free(cipher->prov);
 1736|    130|    CRYPTO_FREE_REF(&cipher->refcnt);
 1737|    130|    OPENSSL_free(cipher);
  ------------------
  |  |  115|    130|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    130|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    130|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1738|    130|}
EVP_CIPHER_free:
 1741|    280|{
 1742|    280|    int i;
 1743|       |
 1744|    280|    if (cipher == NULL || cipher->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  251|    271|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1744:9): [True: 9, False: 271]
  |  Branch (1744:27): [True: 0, False: 271]
  ------------------
 1745|      9|        return;
 1746|       |
 1747|    271|    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
 1748|    271|    if (i > 0)
  ------------------
  |  Branch (1748:9): [True: 141, False: 130]
  ------------------
 1749|    141|        return;
 1750|    130|    evp_cipher_free_int(cipher);
 1751|    130|}
evp_enc.c:evp_cipher_init_internal:
   97|  61.7k|{
   98|  61.7k|    int n;
   99|  61.7k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  100|  61.7k|    ENGINE *tmpimpl = NULL;
  101|  61.7k|#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|  61.7k|    if (enc == -1) {
  ------------------
  |  Branch (108:9): [True: 61.7k, False: 5]
  ------------------
  109|  61.7k|        enc = ctx->encrypt;
  110|  61.7k|    } 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|  61.7k|    if (cipher == NULL && ctx->cipher == NULL) {
  ------------------
  |  Branch (116:9): [True: 61.7k, False: 5]
  |  Branch (116:27): [True: 0, False: 61.7k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  61.7k|#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|  61.7k|    if (ctx->engine && ctx->cipher
  ------------------
  |  Branch (130:9): [True: 0, False: 61.7k]
  |  Branch (130:24): [True: 0, False: 0]
  ------------------
  131|  61.7k|        && (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|  61.7k|    if (cipher != NULL && impl == NULL) {
  ------------------
  |  Branch (134:9): [True: 5, False: 61.7k]
  |  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|  61.7k|#endif
  139|       |
  140|       |    /*
  141|       |     * If there are engines involved then we should use legacy handling for now.
  142|       |     */
  143|  61.7k|    if (ctx->engine != NULL
  ------------------
  |  Branch (143:9): [True: 0, False: 61.7k]
  ------------------
  144|  61.7k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  145|  61.7k|            || tmpimpl != NULL
  ------------------
  |  Branch (145:16): [True: 0, False: 61.7k]
  ------------------
  146|  61.7k|#endif
  147|  61.7k|            || impl != NULL
  ------------------
  |  Branch (147:16): [True: 0, False: 61.7k]
  ------------------
  148|  61.7k|            || (cipher != NULL && cipher->origin == EVP_ORIG_METH)
  ------------------
  |  |  253|      5|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (148:17): [True: 5, False: 61.7k]
  |  Branch (148:35): [True: 0, False: 5]
  ------------------
  149|  61.7k|            || (cipher == NULL && ctx->cipher != NULL
  ------------------
  |  Branch (149:17): [True: 61.7k, False: 5]
  |  Branch (149:35): [True: 61.7k, False: 0]
  ------------------
  150|  61.7k|                               && ctx->cipher->origin == EVP_ORIG_METH)) {
  ------------------
  |  |  253|  61.7k|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (150:35): [True: 0, False: 61.7k]
  ------------------
  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|  61.7k|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (161:9): [True: 5, False: 61.7k]
  |  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);
  ------------------
  |  |  113|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|  61.7k|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (171:9): [True: 5, False: 61.7k]
  |  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|  61.7k|    if (cipher == NULL)
  ------------------
  |  Branch (180:9): [True: 61.7k, False: 5]
  ------------------
  181|  61.7k|        cipher = ctx->cipher;
  182|       |
  183|  61.7k|    if (cipher->prov == NULL) {
  ------------------
  |  Branch (183:9): [True: 0, False: 61.7k]
  ------------------
  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|  61.7k|    if (!ossl_assert(cipher->prov != NULL)) {
  ------------------
  |  |   52|  61.7k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  61.7k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (203:9): [True: 0, False: 61.7k]
  ------------------
  204|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  205|      0|        return 0;
  206|      0|    }
  207|       |
  208|  61.7k|    if (cipher != ctx->fetched_cipher) {
  ------------------
  |  Branch (208:9): [True: 5, False: 61.7k]
  ------------------
  209|      5|        if (!EVP_CIPHER_up_ref((EVP_CIPHER *)cipher)) {
  ------------------
  |  Branch (209:13): [True: 0, False: 5]
  ------------------
  210|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  211|      0|            return 0;
  212|      0|        }
  213|      5|        EVP_CIPHER_free(ctx->fetched_cipher);
  214|       |        /* Coverity false positive, the reference counting is confusing it */
  215|       |        /* coverity[use_after_free] */
  216|      5|        ctx->fetched_cipher = (EVP_CIPHER *)cipher;
  217|      5|    }
  218|  61.7k|    ctx->cipher = cipher;
  219|  61.7k|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (219:9): [True: 5, False: 61.7k]
  ------------------
  220|      5|        ctx->algctx = ctx->cipher->newctx(ossl_provider_ctx(cipher->prov));
  221|      5|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (221:13): [True: 0, False: 5]
  ------------------
  222|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  223|      0|            return 0;
  224|      0|        }
  225|      5|    }
  226|       |
  227|  61.7k|    if ((ctx->flags & EVP_CIPH_NO_PADDING) != 0) {
  ------------------
  |  |  326|  61.7k|# define         EVP_CIPH_NO_PADDING             0x100
  ------------------
  |  Branch (227:9): [True: 0, False: 61.7k]
  ------------------
  228|       |        /*
  229|       |         * If this ctx was already set up for no padding then we need to tell
  230|       |         * the new cipher about it.
  231|       |         */
  232|      0|        if (!EVP_CIPHER_CTX_set_padding(ctx, 0))
  ------------------
  |  Branch (232:13): [True: 0, False: 0]
  ------------------
  233|      0|            return 0;
  234|      0|    }
  235|       |
  236|  61.7k|#ifndef FIPS_MODULE
  237|       |    /*
  238|       |     * Fix for CVE-2023-5363
  239|       |     * Passing in a size as part of the init call takes effect late
  240|       |     * so, force such to occur before the initialisation.
  241|       |     *
  242|       |     * The FIPS provider's internal library context is used in a manner
  243|       |     * such that this is not an issue.
  244|       |     */
  245|  61.7k|    if (params != NULL) {
  ------------------
  |  Branch (245:9): [True: 0, False: 61.7k]
  ------------------
  246|      0|        OSSL_PARAM param_lens[3] = { OSSL_PARAM_END, OSSL_PARAM_END,
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM param_lens[3] = { OSSL_PARAM_END, OSSL_PARAM_END,
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
  247|      0|                                     OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
  248|      0|        OSSL_PARAM *q = param_lens;
  249|      0|        const OSSL_PARAM *p;
  250|       |
  251|      0|        p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN); 
  ------------------
  |  |  175|      0|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  252|      0|        if (p != NULL)
  ------------------
  |  Branch (252:13): [True: 0, False: 0]
  ------------------
  253|      0|            memcpy(q++, p, sizeof(*q));
  254|       |
  255|       |        /*
  256|       |         * Note that OSSL_CIPHER_PARAM_AEAD_IVLEN is a synonym for
  257|       |         * OSSL_CIPHER_PARAM_IVLEN so both are covered here.
  258|       |         */
  259|      0|        p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  174|      0|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  260|      0|        if (p != NULL)
  ------------------
  |  Branch (260:13): [True: 0, False: 0]
  ------------------
  261|      0|            memcpy(q++, p, sizeof(*q));
  262|       |
  263|      0|        if (q != param_lens) {
  ------------------
  |  Branch (263:13): [True: 0, False: 0]
  ------------------
  264|      0|            if (!EVP_CIPHER_CTX_set_params(ctx, param_lens)) {
  ------------------
  |  Branch (264:17): [True: 0, False: 0]
  ------------------
  265|      0|                ERR_raise(ERR_LIB_EVP, EVP_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  266|      0|                return 0;
  267|      0|            }
  268|      0|        }
  269|      0|    }
  270|  61.7k|#endif
  271|       |
  272|  61.7k|    if (enc) {
  ------------------
  |  Branch (272:9): [True: 61.7k, False: 0]
  ------------------
  273|  61.7k|        if (ctx->cipher->einit == NULL) {
  ------------------
  |  Branch (273:13): [True: 0, False: 61.7k]
  ------------------
  274|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  275|      0|            return 0;
  276|      0|        }
  277|       |
  278|  61.7k|        return ctx->cipher->einit(ctx->algctx,
  279|  61.7k|                                  key,
  280|  61.7k|                                  key == NULL ? 0
  ------------------
  |  Branch (280:35): [True: 20.5k, False: 41.1k]
  ------------------
  281|  61.7k|                                              : EVP_CIPHER_CTX_get_key_length(ctx),
  282|  61.7k|                                  iv,
  283|  61.7k|                                  iv == NULL ? 0
  ------------------
  |  Branch (283:35): [True: 41.1k, False: 20.5k]
  ------------------
  284|  61.7k|                                             : EVP_CIPHER_CTX_get_iv_length(ctx),
  285|  61.7k|                                  params);
  286|  61.7k|    }
  287|       |
  288|      0|    if (ctx->cipher->dinit == NULL) {
  ------------------
  |  Branch (288:9): [True: 0, False: 0]
  ------------------
  289|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  290|      0|        return 0;
  291|      0|    }
  292|       |
  293|      0|    return ctx->cipher->dinit(ctx->algctx,
  294|      0|                              key,
  295|      0|                              key == NULL ? 0
  ------------------
  |  Branch (295:31): [True: 0, False: 0]
  ------------------
  296|      0|                                          : EVP_CIPHER_CTX_get_key_length(ctx),
  297|      0|                              iv,
  298|      0|                              iv == NULL ? 0
  ------------------
  |  Branch (298:31): [True: 0, False: 0]
  ------------------
  299|      0|                                         : EVP_CIPHER_CTX_get_iv_length(ctx),
  300|      0|                                  params);
  301|       |
  302|       |    /* Code below to be removed when legacy support is dropped. */
  303|      0| legacy:
  304|       |
  305|      0|    if (cipher != NULL) {
  ------------------
  |  Branch (305:9): [True: 0, False: 0]
  ------------------
  306|       |        /*
  307|       |         * Ensure a context left lying around from last time is cleared (we
  308|       |         * previously attempted to avoid this if the same ENGINE and
  309|       |         * EVP_CIPHER could be used).
  310|       |         */
  311|      0|        if (ctx->cipher) {
  ------------------
  |  Branch (311:13): [True: 0, False: 0]
  ------------------
  312|      0|            unsigned long flags = ctx->flags;
  313|      0|            EVP_CIPHER_CTX_reset(ctx);
  314|       |            /* Restore encrypt and flags */
  315|      0|            ctx->encrypt = enc;
  316|      0|            ctx->flags = flags;
  317|      0|        }
  318|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  319|      0|        if (impl != NULL) {
  ------------------
  |  Branch (319:13): [True: 0, False: 0]
  ------------------
  320|      0|            if (!ENGINE_init(impl)) {
  ------------------
  |  Branch (320:17): [True: 0, False: 0]
  ------------------
  321|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  322|      0|                return 0;
  323|      0|            }
  324|      0|        } else {
  325|      0|            impl = tmpimpl;
  326|      0|        }
  327|      0|        if (impl != NULL) {
  ------------------
  |  Branch (327:13): [True: 0, False: 0]
  ------------------
  328|       |            /* There's an ENGINE for this job ... (apparently) */
  329|      0|            const EVP_CIPHER *c = ENGINE_get_cipher(impl, cipher->nid);
  330|       |
  331|      0|            if (c == NULL) {
  ------------------
  |  Branch (331:17): [True: 0, False: 0]
  ------------------
  332|       |                /*
  333|       |                 * One positive side-effect of US's export control history,
  334|       |                 * is that we should at least be able to avoid using US
  335|       |                 * misspellings of "initialisation"?
  336|       |                 */
  337|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  338|      0|                return 0;
  339|      0|            }
  340|       |            /* We'll use the ENGINE's private cipher definition */
  341|      0|            cipher = c;
  342|       |            /*
  343|       |             * Store the ENGINE functional reference so we know 'cipher' came
  344|       |             * from an ENGINE and we need to release it when done.
  345|       |             */
  346|      0|            ctx->engine = impl;
  347|      0|        } else {
  348|      0|            ctx->engine = NULL;
  349|      0|        }
  350|      0|#endif
  351|       |
  352|      0|        ctx->cipher = cipher;
  353|      0|        if (ctx->cipher->ctx_size) {
  ------------------
  |  Branch (353:13): [True: 0, False: 0]
  ------------------
  354|      0|            ctx->cipher_data = OPENSSL_zalloc(ctx->cipher->ctx_size);
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  355|      0|            if (ctx->cipher_data == NULL) {
  ------------------
  |  Branch (355:17): [True: 0, False: 0]
  ------------------
  356|      0|                ctx->cipher = NULL;
  357|      0|                return 0;
  358|      0|            }
  359|      0|        } else {
  360|      0|            ctx->cipher_data = NULL;
  361|      0|        }
  362|      0|        ctx->key_len = cipher->key_len;
  363|       |        /* Preserve wrap enable flag, zero everything else */
  364|      0|        ctx->flags &= EVP_CIPHER_CTX_FLAG_WRAP_ALLOW;
  ------------------
  |  |  365|      0|# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1
  ------------------
  365|      0|        if (ctx->cipher->flags & EVP_CIPH_CTRL_INIT) {
  ------------------
  |  |  322|      0|# define         EVP_CIPH_CTRL_INIT              0x40
  ------------------
  |  Branch (365:13): [True: 0, False: 0]
  ------------------
  366|      0|            if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL) <= 0) {
  ------------------
  |  |  369|      0|# define         EVP_CTRL_INIT                   0x0
  ------------------
  |  Branch (366:17): [True: 0, False: 0]
  ------------------
  367|      0|                ctx->cipher = NULL;
  368|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  369|      0|                return 0;
  370|      0|            }
  371|      0|        }
  372|      0|    }
  373|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  374|      0| skip_to_init:
  375|      0|#endif
  376|      0|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (376:9): [True: 0, False: 0]
  ------------------
  377|      0|        return 0;
  378|       |
  379|       |    /* we assume block size is a power of 2 in *cryptUpdate */
  380|      0|    OPENSSL_assert(ctx->cipher->block_size == 1
  ------------------
  |  |  434|      0|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (434:13): [True: 0, False: 0]
  |  |  |  Branch (434:13): [True: 0, False: 0]
  |  |  |  Branch (434:13): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  381|      0|                   || ctx->cipher->block_size == 8
  382|      0|                   || ctx->cipher->block_size == 16);
  383|       |
  384|      0|    if (!(ctx->flags & EVP_CIPHER_CTX_FLAG_WRAP_ALLOW)
  ------------------
  |  |  365|      0|# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1
  ------------------
  |  Branch (384:9): [True: 0, False: 0]
  ------------------
  385|      0|        && EVP_CIPHER_CTX_get_mode(ctx) == EVP_CIPH_WRAP_MODE) {
  ------------------
  |  |  654|      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) {
  ------------------
  |  |  310|      0|# define         EVP_CIPH_WRAP_MODE              0x10002
  ------------------
  |  Branch (385:12): [True: 0, False: 0]
  ------------------
  386|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  387|      0|        return 0;
  388|      0|    }
  389|       |
  390|      0|    if ((EVP_CIPHER_get_flags(EVP_CIPHER_CTX_get0_cipher(ctx))
  ------------------
  |  Branch (390:9): [True: 0, False: 0]
  ------------------
  391|      0|                & EVP_CIPH_CUSTOM_IV) == 0) {
  ------------------
  |  |  318|      0|# define         EVP_CIPH_CUSTOM_IV              0x10
  ------------------
  392|      0|        switch (EVP_CIPHER_CTX_get_mode(ctx)) {
  ------------------
  |  |  654|      0|# define EVP_CIPHER_CTX_get_mode(c)  EVP_CIPHER_get_mode(EVP_CIPHER_CTX_get0_cipher(c))
  ------------------
  393|       |
  394|      0|        case EVP_CIPH_STREAM_CIPHER:
  ------------------
  |  |  301|      0|# define         EVP_CIPH_STREAM_CIPHER          0x0
  ------------------
  |  Branch (394:9): [True: 0, False: 0]
  ------------------
  395|      0|        case EVP_CIPH_ECB_MODE:
  ------------------
  |  |  302|      0|# define         EVP_CIPH_ECB_MODE               0x1
  ------------------
  |  Branch (395:9): [True: 0, False: 0]
  ------------------
  396|      0|            break;
  397|       |
  398|      0|        case EVP_CIPH_CFB_MODE:
  ------------------
  |  |  304|      0|# define         EVP_CIPH_CFB_MODE               0x3
  ------------------
  |  Branch (398:9): [True: 0, False: 0]
  ------------------
  399|      0|        case EVP_CIPH_OFB_MODE:
  ------------------
  |  |  305|      0|# define         EVP_CIPH_OFB_MODE               0x4
  ------------------
  |  Branch (399:9): [True: 0, False: 0]
  ------------------
  400|       |
  401|      0|            ctx->num = 0;
  402|       |            /* fall-through */
  403|       |
  404|      0|        case EVP_CIPH_CBC_MODE:
  ------------------
  |  |  303|      0|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (404:9): [True: 0, False: 0]
  ------------------
  405|      0|            n = EVP_CIPHER_CTX_get_iv_length(ctx);
  406|      0|            if (n < 0 || n > (int)sizeof(ctx->iv)) {
  ------------------
  |  Branch (406:17): [True: 0, False: 0]
  |  Branch (406:26): [True: 0, False: 0]
  ------------------
  407|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  408|      0|                return 0;
  409|      0|            }
  410|      0|            if (iv != NULL)
  ------------------
  |  Branch (410:17): [True: 0, False: 0]
  ------------------
  411|      0|                memcpy(ctx->oiv, iv, n);
  412|      0|            memcpy(ctx->iv, ctx->oiv, n);
  413|      0|            break;
  414|       |
  415|      0|        case EVP_CIPH_CTR_MODE:
  ------------------
  |  |  306|      0|# define         EVP_CIPH_CTR_MODE               0x5
  ------------------
  |  Branch (415:9): [True: 0, False: 0]
  ------------------
  416|      0|            ctx->num = 0;
  417|       |            /* Don't reuse IV for CTR mode */
  418|      0|            if (iv != NULL) {
  ------------------
  |  Branch (418:17): [True: 0, False: 0]
  ------------------
  419|      0|                n = EVP_CIPHER_CTX_get_iv_length(ctx);
  420|      0|                if (n <= 0 || n > (int)sizeof(ctx->iv)) {
  ------------------
  |  Branch (420:21): [True: 0, False: 0]
  |  Branch (420:31): [True: 0, False: 0]
  ------------------
  421|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  422|      0|                    return 0;
  423|      0|                }
  424|      0|                memcpy(ctx->iv, iv, n);
  425|      0|            }
  426|      0|            break;
  427|       |
  428|      0|        default:
  ------------------
  |  Branch (428:9): [True: 0, False: 0]
  ------------------
  429|      0|            return 0;
  430|      0|        }
  431|      0|    }
  432|       |
  433|      0|    if (key != NULL || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) {
  ------------------
  |  |  320|      0|# define         EVP_CIPH_ALWAYS_CALL_INIT       0x20
  ------------------
  |  Branch (433:9): [True: 0, False: 0]
  |  Branch (433:24): [True: 0, False: 0]
  ------------------
  434|      0|        if (!ctx->cipher->init(ctx, key, iv, enc))
  ------------------
  |  Branch (434:13): [True: 0, False: 0]
  ------------------
  435|      0|            return 0;
  436|      0|    }
  437|      0|    ctx->buf_len = 0;
  438|      0|    ctx->final_used = 0;
  439|      0|    ctx->block_mask = ctx->cipher->block_size - 1;
  440|      0|    return 1;
  441|      0|}
evp_enc.c:evp_cipher_from_algorithm:
 1567|    130|{
 1568|    130|    const OSSL_DISPATCH *fns = algodef->implementation;
 1569|    130|    EVP_CIPHER *cipher = NULL;
 1570|    130|    int fnciphcnt = 0, fnctxcnt = 0;
 1571|       |
 1572|    130|    if ((cipher = evp_cipher_new()) == NULL) {
  ------------------
  |  Branch (1572:9): [True: 0, False: 130]
  ------------------
 1573|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1574|      0|        return NULL;
 1575|      0|    }
 1576|       |
 1577|    130|#ifndef FIPS_MODULE
 1578|    130|    cipher->nid = NID_undef;
  ------------------
  |  |   18|    130|#define NID_undef                       0
  ------------------
 1579|    130|    if (!evp_names_do_all(prov, name_id, set_legacy_nid, &cipher->nid)
  ------------------
  |  Branch (1579:9): [True: 0, False: 130]
  ------------------
 1580|    130|            || cipher->nid == -1) {
  ------------------
  |  Branch (1580:16): [True: 0, False: 130]
  ------------------
 1581|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1582|      0|        EVP_CIPHER_free(cipher);
 1583|      0|        return NULL;
 1584|      0|    }
 1585|    130|#endif
 1586|       |
 1587|    130|    cipher->name_id = name_id;
 1588|    130|    if ((cipher->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (1588:9): [True: 0, False: 130]
  ------------------
 1589|      0|        EVP_CIPHER_free(cipher);
 1590|      0|        return NULL;
 1591|      0|    }
 1592|    130|    cipher->description = algodef->algorithm_description;
 1593|       |
 1594|  1.93k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (1594:12): [True: 1.80k, False: 130]
  ------------------
 1595|  1.80k|        switch (fns->function_id) {
  ------------------
  |  Branch (1595:17): [True: 0, False: 1.80k]
  ------------------
 1596|    130|        case OSSL_FUNC_CIPHER_NEWCTX:
  ------------------
  |  |  340|    130|# define OSSL_FUNC_CIPHER_NEWCTX                     1
  ------------------
  |  Branch (1596:9): [True: 130, False: 1.67k]
  ------------------
 1597|    130|            if (cipher->newctx != NULL)
  ------------------
  |  Branch (1597:17): [True: 0, False: 130]
  ------------------
 1598|      0|                break;
 1599|    130|            cipher->newctx = OSSL_FUNC_cipher_newctx(fns);
 1600|    130|            fnctxcnt++;
 1601|    130|            break;
 1602|    130|        case OSSL_FUNC_CIPHER_ENCRYPT_INIT:
  ------------------
  |  |  341|    130|# define OSSL_FUNC_CIPHER_ENCRYPT_INIT               2
  ------------------
  |  Branch (1602:9): [True: 130, False: 1.67k]
  ------------------
 1603|    130|            if (cipher->einit != NULL)
  ------------------
  |  Branch (1603:17): [True: 0, False: 130]
  ------------------
 1604|      0|                break;
 1605|    130|            cipher->einit = OSSL_FUNC_cipher_encrypt_init(fns);
 1606|    130|            fnciphcnt++;
 1607|    130|            break;
 1608|    130|        case OSSL_FUNC_CIPHER_DECRYPT_INIT:
  ------------------
  |  |  342|    130|# define OSSL_FUNC_CIPHER_DECRYPT_INIT               3
  ------------------
  |  Branch (1608:9): [True: 130, False: 1.67k]
  ------------------
 1609|    130|            if (cipher->dinit != NULL)
  ------------------
  |  Branch (1609:17): [True: 0, False: 130]
  ------------------
 1610|      0|                break;
 1611|    130|            cipher->dinit = OSSL_FUNC_cipher_decrypt_init(fns);
 1612|    130|            fnciphcnt++;
 1613|    130|            break;
 1614|    130|        case OSSL_FUNC_CIPHER_UPDATE:
  ------------------
  |  |  343|    130|# define OSSL_FUNC_CIPHER_UPDATE                     4
  ------------------
  |  Branch (1614:9): [True: 130, False: 1.67k]
  ------------------
 1615|    130|            if (cipher->cupdate != NULL)
  ------------------
  |  Branch (1615:17): [True: 0, False: 130]
  ------------------
 1616|      0|                break;
 1617|    130|            cipher->cupdate = OSSL_FUNC_cipher_update(fns);
 1618|    130|            fnciphcnt++;
 1619|    130|            break;
 1620|    130|        case OSSL_FUNC_CIPHER_FINAL:
  ------------------
  |  |  344|    130|# define OSSL_FUNC_CIPHER_FINAL                      5
  ------------------
  |  Branch (1620:9): [True: 130, False: 1.67k]
  ------------------
 1621|    130|            if (cipher->cfinal != NULL)
  ------------------
  |  Branch (1621:17): [True: 0, False: 130]
  ------------------
 1622|      0|                break;
 1623|    130|            cipher->cfinal = OSSL_FUNC_cipher_final(fns);
 1624|    130|            fnciphcnt++;
 1625|    130|            break;
 1626|    118|        case OSSL_FUNC_CIPHER_CIPHER:
  ------------------
  |  |  345|    118|# define OSSL_FUNC_CIPHER_CIPHER                     6
  ------------------
  |  Branch (1626:9): [True: 118, False: 1.68k]
  ------------------
 1627|    118|            if (cipher->ccipher != NULL)
  ------------------
  |  Branch (1627:17): [True: 0, False: 118]
  ------------------
 1628|      0|                break;
 1629|    118|            cipher->ccipher = OSSL_FUNC_cipher_cipher(fns);
 1630|    118|            break;
 1631|    130|        case OSSL_FUNC_CIPHER_FREECTX:
  ------------------
  |  |  346|    130|# define OSSL_FUNC_CIPHER_FREECTX                    7
  ------------------
  |  Branch (1631:9): [True: 130, False: 1.67k]
  ------------------
 1632|    130|            if (cipher->freectx != NULL)
  ------------------
  |  Branch (1632:17): [True: 0, False: 130]
  ------------------
 1633|      0|                break;
 1634|    130|            cipher->freectx = OSSL_FUNC_cipher_freectx(fns);
 1635|    130|            fnctxcnt++;
 1636|    130|            break;
 1637|    129|        case OSSL_FUNC_CIPHER_DUPCTX:
  ------------------
  |  |  347|    129|# define OSSL_FUNC_CIPHER_DUPCTX                     8
  ------------------
  |  Branch (1637:9): [True: 129, False: 1.67k]
  ------------------
 1638|    129|            if (cipher->dupctx != NULL)
  ------------------
  |  Branch (1638:17): [True: 0, False: 129]
  ------------------
 1639|      0|                break;
 1640|    129|            cipher->dupctx = OSSL_FUNC_cipher_dupctx(fns);
 1641|    129|            break;
 1642|    130|        case OSSL_FUNC_CIPHER_GET_PARAMS:
  ------------------
  |  |  348|    130|# define OSSL_FUNC_CIPHER_GET_PARAMS                 9
  ------------------
  |  Branch (1642:9): [True: 130, False: 1.67k]
  ------------------
 1643|    130|            if (cipher->get_params != NULL)
  ------------------
  |  Branch (1643:17): [True: 0, False: 130]
  ------------------
 1644|      0|                break;
 1645|    130|            cipher->get_params = OSSL_FUNC_cipher_get_params(fns);
 1646|    130|            break;
 1647|    130|        case OSSL_FUNC_CIPHER_GET_CTX_PARAMS:
  ------------------
  |  |  349|    130|# define OSSL_FUNC_CIPHER_GET_CTX_PARAMS            10
  ------------------
  |  Branch (1647:9): [True: 130, False: 1.67k]
  ------------------
 1648|    130|            if (cipher->get_ctx_params != NULL)
  ------------------
  |  Branch (1648:17): [True: 0, False: 130]
  ------------------
 1649|      0|                break;
 1650|    130|            cipher->get_ctx_params = OSSL_FUNC_cipher_get_ctx_params(fns);
 1651|    130|            break;
 1652|    130|        case OSSL_FUNC_CIPHER_SET_CTX_PARAMS:
  ------------------
  |  |  350|    130|# define OSSL_FUNC_CIPHER_SET_CTX_PARAMS            11
  ------------------
  |  Branch (1652:9): [True: 130, False: 1.67k]
  ------------------
 1653|    130|            if (cipher->set_ctx_params != NULL)
  ------------------
  |  Branch (1653:17): [True: 0, False: 130]
  ------------------
 1654|      0|                break;
 1655|    130|            cipher->set_ctx_params = OSSL_FUNC_cipher_set_ctx_params(fns);
 1656|    130|            break;
 1657|    130|        case OSSL_FUNC_CIPHER_GETTABLE_PARAMS:
  ------------------
  |  |  351|    130|# define OSSL_FUNC_CIPHER_GETTABLE_PARAMS           12
  ------------------
  |  Branch (1657:9): [True: 130, False: 1.67k]
  ------------------
 1658|    130|            if (cipher->gettable_params != NULL)
  ------------------
  |  Branch (1658:17): [True: 0, False: 130]
  ------------------
 1659|      0|                break;
 1660|    130|            cipher->gettable_params = OSSL_FUNC_cipher_gettable_params(fns);
 1661|    130|            break;
 1662|    130|        case OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  352|    130|# define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS       13
  ------------------
  |  Branch (1662:9): [True: 130, False: 1.67k]
  ------------------
 1663|    130|            if (cipher->gettable_ctx_params != NULL)
  ------------------
  |  Branch (1663:17): [True: 0, False: 130]
  ------------------
 1664|      0|                break;
 1665|    130|            cipher->gettable_ctx_params =
 1666|    130|                OSSL_FUNC_cipher_gettable_ctx_params(fns);
 1667|    130|            break;
 1668|    130|        case OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  353|    130|# define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS       14
  ------------------
  |  Branch (1668:9): [True: 130, False: 1.67k]
  ------------------
 1669|    130|            if (cipher->settable_ctx_params != NULL)
  ------------------
  |  Branch (1669:17): [True: 0, False: 130]
  ------------------
 1670|      0|                break;
 1671|    130|            cipher->settable_ctx_params =
 1672|    130|                OSSL_FUNC_cipher_settable_ctx_params(fns);
 1673|    130|            break;
 1674|  1.80k|        }
 1675|  1.80k|    }
 1676|    130|    if ((fnciphcnt != 0 && fnciphcnt != 3 && fnciphcnt != 4)
  ------------------
  |  Branch (1676:10): [True: 130, False: 0]
  |  Branch (1676:28): [True: 130, False: 0]
  |  Branch (1676:46): [True: 0, False: 130]
  ------------------
 1677|    130|            || (fnciphcnt == 0 && cipher->ccipher == NULL)
  ------------------
  |  Branch (1677:17): [True: 0, False: 130]
  |  Branch (1677:35): [True: 0, False: 0]
  ------------------
 1678|    130|            || fnctxcnt != 2) {
  ------------------
  |  Branch (1678:16): [True: 0, False: 130]
  ------------------
 1679|       |        /*
 1680|       |         * In order to be a consistent set of functions we must have at least
 1681|       |         * a complete set of "encrypt" functions, or a complete set of "decrypt"
 1682|       |         * functions, or a single "cipher" function. In all cases we need both
 1683|       |         * the "newctx" and "freectx" functions.
 1684|       |         */
 1685|      0|        EVP_CIPHER_free(cipher);
 1686|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1687|      0|        return NULL;
 1688|      0|    }
 1689|    130|    cipher->prov = prov;
 1690|    130|    if (prov != NULL)
  ------------------
  |  Branch (1690:9): [True: 130, False: 0]
  ------------------
 1691|    130|        ossl_provider_up_ref(prov);
 1692|       |
 1693|    130|    if (!evp_cipher_cache_constants(cipher)) {
  ------------------
  |  Branch (1693:9): [True: 0, False: 130]
  ------------------
 1694|      0|        EVP_CIPHER_free(cipher);
 1695|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1696|      0|        cipher = NULL;
 1697|      0|    }
 1698|       |
 1699|    130|    return cipher;
 1700|    130|}
evp_enc.c:set_legacy_nid:
 1541|    243|{
 1542|    243|    int nid;
 1543|    243|    int *legacy_nid = vlegacy_nid;
 1544|       |    /*
 1545|       |     * We use lowest level function to get the associated method, because
 1546|       |     * higher level functions such as EVP_get_cipherbyname() have changed
 1547|       |     * to look at providers too.
 1548|       |     */
 1549|    243|    const void *legacy_method = OBJ_NAME_get(name, OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|    243|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
 1550|       |
 1551|    243|    if (*legacy_nid == -1)       /* We found a clash already */
  ------------------
  |  Branch (1551:9): [True: 0, False: 243]
  ------------------
 1552|      0|        return;
 1553|    243|    if (legacy_method == NULL)
  ------------------
  |  Branch (1553:9): [True: 109, False: 134]
  ------------------
 1554|    109|        return;
 1555|    134|    nid = EVP_CIPHER_get_nid(legacy_method);
 1556|    134|    if (*legacy_nid != NID_undef && *legacy_nid != nid) {
  ------------------
  |  |   18|    268|#define NID_undef                       0
  ------------------
  |  Branch (1556:9): [True: 26, False: 108]
  |  Branch (1556:37): [True: 0, False: 26]
  ------------------
 1557|      0|        *legacy_nid = -1;
 1558|      0|        return;
 1559|      0|    }
 1560|    134|    *legacy_nid = nid;
 1561|    134|}
evp_enc.c:evp_cipher_up_ref:
 1703|    136|{
 1704|    136|    return EVP_CIPHER_up_ref(cipher);
 1705|    136|}
evp_enc.c:evp_cipher_free:
 1708|    262|{
 1709|    262|    EVP_CIPHER_free(cipher);
 1710|    262|}

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

evp_generic_fetch:
  372|  19.3k|{
  373|  19.3k|    struct evp_method_data_st methdata;
  374|  19.3k|    void *method;
  375|       |
  376|  19.3k|    methdata.libctx = libctx;
  377|  19.3k|    methdata.tmp_store = NULL;
  378|  19.3k|    method = inner_evp_generic_fetch(&methdata, NULL, operation_id,
  379|  19.3k|                                     name, properties,
  380|  19.3k|                                     new_method, up_ref_method, free_method);
  381|  19.3k|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  382|  19.3k|    return method;
  383|  19.3k|}
evp_generic_do_all:
  606|    731|{
  607|    731|    struct evp_method_data_st methdata;
  608|    731|    struct filter_data_st data;
  609|       |
  610|    731|    methdata.libctx = libctx;
  611|    731|    methdata.tmp_store = NULL;
  612|    731|    (void)inner_evp_generic_fetch(&methdata, NULL, operation_id, NULL, NULL,
  613|    731|                                  new_method, up_ref_method, free_method);
  614|       |
  615|    731|    data.operation_id = operation_id;
  616|    731|    data.user_fn = user_fn;
  617|    731|    data.user_arg = user_arg;
  618|    731|    if (methdata.tmp_store != NULL)
  ------------------
  |  Branch (618:9): [True: 0, False: 731]
  ------------------
  619|      0|        ossl_method_store_do_all(methdata.tmp_store, &filter_on_operation_id,
  620|      0|                                 &data);
  621|    731|    ossl_method_store_do_all(get_evp_method_store(libctx),
  622|    731|                             &filter_on_operation_id, &data);
  623|    731|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  624|    731|}
evp_is_a:
  628|  35.2k|{
  629|       |    /*
  630|       |     * For a |prov| that is NULL, the library context will be NULL
  631|       |     */
  632|  35.2k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  633|  35.2k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  634|       |
  635|  35.2k|    if (prov == NULL)
  ------------------
  |  Branch (635:9): [True: 19.3k, False: 15.9k]
  ------------------
  636|  19.3k|        number = ossl_namemap_name2num(namemap, legacy_name);
  637|  35.2k|    return ossl_namemap_name2num(namemap, name) == number;
  638|  35.2k|}
evp_names_do_all:
  643|  16.1k|{
  644|  16.1k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  645|  16.1k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  646|       |
  647|  16.1k|    return ossl_namemap_doall_names(namemap, number, fn, data);
  648|  16.1k|}
evp_fetch.c:inner_evp_generic_fetch:
  249|  20.0k|{
  250|  20.0k|    OSSL_METHOD_STORE *store = get_evp_method_store(methdata->libctx);
  251|  20.0k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  252|  20.0k|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (252:31): [True: 1, False: 20.0k]
  ------------------
  253|  20.0k|    uint32_t meth_id = 0;
  254|  20.0k|    void *method = NULL;
  255|  20.0k|    int unsupported, name_id;
  256|       |
  257|  20.0k|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (257:9): [True: 0, False: 20.0k]
  |  Branch (257:26): [True: 0, False: 20.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  20.0k|    if (!ossl_assert(operation_id > 0)) {
  ------------------
  |  |   52|  20.0k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  20.0k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (266:9): [True: 0, False: 20.0k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  20.0k|    name_id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (272:15): [True: 19.3k, False: 731]
  ------------------
  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|  20.0k|    if (name_id != 0 && (meth_id = evp_method_id(name_id, operation_id)) == 0) {
  ------------------
  |  Branch (282:9): [True: 19.3k, False: 733]
  |  Branch (282:25): [True: 0, False: 19.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  20.0k|    unsupported = name_id == 0;
  292|       |
  293|  20.0k|    if (meth_id == 0
  ------------------
  |  Branch (293:9): [True: 733, False: 19.3k]
  ------------------
  294|  20.0k|        || !ossl_method_store_cache_get(store, prov, meth_id, propq, &method)) {
  ------------------
  |  Branch (294:12): [True: 3, False: 19.3k]
  ------------------
  295|    736|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  296|    736|            get_tmp_evp_method_store,
  297|    736|            reserve_evp_method_store,
  298|    736|            unreserve_evp_method_store,
  299|    736|            get_evp_method_from_store,
  300|    736|            put_evp_method_in_store,
  301|    736|            construct_evp_method,
  302|    736|            destruct_evp_method
  303|    736|        };
  304|       |
  305|    736|        methdata->operation_id = operation_id;
  306|    736|        methdata->name_id = name_id;
  307|    736|        methdata->names = name;
  308|    736|        methdata->propquery = propq;
  309|    736|        methdata->method_from_algorithm = new_method;
  310|    736|        methdata->refcnt_up_method = up_ref_method;
  311|    736|        methdata->destruct_method = free_method;
  312|    736|        methdata->flag_construct_error_occurred = 0;
  313|    736|        if ((method = ossl_method_construct(methdata->libctx, operation_id,
  ------------------
  |  Branch (313:13): [True: 5, False: 731]
  ------------------
  314|    736|                                            &prov, 0 /* !force_cache */,
  315|    736|                                            &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|       |             * Note that there is a corner case here, in which, if a user
  322|       |             * passes a name of the form name1:name2:..., then the construction
  323|       |             * will create a method against all names, but the lookup will fail
  324|       |             * as ossl_namemap_name2num treats the name string as a single name
  325|       |             * rather than introducing new features where in the EVP_<obj>_fetch
  326|       |             * parses the string and queries for each, return an error.
  327|       |             */
  328|      5|            if (name_id == 0)
  ------------------
  |  Branch (328:17): [True: 2, False: 3]
  ------------------
  329|      2|                name_id = ossl_namemap_name2num(namemap, name);
  330|      5|            if (name_id == 0) {
  ------------------
  |  Branch (330:17): [True: 0, False: 5]
  ------------------
  331|      0|                ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |  364|      0|# define ERR_R_FETCH_FAILED                      (269|ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  332|      0|                               "Algorithm %s cannot be found", name);
  333|      0|                free_method(method);
  334|      0|                method = NULL;
  335|      5|            } else {
  336|      5|                meth_id = evp_method_id(name_id, operation_id);
  337|      5|                if (meth_id != 0)
  ------------------
  |  Branch (337:21): [True: 5, False: 0]
  ------------------
  338|      5|                    ossl_method_store_cache_set(store, prov, meth_id, propq,
  339|      5|                                                method, up_ref_method, free_method);
  340|      5|            }
  341|      5|        }
  342|       |
  343|       |        /*
  344|       |         * If we never were in the constructor, the algorithm to be fetched
  345|       |         * is unsupported.
  346|       |         */
  347|    736|        unsupported = !methdata->flag_construct_error_occurred;
  348|    736|    }
  349|       |
  350|  20.0k|    if ((name_id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (350:10): [True: 19.3k, False: 731]
  |  Branch (350:26): [True: 0, False: 731]
  |  Branch (350:43): [True: 0, False: 19.3k]
  ------------------
  351|      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 (351:20): [True: 0, False: 0]
  ------------------
  352|       |
  353|      0|        if (name == NULL)
  ------------------
  |  Branch (353:13): [True: 0, False: 0]
  ------------------
  354|      0|            name = ossl_namemap_num2name(namemap, name_id, 0);
  355|      0|        ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
  356|      0|                       "%s, Algorithm (%s : %d), Properties (%s)",
  357|      0|                       ossl_lib_ctx_get_descriptor(methdata->libctx),
  358|      0|                       name == NULL ? "<null>" : name, name_id,
  ------------------
  |  Branch (358:24): [True: 0, False: 0]
  ------------------
  359|      0|                       properties == NULL ? "<null>" : properties);
  ------------------
  |  Branch (359:24): [True: 0, False: 0]
  ------------------
  360|      0|    }
  361|       |
  362|  20.0k|    return method;
  363|  20.0k|}
evp_fetch.c:evp_method_id:
  112|  19.5k|{
  113|  19.5k|    if (!ossl_assert(name_id > 0 && name_id <= METHOD_ID_NAME_MAX)
  ------------------
  |  |   52|  39.0k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 19.5k, False: 0]
  |  |  |  Branch (52:43): [True: 19.5k, False: 0]
  |  |  ------------------
  |  |   53|  39.0k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (113:9): [True: 0, False: 19.5k]
  ------------------
  114|  19.5k|        || !ossl_assert(operation_id > 0
  ------------------
  |  |   52|  39.0k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 19.5k, False: 0]
  |  |  |  Branch (52:43): [True: 19.5k, False: 0]
  |  |  ------------------
  |  |   53|  19.5k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (114:12): [True: 0, False: 19.5k]
  ------------------
  115|  19.5k|                        && operation_id <= METHOD_ID_OPERATION_MAX))
  116|      0|        return 0;
  117|  19.5k|    return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  109|  19.5k|#define METHOD_ID_NAME_OFFSET           8
  ------------------
                  return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  108|  19.5k|#define METHOD_ID_NAME_MASK             0x7FFFFF00
  ------------------
  118|  19.5k|            | (operation_id & METHOD_ID_OPERATION_MASK));
  ------------------
  |  |  106|  19.5k|#define METHOD_ID_OPERATION_MASK        0x000000FF
  ------------------
  119|  19.5k|}
evp_fetch.c:reserve_evp_method_store:
   68|    736|{
   69|    736|    struct evp_method_data_st *methdata = data;
   70|       |
   71|    736|    if (store == NULL
  ------------------
  |  Branch (71:9): [True: 736, False: 0]
  ------------------
   72|    736|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (72:12): [True: 0, False: 736]
  ------------------
   73|      0|        return 0;
   74|       |
   75|    736|    return ossl_method_lock_store(store);
   76|    736|}
evp_fetch.c:unreserve_evp_method_store:
   79|    736|{
   80|    736|    struct evp_method_data_st *methdata = data;
   81|       |
   82|    736|    if (store == NULL
  ------------------
  |  Branch (82:9): [True: 736, False: 0]
  ------------------
   83|    736|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (83:12): [True: 0, False: 736]
  ------------------
   84|      0|        return 0;
   85|       |
   86|    736|    return ossl_method_unlock_store(store);
   87|    736|}
evp_fetch.c:get_evp_method_from_store:
  123|    736|{
  124|    736|    struct evp_method_data_st *methdata = data;
  125|    736|    void *method = NULL;
  126|    736|    int name_id;
  127|    736|    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|    736|    if ((name_id = methdata->name_id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (134:9): [True: 733, False: 3]
  |  Branch (134:47): [True: 2, False: 731]
  ------------------
  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|    736|    if (name_id == 0
  ------------------
  |  Branch (145:9): [True: 731, False: 5]
  ------------------
  146|    736|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (146:12): [True: 0, False: 5]
  ------------------
  147|    731|        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|  20.0k|{
   58|  20.0k|    if (store != NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 20.0k]
  ------------------
   59|      0|        ossl_method_store_free(store);
   60|  20.0k|}
evp_fetch.c:get_evp_method_store:
   63|  22.4k|{
   64|  22.4k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX);
  ------------------
  |  |   96|  22.4k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
   65|  22.4k|}
evp_fetch.c:filter_on_operation_id:
  591|  89.3k|{
  592|  89.3k|    struct filter_data_st *data = arg;
  593|       |
  594|  89.3k|    if ((id & METHOD_ID_OPERATION_MASK) == data->operation_id)
  ------------------
  |  |  106|  89.3k|#define METHOD_ID_OPERATION_MASK        0x000000FF
  ------------------
  |  Branch (594:9): [True: 13.1k, False: 76.1k]
  ------------------
  595|  13.1k|        data->user_fn(method, data->user_arg);
  596|  89.3k|}

EVP_CIPHER_get_type:
  286|    183|{
  287|    183|    int nid;
  288|    183|    nid = EVP_CIPHER_get_nid(cipher);
  289|       |
  290|    183|    switch (nid) {
  291|       |
  292|      3|    case NID_rc2_cbc:
  ------------------
  |  | 1280|      3|#define NID_rc2_cbc             37
  ------------------
  |  Branch (292:5): [True: 3, False: 180]
  ------------------
  293|      5|    case NID_rc2_64_cbc:
  ------------------
  |  | 1301|      5|#define NID_rc2_64_cbc          166
  ------------------
  |  Branch (293:5): [True: 2, False: 181]
  ------------------
  294|      7|    case NID_rc2_40_cbc:
  ------------------
  |  | 1297|      7|#define NID_rc2_40_cbc          98
  ------------------
  |  Branch (294:5): [True: 2, False: 181]
  ------------------
  295|       |
  296|      7|        return NID_rc2_cbc;
  ------------------
  |  | 1280|      7|#define NID_rc2_cbc             37
  ------------------
  297|       |
  298|      1|    case NID_rc4:
  ------------------
  |  | 1305|      1|#define NID_rc4         5
  ------------------
  |  Branch (298:5): [True: 1, False: 182]
  ------------------
  299|      2|    case NID_rc4_40:
  ------------------
  |  | 1310|      2|#define NID_rc4_40              97
  ------------------
  |  Branch (299:5): [True: 1, False: 182]
  ------------------
  300|       |
  301|      2|        return NID_rc4;
  ------------------
  |  | 1305|      2|#define NID_rc4         5
  ------------------
  302|       |
  303|      1|    case NID_aes_128_cfb128:
  ------------------
  |  | 3075|      1|#define NID_aes_128_cfb128              421
  ------------------
  |  Branch (303:5): [True: 1, False: 182]
  ------------------
  304|      2|    case NID_aes_128_cfb8:
  ------------------
  |  | 3196|      2|#define NID_aes_128_cfb8                653
  ------------------
  |  Branch (304:5): [True: 1, False: 182]
  ------------------
  305|      3|    case NID_aes_128_cfb1:
  ------------------
  |  | 3184|      3|#define NID_aes_128_cfb1                650
  ------------------
  |  Branch (305:5): [True: 1, False: 182]
  ------------------
  306|       |
  307|      3|        return NID_aes_128_cfb128;
  ------------------
  |  | 3075|      3|#define NID_aes_128_cfb128              421
  ------------------
  308|       |
  309|      1|    case NID_aes_192_cfb128:
  ------------------
  |  | 3113|      1|#define NID_aes_192_cfb128              425
  ------------------
  |  Branch (309:5): [True: 1, False: 182]
  ------------------
  310|      2|    case NID_aes_192_cfb8:
  ------------------
  |  | 3200|      2|#define NID_aes_192_cfb8                654
  ------------------
  |  Branch (310:5): [True: 1, False: 182]
  ------------------
  311|      3|    case NID_aes_192_cfb1:
  ------------------
  |  | 3188|      3|#define NID_aes_192_cfb1                651
  ------------------
  |  Branch (311:5): [True: 1, False: 182]
  ------------------
  312|       |
  313|      3|        return NID_aes_192_cfb128;
  ------------------
  |  | 3113|      3|#define NID_aes_192_cfb128              425
  ------------------
  314|       |
  315|      1|    case NID_aes_256_cfb128:
  ------------------
  |  | 3151|      1|#define NID_aes_256_cfb128              429
  ------------------
  |  Branch (315:5): [True: 1, False: 182]
  ------------------
  316|      2|    case NID_aes_256_cfb8:
  ------------------
  |  | 3204|      2|#define NID_aes_256_cfb8                655
  ------------------
  |  Branch (316:5): [True: 1, False: 182]
  ------------------
  317|      3|    case NID_aes_256_cfb1:
  ------------------
  |  | 3192|      3|#define NID_aes_256_cfb1                652
  ------------------
  |  Branch (317:5): [True: 1, False: 182]
  ------------------
  318|       |
  319|      3|        return NID_aes_256_cfb128;
  ------------------
  |  | 3151|      3|#define NID_aes_256_cfb128              429
  ------------------
  320|       |
  321|      1|    case NID_des_cfb64:
  ------------------
  |  | 2250|      1|#define NID_des_cfb64           30
  ------------------
  |  Branch (321:5): [True: 1, False: 182]
  ------------------
  322|      2|    case NID_des_cfb8:
  ------------------
  |  | 3236|      2|#define NID_des_cfb8            657
  ------------------
  |  Branch (322:5): [True: 1, False: 182]
  ------------------
  323|      3|    case NID_des_cfb1:
  ------------------
  |  | 3232|      3|#define NID_des_cfb1            656
  ------------------
  |  Branch (323:5): [True: 1, False: 182]
  ------------------
  324|       |
  325|      3|        return NID_des_cfb64;
  ------------------
  |  | 2250|      3|#define NID_des_cfb64           30
  ------------------
  326|       |
  327|      1|    case NID_des_ede3_cfb64:
  ------------------
  |  | 2291|      1|#define NID_des_ede3_cfb64              61
  ------------------
  |  Branch (327:5): [True: 1, False: 182]
  ------------------
  328|      2|    case NID_des_ede3_cfb8:
  ------------------
  |  | 3244|      2|#define NID_des_ede3_cfb8               659
  ------------------
  |  Branch (328:5): [True: 1, False: 182]
  ------------------
  329|      3|    case NID_des_ede3_cfb1:
  ------------------
  |  | 3240|      3|#define NID_des_ede3_cfb1               658
  ------------------
  |  Branch (329:5): [True: 1, False: 182]
  ------------------
  330|       |
  331|      3|        return NID_des_cfb64;
  ------------------
  |  | 2250|      3|#define NID_des_cfb64           30
  ------------------
  332|       |
  333|    159|    default:
  ------------------
  |  Branch (333:5): [True: 159, False: 24]
  ------------------
  334|       |#ifdef FIPS_MODULE
  335|       |        return NID_undef;
  336|       |#else
  337|    159|        {
  338|       |            /* Check it has an OID and it is valid */
  339|    159|            ASN1_OBJECT *otmp = OBJ_nid2obj(nid);
  340|       |
  341|    159|            if (OBJ_get0_data(otmp) == NULL)
  ------------------
  |  Branch (341:17): [True: 48, False: 111]
  ------------------
  342|     48|                nid = NID_undef;
  ------------------
  |  |   18|     48|#define NID_undef                       0
  ------------------
  343|    159|            ASN1_OBJECT_free(otmp);
  344|    159|            return nid;
  345|      2|        }
  346|    183|#endif
  347|    183|    }
  348|    183|}
evp_cipher_cache_constants:
  351|    130|{
  352|    130|    int ok, aead = 0, custom_iv = 0, cts = 0, multiblock = 0, randkey = 0;
  353|    130|    size_t ivlen = 0;
  354|    130|    size_t blksz = 0;
  355|    130|    size_t keylen = 0;
  356|    130|    unsigned int mode = 0;
  357|    130|    OSSL_PARAM params[10];
  358|       |
  359|    130|    params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_BLOCK_SIZE, &blksz);
  ------------------
  |  |  166|    130|# define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  360|    130|    params[1] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN, &ivlen);
  ------------------
  |  |  174|    130|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  361|    130|    params[2] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &keylen);
  ------------------
  |  |  175|    130|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  362|    130|    params[3] = OSSL_PARAM_construct_uint(OSSL_CIPHER_PARAM_MODE, &mode);
  ------------------
  |  |  176|    130|# define OSSL_CIPHER_PARAM_MODE "mode"
  ------------------
  363|    130|    params[4] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_AEAD, &aead);
  ------------------
  |  |  155|    130|# define OSSL_CIPHER_PARAM_AEAD "aead"
  ------------------
  364|    130|    params[5] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_CUSTOM_IV,
  ------------------
  |  |  169|    130|# define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv"
  ------------------
  365|    130|                                         &custom_iv);
  366|    130|    params[6] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_CTS, &cts);
  ------------------
  |  |  167|    130|# define OSSL_CIPHER_PARAM_CTS "cts"
  ------------------
  367|    130|    params[7] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK,
  ------------------
  |  |  183|    130|# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi"
  ------------------
  368|    130|                                         &multiblock);
  369|    130|    params[8] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_HAS_RAND_KEY,
  ------------------
  |  |  172|    130|# define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey"
  ------------------
  370|    130|                                         &randkey);
  371|    130|    params[9] = OSSL_PARAM_construct_end();
  372|    130|    ok = evp_do_ciph_getparams(cipher, params) > 0;
  373|    130|    if (ok) {
  ------------------
  |  Branch (373:9): [True: 130, False: 0]
  ------------------
  374|    130|        cipher->block_size = blksz;
  375|    130|        cipher->iv_len = ivlen;
  376|    130|        cipher->key_len = keylen;
  377|    130|        cipher->flags = mode;
  378|    130|        if (aead)
  ------------------
  |  Branch (378:13): [True: 28, False: 102]
  ------------------
  379|     28|            cipher->flags |= EVP_CIPH_FLAG_AEAD_CIPHER;
  ------------------
  |  |  348|     28|# define         EVP_CIPH_FLAG_AEAD_CIPHER       0x200000
  ------------------
  380|    130|        if (custom_iv)
  ------------------
  |  Branch (380:13): [True: 41, False: 89]
  ------------------
  381|     41|            cipher->flags |= EVP_CIPH_CUSTOM_IV;
  ------------------
  |  |  318|     41|# define         EVP_CIPH_CUSTOM_IV              0x10
  ------------------
  382|    130|        if (cts)
  ------------------
  |  Branch (382:13): [True: 6, False: 124]
  ------------------
  383|      6|            cipher->flags |= EVP_CIPH_FLAG_CTS;
  ------------------
  |  |  346|      6|# define         EVP_CIPH_FLAG_CTS               0x4000
  ------------------
  384|    130|        if (multiblock)
  ------------------
  |  Branch (384:13): [True: 4, False: 126]
  ------------------
  385|      4|            cipher->flags |= EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK;
  ------------------
  |  |  349|      4|# define         EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000
  ------------------
  386|    130|        if (cipher->ccipher != NULL)
  ------------------
  |  Branch (386:13): [True: 118, False: 12]
  ------------------
  387|    118|            cipher->flags |= EVP_CIPH_FLAG_CUSTOM_CIPHER;
  ------------------
  |  |  347|    118|# define         EVP_CIPH_FLAG_CUSTOM_CIPHER     0x100000
  ------------------
  388|    130|        if (randkey)
  ------------------
  |  Branch (388:13): [True: 11, False: 119]
  ------------------
  389|     11|            cipher->flags |= EVP_CIPH_RAND_KEY;
  ------------------
  |  |  328|     11|# define         EVP_CIPH_RAND_KEY               0x200
  ------------------
  390|    130|        if (OSSL_PARAM_locate_const(EVP_CIPHER_gettable_ctx_params(cipher),
  ------------------
  |  Branch (390:13): [True: 0, False: 130]
  ------------------
  391|    130|                                    OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS))
  ------------------
  |  |  165|    130|# define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS "alg_id_param"
  ------------------
  392|      0|            cipher->flags |= EVP_CIPH_FLAG_CUSTOM_ASN1;
  ------------------
  |  |  353|      0|# define         EVP_CIPH_FLAG_CUSTOM_ASN1       0x1000000
  ------------------
  393|    130|    }
  394|    130|    return ok;
  395|    130|}
EVP_CIPHER_get_iv_length:
  516|      2|{
  517|      2|    return (cipher == NULL) ? 0 : cipher->iv_len;
  ------------------
  |  Branch (517:12): [True: 0, False: 2]
  ------------------
  518|      2|}
EVP_CIPHER_CTX_get_iv_length:
  521|  20.5k|{
  522|  20.5k|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (522:9): [True: 0, False: 20.5k]
  ------------------
  523|      0|        return 0;
  524|       |
  525|  20.5k|    if (ctx->iv_len < 0) {
  ------------------
  |  Branch (525:9): [True: 2, False: 20.5k]
  ------------------
  526|      2|        int rv, len = EVP_CIPHER_get_iv_length(ctx->cipher);
  527|      2|        size_t v = len;
  528|      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 }
  ------------------
  529|       |
  530|      2|        if (ctx->cipher->get_ctx_params != NULL) {
  ------------------
  |  Branch (530:13): [True: 2, False: 0]
  ------------------
  531|      2|            params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN,
  ------------------
  |  |  174|      2|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  532|      2|                                                    &v);
  533|      2|            rv = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  534|      2|            if (rv > 0) {
  ------------------
  |  Branch (534:17): [True: 2, False: 0]
  ------------------
  535|      2|                if (OSSL_PARAM_modified(params)
  ------------------
  |  Branch (535:21): [True: 2, False: 0]
  ------------------
  536|      2|                        && !OSSL_PARAM_get_int(params, &len))
  ------------------
  |  Branch (536:28): [True: 0, False: 2]
  ------------------
  537|      0|                    return -1;
  538|      2|            } else if (rv != EVP_CTRL_RET_UNSUPPORTED) {
  ------------------
  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  ------------------
  |  Branch (538:24): [True: 0, False: 0]
  ------------------
  539|      0|                return -1;
  540|      0|            }
  541|      2|        }
  542|       |        /* Code below to be removed when legacy support is dropped. */
  543|      0|        else if ((EVP_CIPHER_get_flags(ctx->cipher)
  ------------------
  |  Branch (543:18): [True: 0, False: 0]
  ------------------
  544|      0|                  & EVP_CIPH_CUSTOM_IV_LENGTH) != 0) {
  ------------------
  |  |  332|      0|# define         EVP_CIPH_CUSTOM_IV_LENGTH       0x800
  ------------------
  545|      0|            rv = EVP_CIPHER_CTX_ctrl((EVP_CIPHER_CTX *)ctx, EVP_CTRL_GET_IVLEN,
  ------------------
  |  |  432|      0|# define         EVP_CTRL_GET_IVLEN                      0x25
  ------------------
  546|      0|                                     0, &len);
  547|      0|            if (rv <= 0)
  ------------------
  |  Branch (547:17): [True: 0, False: 0]
  ------------------
  548|      0|                return -1;
  549|      0|        }
  550|       |        /*-
  551|       |         * Casting away the const is annoying but required here.  We need to
  552|       |         * cache the result for performance reasons.
  553|       |         */
  554|      2|        ((EVP_CIPHER_CTX *)ctx)->iv_len = len;
  555|      2|    }
  556|  20.5k|    return ctx->iv_len;
  557|  20.5k|}
EVP_CIPHER_get_key_length:
  667|      2|{
  668|      2|    return cipher->key_len;
  669|      2|}
EVP_CIPHER_CTX_get_key_length:
  672|  41.1k|{
  673|  41.1k|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (673:9): [True: 0, False: 41.1k]
  ------------------
  674|      0|        return 0;
  675|       |
  676|  41.1k|    if (ctx->key_len <= 0 && ctx->cipher->prov != NULL) {
  ------------------
  |  Branch (676:9): [True: 5, False: 41.1k]
  |  Branch (676:30): [True: 5, False: 0]
  ------------------
  677|      5|        int ok;
  678|      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 }
  ------------------
  679|      5|        size_t len;
  680|       |
  681|      5|        params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &len);
  ------------------
  |  |  175|      5|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  682|      5|        ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  683|      5|        if (ok <= 0)
  ------------------
  |  Branch (683:13): [True: 0, False: 5]
  ------------------
  684|      0|            return EVP_CTRL_RET_UNSUPPORTED;
  ------------------
  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  ------------------
  685|       |
  686|       |        /*-
  687|       |         * The if branch should never be taken since EVP_MAX_KEY_LENGTH is
  688|       |         * less than INT_MAX but best to be safe.
  689|       |         *
  690|       |         * Casting away the const is annoying but required here.  We need to
  691|       |         * cache the result for performance reasons.
  692|       |         */
  693|      5|        if (!OSSL_PARAM_get_int(params, &((EVP_CIPHER_CTX *)ctx)->key_len))
  ------------------
  |  Branch (693:13): [True: 0, False: 5]
  ------------------
  694|      0|            return -1;
  695|      5|        ((EVP_CIPHER_CTX *)ctx)->key_len = (int)len;
  696|      5|    }
  697|  41.1k|    return ctx->key_len;
  698|  41.1k|}
EVP_CIPHER_get_nid:
  701|    317|{
  702|    317|    return (cipher == NULL) ? NID_undef : cipher->nid;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (702:12): [True: 0, False: 317]
  ------------------
  703|    317|}
EVP_CIPHER_get0_provider:
  757|    130|{
  758|    130|    return cipher->prov;
  759|    130|}
EVP_MD_is_a:
  767|  19.3k|{
  768|  19.3k|    if (md == NULL)
  ------------------
  |  Branch (768:9): [True: 0, False: 19.3k]
  ------------------
  769|      0|        return 0;
  770|  19.3k|    if (md->prov != NULL)
  ------------------
  |  Branch (770:9): [True: 0, False: 19.3k]
  ------------------
  771|      0|        return evp_is_a(md->prov, md->name_id, NULL, name);
  772|  19.3k|    return evp_is_a(NULL, 0, EVP_MD_get0_name(md), name);
  773|  19.3k|}
EVP_MD_get0_name:
  792|  38.6k|{
  793|  38.6k|    if (md == NULL)
  ------------------
  |  Branch (793:9): [True: 0, False: 38.6k]
  ------------------
  794|      0|        return NULL;
  795|  38.6k|    if (md->type_name != NULL)
  ------------------
  |  Branch (795:9): [True: 0, False: 38.6k]
  ------------------
  796|      0|        return md->type_name;
  797|  38.6k|#ifndef FIPS_MODULE
  798|  38.6k|    return OBJ_nid2sn(EVP_MD_nid(md));
  ------------------
  |  |  538|  38.6k|# define EVP_MD_nid EVP_MD_get_type
  ------------------
  799|       |#else
  800|       |    return NULL;
  801|       |#endif
  802|  38.6k|}
EVP_MD_get0_provider:
  815|  19.3k|{
  816|  19.3k|    return md->prov;
  817|  19.3k|}
EVP_MD_get_type:
  820|  58.0k|{
  821|  58.0k|    return md->type;
  822|  58.0k|}
EVP_MD_get_size:
  839|  19.3k|{
  840|  19.3k|    if (md == NULL) {
  ------------------
  |  Branch (840:9): [True: 0, False: 19.3k]
  ------------------
  841|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  842|      0|        return -1;
  843|      0|    }
  844|  19.3k|    return md->md_size;
  845|  19.3k|}
evp_md_free_int:
  886|     27|{
  887|     27|    OPENSSL_free(md->type_name);
  ------------------
  |  |  115|     27|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  888|     27|    ossl_provider_free(md->prov);
  889|     27|    CRYPTO_FREE_REF(&md->refcnt);
  890|     27|    OPENSSL_free(md);
  ------------------
  |  |  115|     27|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  891|     27|}
EVP_MD_CTX_set_flags:
 1106|  38.6k|{
 1107|  38.6k|    ctx->flags |= flags;
 1108|  38.6k|}
EVP_MD_CTX_clear_flags:
 1111|  19.3k|{
 1112|  19.3k|    ctx->flags &= ~flags;
 1113|  19.3k|}
EVP_MD_CTX_test_flags:
 1116|  19.3k|{
 1117|  19.3k|    return (ctx->flags & flags);
 1118|  19.3k|}
EVP_CIPHER_CTX_set_flags:
 1130|  1.90k|{
 1131|  1.90k|    int oldflags = ctx->flags;
 1132|       |
 1133|  1.90k|    ctx->flags |= flags;
 1134|  1.90k|    if (((oldflags ^ ctx->flags) & EVP_CIPH_FLAG_LENGTH_BITS) != 0)
  ------------------
  |  |  337|  1.90k|# define         EVP_CIPH_FLAG_LENGTH_BITS       0x2000
  ------------------
  |  Branch (1134:9): [True: 0, False: 1.90k]
  ------------------
 1135|      0|        evp_cipher_ctx_enable_use_bits(ctx, 1);
 1136|  1.90k|}

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

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|  15.9k|{
   63|  15.9k|    if (pkey == NULL || keymgmt == NULL || keydata == NULL
  ------------------
  |  Branch (63:9): [True: 0, False: 15.9k]
  |  Branch (63:25): [True: 0, False: 15.9k]
  |  Branch (63:44): [True: 0, False: 15.9k]
  ------------------
   64|  15.9k|        || !EVP_PKEY_set_type_by_keymgmt(pkey, keymgmt)) {
  ------------------
  |  Branch (64:12): [True: 0, False: 15.9k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   66|      0|        return 0;
   67|      0|    }
   68|  15.9k|    pkey->keydata = keydata;
   69|  15.9k|    evp_keymgmt_util_cache_keyinfo(pkey);
   70|  15.9k|    return 1;
   71|  15.9k|}
evp_keymgmt_util_make_pkey:
   74|  15.9k|{
   75|  15.9k|    EVP_PKEY *pkey = NULL;
   76|       |
   77|  15.9k|    if (keymgmt == NULL
  ------------------
  |  Branch (77:9): [True: 0, False: 15.9k]
  ------------------
   78|  15.9k|        || keydata == NULL
  ------------------
  |  Branch (78:12): [True: 0, False: 15.9k]
  ------------------
   79|  15.9k|        || (pkey = EVP_PKEY_new()) == NULL
  ------------------
  |  Branch (79:12): [True: 0, False: 15.9k]
  ------------------
   80|  15.9k|        || !evp_keymgmt_util_assign_pkey(pkey, keymgmt, keydata)) {
  ------------------
  |  Branch (80:12): [True: 0, False: 15.9k]
  ------------------
   81|      0|        EVP_PKEY_free(pkey);
   82|      0|        return NULL;
   83|      0|    }
   84|  15.9k|    return pkey;
   85|  15.9k|}
evp_keymgmt_util_clear_operation_cache:
  223|  52.4k|{
  224|  52.4k|    if (pk != NULL) {
  ------------------
  |  Branch (224:9): [True: 52.4k, False: 0]
  ------------------
  225|  52.4k|        sk_OP_CACHE_ELEM_pop_free(pk->operation_cache, op_cache_free);
  226|  52.4k|        pk->operation_cache = NULL;
  227|  52.4k|    }
  228|       |
  229|  52.4k|    return 1;
  230|  52.4k|}
evp_keymgmt_util_cache_keyinfo:
  290|  15.9k|{
  291|       |    /*
  292|       |     * Cache information about the provider "origin" key.
  293|       |     *
  294|       |     * This services functions like EVP_PKEY_get_size, EVP_PKEY_get_bits, etc
  295|       |     */
  296|  15.9k|    if (pk->keydata != NULL) {
  ------------------
  |  Branch (296:9): [True: 15.9k, False: 0]
  ------------------
  297|  15.9k|        int bits = 0;
  298|  15.9k|        int security_bits = 0;
  299|  15.9k|        int size = 0;
  300|  15.9k|        OSSL_PARAM params[4];
  301|       |
  302|  15.9k|        params[0] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_BITS, &bits);
  ------------------
  |  |  333|  15.9k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  303|  15.9k|        params[1] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_BITS,
  ------------------
  |  |  447|  15.9k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  304|  15.9k|                                             &security_bits);
  305|  15.9k|        params[2] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_MAX_SIZE, &size);
  ------------------
  |  |  387|  15.9k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  306|  15.9k|        params[3] = OSSL_PARAM_construct_end();
  307|  15.9k|        if (evp_keymgmt_get_params(pk->keymgmt, pk->keydata, params)) {
  ------------------
  |  Branch (307:13): [True: 15.9k, False: 0]
  ------------------
  308|  15.9k|            pk->cache.size = size;
  309|  15.9k|            pk->cache.bits = bits;
  310|  15.9k|            pk->cache.security_bits = security_bits;
  311|  15.9k|        }
  312|  15.9k|    }
  313|  15.9k|}

EVP_KEYMGMT_up_ref:
  269|   102k|{
  270|   102k|    int ref = 0;
  271|       |
  272|   102k|    CRYPTO_UP_REF(&keymgmt->refcnt, &ref);
  273|   102k|    return 1;
  274|   102k|}
EVP_KEYMGMT_free:
  277|   102k|{
  278|   102k|    int ref = 0;
  279|       |
  280|   102k|    if (keymgmt == NULL)
  ------------------
  |  Branch (280:9): [True: 0, False: 102k]
  ------------------
  281|      0|        return;
  282|       |
  283|   102k|    CRYPTO_DOWN_REF(&keymgmt->refcnt, &ref);
  284|   102k|    if (ref > 0)
  ------------------
  |  Branch (284:9): [True: 102k, False: 18]
  ------------------
  285|   102k|        return;
  286|     18|    OPENSSL_free(keymgmt->type_name);
  ------------------
  |  |  115|     18|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  287|     18|    ossl_provider_free(keymgmt->prov);
  288|     18|    CRYPTO_FREE_REF(&keymgmt->refcnt);
  289|     18|    OPENSSL_free(keymgmt);
  ------------------
  |  |  115|     18|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  290|     18|}
EVP_KEYMGMT_get0_provider:
  293|  15.9k|{
  294|  15.9k|    return keymgmt->prov;
  295|  15.9k|}
EVP_KEYMGMT_is_a:
  318|  15.9k|{
  319|  15.9k|    return keymgmt != NULL
  ------------------
  |  Branch (319:12): [True: 15.9k, False: 0]
  ------------------
  320|  15.9k|           && evp_is_a(keymgmt->prov, keymgmt->name_id, NULL, name);
  ------------------
  |  Branch (320:15): [True: 15.9k, False: 0]
  ------------------
  321|  15.9k|}
EVP_KEYMGMT_do_all_provided:
  326|    731|{
  327|    731|    evp_generic_do_all(libctx, OSSL_OP_KEYMGMT,
  ------------------
  |  |  280|    731|# define OSSL_OP_KEYMGMT                            10
  ------------------
  328|    731|                       (void (*)(void *, void *))fn, arg,
  329|    731|                       keymgmt_from_algorithm,
  330|    731|                       (int (*)(void *))EVP_KEYMGMT_up_ref,
  331|    731|                       (void (*)(void *))EVP_KEYMGMT_free);
  332|    731|}
EVP_KEYMGMT_names_do_all:
  337|  15.9k|{
  338|  15.9k|    if (keymgmt->prov != NULL)
  ------------------
  |  Branch (338:9): [True: 15.9k, False: 0]
  ------------------
  339|  15.9k|        return evp_names_do_all(keymgmt->prov, keymgmt->name_id, fn, data);
  340|       |
  341|      0|    return 1;
  342|  15.9k|}
evp_keymgmt_freedata:
  362|  15.9k|{
  363|       |    /* This is mandatory, no need to check for its presence */
  364|  15.9k|    keymgmt->free(keydata);
  365|  15.9k|}
evp_keymgmt_has_load:
  423|  31.9k|{
  424|  31.9k|    return keymgmt != NULL && keymgmt->load != NULL;
  ------------------
  |  Branch (424:12): [True: 31.9k, False: 0]
  |  Branch (424:31): [True: 31.9k, False: 0]
  ------------------
  425|  31.9k|}
evp_keymgmt_load:
  429|  15.9k|{
  430|  15.9k|    if (evp_keymgmt_has_load(keymgmt))
  ------------------
  |  Branch (430:9): [True: 15.9k, False: 0]
  ------------------
  431|  15.9k|        return keymgmt->load(objref, objref_sz);
  432|      0|    return NULL;
  433|  15.9k|}
evp_keymgmt_get_params:
  437|  15.9k|{
  438|  15.9k|    if (keymgmt->get_params == NULL)
  ------------------
  |  Branch (438:9): [True: 0, False: 15.9k]
  ------------------
  439|      0|        return 1;
  440|  15.9k|    return keymgmt->get_params(keydata, params);
  441|  15.9k|}
keymgmt_meth.c:keymgmt_from_algorithm:
   56|     18|{
   57|     18|    const OSSL_DISPATCH *fns = algodef->implementation;
   58|     18|    EVP_KEYMGMT *keymgmt = NULL;
   59|     18|    int setparamfncnt = 0, getparamfncnt = 0;
   60|     18|    int setgenparamfncnt = 0;
   61|     18|    int importfncnt = 0, exportfncnt = 0;
   62|     18|    int importtypesfncnt = 0, exporttypesfncnt = 0;
   63|       |
   64|     18|    if ((keymgmt = keymgmt_new()) == NULL)
  ------------------
  |  Branch (64:9): [True: 0, False: 18]
  ------------------
   65|      0|        return NULL;
   66|       |
   67|     18|    keymgmt->name_id = name_id;
   68|     18|    if ((keymgmt->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (68:9): [True: 0, False: 18]
  ------------------
   69|      0|        EVP_KEYMGMT_free(keymgmt);
   70|      0|        return NULL;
   71|      0|    }
   72|     18|    keymgmt->description = algodef->algorithm_description;
   73|       |
   74|    318|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (74:12): [True: 300, False: 18]
  ------------------
   75|    300|        switch (fns->function_id) {
  ------------------
  |  Branch (75:17): [True: 0, False: 300]
  ------------------
   76|     18|        case OSSL_FUNC_KEYMGMT_NEW:
  ------------------
  |  |  585|     18|# define OSSL_FUNC_KEYMGMT_NEW                         1
  ------------------
  |  Branch (76:9): [True: 18, False: 282]
  ------------------
   77|     18|            if (keymgmt->new == NULL)
  ------------------
  |  Branch (77:17): [True: 18, False: 0]
  ------------------
   78|     18|                keymgmt->new = OSSL_FUNC_keymgmt_new(fns);
   79|     18|            break;
   80|     15|        case OSSL_FUNC_KEYMGMT_GEN_INIT:
  ------------------
  |  |  589|     15|# define OSSL_FUNC_KEYMGMT_GEN_INIT                    2
  ------------------
  |  Branch (80:9): [True: 15, False: 285]
  ------------------
   81|     15|            if (keymgmt->gen_init == NULL)
  ------------------
  |  Branch (81:17): [True: 15, False: 0]
  ------------------
   82|     15|                keymgmt->gen_init = OSSL_FUNC_keymgmt_gen_init(fns);
   83|     15|            break;
   84|      5|        case OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE:
  ------------------
  |  |  590|      5|# define OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE            3
  ------------------
  |  Branch (84:9): [True: 5, False: 295]
  ------------------
   85|      5|            if (keymgmt->gen_set_template == NULL)
  ------------------
  |  Branch (85:17): [True: 5, False: 0]
  ------------------
   86|      5|                keymgmt->gen_set_template =
   87|      5|                    OSSL_FUNC_keymgmt_gen_set_template(fns);
   88|      5|            break;
   89|     15|        case OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS:
  ------------------
  |  |  591|     15|# define OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS              4
  ------------------
  |  Branch (89:9): [True: 15, False: 285]
  ------------------
   90|     15|            if (keymgmt->gen_set_params == NULL) {
  ------------------
  |  Branch (90:17): [True: 15, False: 0]
  ------------------
   91|     15|                setgenparamfncnt++;
   92|     15|                keymgmt->gen_set_params =
   93|     15|                    OSSL_FUNC_keymgmt_gen_set_params(fns);
   94|     15|            }
   95|     15|            break;
   96|     15|        case OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS:
  ------------------
  |  |  592|     15|# define OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS         5
  ------------------
  |  Branch (96:9): [True: 15, False: 285]
  ------------------
   97|     15|            if (keymgmt->gen_settable_params == NULL) {
  ------------------
  |  Branch (97:17): [True: 15, False: 0]
  ------------------
   98|     15|                setgenparamfncnt++;
   99|     15|                keymgmt->gen_settable_params =
  100|     15|                    OSSL_FUNC_keymgmt_gen_settable_params(fns);
  101|     15|            }
  102|     15|            break;
  103|     15|        case OSSL_FUNC_KEYMGMT_GEN:
  ------------------
  |  |  593|     15|# define OSSL_FUNC_KEYMGMT_GEN                         6
  ------------------
  |  Branch (103:9): [True: 15, False: 285]
  ------------------
  104|     15|            if (keymgmt->gen == NULL)
  ------------------
  |  Branch (104:17): [True: 15, False: 0]
  ------------------
  105|     15|                keymgmt->gen = OSSL_FUNC_keymgmt_gen(fns);
  106|     15|            break;
  107|     15|        case OSSL_FUNC_KEYMGMT_GEN_CLEANUP:
  ------------------
  |  |  594|     15|# define OSSL_FUNC_KEYMGMT_GEN_CLEANUP                 7
  ------------------
  |  Branch (107:9): [True: 15, False: 285]
  ------------------
  108|     15|            if (keymgmt->gen_cleanup == NULL)
  ------------------
  |  Branch (108:17): [True: 15, False: 0]
  ------------------
  109|     15|                keymgmt->gen_cleanup = OSSL_FUNC_keymgmt_gen_cleanup(fns);
  110|     15|            break;
  111|     18|        case OSSL_FUNC_KEYMGMT_FREE:
  ------------------
  |  |  615|     18|# define OSSL_FUNC_KEYMGMT_FREE                       10
  ------------------
  |  Branch (111:9): [True: 18, False: 282]
  ------------------
  112|     18|            if (keymgmt->free == NULL)
  ------------------
  |  Branch (112:17): [True: 18, False: 0]
  ------------------
  113|     18|                keymgmt->free = OSSL_FUNC_keymgmt_free(fns);
  114|     18|            break;
  115|     11|        case OSSL_FUNC_KEYMGMT_LOAD:
  ------------------
  |  |  610|     11|# define OSSL_FUNC_KEYMGMT_LOAD                        8
  ------------------
  |  Branch (115:9): [True: 11, False: 289]
  ------------------
  116|     11|            if (keymgmt->load == NULL)
  ------------------
  |  Branch (116:17): [True: 11, False: 0]
  ------------------
  117|     11|                keymgmt->load = OSSL_FUNC_keymgmt_load(fns);
  118|     11|            break;
  119|     15|        case OSSL_FUNC_KEYMGMT_GET_PARAMS:
  ------------------
  |  |  619|     15|#define OSSL_FUNC_KEYMGMT_GET_PARAMS                  11
  ------------------
  |  Branch (119:9): [True: 15, False: 285]
  ------------------
  120|     15|            if (keymgmt->get_params == NULL) {
  ------------------
  |  Branch (120:17): [True: 15, False: 0]
  ------------------
  121|     15|                getparamfncnt++;
  122|     15|                keymgmt->get_params = OSSL_FUNC_keymgmt_get_params(fns);
  123|     15|            }
  124|     15|            break;
  125|     15|        case OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS:
  ------------------
  |  |  620|     15|#define OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS             12
  ------------------
  |  Branch (125:9): [True: 15, False: 285]
  ------------------
  126|     15|            if (keymgmt->gettable_params == NULL) {
  ------------------
  |  Branch (126:17): [True: 15, False: 0]
  ------------------
  127|     15|                getparamfncnt++;
  128|     15|                keymgmt->gettable_params =
  129|     15|                    OSSL_FUNC_keymgmt_gettable_params(fns);
  130|     15|            }
  131|     15|            break;
  132|     12|         case OSSL_FUNC_KEYMGMT_SET_PARAMS:
  ------------------
  |  |  626|     12|#define OSSL_FUNC_KEYMGMT_SET_PARAMS                  13
  ------------------
  |  Branch (132:10): [True: 12, False: 288]
  ------------------
  133|     12|            if (keymgmt->set_params == NULL) {
  ------------------
  |  Branch (133:17): [True: 12, False: 0]
  ------------------
  134|     12|                setparamfncnt++;
  135|     12|                keymgmt->set_params = OSSL_FUNC_keymgmt_set_params(fns);
  136|     12|            }
  137|     12|            break;
  138|     12|        case OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS:
  ------------------
  |  |  627|     12|#define OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS             14
  ------------------
  |  Branch (138:9): [True: 12, False: 288]
  ------------------
  139|     12|            if (keymgmt->settable_params == NULL) {
  ------------------
  |  Branch (139:17): [True: 12, False: 0]
  ------------------
  140|     12|                setparamfncnt++;
  141|     12|                keymgmt->settable_params =
  142|     12|                    OSSL_FUNC_keymgmt_settable_params(fns);
  143|     12|            }
  144|     12|            break;
  145|      4|        case OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME:
  ------------------
  |  |  634|      4|# define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME       20
  ------------------
  |  Branch (145:9): [True: 4, False: 296]
  ------------------
  146|      4|            if (keymgmt->query_operation_name == NULL)
  ------------------
  |  Branch (146:17): [True: 4, False: 0]
  ------------------
  147|      4|                keymgmt->query_operation_name =
  148|      4|                    OSSL_FUNC_keymgmt_query_operation_name(fns);
  149|      4|            break;
  150|     18|        case OSSL_FUNC_KEYMGMT_HAS:
  ------------------
  |  |  639|     18|# define OSSL_FUNC_KEYMGMT_HAS                        21
  ------------------
  |  Branch (150:9): [True: 18, False: 282]
  ------------------
  151|     18|            if (keymgmt->has == NULL)
  ------------------
  |  Branch (151:17): [True: 18, False: 0]
  ------------------
  152|     18|                keymgmt->has = OSSL_FUNC_keymgmt_has(fns);
  153|     18|            break;
  154|     11|        case OSSL_FUNC_KEYMGMT_DUP:
  ------------------
  |  |  669|     11|# define OSSL_FUNC_KEYMGMT_DUP                        44
  ------------------
  |  Branch (154:9): [True: 11, False: 289]
  ------------------
  155|     11|            if (keymgmt->dup == NULL)
  ------------------
  |  Branch (155:17): [True: 11, False: 0]
  ------------------
  156|     11|                keymgmt->dup = OSSL_FUNC_keymgmt_dup(fns);
  157|     11|            break;
  158|     11|        case OSSL_FUNC_KEYMGMT_VALIDATE:
  ------------------
  |  |  643|     11|# define OSSL_FUNC_KEYMGMT_VALIDATE                   22
  ------------------
  |  Branch (158:9): [True: 11, False: 289]
  ------------------
  159|     11|            if (keymgmt->validate == NULL)
  ------------------
  |  Branch (159:17): [True: 11, False: 0]
  ------------------
  160|     11|                keymgmt->validate = OSSL_FUNC_keymgmt_validate(fns);
  161|     11|            break;
  162|     15|        case OSSL_FUNC_KEYMGMT_MATCH:
  ------------------
  |  |  648|     15|# define OSSL_FUNC_KEYMGMT_MATCH                      23
  ------------------
  |  Branch (162:9): [True: 15, False: 285]
  ------------------
  163|     15|            if (keymgmt->match == NULL)
  ------------------
  |  Branch (163:17): [True: 15, False: 0]
  ------------------
  164|     15|                keymgmt->match = OSSL_FUNC_keymgmt_match(fns);
  165|     15|            break;
  166|     15|        case OSSL_FUNC_KEYMGMT_IMPORT:
  ------------------
  |  |  654|     15|# define OSSL_FUNC_KEYMGMT_IMPORT                     40
  ------------------
  |  Branch (166:9): [True: 15, False: 285]
  ------------------
  167|     15|            if (keymgmt->import == NULL) {
  ------------------
  |  Branch (167:17): [True: 15, False: 0]
  ------------------
  168|     15|                importfncnt++;
  169|     15|                keymgmt->import = OSSL_FUNC_keymgmt_import(fns);
  170|     15|            }
  171|     15|            break;
  172|     15|        case OSSL_FUNC_KEYMGMT_IMPORT_TYPES:
  ------------------
  |  |  655|     15|# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES               41
  ------------------
  |  Branch (172:9): [True: 15, False: 285]
  ------------------
  173|     15|            if (keymgmt->import_types == NULL) {
  ------------------
  |  Branch (173:17): [True: 15, False: 0]
  ------------------
  174|     15|                if (importtypesfncnt == 0)
  ------------------
  |  Branch (174:21): [True: 15, False: 0]
  ------------------
  175|     15|                    importfncnt++;
  176|     15|                importtypesfncnt++;
  177|     15|                keymgmt->import_types = OSSL_FUNC_keymgmt_import_types(fns);
  178|     15|            }
  179|     15|            break;
  180|      0|        case OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX:
  ------------------
  |  |  674|      0|# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX            45
  ------------------
  |  Branch (180:9): [True: 0, False: 300]
  ------------------
  181|      0|            if (keymgmt->import_types_ex == NULL) {
  ------------------
  |  Branch (181:17): [True: 0, False: 0]
  ------------------
  182|      0|                if (importtypesfncnt == 0)
  ------------------
  |  Branch (182:21): [True: 0, False: 0]
  ------------------
  183|      0|                    importfncnt++;
  184|      0|                importtypesfncnt++;
  185|      0|                keymgmt->import_types_ex = OSSL_FUNC_keymgmt_import_types_ex(fns);
  186|      0|            }
  187|      0|            break;
  188|     15|        case OSSL_FUNC_KEYMGMT_EXPORT:
  ------------------
  |  |  656|     15|# define OSSL_FUNC_KEYMGMT_EXPORT                     42
  ------------------
  |  Branch (188:9): [True: 15, False: 285]
  ------------------
  189|     15|            if (keymgmt->export == NULL) {
  ------------------
  |  Branch (189:17): [True: 15, False: 0]
  ------------------
  190|     15|                exportfncnt++;
  191|     15|                keymgmt->export = OSSL_FUNC_keymgmt_export(fns);
  192|     15|            }
  193|     15|            break;
  194|     15|        case OSSL_FUNC_KEYMGMT_EXPORT_TYPES:
  ------------------
  |  |  657|     15|# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES               43
  ------------------
  |  Branch (194:9): [True: 15, False: 285]
  ------------------
  195|     15|            if (keymgmt->export_types == NULL) {
  ------------------
  |  Branch (195:17): [True: 15, False: 0]
  ------------------
  196|     15|                if (exporttypesfncnt == 0)
  ------------------
  |  Branch (196:21): [True: 15, False: 0]
  ------------------
  197|     15|                    exportfncnt++;
  198|     15|                exporttypesfncnt++;
  199|     15|                keymgmt->export_types = OSSL_FUNC_keymgmt_export_types(fns);
  200|     15|            }
  201|     15|            break;
  202|      0|        case OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX:
  ------------------
  |  |  675|      0|# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX            46
  ------------------
  |  Branch (202:9): [True: 0, False: 300]
  ------------------
  203|      0|            if (keymgmt->export_types_ex == NULL) {
  ------------------
  |  Branch (203:17): [True: 0, False: 0]
  ------------------
  204|      0|                if (exporttypesfncnt == 0)
  ------------------
  |  Branch (204:21): [True: 0, False: 0]
  ------------------
  205|      0|                    exportfncnt++;
  206|      0|                exporttypesfncnt++;
  207|      0|                keymgmt->export_types_ex = OSSL_FUNC_keymgmt_export_types_ex(fns);
  208|      0|            }
  209|      0|            break;
  210|    300|        }
  211|    300|    }
  212|       |    /*
  213|       |     * Try to check that the method is sensible.
  214|       |     * At least one constructor and the destructor are MANDATORY
  215|       |     * The functions 'has' is MANDATORY
  216|       |     * It makes no sense being able to free stuff if you can't create it.
  217|       |     * It makes no sense providing OSSL_PARAM descriptors for import and
  218|       |     * export if you can't import or export.
  219|       |     */
  220|     18|    if (keymgmt->free == NULL
  ------------------
  |  Branch (220:9): [True: 0, False: 18]
  ------------------
  221|     18|        || (keymgmt->new == NULL
  ------------------
  |  Branch (221:13): [True: 0, False: 18]
  ------------------
  222|     18|            && keymgmt->gen == NULL
  ------------------
  |  Branch (222:16): [True: 0, False: 0]
  ------------------
  223|     18|            && keymgmt->load == NULL)
  ------------------
  |  Branch (223:16): [True: 0, False: 0]
  ------------------
  224|     18|        || keymgmt->has == NULL
  ------------------
  |  Branch (224:12): [True: 0, False: 18]
  ------------------
  225|     18|        || (getparamfncnt != 0 && getparamfncnt != 2)
  ------------------
  |  Branch (225:13): [True: 15, False: 3]
  |  Branch (225:35): [True: 0, False: 15]
  ------------------
  226|     18|        || (setparamfncnt != 0 && setparamfncnt != 2)
  ------------------
  |  Branch (226:13): [True: 12, False: 6]
  |  Branch (226:35): [True: 0, False: 12]
  ------------------
  227|     18|        || (setgenparamfncnt != 0 && setgenparamfncnt != 2)
  ------------------
  |  Branch (227:13): [True: 15, False: 3]
  |  Branch (227:38): [True: 0, False: 15]
  ------------------
  228|     18|        || (importfncnt != 0 && importfncnt != 2)
  ------------------
  |  Branch (228:13): [True: 15, False: 3]
  |  Branch (228:33): [True: 0, False: 15]
  ------------------
  229|     18|        || (exportfncnt != 0 && exportfncnt != 2)
  ------------------
  |  Branch (229:13): [True: 15, False: 3]
  |  Branch (229:33): [True: 0, False: 15]
  ------------------
  230|     18|        || (keymgmt->gen != NULL
  ------------------
  |  Branch (230:13): [True: 15, False: 3]
  ------------------
  231|     18|            && (keymgmt->gen_init == NULL
  ------------------
  |  Branch (231:17): [True: 0, False: 15]
  ------------------
  232|     15|                || keymgmt->gen_cleanup == NULL))) {
  ------------------
  |  Branch (232:20): [True: 0, False: 15]
  ------------------
  233|      0|        EVP_KEYMGMT_free(keymgmt);
  234|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  235|      0|        return NULL;
  236|      0|    }
  237|     18|    keymgmt->prov = prov;
  238|     18|    if (prov != NULL)
  ------------------
  |  Branch (238:9): [True: 18, False: 0]
  ------------------
  239|     18|        ossl_provider_up_ref(prov);
  240|       |
  241|     18|#ifndef FIPS_MODULE
  242|     18|    keymgmt->legacy_alg = get_legacy_alg_type_from_keymgmt(keymgmt);
  243|     18|#endif
  244|       |
  245|     18|    return keymgmt;
  246|     18|}
keymgmt_meth.c:keymgmt_new:
   21|     18|{
   22|     18|    EVP_KEYMGMT *keymgmt = NULL;
   23|       |
   24|     18|    if ((keymgmt = OPENSSL_zalloc(sizeof(*keymgmt))) == NULL)
  ------------------
  |  |  104|     18|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     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|}
keymgmt_meth.c:get_legacy_alg_type_from_keymgmt:
   44|     18|{
   45|     18|    int type = NID_undef;
  ------------------
  |  |   18|     18|#define NID_undef                       0
  ------------------
   46|       |
   47|     18|    EVP_KEYMGMT_names_do_all(keymgmt, help_get_legacy_alg_type_from_keymgmt,
   48|     18|                             &type);
   49|     18|    return type;
   50|     18|}
keymgmt_meth.c:help_get_legacy_alg_type_from_keymgmt:
   36|     43|{
   37|     43|    int *type = arg;
   38|       |
   39|     43|    if (*type == NID_undef)
  ------------------
  |  |   18|     43|#define NID_undef                       0
  ------------------
  |  Branch (39:9): [True: 26, False: 17]
  ------------------
   40|     26|        *type = evp_pkey_name2type(keytype);
   41|     43|}

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:
  103|  19.3k|{
  104|  19.3k|    return &sha1_md;
  105|  19.3k|}
EVP_sha224:
  118|      1|{
  119|      1|    return &sha224_md;
  120|      1|}
EVP_sha256:
  133|      1|{
  134|      1|    return &sha256_md;
  135|      1|}
EVP_sha512_224:
  148|      1|{
  149|      1|    return &sha512_224_md;
  150|      1|}
EVP_sha512_256:
  163|      1|{
  164|      1|    return &sha512_256_md;
  165|      1|}
EVP_sha384:
  178|      1|{
  179|      1|    return &sha384_md;
  180|      1|}
EVP_sha512:
  193|      1|{
  194|      1|    return &sha512_md;
  195|      1|}
EVP_sha3_224:
  198|      1|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  199|      1|{                                                                              \
  200|      1|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  201|      1|        NID_sha3_##bitlen,                                                     \
  202|      1|        NID_RSA_SHA3_##bitlen,                                                 \
  203|      1|        bitlen / 8,                                                            \
  204|      1|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  176|      1|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  205|      1|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  252|      1|#define EVP_ORIG_GLOBAL     1
  ------------------
  206|      1|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      1|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  207|      1|                                 sha3_int_final, NULL,                         \
  208|      1|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  209|      1|    };                                                                         \
  210|      1|    return &sha3_##bitlen##_md;                                                \
  211|      1|}
EVP_sha3_256:
  198|      1|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  199|      1|{                                                                              \
  200|      1|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  201|      1|        NID_sha3_##bitlen,                                                     \
  202|      1|        NID_RSA_SHA3_##bitlen,                                                 \
  203|      1|        bitlen / 8,                                                            \
  204|      1|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  176|      1|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  205|      1|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  252|      1|#define EVP_ORIG_GLOBAL     1
  ------------------
  206|      1|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      1|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  207|      1|                                 sha3_int_final, NULL,                         \
  208|      1|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  209|      1|    };                                                                         \
  210|      1|    return &sha3_##bitlen##_md;                                                \
  211|      1|}
EVP_sha3_384:
  198|      1|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  199|      1|{                                                                              \
  200|      1|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  201|      1|        NID_sha3_##bitlen,                                                     \
  202|      1|        NID_RSA_SHA3_##bitlen,                                                 \
  203|      1|        bitlen / 8,                                                            \
  204|      1|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  176|      1|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  205|      1|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  252|      1|#define EVP_ORIG_GLOBAL     1
  ------------------
  206|      1|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      1|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  207|      1|                                 sha3_int_final, NULL,                         \
  208|      1|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  209|      1|    };                                                                         \
  210|      1|    return &sha3_##bitlen##_md;                                                \
  211|      1|}
EVP_sha3_512:
  198|      1|const EVP_MD *EVP_sha3_##bitlen(void)                                          \
  199|      1|{                                                                              \
  200|      1|    static const EVP_MD sha3_##bitlen##_md = {                                 \
  201|      1|        NID_sha3_##bitlen,                                                     \
  202|      1|        NID_RSA_SHA3_##bitlen,                                                 \
  203|      1|        bitlen / 8,                                                            \
  204|      1|        EVP_MD_FLAG_DIGALGID_ABSENT,                                           \
  ------------------
  |  |  176|      1|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
  205|      1|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  252|      1|#define EVP_ORIG_GLOBAL     1
  ------------------
  206|      1|        LEGACY_EVP_MD_METH_TABLE(sha3_int_init, sha3_int_update,               \
  ------------------
  |  |   40|      1|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  207|      1|                                 sha3_int_final, NULL,                         \
  208|      1|                                 (KECCAK1600_WIDTH - bitlen * 2) / 8),         \
  209|      1|    };                                                                         \
  210|      1|    return &sha3_##bitlen##_md;                                                \
  211|      1|}
EVP_shake128:
  213|      1|const EVP_MD *EVP_shake##bitlen(void)                                          \
  214|      1|{                                                                              \
  215|      1|    static const EVP_MD shake##bitlen##_md = {                                 \
  216|      1|        NID_shake##bitlen,                                                     \
  217|      1|        0,                                                                     \
  218|      1|        bitlen / 8,                                                            \
  219|      1|        EVP_MD_FLAG_XOF,                                                       \
  ------------------
  |  |  164|      1|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
  220|      1|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  252|      1|#define EVP_ORIG_GLOBAL     1
  ------------------
  221|      1|        LEGACY_EVP_MD_METH_TABLE(shake_init, sha3_int_update, sha3_int_final,  \
  ------------------
  |  |   40|      1|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  222|      1|                        shake_ctrl, (KECCAK1600_WIDTH - bitlen * 2) / 8),      \
  223|      1|    };                                                                         \
  224|      1|    return &shake##bitlen##_md;                                                \
  225|      1|}
EVP_shake256:
  213|      1|const EVP_MD *EVP_shake##bitlen(void)                                          \
  214|      1|{                                                                              \
  215|      1|    static const EVP_MD shake##bitlen##_md = {                                 \
  216|      1|        NID_shake##bitlen,                                                     \
  217|      1|        0,                                                                     \
  218|      1|        bitlen / 8,                                                            \
  219|      1|        EVP_MD_FLAG_XOF,                                                       \
  ------------------
  |  |  164|      1|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
  220|      1|        EVP_ORIG_GLOBAL,                                                       \
  ------------------
  |  |  252|      1|#define EVP_ORIG_GLOBAL     1
  ------------------
  221|      1|        LEGACY_EVP_MD_METH_TABLE(shake_init, sha3_int_update, sha3_int_final,  \
  ------------------
  |  |   40|      1|    init, update, final, NULL, NULL, blksz, 0, ctrl
  ------------------
  222|      1|                        shake_ctrl, (KECCAK1600_WIDTH - bitlen * 2) / 8),      \
  223|      1|    };                                                                         \
  224|      1|    return &shake##bitlen##_md;                                                \
  225|      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|     14|{
   36|     14|    if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA_PSS) {
  ------------------
  |  |   60|     14|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|     28|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
                  if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA_PSS) {
  ------------------
  |  |   62|      8|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      8|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (36:9): [True: 8, False: 6]
  |  Branch (36:39): [True: 0, False: 8]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   38|      0|        return NULL;
   39|      0|    }
   40|     14|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
   41|     14|}
EVP_PKEY_get1_RSA:
   49|     14|{
   50|     14|    RSA *ret = evp_pkey_get0_RSA_int(pkey);
   51|       |
   52|     14|    if (ret != NULL)
  ------------------
  |  Branch (52:9): [True: 14, False: 0]
  ------------------
   53|     14|        RSA_up_ref(ret);
   54|     14|    return ret;
   55|     14|}
evp_pkey_get0_EC_KEY_int:
   70|  15.9k|{
   71|  15.9k|    if (EVP_PKEY_get_base_id(pkey) != EVP_PKEY_EC) {
  ------------------
  |  |   70|  15.9k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  15.9k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (71:9): [True: 0, False: 15.9k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   73|      0|        return NULL;
   74|      0|    }
   75|  15.9k|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
   76|  15.9k|}
EVP_PKEY_get1_EC_KEY:
   84|  15.9k|{
   85|  15.9k|    EC_KEY *ret = evp_pkey_get0_EC_KEY_int(pkey);
   86|       |
   87|  15.9k|    if (ret != NULL && !EC_KEY_up_ref(ret))
  ------------------
  |  Branch (87:9): [True: 15.9k, False: 0]
  |  Branch (87:24): [True: 0, False: 15.9k]
  ------------------
   88|      0|        ret = NULL;
   89|  15.9k|    return ret;
   90|  15.9k|}

EVP_PKEY_set_type:
  688|  52.4k|{
  689|  52.4k|    return pkey_set_type(pkey, NULL, type, NULL, -1, NULL);
  690|  52.4k|}
EVP_PKEY_assign:
  758|  15.9k|{
  759|  15.9k|#  ifndef OPENSSL_NO_EC
  760|  15.9k|    int pktype;
  761|       |
  762|  15.9k|    pktype = EVP_PKEY_type(type);
  763|  15.9k|    if ((key != NULL) && (pktype == EVP_PKEY_EC || pktype == EVP_PKEY_SM2)) {
  ------------------
  |  |   70|  15.9k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  31.9k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
                  if ((key != NULL) && (pktype == EVP_PKEY_EC || pktype == EVP_PKEY_SM2)) {
  ------------------
  |  |   71|     66|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|     66|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (763:9): [True: 15.9k, False: 0]
  |  Branch (763:27): [True: 15.9k, False: 66]
  |  Branch (763:52): [True: 0, False: 66]
  ------------------
  764|  15.9k|        const EC_GROUP *group = EC_KEY_get0_group(key);
  765|       |
  766|  15.9k|        if (group != NULL) {
  ------------------
  |  Branch (766:13): [True: 15.9k, False: 0]
  ------------------
  767|  15.9k|            int curve = EC_GROUP_get_curve_name(group);
  768|       |
  769|       |            /*
  770|       |             * Regardless of what is requested the SM2 curve must be SM2 type,
  771|       |             * and non SM2 curves are EC type.
  772|       |             */
  773|  15.9k|            if (curve == NID_sm2 && pktype == EVP_PKEY_EC)
  ------------------
  |  | 1232|  31.8k|#define NID_sm2         1172
  ------------------
                          if (curve == NID_sm2 && pktype == EVP_PKEY_EC)
  ------------------
  |  |   70|      0|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|      0|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (773:17): [True: 0, False: 15.9k]
  |  Branch (773:37): [True: 0, False: 0]
  ------------------
  774|      0|                type = EVP_PKEY_SM2;
  ------------------
  |  |   71|      0|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|      0|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  775|  15.9k|            else if(curve != NID_sm2 && pktype == EVP_PKEY_SM2)
  ------------------
  |  | 1232|  31.8k|#define NID_sm2         1172
  ------------------
                          else if(curve != NID_sm2 && pktype == EVP_PKEY_SM2)
  ------------------
  |  |   71|  15.9k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|  15.9k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (775:21): [True: 15.9k, False: 0]
  |  Branch (775:41): [True: 0, False: 15.9k]
  ------------------
  776|      0|                type = EVP_PKEY_EC;
  ------------------
  |  |   70|      0|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|      0|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  777|  15.9k|        }
  778|  15.9k|    }
  779|  15.9k|#  endif
  780|       |
  781|  15.9k|    if (pkey == NULL || !EVP_PKEY_set_type(pkey, type))
  ------------------
  |  Branch (781:9): [True: 0, False: 15.9k]
  |  Branch (781:25): [True: 0, False: 15.9k]
  ------------------
  782|      0|        return 0;
  783|       |
  784|  15.9k|    pkey->pkey.ptr = key;
  785|  15.9k|    detect_foreign_key(pkey);
  786|       |
  787|  15.9k|    return (key != NULL);
  788|  15.9k|}
EVP_PKEY_get1_DSA:
  875|     34|{
  876|     34|    DSA *ret = evp_pkey_get0_DSA_int(pkey);
  877|       |
  878|     34|    if (ret != NULL)
  ------------------
  |  Branch (878:9): [True: 34, False: 0]
  ------------------
  879|     34|        DSA_up_ref(ret);
  880|     34|    return ret;
  881|     34|}
evp_pkey_get0_DH_int:
  953|     18|{
  954|     18|    if (pkey->type != EVP_PKEY_DH && pkey->type != EVP_PKEY_DHX) {
  ------------------
  |  |   68|     18|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|     36|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
                  if (pkey->type != EVP_PKEY_DH && pkey->type != EVP_PKEY_DHX) {
  ------------------
  |  |   69|     18|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5299|     18|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (954:9): [True: 18, False: 0]
  |  Branch (954:38): [True: 0, False: 18]
  ------------------
  955|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  956|      0|        return NULL;
  957|      0|    }
  958|     18|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
  959|     18|}
EVP_PKEY_get1_DH:
  967|     18|{
  968|     18|    DH *ret = evp_pkey_get0_DH_int(pkey);
  969|       |
  970|     18|    if (ret != NULL)
  ------------------
  |  Branch (970:9): [True: 18, False: 0]
  ------------------
  971|     18|        DH_up_ref(ret);
  972|     18|    return ret;
  973|     18|}
EVP_PKEY_type:
  977|  31.9k|{
  978|  31.9k|    int ret;
  979|  31.9k|    const EVP_PKEY_ASN1_METHOD *ameth;
  980|  31.9k|    ENGINE *e;
  981|  31.9k|    ameth = EVP_PKEY_asn1_find(&e, type);
  982|  31.9k|    if (ameth)
  ------------------
  |  Branch (982:9): [True: 31.9k, False: 31]
  ------------------
  983|  31.9k|        ret = ameth->pkey_id;
  984|     31|    else
  985|     31|        ret = NID_undef;
  ------------------
  |  |   18|     31|#define NID_undef                       0
  ------------------
  986|  31.9k|# ifndef OPENSSL_NO_ENGINE
  987|  31.9k|    ENGINE_finish(e);
  988|  31.9k|# endif
  989|  31.9k|    return ret;
  990|  31.9k|}
EVP_PKEY_get_id:
  993|  15.9k|{
  994|  15.9k|    return pkey->type;
  995|  15.9k|}
EVP_PKEY_get_base_id:
  998|  15.9k|{
  999|  15.9k|    return EVP_PKEY_type(pkey->type);
 1000|  15.9k|}
evp_pkey_name2type:
 1030|     26|{
 1031|     26|    int type;
 1032|     26|    size_t i;
 1033|       |
 1034|    287|    for (i = 0; i < OSSL_NELEM(standard_name2type); i++) {
  ------------------
  |  |   14|    287|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1034:17): [True: 269, False: 18]
  ------------------
 1035|    269|        if (OPENSSL_strcasecmp(name, standard_name2type[i].ptr) == 0)
  ------------------
  |  Branch (1035:13): [True: 8, False: 261]
  ------------------
 1036|      8|            return (int)standard_name2type[i].id;
 1037|    269|    }
 1038|       |
 1039|     18|    if ((type = EVP_PKEY_type(OBJ_sn2nid(name))) != NID_undef)
  ------------------
  |  |   18|     18|#define NID_undef                       0
  ------------------
  |  Branch (1039:9): [True: 2, False: 16]
  ------------------
 1040|      2|        return type;
 1041|     16|    return EVP_PKEY_type(OBJ_ln2nid(name));
 1042|     18|}
EVP_PKEY_new:
 1453|  52.4k|{
 1454|  52.4k|    EVP_PKEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  52.4k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  52.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  52.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1455|       |
 1456|  52.4k|    if (ret == NULL)
  ------------------
  |  Branch (1456:9): [True: 0, False: 52.4k]
  ------------------
 1457|      0|        return NULL;
 1458|       |
 1459|  52.4k|    ret->type = EVP_PKEY_NONE;
  ------------------
  |  |   59|  52.4k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  52.4k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1460|  52.4k|    ret->save_type = EVP_PKEY_NONE;
  ------------------
  |  |   59|  52.4k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  52.4k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1461|       |
 1462|  52.4k|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (1462:9): [True: 0, False: 52.4k]
  ------------------
 1463|      0|        goto err;
 1464|       |
 1465|  52.4k|    ret->lock = CRYPTO_THREAD_lock_new();
 1466|  52.4k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (1466:9): [True: 0, False: 52.4k]
  ------------------
 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1468|      0|        goto err;
 1469|      0|    }
 1470|       |
 1471|  52.4k|#ifndef FIPS_MODULE
 1472|  52.4k|    ret->save_parameters = 1;
 1473|  52.4k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, ret, &ret->ex_data)) {
  ------------------
  |  |  246|  52.4k|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
  |  Branch (1473:9): [True: 0, False: 52.4k]
  ------------------
 1474|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1475|      0|        goto err;
 1476|      0|    }
 1477|  52.4k|#endif
 1478|  52.4k|    return ret;
 1479|       |
 1480|      0| err:
 1481|      0|    CRYPTO_FREE_REF(&ret->references);
 1482|      0|    CRYPTO_THREAD_lock_free(ret->lock);
 1483|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1484|      0|    return NULL;
 1485|  52.4k|}
EVP_PKEY_set_type_by_keymgmt:
 1639|  15.9k|{
 1640|  15.9k|#ifndef FIPS_MODULE
 1641|  15.9k|# define EVP_PKEY_TYPE_STR str[0]
 1642|  15.9k|# define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
 1643|       |    /*
 1644|       |     * Find at most two strings that have an associated EVP_PKEY_ASN1_METHOD
 1645|       |     * Ideally, only one should be found.  If two (or more) are found, the
 1646|       |     * match is ambiguous.  This should never happen, but...
 1647|       |     */
 1648|  15.9k|    const char *str[2] = { NULL, NULL };
 1649|       |
 1650|  15.9k|    if (!EVP_KEYMGMT_names_do_all(keymgmt, find_ameth, &str)
  ------------------
  |  Branch (1650:9): [True: 0, False: 15.9k]
  ------------------
 1651|  15.9k|            || str[1] != NULL) {
  ------------------
  |  Branch (1651:16): [True: 0, False: 15.9k]
  ------------------
 1652|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1653|      0|        return 0;
 1654|      0|    }
 1655|       |#else
 1656|       |# define EVP_PKEY_TYPE_STR NULL
 1657|       |# define EVP_PKEY_TYPE_STRLEN -1
 1658|       |#endif
 1659|  15.9k|    return pkey_set_type(pkey, NULL, EVP_PKEY_NONE,
  ------------------
  |  |   59|  15.9k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  15.9k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1660|  15.9k|                         EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1641|  15.9k|# define EVP_PKEY_TYPE_STR str[0]
  ------------------
                                       EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1642|  15.9k|# define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
  |  |  ------------------
  |  |  |  Branch (1642:32): [True: 0, False: 15.9k]
  |  |  ------------------
  ------------------
 1661|  15.9k|                         keymgmt);
 1662|       |
 1663|  15.9k|#undef EVP_PKEY_TYPE_STR
 1664|  15.9k|#undef EVP_PKEY_TYPE_STRLEN
 1665|  15.9k|}
EVP_PKEY_up_ref:
 1668|  15.9k|{
 1669|  15.9k|    int i;
 1670|       |
 1671|  15.9k|    if (CRYPTO_UP_REF(&pkey->references, &i) <= 0)
  ------------------
  |  Branch (1671:9): [True: 0, False: 15.9k]
  ------------------
 1672|      0|        return 0;
 1673|       |
 1674|  15.9k|    REF_PRINT_COUNT("EVP_PKEY", pkey);
  ------------------
  |  |  289|  15.9k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  15.9k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  15.9k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  15.9k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1675|  15.9k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|  15.9k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 15.9k]
  |  |  ------------------
  ------------------
 1676|  15.9k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (1676:13): [True: 15.9k, False: 0]
  ------------------
 1677|  15.9k|}
evp_pkey_free_legacy:
 1735|  52.4k|{
 1736|  52.4k|    const EVP_PKEY_ASN1_METHOD *ameth = x->ameth;
 1737|  52.4k|    ENGINE *tmpe = NULL;
 1738|       |
 1739|  52.4k|    if (ameth == NULL && x->legacy_cache_pkey.ptr != NULL)
  ------------------
  |  Branch (1739:9): [True: 15.9k, False: 36.4k]
  |  Branch (1739:26): [True: 0, False: 15.9k]
  ------------------
 1740|      0|        ameth = EVP_PKEY_asn1_find(&tmpe, x->type);
 1741|       |
 1742|  52.4k|    if (ameth != NULL) {
  ------------------
  |  Branch (1742:9): [True: 36.4k, False: 15.9k]
  ------------------
 1743|  36.4k|        if (x->legacy_cache_pkey.ptr != NULL) {
  ------------------
  |  Branch (1743:13): [True: 0, False: 36.4k]
  ------------------
 1744|       |            /*
 1745|       |             * We should never have both a legacy origin key, and a key in the
 1746|       |             * legacy cache.
 1747|       |             */
 1748|      0|            assert(x->pkey.ptr == NULL);
 1749|       |            /*
 1750|       |             * For the purposes of freeing we make the legacy cache look like
 1751|       |             * a legacy origin key.
 1752|       |             */
 1753|      0|            x->pkey = x->legacy_cache_pkey;
 1754|      0|            x->legacy_cache_pkey.ptr = NULL;
 1755|      0|        }
 1756|  36.4k|        if (ameth->pkey_free != NULL)
  ------------------
  |  Branch (1756:13): [True: 36.4k, False: 0]
  ------------------
 1757|  36.4k|            ameth->pkey_free(x);
 1758|  36.4k|        x->pkey.ptr = NULL;
 1759|  36.4k|    }
 1760|  52.4k|# ifndef OPENSSL_NO_ENGINE
 1761|  52.4k|    ENGINE_finish(tmpe);
 1762|  52.4k|    ENGINE_finish(x->engine);
 1763|  52.4k|    x->engine = NULL;
 1764|  52.4k|    ENGINE_finish(x->pmeth_engine);
 1765|  52.4k|    x->pmeth_engine = NULL;
 1766|  52.4k|# endif
 1767|  52.4k|}
EVP_PKEY_free:
 1788|   195k|{
 1789|   195k|    int i;
 1790|       |
 1791|   195k|    if (x == NULL)
  ------------------
  |  Branch (1791:9): [True: 126k, False: 68.4k]
  ------------------
 1792|   126k|        return;
 1793|       |
 1794|  68.4k|    CRYPTO_DOWN_REF(&x->references, &i);
 1795|  68.4k|    REF_PRINT_COUNT("EVP_PKEY", x);
  ------------------
  |  |  289|  68.4k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  68.4k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  68.4k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  68.4k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1796|  68.4k|    if (i > 0)
  ------------------
  |  Branch (1796:9): [True: 15.9k, False: 52.4k]
  ------------------
 1797|  15.9k|        return;
 1798|  52.4k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|  52.4k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 52.4k]
  |  |  ------------------
  ------------------
 1799|  52.4k|    evp_pkey_free_it(x);
 1800|  52.4k|#ifndef FIPS_MODULE
 1801|  52.4k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, x, &x->ex_data);
  ------------------
  |  |  246|  52.4k|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
 1802|  52.4k|#endif
 1803|  52.4k|    CRYPTO_THREAD_lock_free(x->lock);
 1804|  52.4k|    CRYPTO_FREE_REF(&x->references);
 1805|  52.4k|#ifndef FIPS_MODULE
 1806|  52.4k|    sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
  ------------------
  |  |  278|  52.4k|#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))
  ------------------
 1807|  52.4k|#endif
 1808|  52.4k|    OPENSSL_free(x);
  ------------------
  |  |  115|  52.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  52.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  52.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1809|  52.4k|}
evp_pkey_get_legacy:
 2114|  15.9k|{
 2115|  15.9k|    EVP_PKEY *tmp_copy = NULL;
 2116|  15.9k|    void *ret = NULL;
 2117|       |
 2118|  15.9k|    if (!ossl_assert(pk != NULL))
  ------------------
  |  |   52|  15.9k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  15.9k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (2118:9): [True: 0, False: 15.9k]
  ------------------
 2119|      0|        return NULL;
 2120|       |
 2121|       |    /*
 2122|       |     * If this isn't an assigned provider side key, we just use any existing
 2123|       |     * origin legacy key.
 2124|       |     */
 2125|  15.9k|    if (!evp_pkey_is_assigned(pk))
  ------------------
  |  |  633|  15.9k|    ((pk)->pkey.ptr != NULL || (pk)->keydata != NULL)
  |  |  ------------------
  |  |  |  Branch (633:6): [True: 15.9k, False: 0]
  |  |  |  Branch (633:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2126|      0|        return NULL;
 2127|  15.9k|    if (!evp_pkey_is_provided(pk))
  ------------------
  |  |  641|  15.9k|    ((pk)->keymgmt != NULL)
  ------------------
  |  Branch (2127:9): [True: 15.9k, False: 0]
  ------------------
 2128|  15.9k|        return pk->pkey.ptr;
 2129|       |
 2130|      0|    if (!CRYPTO_THREAD_read_lock(pk->lock))
  ------------------
  |  Branch (2130:9): [True: 0, False: 0]
  ------------------
 2131|      0|        return NULL;
 2132|       |
 2133|      0|    ret = pk->legacy_cache_pkey.ptr;
 2134|       |
 2135|      0|    if (!CRYPTO_THREAD_unlock(pk->lock))
  ------------------
  |  Branch (2135:9): [True: 0, False: 0]
  ------------------
 2136|      0|        return NULL;
 2137|       |
 2138|      0|    if (ret != NULL)
  ------------------
  |  Branch (2138:9): [True: 0, False: 0]
  ------------------
 2139|      0|        return ret;
 2140|       |
 2141|      0|    if (!evp_pkey_copy_downgraded(&tmp_copy, pk))
  ------------------
  |  Branch (2141:9): [True: 0, False: 0]
  ------------------
 2142|      0|        goto err;
 2143|       |
 2144|      0|    if (!CRYPTO_THREAD_write_lock(pk->lock))
  ------------------
  |  Branch (2144:9): [True: 0, False: 0]
  ------------------
 2145|      0|        goto err;
 2146|       |
 2147|       |    /* Check again in case some other thread has updated it in the meantime */
 2148|      0|    ret = pk->legacy_cache_pkey.ptr;
 2149|      0|    if (ret == NULL) {
  ------------------
  |  Branch (2149:9): [True: 0, False: 0]
  ------------------
 2150|       |        /* Steal the legacy key reference from the temporary copy */
 2151|      0|        ret = pk->legacy_cache_pkey.ptr = tmp_copy->pkey.ptr;
 2152|      0|        tmp_copy->pkey.ptr = NULL;
 2153|      0|    }
 2154|       |
 2155|      0|    if (!CRYPTO_THREAD_unlock(pk->lock)) {
  ------------------
  |  Branch (2155:9): [True: 0, False: 0]
  ------------------
 2156|      0|        ret = NULL;
 2157|      0|        goto err;
 2158|      0|    }
 2159|       |
 2160|      0| err:
 2161|      0|    EVP_PKEY_free(tmp_copy);
 2162|       |
 2163|      0|    return ret;
 2164|      0|}
p_lib.c:detect_foreign_key:
  724|  15.9k|{
  725|  15.9k|    switch (pkey->type) {
  726|      6|    case EVP_PKEY_RSA:
  ------------------
  |  |   60|      6|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|      6|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (726:5): [True: 6, False: 15.9k]
  ------------------
  727|     14|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   62|     14|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|     14|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (727:5): [True: 8, False: 15.9k]
  ------------------
  728|     14|        pkey->foreign = pkey->pkey.rsa != NULL
  ------------------
  |  Branch (728:25): [True: 14, False: 0]
  ------------------
  729|     14|                        && ossl_rsa_is_foreign(pkey->pkey.rsa);
  ------------------
  |  Branch (729:28): [True: 0, False: 14]
  ------------------
  730|     14|        break;
  731|      0|#  ifndef OPENSSL_NO_EC
  732|      0|    case EVP_PKEY_SM2:
  ------------------
  |  |   71|      0|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|      0|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (732:5): [True: 0, False: 15.9k]
  ------------------
  733|      0|        break;
  734|  15.9k|    case EVP_PKEY_EC:
  ------------------
  |  |   70|  15.9k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  15.9k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (734:5): [True: 15.9k, False: 66]
  ------------------
  735|  15.9k|        pkey->foreign = pkey->pkey.ec != NULL
  ------------------
  |  Branch (735:25): [True: 15.9k, False: 0]
  ------------------
  736|  15.9k|                        && ossl_ec_key_is_foreign(pkey->pkey.ec);
  ------------------
  |  Branch (736:28): [True: 0, False: 15.9k]
  ------------------
  737|  15.9k|        break;
  738|      0|#  endif
  739|      0|#  ifndef OPENSSL_NO_DSA
  740|     34|    case EVP_PKEY_DSA:
  ------------------
  |  |   63|     34|# define EVP_PKEY_DSA    NID_dsa
  |  |  ------------------
  |  |  |  |  136|     34|#define NID_dsa         116
  |  |  ------------------
  ------------------
  |  Branch (740:5): [True: 34, False: 15.9k]
  ------------------
  741|     34|        pkey->foreign = pkey->pkey.dsa != NULL
  ------------------
  |  Branch (741:25): [True: 34, False: 0]
  ------------------
  742|     34|                        && ossl_dsa_is_foreign(pkey->pkey.dsa);
  ------------------
  |  Branch (742:28): [True: 0, False: 34]
  ------------------
  743|     34|        break;
  744|      0|#endif
  745|      0|#  ifndef OPENSSL_NO_DH
  746|      0|    case EVP_PKEY_DH:
  ------------------
  |  |   68|      0|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|      0|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
  |  Branch (746:5): [True: 0, False: 15.9k]
  ------------------
  747|      0|        pkey->foreign = pkey->pkey.dh != NULL
  ------------------
  |  Branch (747:25): [True: 0, False: 0]
  ------------------
  748|      0|                        && ossl_dh_is_foreign(pkey->pkey.dh);
  ------------------
  |  Branch (748:28): [True: 0, False: 0]
  ------------------
  749|      0|        break;
  750|      0|#endif
  751|     18|    default:
  ------------------
  |  Branch (751:5): [True: 18, False: 15.9k]
  ------------------
  752|     18|        pkey->foreign = 0;
  753|     18|        break;
  754|  15.9k|    }
  755|  15.9k|}
p_lib.c:evp_pkey_get0_DSA_int:
  854|     34|{
  855|     34|    if (pkey->type != EVP_PKEY_DSA) {
  ------------------
  |  |   63|     34|# define EVP_PKEY_DSA    NID_dsa
  |  |  ------------------
  |  |  |  |  136|     34|#define NID_dsa         116
  |  |  ------------------
  ------------------
  |  Branch (855:9): [True: 0, False: 34]
  ------------------
  856|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  857|      0|        return NULL;
  858|      0|    }
  859|     34|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
  860|     34|}
p_lib.c:pkey_set_type:
 1502|   116k|{
 1503|   116k|#ifndef FIPS_MODULE
 1504|   116k|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
 1505|   116k|    ENGINE **eptr = (e == NULL) ? &e :  NULL;
  ------------------
  |  Branch (1505:21): [True: 116k, False: 0]
  ------------------
 1506|   116k|#endif
 1507|       |
 1508|       |    /*
 1509|       |     * The setups can't set both legacy and provider side methods.
 1510|       |     * It is forbidden
 1511|       |     */
 1512|   116k|    if (!ossl_assert(type == EVP_PKEY_NONE || keymgmt == NULL)
  ------------------
  |  |   52|   232k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 63.8k, False: 52.4k]
  |  |  |  Branch (52:43): [True: 52.4k, False: 0]
  |  |  ------------------
  |  |   53|   232k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1512:9): [True: 0, False: 116k]
  ------------------
 1513|   116k|        || !ossl_assert(e == NULL || keymgmt == NULL)) {
  ------------------
  |  |   52|   116k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 116k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|   116k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1513:12): [True: 0, False: 116k]
  ------------------
 1514|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1515|      0|        return 0;
 1516|      0|    }
 1517|       |
 1518|   116k|    if (pkey != NULL) {
  ------------------
  |  Branch (1518:9): [True: 68.4k, False: 47.9k]
  ------------------
 1519|  68.4k|        int free_it = 0;
 1520|       |
 1521|  68.4k|#ifndef FIPS_MODULE
 1522|  68.4k|        free_it = free_it || pkey->pkey.ptr != NULL;
  ------------------
  |  Branch (1522:19): [True: 0, False: 68.4k]
  |  Branch (1522:30): [True: 0, False: 68.4k]
  ------------------
 1523|  68.4k|#endif
 1524|  68.4k|        free_it = free_it || pkey->keydata != NULL;
  ------------------
  |  Branch (1524:19): [True: 0, False: 68.4k]
  |  Branch (1524:30): [True: 0, False: 68.4k]
  ------------------
 1525|  68.4k|        if (free_it)
  ------------------
  |  Branch (1525:13): [True: 0, False: 68.4k]
  ------------------
 1526|      0|            evp_pkey_free_it(pkey);
 1527|  68.4k|#ifndef FIPS_MODULE
 1528|       |        /*
 1529|       |         * If key type matches and a method exists then this lookup has
 1530|       |         * succeeded once so just indicate success.
 1531|       |         */
 1532|  68.4k|        if (pkey->type != EVP_PKEY_NONE
  ------------------
  |  |   59|  68.4k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|   136k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1532:13): [True: 15.9k, False: 52.4k]
  ------------------
 1533|  68.4k|            && type == pkey->save_type
  ------------------
  |  Branch (1533:16): [True: 15.9k, False: 8]
  ------------------
 1534|  68.4k|            && pkey->ameth != NULL)
  ------------------
  |  Branch (1534:16): [True: 15.9k, False: 0]
  ------------------
 1535|  15.9k|            return 1;
 1536|  52.4k|# ifndef OPENSSL_NO_ENGINE
 1537|       |        /* If we have ENGINEs release them */
 1538|  52.4k|        ENGINE_finish(pkey->engine);
 1539|  52.4k|        pkey->engine = NULL;
 1540|  52.4k|        ENGINE_finish(pkey->pmeth_engine);
 1541|  52.4k|        pkey->pmeth_engine = NULL;
 1542|  52.4k|# endif
 1543|  52.4k|#endif
 1544|  52.4k|    }
 1545|   100k|#ifndef FIPS_MODULE
 1546|   100k|    if (str != NULL)
  ------------------
  |  Branch (1546:9): [True: 63.8k, False: 36.4k]
  ------------------
 1547|  63.8k|        ameth = EVP_PKEY_asn1_find_str(eptr, str, len);
 1548|  36.4k|    else if (type != EVP_PKEY_NONE)
  ------------------
  |  |   59|  36.4k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  36.4k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1548:14): [True: 36.4k, False: 0]
  ------------------
 1549|  36.4k|        ameth = EVP_PKEY_asn1_find(eptr, type);
 1550|   100k|# ifndef OPENSSL_NO_ENGINE
 1551|   100k|    if (pkey == NULL && eptr != NULL)
  ------------------
  |  Branch (1551:9): [True: 47.9k, False: 52.4k]
  |  Branch (1551:25): [True: 47.9k, False: 0]
  ------------------
 1552|  47.9k|        ENGINE_finish(e);
 1553|   100k|# endif
 1554|   100k|#endif
 1555|       |
 1556|       |
 1557|   100k|    {
 1558|   100k|        int check = 1;
 1559|       |
 1560|   100k|#ifndef FIPS_MODULE
 1561|   100k|        check = check && ameth == NULL;
  ------------------
  |  Branch (1561:17): [True: 100k, False: 0]
  |  Branch (1561:26): [True: 31.9k, False: 68.3k]
  ------------------
 1562|   100k|#endif
 1563|   100k|        check = check && keymgmt == NULL;
  ------------------
  |  Branch (1563:17): [True: 31.9k, False: 68.3k]
  |  Branch (1563:26): [True: 31.9k, False: 0]
  ------------------
 1564|   100k|        if (check) {
  ------------------
  |  Branch (1564:13): [True: 31.9k, False: 68.3k]
  ------------------
 1565|  31.9k|            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|  31.9k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  31.9k|    (ERR_new(),                                                 \
  |  |  |  |  404|  31.9k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  31.9k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  31.9k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  31.9k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  31.9k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1566|  31.9k|            return 0;
 1567|  31.9k|        }
 1568|   100k|    }
 1569|  68.3k|    if (pkey != NULL) {
  ------------------
  |  Branch (1569:9): [True: 52.4k, False: 15.9k]
  ------------------
 1570|  52.4k|        if (keymgmt != NULL && !EVP_KEYMGMT_up_ref(keymgmt)) {
  ------------------
  |  Branch (1570:13): [True: 15.9k, False: 36.4k]
  |  Branch (1570:32): [True: 0, False: 15.9k]
  ------------------
 1571|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1572|      0|            return 0;
 1573|      0|        }
 1574|       |
 1575|  52.4k|        pkey->keymgmt = keymgmt;
 1576|       |
 1577|  52.4k|        pkey->save_type = type;
 1578|  52.4k|        pkey->type = type;
 1579|       |
 1580|  52.4k|#ifndef FIPS_MODULE
 1581|       |        /*
 1582|       |         * If the internal "origin" key is provider side, don't save |ameth|.
 1583|       |         * The main reason is that |ameth| is one factor to detect that the
 1584|       |         * internal "origin" key is a legacy one.
 1585|       |         */
 1586|  52.4k|        if (keymgmt == NULL)
  ------------------
  |  Branch (1586:13): [True: 36.4k, False: 15.9k]
  ------------------
 1587|  36.4k|            pkey->ameth = ameth;
 1588|       |
 1589|       |        /*
 1590|       |         * The EVP_PKEY_ASN1_METHOD |pkey_id| retains its legacy key purpose
 1591|       |         * for any key type that has a legacy implementation, regardless of
 1592|       |         * if the internal key is a legacy or a provider side one.  When
 1593|       |         * there is no legacy implementation for the key, the type becomes
 1594|       |         * EVP_PKEY_KEYMGMT, which indicates that one should be cautious
 1595|       |         * with functions that expect legacy internal keys.
 1596|       |         */
 1597|  52.4k|        if (ameth != NULL) {
  ------------------
  |  Branch (1597:13): [True: 52.4k, False: 0]
  ------------------
 1598|  52.4k|            if (type == EVP_PKEY_NONE)
  ------------------
  |  |   59|  52.4k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  52.4k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1598:17): [True: 15.9k, False: 36.4k]
  ------------------
 1599|  15.9k|                pkey->type = ameth->pkey_id;
 1600|  52.4k|        } else {
 1601|      0|            pkey->type = EVP_PKEY_KEYMGMT;
  ------------------
  |  |   84|      0|# define EVP_PKEY_KEYMGMT -1
  ------------------
 1602|      0|        }
 1603|  52.4k|# ifndef OPENSSL_NO_ENGINE
 1604|  52.4k|        if (eptr == NULL && e != NULL && !ENGINE_init(e)) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 52.4k]
  |  Branch (1604:29): [True: 0, False: 0]
  |  Branch (1604:42): [True: 0, False: 0]
  ------------------
 1605|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1606|      0|            return 0;
 1607|      0|        }
 1608|  52.4k|# endif
 1609|  52.4k|        pkey->engine = e;
 1610|  52.4k|#endif
 1611|  52.4k|    }
 1612|  68.3k|    return 1;
 1613|  68.3k|}
p_lib.c:find_ameth:
 1617|  47.9k|{
 1618|  47.9k|    const char **str = data;
 1619|       |
 1620|       |    /*
 1621|       |     * The error messages from pkey_set_type() are uninteresting here,
 1622|       |     * and misleading.
 1623|       |     */
 1624|  47.9k|    ERR_set_mark();
 1625|       |
 1626|  47.9k|    if (pkey_set_type(NULL, NULL, EVP_PKEY_NONE, name, strlen(name),
  ------------------
  |  |   59|  47.9k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  47.9k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1626:9): [True: 15.9k, False: 31.9k]
  ------------------
 1627|  47.9k|                      NULL)) {
 1628|  15.9k|        if (str[0] == NULL)
  ------------------
  |  Branch (1628:13): [True: 15.9k, False: 0]
  ------------------
 1629|  15.9k|            str[0] = name;
 1630|      0|        else if (str[1] == NULL)
  ------------------
  |  Branch (1630:18): [True: 0, False: 0]
  ------------------
 1631|      0|            str[1] = name;
 1632|  15.9k|    }
 1633|       |
 1634|  47.9k|    ERR_pop_to_mark();
 1635|  47.9k|}
p_lib.c:evp_pkey_free_it:
 1771|  52.4k|{
 1772|       |    /* internal function; x is never NULL */
 1773|  52.4k|    evp_keymgmt_util_clear_operation_cache(x);
 1774|  52.4k|#ifndef FIPS_MODULE
 1775|  52.4k|    evp_pkey_free_legacy(x);
 1776|  52.4k|#endif
 1777|       |
 1778|  52.4k|    if (x->keymgmt != NULL) {
  ------------------
  |  Branch (1778:9): [True: 15.9k, False: 36.4k]
  ------------------
 1779|  15.9k|        evp_keymgmt_freedata(x->keymgmt, x->keydata);
 1780|  15.9k|        EVP_KEYMGMT_free(x->keymgmt);
 1781|  15.9k|        x->keymgmt = NULL;
 1782|  15.9k|        x->keydata = NULL;
 1783|  15.9k|    }
 1784|  52.4k|    x->type = EVP_PKEY_NONE;
  ------------------
  |  |   59|  52.4k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  52.4k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1785|  52.4k|}

EVP_PKEY_CTX_free:
  388|  25.2k|{
  389|  25.2k|    if (ctx == NULL)
  ------------------
  |  Branch (389:9): [True: 25.2k, False: 0]
  ------------------
  390|  25.2k|        return;
  391|      0|    if (ctx->pmeth && ctx->pmeth->cleanup)
  ------------------
  |  Branch (391:9): [True: 0, False: 0]
  |  Branch (391:23): [True: 0, False: 0]
  ------------------
  392|      0|        ctx->pmeth->cleanup(ctx);
  393|       |
  394|      0|    evp_pkey_ctx_free_old_ops(ctx);
  395|      0|#ifndef FIPS_MODULE
  396|      0|    evp_pkey_ctx_free_all_cached_data(ctx);
  397|      0|#endif
  398|      0|    EVP_KEYMGMT_free(ctx->keymgmt);
  399|       |
  400|      0|    OPENSSL_free(ctx->propquery);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  401|      0|    EVP_PKEY_free(ctx->pkey);
  402|      0|    EVP_PKEY_free(ctx->peerkey);
  403|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  404|      0|    ENGINE_finish(ctx->engine);
  405|      0|#endif
  406|      0|    BN_free(ctx->rsa_pubexp);
  407|      0|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  408|      0|}
evp_app_cleanup_int:
  618|      2|{
  619|      2|    if (app_pkey_methods != NULL)
  ------------------
  |  Branch (619:9): [True: 0, False: 2]
  ------------------
  620|      0|        sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free);
  621|      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) {
  ------------------
  |  |  247|     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|   326k|{
  222|   326k|    int mx, i;
  223|   326k|    void *ptr;
  224|   326k|    EX_CALLBACK **storage = NULL;
  225|   326k|    EX_CALLBACK *stack[10];
  226|   326k|    EX_CALLBACKS *ip;
  227|   326k|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  228|       |
  229|   326k|    if (global == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 326k]
  ------------------
  230|      0|        return 0;
  231|       |
  232|   326k|    ip = get_and_lock(global, class_index, 1);
  233|   326k|    if (ip == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 326k]
  ------------------
  234|      0|        return 0;
  235|       |
  236|   326k|    ad->ctx = ctx;
  237|   326k|    ad->sk = NULL;
  238|   326k|    mx = sk_EX_CALLBACK_num(ip->meth);
  239|   326k|    if (mx > 0) {
  ------------------
  |  Branch (239:9): [True: 0, False: 326k]
  ------------------
  240|      0|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|            storage = stack;
  242|      0|        else
  243|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|   326k|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  249|       |
  250|   326k|    if (mx > 0 && storage == NULL)
  ------------------
  |  Branch (250:9): [True: 0, False: 326k]
  |  Branch (250:19): [True: 0, False: 0]
  ------------------
  251|      0|        return 0;
  252|   326k|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (252:17): [True: 0, False: 326k]
  ------------------
  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|   326k|    if (storage != stack)
  ------------------
  |  Branch (259:9): [True: 326k, False: 0]
  ------------------
  260|   326k|        OPENSSL_free(storage);
  ------------------
  |  |  115|   326k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   326k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   326k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|   326k|    return 1;
  262|   326k|}
CRYPTO_new_ex_data:
  265|   326k|{
  266|   326k|    return ossl_crypto_new_ex_data_ex(NULL, class_index, obj, ad);
  267|   326k|}
CRYPTO_free_ex_data:
  368|   326k|{
  369|   326k|    int mx, i;
  370|   326k|    EX_CALLBACKS *ip;
  371|   326k|    void *ptr;
  372|   326k|    const EX_CALLBACK *f;
  373|   326k|    struct ex_callback_entry stack[10];
  374|   326k|    struct ex_callback_entry *storage = NULL;
  375|   326k|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
  376|       |
  377|   326k|    if (global == NULL)
  ------------------
  |  Branch (377:9): [True: 0, False: 326k]
  ------------------
  378|      0|        goto err;
  379|       |
  380|   326k|    ip = get_and_lock(global, class_index, 1);
  381|   326k|    if (ip == NULL)
  ------------------
  |  Branch (381:9): [True: 0, False: 326k]
  ------------------
  382|      0|        goto err;
  383|       |
  384|   326k|    mx = sk_EX_CALLBACK_num(ip->meth);
  385|   326k|    if (mx > 0) {
  ------------------
  |  Branch (385:9): [True: 0, False: 326k]
  ------------------
  386|      0|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (386:13): [True: 0, False: 0]
  ------------------
  387|      0|            storage = stack;
  388|      0|        else
  389|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|   326k|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  397|       |
  398|   326k|    if (storage != NULL) {
  ------------------
  |  Branch (398:9): [True: 0, False: 326k]
  ------------------
  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|   326k|    if (storage != stack)
  ------------------
  |  Branch (411:9): [True: 326k, False: 0]
  ------------------
  412|   326k|        OPENSSL_free(storage);
  ------------------
  |  |  115|   326k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   326k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   326k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  413|   326k| err:
  414|   326k|    sk_void_free(ad->sk);
  ------------------
  |  |  203|   326k|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
  415|   326k|    ad->sk = NULL;
  416|   326k|    ad->ctx = NULL;
  417|   326k|}
ex_data.c:get_and_lock:
   33|   652k|{
   34|   652k|    EX_CALLBACKS *ip;
   35|       |
   36|   652k|    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
  ------------------
  |  |  247|   652k|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (36:9): [True: 0, False: 652k]
  |  Branch (36:28): [True: 0, False: 652k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   38|      0|        return NULL;
   39|      0|    }
   40|       |
   41|   652k|    if (global->ex_data_lock == NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 652k]
  ------------------
   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|   652k|    if (read) {
  ------------------
  |  Branch (49:9): [True: 652k, False: 2]
  ------------------
   50|   652k|        if (!CRYPTO_THREAD_read_lock(global->ex_data_lock))
  ------------------
  |  Branch (50:13): [True: 0, False: 652k]
  ------------------
   51|      0|            return NULL;
   52|   652k|    } 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|   652k|    ip = &global->ex_data[class_index];
   58|   652k|    return ip;
   59|   652k|}

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

ossl_ffc_params_init:
   21|    516|{
   22|    516|    memset(params, 0, sizeof(*params));
   23|    516|    params->pcounter = -1;
   24|    516|    params->gindex = FFC_UNVERIFIABLE_GINDEX;
  ------------------
  |  |   23|    516|# define FFC_UNVERIFIABLE_GINDEX -1
  ------------------
   25|    516|    params->flags = FFC_PARAM_FLAG_VALIDATE_PQG;
  ------------------
  |  |   46|    516|    (FFC_PARAM_FLAG_VALIDATE_PQ | FFC_PARAM_FLAG_VALIDATE_G)
  |  |  ------------------
  |  |  |  |   43|    516|# define FFC_PARAM_FLAG_VALIDATE_PQ    0x01
  |  |  ------------------
  |  |                   (FFC_PARAM_FLAG_VALIDATE_PQ | FFC_PARAM_FLAG_VALIDATE_G)
  |  |  ------------------
  |  |  |  |   44|    516|# define FFC_PARAM_FLAG_VALIDATE_G     0x02
  |  |  ------------------
  ------------------
   26|    516|}
ossl_ffc_params_cleanup:
   29|    258|{
   30|       |#ifdef FIPS_MODULE
   31|       |    BN_clear_free(params->p);
   32|       |    BN_clear_free(params->q);
   33|       |    BN_clear_free(params->g);
   34|       |    BN_clear_free(params->j);
   35|       |    OPENSSL_clear_free(params->seed, params->seedlen);
   36|       |#else
   37|    258|    BN_free(params->p);
   38|    258|    BN_free(params->q);
   39|    258|    BN_free(params->g);
   40|    258|    BN_free(params->j);
   41|    258|    OPENSSL_free(params->seed);
  ------------------
  |  |  115|    258|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    258|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    258|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   42|    258|#endif
   43|    258|    ossl_ffc_params_init(params);
   44|    258|}
ossl_ffc_params_set0_pqg:
   47|     20|{
   48|     20|    if (p != NULL && p != d->p) {
  ------------------
  |  Branch (48:9): [True: 20, False: 0]
  |  Branch (48:22): [True: 20, False: 0]
  ------------------
   49|     20|        BN_free(d->p);
   50|     20|        d->p = p;
   51|     20|    }
   52|     20|    if (q != NULL && q != d->q) {
  ------------------
  |  Branch (52:9): [True: 20, False: 0]
  |  Branch (52:22): [True: 20, False: 0]
  ------------------
   53|     20|        BN_free(d->q);
   54|     20|        d->q = q;
   55|     20|    }
   56|     20|    if (g != NULL && g != d->g) {
  ------------------
  |  Branch (56:9): [True: 20, False: 0]
  |  Branch (56:22): [True: 20, False: 0]
  ------------------
   57|     20|        BN_free(d->g);
   58|     20|        d->g = g;
   59|     20|    }
   60|     20|}
ossl_ffc_params_get0_pqg:
   64|     34|{
   65|     34|    if (p != NULL)
  ------------------
  |  Branch (65:9): [True: 34, False: 0]
  ------------------
   66|     34|        *p = d->p;
   67|     34|    if (q != NULL)
  ------------------
  |  Branch (67:9): [True: 34, False: 0]
  ------------------
   68|     34|        *q = d->q;
   69|     34|    if (g != NULL)
  ------------------
  |  Branch (69:9): [True: 34, False: 0]
  ------------------
   70|     34|        *g = d->g;
   71|     34|}
ossl_ffc_params_set0_j:
   76|     20|{
   77|     20|    BN_free(d->j);
   78|     20|    d->j = NULL;
   79|     20|    if (j != NULL)
  ------------------
  |  Branch (79:9): [True: 2, False: 18]
  ------------------
   80|      2|        d->j = j;
   81|     20|}
ossl_ffc_params_todata:
  218|     22|{
  219|     22|    int test_flags;
  220|       |
  221|     22|    if (ffc->p != NULL
  ------------------
  |  Branch (221:9): [True: 22, False: 0]
  ------------------
  222|     22|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_P, ffc->p))
  ------------------
  |  |  371|     22|# define OSSL_PKEY_PARAM_FFC_P "p"
  ------------------
  |  Branch (222:12): [True: 0, False: 22]
  ------------------
  223|      0|        return 0;
  224|     22|    if (ffc->q != NULL
  ------------------
  |  Branch (224:9): [True: 22, False: 0]
  ------------------
  225|     22|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_Q, ffc->q))
  ------------------
  |  |  374|     22|# define OSSL_PKEY_PARAM_FFC_Q "q"
  ------------------
  |  Branch (225:12): [True: 0, False: 22]
  ------------------
  226|      0|        return 0;
  227|     22|    if (ffc->g != NULL
  ------------------
  |  Branch (227:9): [True: 22, False: 0]
  ------------------
  228|     22|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_G, ffc->g))
  ------------------
  |  |  368|     22|# define OSSL_PKEY_PARAM_FFC_G "g"
  ------------------
  |  Branch (228:12): [True: 0, False: 22]
  ------------------
  229|      0|        return 0;
  230|     22|    if (ffc->j != NULL
  ------------------
  |  Branch (230:9): [True: 2, False: 20]
  ------------------
  231|     22|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_COFACTOR,
  ------------------
  |  |  365|      2|# define OSSL_PKEY_PARAM_FFC_COFACTOR "j"
  ------------------
  |  Branch (231:12): [True: 0, False: 2]
  ------------------
  232|      2|                                    ffc->j))
  233|      0|        return 0;
  234|     22|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_GINDEX,
  ------------------
  |  |  369|     22|# define OSSL_PKEY_PARAM_FFC_GINDEX "gindex"
  ------------------
  |  Branch (234:9): [True: 0, False: 22]
  ------------------
  235|     22|                                  ffc->gindex))
  236|      0|        return 0;
  237|     22|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_PCOUNTER,
  ------------------
  |  |  373|     22|# define OSSL_PKEY_PARAM_FFC_PCOUNTER "pcounter"
  ------------------
  |  Branch (237:9): [True: 0, False: 22]
  ------------------
  238|     22|                                  ffc->pcounter))
  239|      0|        return 0;
  240|     22|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_H, ffc->h))
  ------------------
  |  |  370|     22|# define OSSL_PKEY_PARAM_FFC_H "hindex"
  ------------------
  |  Branch (240:9): [True: 0, False: 22]
  ------------------
  241|      0|        return 0;
  242|     22|    if (ffc->seed != NULL
  ------------------
  |  Branch (242:9): [True: 0, False: 22]
  ------------------
  243|     22|        && !ossl_param_build_set_octet_string(bld, params,
  ------------------
  |  Branch (243:12): [True: 0, False: 0]
  ------------------
  244|      0|                                              OSSL_PKEY_PARAM_FFC_SEED,
  ------------------
  |  |  376|      0|# define OSSL_PKEY_PARAM_FFC_SEED "seed"
  ------------------
  245|      0|                                              ffc->seed, ffc->seedlen))
  246|      0|        return 0;
  247|     22|    if (ffc->nid != NID_undef) {
  ------------------
  |  |   18|     22|#define NID_undef                       0
  ------------------
  |  Branch (247:9): [True: 0, False: 22]
  ------------------
  248|      0|        const DH_NAMED_GROUP *group = ossl_ffc_uid_to_dh_named_group(ffc->nid);
  249|      0|        const char *name = ossl_ffc_named_group_get_name(group);
  250|       |
  251|      0|        if (name == NULL
  ------------------
  |  Branch (251:13): [True: 0, False: 0]
  ------------------
  252|      0|            || !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (252:16): [True: 0, False: 0]
  ------------------
  253|      0|                                                 OSSL_PKEY_PARAM_GROUP_NAME,
  ------------------
  |  |  383|      0|# define OSSL_PKEY_PARAM_GROUP_NAME "group"
  ------------------
  254|      0|                                                 name))
  255|      0|            return 0;
  256|      0|    }
  257|     22|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_PQ) != 0);
  ------------------
  |  |   43|     22|# define FFC_PARAM_FLAG_VALIDATE_PQ    0x01
  ------------------
  258|     22|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (258:9): [True: 0, False: 22]
  ------------------
  259|     22|                                  OSSL_PKEY_PARAM_FFC_VALIDATE_PQ, test_flags))
  ------------------
  |  |  380|     22|# define OSSL_PKEY_PARAM_FFC_VALIDATE_PQ "validate-pq"
  ------------------
  260|      0|        return 0;
  261|     22|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_G) != 0);
  ------------------
  |  |   44|     22|# define FFC_PARAM_FLAG_VALIDATE_G     0x02
  ------------------
  262|     22|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (262:9): [True: 0, False: 22]
  ------------------
  263|     22|                                  OSSL_PKEY_PARAM_FFC_VALIDATE_G, test_flags))
  ------------------
  |  |  378|     22|# define OSSL_PKEY_PARAM_FFC_VALIDATE_G "validate-g"
  ------------------
  264|      0|        return 0;
  265|     22|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_LEGACY) != 0);
  ------------------
  |  |   47|     22|#define FFC_PARAM_FLAG_VALIDATE_LEGACY 0x04
  ------------------
  266|     22|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (266:9): [True: 0, False: 22]
  ------------------
  267|     22|                                  OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY,
  ------------------
  |  |  379|     22|# define OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY "validate-legacy"
  ------------------
  268|     22|                                  test_flags))
  269|      0|        return 0;
  270|       |
  271|     22|    if (ffc->mdname != NULL
  ------------------
  |  Branch (271:9): [True: 0, False: 22]
  ------------------
  272|     22|        && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (272:12): [True: 0, False: 0]
  ------------------
  273|      0|                                             OSSL_PKEY_PARAM_FFC_DIGEST,
  ------------------
  |  |  366|      0|# define OSSL_PKEY_PARAM_FFC_DIGEST OSSL_PKEY_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  339|      0|# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|      0|                                             ffc->mdname))
  275|      0|       return 0;
  276|     22|    if (ffc->mdprops != NULL
  ------------------
  |  Branch (276:9): [True: 0, False: 22]
  ------------------
  277|     22|        && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (277:12): [True: 0, False: 0]
  ------------------
  278|      0|                                             OSSL_PKEY_PARAM_FFC_DIGEST_PROPS,
  ------------------
  |  |  367|      0|# define OSSL_PKEY_PARAM_FFC_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  392|      0|# define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|      0|                                             ffc->mdprops))
  280|      0|        return 0;
  281|     22|    return 1;
  282|     22|}

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

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

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

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

CRYPTO_malloc:
  178|  20.6M|{
  179|  20.6M|    void *ptr;
  180|       |
  181|  20.6M|    INCREMENT(malloc_count);
  182|  20.6M|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (182:9): [True: 0, False: 20.6M]
  ------------------
  183|      0|        ptr = malloc_impl(num, file, line);
  184|      0|        if (ptr != NULL || num == 0)
  ------------------
  |  Branch (184:13): [True: 0, False: 0]
  |  Branch (184:28): [True: 0, False: 0]
  ------------------
  185|      0|            return ptr;
  186|      0|        goto err;
  187|      0|    }
  188|       |
  189|  20.6M|    if (num == 0)
  ------------------
  |  Branch (189:9): [True: 0, False: 20.6M]
  ------------------
  190|      0|        return NULL;
  191|       |
  192|  20.6M|    FAILTEST();
  193|  20.6M|    if (allow_customize) {
  ------------------
  |  Branch (193:9): [True: 2, False: 20.6M]
  ------------------
  194|       |        /*
  195|       |         * Disallow customization after the first allocation. We only set this
  196|       |         * if necessary to avoid a store to the same cache line on every
  197|       |         * allocation.
  198|       |         */
  199|      2|        allow_customize = 0;
  200|      2|    }
  201|       |
  202|  20.6M|    ptr = malloc(num);
  203|  20.6M|    if (ptr != NULL)
  ------------------
  |  Branch (203:9): [True: 20.6M, False: 0]
  ------------------
  204|  20.6M|        return ptr;
  205|      0| err:
  206|       |    /*
  207|       |     * ossl_err_get_state_int() in err.c uses CRYPTO_zalloc(num, NULL, 0) for
  208|       |     * ERR_STATE allocation. Prevent mem alloc error loop while reporting error.
  209|       |     */
  210|      0|    if (file != NULL || line != 0) {
  ------------------
  |  Branch (210:9): [True: 0, False: 0]
  |  Branch (210:25): [True: 0, False: 0]
  ------------------
  211|      0|        ERR_new();
  212|      0|        ERR_set_debug(file, line, NULL);
  213|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|      0|    }
  215|      0|    return NULL;
  216|  20.6M|}
CRYPTO_zalloc:
  219|  14.3M|{
  220|  14.3M|    void *ret;
  221|       |
  222|  14.3M|    ret = CRYPTO_malloc(num, file, line);
  223|  14.3M|    if (ret != NULL)
  ------------------
  |  Branch (223:9): [True: 14.3M, False: 0]
  ------------------
  224|  14.3M|        memset(ret, 0, num);
  225|       |
  226|  14.3M|    return ret;
  227|  14.3M|}
CRYPTO_realloc:
  289|  1.56M|{
  290|  1.56M|    INCREMENT(realloc_count);
  291|  1.56M|    if (realloc_impl != CRYPTO_realloc)
  ------------------
  |  Branch (291:9): [True: 0, False: 1.56M]
  ------------------
  292|      0|        return realloc_impl(str, num, file, line);
  293|       |
  294|  1.56M|    if (str == NULL)
  ------------------
  |  Branch (294:9): [True: 1.46M, False: 101k]
  ------------------
  295|  1.46M|        return CRYPTO_malloc(num, file, line);
  296|       |
  297|   101k|    if (num == 0) {
  ------------------
  |  Branch (297:9): [True: 0, False: 101k]
  ------------------
  298|      0|        CRYPTO_free(str, file, line);
  299|      0|        return NULL;
  300|      0|    }
  301|       |
  302|   101k|    FAILTEST();
  303|   101k|    return realloc(str, num);
  304|   101k|}
CRYPTO_clear_realloc:
  308|   532k|{
  309|   532k|    void *ret = NULL;
  310|       |
  311|   532k|    if (str == NULL)
  ------------------
  |  Branch (311:9): [True: 239k, False: 293k]
  ------------------
  312|   239k|        return CRYPTO_malloc(num, file, line);
  313|       |
  314|   293k|    if (num == 0) {
  ------------------
  |  Branch (314:9): [True: 0, False: 293k]
  ------------------
  315|      0|        CRYPTO_clear_free(str, old_len, file, line);
  316|      0|        return NULL;
  317|      0|    }
  318|       |
  319|       |    /* Can't shrink the buffer since memcpy below copies |old_len| bytes. */
  320|   293k|    if (num < old_len) {
  ------------------
  |  Branch (320:9): [True: 0, False: 293k]
  ------------------
  321|      0|        OPENSSL_cleanse((char*)str + num, old_len - num);
  322|      0|        return str;
  323|      0|    }
  324|       |
  325|   293k|    ret = CRYPTO_malloc(num, file, line);
  326|   293k|    if (ret != NULL) {
  ------------------
  |  Branch (326:9): [True: 293k, False: 0]
  ------------------
  327|   293k|        memcpy(ret, str, old_len);
  328|   293k|        CRYPTO_clear_free(str, old_len, file, line);
  329|   293k|    }
  330|   293k|    return ret;
  331|   293k|}
CRYPTO_free:
  334|  31.3M|{
  335|  31.3M|    INCREMENT(free_count);
  336|  31.3M|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (336:9): [True: 0, False: 31.3M]
  ------------------
  337|      0|        free_impl(str, file, line);
  338|      0|        return;
  339|      0|    }
  340|       |
  341|  31.3M|    free(str);
  342|  31.3M|}
CRYPTO_clear_free:
  345|  2.32M|{
  346|  2.32M|    if (str == NULL)
  ------------------
  |  Branch (346:9): [True: 81.2k, False: 2.24M]
  ------------------
  347|  81.2k|        return;
  348|  2.24M|    if (num)
  ------------------
  |  Branch (348:9): [True: 2.24M, False: 0]
  ------------------
  349|  2.24M|        OPENSSL_cleanse(str, num);
  350|  2.24M|    CRYPTO_free(str, file, line);
  351|  2.24M|}

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|      2|{
  156|      2|#ifndef OPENSSL_NO_SECURE_MEMORY
  157|      2|    void *ret = NULL;
  158|      2|    size_t actual_size;
  159|      2|    int reason = CRYPTO_R_SECURE_MALLOC_FAILURE;
  ------------------
  |  |   47|      2|# define CRYPTO_R_SECURE_MALLOC_FAILURE                   111
  ------------------
  160|       |
  161|      2|    if (!secure_mem_initialized) {
  ------------------
  |  Branch (161:9): [True: 2, False: 0]
  ------------------
  162|      2|        return CRYPTO_malloc(num, file, line);
  163|      2|    }
  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|      6|{
  220|      6|#ifndef OPENSSL_NO_SECURE_MEMORY
  221|      6|    size_t actual_size;
  222|       |
  223|      6|    if (ptr == NULL)
  ------------------
  |  Branch (223:9): [True: 1, False: 5]
  ------------------
  224|      1|        return;
  225|      5|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (225:9): [True: 5, False: 0]
  ------------------
  226|      5|        OPENSSL_cleanse(ptr, num);
  227|      5|        CRYPTO_free(ptr, file, line);
  228|      5|        return;
  229|      5|    }
  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|      5|{
  247|      5|#ifndef OPENSSL_NO_SECURE_MEMORY
  248|      5|    if (!secure_mem_initialized)
  ------------------
  |  Branch (248:9): [True: 5, False: 0]
  ------------------
  249|      5|        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|      5|}
mem_sec.c:sh_done:
  599|      2|{
  600|      2|    OPENSSL_free(sh.freelist);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  601|      2|    OPENSSL_free(sh.bittable);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  602|      2|    OPENSSL_free(sh.bitmalloc);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  603|      2|#if !defined(_WIN32)
  604|      2|    if (sh.map_result != MAP_FAILED && sh.map_size)
  ------------------
  |  Branch (604:9): [True: 2, False: 0]
  |  Branch (604:40): [True: 0, False: 2]
  ------------------
  605|      0|        munmap(sh.map_result, sh.map_size);
  606|       |#else
  607|       |    if (sh.map_result != NULL && sh.map_size)
  608|       |        VirtualFree(sh.map_result, 0, MEM_RELEASE);
  609|       |#endif
  610|      2|    memset(&sh, 0, sizeof(sh));
  611|      2|}

CRYPTO_ctr128_encrypt_ctr32:
  155|  20.5k|{
  156|  20.5k|    unsigned int n, ctr32;
  157|       |
  158|  20.5k|   n = *num;
  159|       |
  160|  20.5k|    while (n && len) {
  ------------------
  |  Branch (160:12): [True: 0, False: 20.5k]
  |  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|  20.5k|    ctr32 = GETU32(ivec + 12);
  ------------------
  |  |  103|  20.5k|# define GETU32(p)       ((u32)(p)[0]<<24|(u32)(p)[1]<<16|(u32)(p)[2]<<8|(u32)(p)[3])
  ------------------
  167|  39.9k|    while (len >= 16) {
  ------------------
  |  Branch (167:12): [True: 19.3k, False: 20.5k]
  ------------------
  168|  19.3k|        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|  19.3k|        if (sizeof(size_t) > sizeof(unsigned int) && blocks > (1U << 28))
  ------------------
  |  Branch (174:13): [Folded - Ignored]
  |  Branch (174:54): [True: 0, False: 19.3k]
  ------------------
  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|  19.3k|        ctr32 += (u32)blocks;
  183|  19.3k|        if (ctr32 < blocks) {
  ------------------
  |  Branch (183:13): [True: 0, False: 19.3k]
  ------------------
  184|      0|            blocks -= ctr32;
  185|      0|            ctr32 = 0;
  186|      0|        }
  187|  19.3k|        (*func) (in, out, blocks, key, ivec);
  188|       |        /* (*ctr) does not update ivec, caller does: */
  189|  19.3k|        PUTU32(ivec + 12, ctr32);
  ------------------
  |  |  104|  19.3k|# 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|  19.3k|        if (ctr32 == 0)
  ------------------
  |  Branch (191:13): [True: 0, False: 19.3k]
  ------------------
  192|      0|            ctr96_inc(ivec);
  193|  19.3k|        blocks *= 16;
  194|  19.3k|        len -= blocks;
  195|  19.3k|        out += blocks;
  196|  19.3k|        in += blocks;
  197|  19.3k|    }
  198|  20.5k|    if (len) {
  ------------------
  |  Branch (198:9): [True: 20.5k, False: 2]
  ------------------
  199|  20.5k|        memset(ecount_buf, 0, 16);
  200|  20.5k|        (*func) (ecount_buf, ecount_buf, 1, key, ivec);
  201|  20.5k|        ++ctr32;
  202|  20.5k|        PUTU32(ivec + 12, ctr32);
  ------------------
  |  |  104|  20.5k|# define PUTU32(p,v)     ((p)[0]=(u8)((v)>>24),(p)[1]=(u8)((v)>>16),(p)[2]=(u8)((v)>>8),(p)[3]=(u8)(v))
  ------------------
  203|  20.5k|        if (ctr32 == 0)
  ------------------
  |  Branch (203:13): [True: 0, False: 20.5k]
  ------------------
  204|      0|            ctr96_inc(ivec);
  205|   190k|        while (len--) {
  ------------------
  |  Branch (205:16): [True: 169k, False: 20.5k]
  ------------------
  206|   169k|            out[n] = in[n] ^ ecount_buf[n];
  207|   169k|            ++n;
  208|   169k|        }
  209|  20.5k|    }
  210|       |
  211|  20.5k|    *num = n;
  212|  20.5k|}

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

CRYPTO_strdup:
   22|  2.81k|{
   23|  2.81k|    char *ret;
   24|       |
   25|  2.81k|    if (str == NULL)
  ------------------
  |  Branch (25:9): [True: 0, False: 2.81k]
  ------------------
   26|      0|        return NULL;
   27|  2.81k|    ret = CRYPTO_malloc(strlen(str) + 1, file, line);
   28|  2.81k|    if (ret != NULL)
  ------------------
  |  Branch (28:9): [True: 2.81k, False: 0]
  ------------------
   29|  2.81k|        strcpy(ret, str);
   30|  2.81k|    return ret;
   31|  2.81k|}
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|   524k|{
   53|   524k|    void *ret;
   54|       |
   55|   524k|    if (data == NULL || siz >= INT_MAX)
  ------------------
  |  Branch (55:9): [True: 0, False: 524k]
  |  Branch (55:25): [True: 0, False: 524k]
  ------------------
   56|      0|        return NULL;
   57|       |
   58|   524k|    ret = CRYPTO_malloc(siz, file, line);
   59|   524k|    if (ret == NULL)
  ------------------
  |  Branch (59:9): [True: 0, False: 524k]
  ------------------
   60|      0|        return NULL;
   61|   524k|    return memcpy(ret, data, siz);
   62|   524k|}
OPENSSL_strnlen:
   65|   125k|{
   66|   125k|    const char *p;
   67|       |
   68|  1.27M|    for (p = str; maxlen-- != 0 && *p != CH_ZERO; ++p) ;
  ------------------
  |  |   19|  1.27M|#define CH_ZERO '\0'
  ------------------
  |  Branch (68:19): [True: 1.27M, False: 444]
  |  Branch (68:36): [True: 1.14M, False: 124k]
  ------------------
   69|       |
   70|   125k|    return p - str;
   71|   125k|}
OPENSSL_strlcpy:
   74|   316k|{
   75|   316k|    size_t l = 0;
   76|  3.66M|    for (; size > 1 && *src; size--) {
  ------------------
  |  Branch (76:12): [True: 3.66M, False: 1.64k]
  |  Branch (76:24): [True: 3.34M, False: 315k]
  ------------------
   77|  3.34M|        *dst++ = *src++;
   78|  3.34M|        l++;
   79|  3.34M|    }
   80|   316k|    if (size)
  ------------------
  |  Branch (80:9): [True: 315k, False: 841]
  ------------------
   81|   315k|        *dst = CH_ZERO;
  ------------------
  |  |   19|   315k|#define CH_ZERO '\0'
  ------------------
   82|   316k|    return l + strlen(src);
   83|   316k|}
OPENSSL_strlcat:
   86|   224k|{
   87|   224k|    size_t l = 0;
   88|  2.76M|    for (; size > 0 && *dst; size--, dst++)
  ------------------
  |  Branch (88:12): [True: 2.76M, False: 0]
  |  Branch (88:24): [True: 2.53M, False: 224k]
  ------------------
   89|  2.53M|        l++;
   90|   224k|    return l + OPENSSL_strlcpy(dst, src, size);
   91|   224k|}
OPENSSL_strcasecmp:
  410|   564k|{
  411|   564k|    int t;
  412|       |
  413|  4.52M|    while ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) == 0)
  ------------------
  |  Branch (413:12): [True: 4.40M, False: 112k]
  ------------------
  414|  4.40M|        if (*s1++ == '\0')
  ------------------
  |  Branch (414:13): [True: 451k, False: 3.95M]
  ------------------
  415|   451k|            return 0;
  416|   112k|    return t;
  417|   564k|}
OPENSSL_strncasecmp:
  420|  31.9k|{
  421|  31.9k|    int t;
  422|  31.9k|    size_t i;
  423|       |
  424|  96.1k|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (424:17): [True: 64.2k, False: 31.9k]
  ------------------
  425|  64.2k|        if ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) != 0)
  ------------------
  |  Branch (425:13): [True: 72, False: 64.1k]
  ------------------
  426|     72|            return t;
  427|  64.1k|        else if (*s1++ == '\0')
  ------------------
  |  Branch (427:18): [True: 0, False: 64.1k]
  ------------------
  428|      0|            return 0;
  429|  31.9k|    return 0;
  430|  31.9k|}

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));
  ------------------
  |  |  102|    424|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    424|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|    182|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    182|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|    242|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    242|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    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:
  319|  1.77M|{
  320|  1.77M|    ADDED_OBJ ad, *adp = NULL;
  321|  1.77M|    ASN1_OBJECT ob;
  322|       |
  323|  1.77M|    if (n == NID_undef
  ------------------
  |  |   18|  3.55M|#define NID_undef                       0
  ------------------
  |  Branch (323:9): [True: 1.30M, False: 468k]
  ------------------
  324|  1.77M|        || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  | 1188|   936k|#define NUM_NID 1321
  ------------------
                      || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  |   18|   468k|#define NID_undef                       0
  ------------------
  |  Branch (324:13): [True: 468k, False: 0]
  |  Branch (324:22): [True: 468k, False: 0]
  |  Branch (324:37): [True: 468k, False: 0]
  ------------------
  325|  1.77M|        return (ASN1_OBJECT *)&(nid_objs[n]);
  326|       |
  327|      0|    ad.type = ADDED_NID;
  ------------------
  |  |   33|      0|#define ADDED_NID       3
  ------------------
  328|      0|    ad.obj = &ob;
  329|      0|    ob.nid = n;
  330|      0|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (330:9): [True: 0, False: 0]
  ------------------
  331|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  332|      0|        return NULL;
  333|      0|    }
  334|      0|    if (added != NULL)
  ------------------
  |  Branch (334:9): [True: 0, False: 0]
  ------------------
  335|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  336|      0|    ossl_obj_unlock(1);
  337|      0|    if (adp != NULL)
  ------------------
  |  Branch (337:9): [True: 0, False: 0]
  ------------------
  338|      0|        return adp->obj;
  339|       |
  340|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  341|      0|    return NULL;
  342|      0|}
OBJ_nid2sn:
  345|  40.5k|{
  346|  40.5k|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  347|       |
  348|  40.5k|    return ob == NULL ? NULL : ob->sn;
  ------------------
  |  Branch (348:12): [True: 0, False: 40.5k]
  ------------------
  349|  40.5k|}
OBJ_nid2ln:
  352|  73.3k|{
  353|  73.3k|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  354|       |
  355|  73.3k|    return ob == NULL ? NULL : ob->ln;
  ------------------
  |  Branch (355:12): [True: 0, False: 73.3k]
  ------------------
  356|  73.3k|}
OBJ_obj2txt:
  457|  76.6k|{
  458|  76.6k|    int i, n = 0, len, nid, first, use_bn;
  459|  76.6k|    BIGNUM *bl;
  460|  76.6k|    unsigned long l;
  461|  76.6k|    const unsigned char *p;
  462|  76.6k|    char tbuf[DECIMAL_SIZE(i) + DECIMAL_SIZE(l) + 2];
  463|  76.6k|    const char *s;
  464|       |
  465|       |    /* Ensure that, at every state, |buf| is NUL-terminated. */
  466|  76.6k|    if (buf != NULL && buf_len > 0)
  ------------------
  |  Branch (466:9): [True: 76.6k, False: 0]
  |  Branch (466:24): [True: 76.6k, False: 0]
  ------------------
  467|  76.6k|        buf[0] = '\0';
  468|       |
  469|  76.6k|    if (a == NULL || a->data == NULL)
  ------------------
  |  Branch (469:9): [True: 0, False: 76.6k]
  |  Branch (469:22): [True: 1, False: 76.6k]
  ------------------
  470|      1|        return 0;
  471|       |
  472|  76.6k|    if (!no_name && (nid = OBJ_obj2nid(a)) != NID_undef) {
  ------------------
  |  |   18|  76.4k|#define NID_undef                       0
  ------------------
  |  Branch (472:9): [True: 76.4k, False: 209]
  |  Branch (472:21): [True: 72.9k, False: 3.47k]
  ------------------
  473|  72.9k|        s = OBJ_nid2ln(nid);
  474|  72.9k|        if (s == NULL)
  ------------------
  |  Branch (474:13): [True: 0, False: 72.9k]
  ------------------
  475|      0|            s = OBJ_nid2sn(nid);
  476|  72.9k|        if (s != NULL) {
  ------------------
  |  Branch (476:13): [True: 72.9k, False: 0]
  ------------------
  477|  72.9k|            if (buf != NULL)
  ------------------
  |  Branch (477:17): [True: 72.9k, False: 0]
  ------------------
  478|  72.9k|                OPENSSL_strlcpy(buf, s, buf_len);
  479|  72.9k|            return (int)strlen(s);
  480|  72.9k|        }
  481|  72.9k|    }
  482|       |
  483|  3.68k|    len = a->length;
  484|  3.68k|    p = a->data;
  485|       |
  486|  3.68k|    first = 1;
  487|  3.68k|    bl = NULL;
  488|       |
  489|       |    /*
  490|       |     * RFC 2578 (STD 58) says this about OBJECT IDENTIFIERs:
  491|       |     *
  492|       |     * > 3.5. OBJECT IDENTIFIER values
  493|       |     * >
  494|       |     * > An OBJECT IDENTIFIER value is an ordered list of non-negative
  495|       |     * > numbers. For the SMIv2, each number in the list is referred to as a
  496|       |     * > sub-identifier, there are at most 128 sub-identifiers in a value,
  497|       |     * > and each sub-identifier has a maximum value of 2^32-1 (4294967295
  498|       |     * > decimal).
  499|       |     *
  500|       |     * So a legitimate OID according to this RFC is at most (32 * 128 / 7),
  501|       |     * i.e. 586 bytes long.
  502|       |     *
  503|       |     * Ref: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5
  504|       |     */
  505|  3.68k|    if (len > 586)
  ------------------
  |  Branch (505:9): [True: 0, False: 3.68k]
  ------------------
  506|      0|        goto err;
  507|       |
  508|  33.5k|    while (len > 0) {
  ------------------
  |  Branch (508:12): [True: 29.8k, False: 3.68k]
  ------------------
  509|  29.8k|        l = 0;
  510|  29.8k|        use_bn = 0;
  511|  91.9k|        for (;;) {
  512|  91.9k|            unsigned char c = *p++;
  513|       |
  514|  91.9k|            len--;
  515|  91.9k|            if (len == 0 && (c & 0x80) != 0)
  ------------------
  |  Branch (515:17): [True: 3.68k, False: 88.2k]
  |  Branch (515:29): [True: 0, False: 3.68k]
  ------------------
  516|      0|                goto err;
  517|  91.9k|            if (use_bn) {
  ------------------
  |  Branch (517:17): [True: 32.9k, False: 58.9k]
  ------------------
  518|  32.9k|                if (!BN_add_word(bl, c & 0x7f))
  ------------------
  |  Branch (518:21): [True: 0, False: 32.9k]
  ------------------
  519|      0|                    goto err;
  520|  58.9k|            } else {
  521|  58.9k|                l |= c & 0x7f;
  522|  58.9k|            }
  523|  91.9k|            if ((c & 0x80) == 0)
  ------------------
  |  Branch (523:17): [True: 29.8k, False: 62.0k]
  ------------------
  524|  29.8k|                break;
  525|  62.0k|            if (!use_bn && l > (ULONG_MAX >> 7L)) {
  ------------------
  |  Branch (525:17): [True: 31.2k, False: 30.7k]
  |  Branch (525:28): [True: 2.17k, False: 29.1k]
  ------------------
  526|  2.17k|                if (bl == NULL && (bl = BN_new()) == NULL)
  ------------------
  |  Branch (526:21): [True: 781, False: 1.39k]
  |  Branch (526:35): [True: 0, False: 781]
  ------------------
  527|      0|                    goto err;
  528|  2.17k|                if (!BN_set_word(bl, l))
  ------------------
  |  Branch (528:21): [True: 0, False: 2.17k]
  ------------------
  529|      0|                    goto err;
  530|  2.17k|                use_bn = 1;
  531|  2.17k|            }
  532|  62.0k|            if (use_bn) {
  ------------------
  |  Branch (532:17): [True: 32.9k, False: 29.1k]
  ------------------
  533|  32.9k|                if (!BN_lshift(bl, bl, 7))
  ------------------
  |  Branch (533:21): [True: 0, False: 32.9k]
  ------------------
  534|      0|                    goto err;
  535|  32.9k|            } else {
  536|  29.1k|                l <<= 7L;
  537|  29.1k|            }
  538|  62.0k|        }
  539|       |
  540|  29.8k|        if (first) {
  ------------------
  |  Branch (540:13): [True: 3.68k, False: 26.1k]
  ------------------
  541|  3.68k|            first = 0;
  542|  3.68k|            if (l >= 80) {
  ------------------
  |  Branch (542:17): [True: 1.02k, False: 2.65k]
  ------------------
  543|  1.02k|                i = 2;
  544|  1.02k|                if (use_bn) {
  ------------------
  |  Branch (544:21): [True: 662, False: 366]
  ------------------
  545|    662|                    if (!BN_sub_word(bl, 80))
  ------------------
  |  Branch (545:25): [True: 0, False: 662]
  ------------------
  546|      0|                        goto err;
  547|    662|                } else {
  548|    366|                    l -= 80;
  549|    366|                }
  550|  2.65k|            } else {
  551|  2.65k|                i = (int)(l / 40);
  552|  2.65k|                l -= (long)(i * 40);
  553|  2.65k|            }
  554|  3.68k|            if (buf != NULL && buf_len > 1) {
  ------------------
  |  Branch (554:17): [True: 3.68k, False: 0]
  |  Branch (554:32): [True: 3.68k, False: 0]
  ------------------
  555|  3.68k|                *buf++ = i + '0';
  556|  3.68k|                *buf = '\0';
  557|  3.68k|                buf_len--;
  558|  3.68k|            }
  559|  3.68k|            n++;
  560|  3.68k|        }
  561|       |
  562|  29.8k|        if (use_bn) {
  ------------------
  |  Branch (562:13): [True: 2.17k, False: 27.6k]
  ------------------
  563|  2.17k|            char *bndec;
  564|  2.17k|            bndec = BN_bn2dec(bl);
  565|  2.17k|            if (!bndec)
  ------------------
  |  Branch (565:17): [True: 0, False: 2.17k]
  ------------------
  566|      0|                goto err;
  567|  2.17k|            i = strlen(bndec);
  568|  2.17k|            if (buf != NULL) {
  ------------------
  |  Branch (568:17): [True: 2.17k, False: 0]
  ------------------
  569|  2.17k|                if (buf_len > 1) {
  ------------------
  |  Branch (569:21): [True: 1.18k, False: 993]
  ------------------
  570|  1.18k|                    *buf++ = '.';
  571|  1.18k|                    *buf = '\0';
  572|  1.18k|                    buf_len--;
  573|  1.18k|                }
  574|  2.17k|                OPENSSL_strlcpy(buf, bndec, buf_len);
  575|  2.17k|                if (i > buf_len) {
  ------------------
  |  Branch (575:21): [True: 1.31k, False: 859]
  ------------------
  576|  1.31k|                    buf += buf_len;
  577|  1.31k|                    buf_len = 0;
  578|  1.31k|                } else {
  579|    859|                    buf += i;
  580|    859|                    buf_len -= i;
  581|    859|                }
  582|  2.17k|            }
  583|  2.17k|            n++;
  584|  2.17k|            n += i;
  585|  2.17k|            OPENSSL_free(bndec);
  ------------------
  |  |  115|  2.17k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.17k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.17k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  586|  27.6k|        } else {
  587|  27.6k|            BIO_snprintf(tbuf, sizeof(tbuf), ".%lu", l);
  588|  27.6k|            i = strlen(tbuf);
  589|  27.6k|            if (buf && buf_len > 0) {
  ------------------
  |  Branch (589:17): [True: 27.6k, False: 0]
  |  Branch (589:24): [True: 16.9k, False: 10.7k]
  ------------------
  590|  16.9k|                OPENSSL_strlcpy(buf, tbuf, buf_len);
  591|  16.9k|                if (i > buf_len) {
  ------------------
  |  Branch (591:21): [True: 99, False: 16.8k]
  ------------------
  592|     99|                    buf += buf_len;
  593|     99|                    buf_len = 0;
  594|  16.8k|                } else {
  595|  16.8k|                    buf += i;
  596|  16.8k|                    buf_len -= i;
  597|  16.8k|                }
  598|  16.9k|            }
  599|  27.6k|            n += i;
  600|  27.6k|            l = 0;
  601|  27.6k|        }
  602|  29.8k|    }
  603|       |
  604|  3.68k|    BN_free(bl);
  605|  3.68k|    return n;
  606|       |
  607|      0| err:
  608|      0|    BN_free(bl);
  609|      0|    return -1;
  610|  3.68k|}
OBJ_ln2nid:
  625|     16|{
  626|     16|    ASN1_OBJECT o;
  627|     16|    const ASN1_OBJECT *oo = &o;
  628|     16|    ADDED_OBJ ad, *adp;
  629|     16|    const unsigned int *op;
  630|     16|    int nid = NID_undef;
  ------------------
  |  |   18|     16|#define NID_undef                       0
  ------------------
  631|       |
  632|     16|    o.ln = s;
  633|     16|    op = OBJ_bsearch_ln(&oo, ln_objs, NUM_LN);
  ------------------
  |  | 3829|     16|#define NUM_LN 1312
  ------------------
  634|     16|    if (op != NULL)
  ------------------
  |  Branch (634:9): [True: 1, False: 15]
  ------------------
  635|      1|        return nid_objs[*op].nid;
  636|     15|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (636:9): [True: 0, False: 15]
  ------------------
  637|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  638|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  639|      0|    }
  640|     15|    if (added != NULL) {
  ------------------
  |  Branch (640:9): [True: 0, False: 15]
  ------------------
  641|      0|        ad.type = ADDED_LNAME;
  ------------------
  |  |   32|      0|#define ADDED_LNAME     2
  ------------------
  642|      0|        ad.obj = &o;
  643|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  644|      0|        if (adp != NULL)
  ------------------
  |  Branch (644:13): [True: 0, False: 0]
  ------------------
  645|      0|            nid = adp->obj->nid;
  646|      0|    }
  647|     15|    ossl_obj_unlock(1);
  648|     15|    return nid;
  649|     15|}
OBJ_sn2nid:
  652|     18|{
  653|     18|    ASN1_OBJECT o;
  654|     18|    const ASN1_OBJECT *oo = &o;
  655|     18|    ADDED_OBJ ad, *adp;
  656|     18|    const unsigned int *op;
  657|     18|    int nid = NID_undef;
  ------------------
  |  |   18|     18|#define NID_undef                       0
  ------------------
  658|       |
  659|     18|    o.sn = s;
  660|     18|    op = OBJ_bsearch_sn(&oo, sn_objs, NUM_SN);
  ------------------
  |  | 2513|     18|#define NUM_SN 1312
  ------------------
  661|     18|    if (op != NULL)
  ------------------
  |  Branch (661:9): [True: 7, False: 11]
  ------------------
  662|      7|        return nid_objs[*op].nid;
  663|     11|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (663:9): [True: 0, False: 11]
  ------------------
  664|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  665|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  666|      0|    }
  667|     11|    if (added != NULL) {
  ------------------
  |  Branch (667:9): [True: 0, False: 11]
  ------------------
  668|      0|        ad.type = ADDED_SNAME;
  ------------------
  |  |   31|      0|#define ADDED_SNAME     1
  ------------------
  669|      0|        ad.obj = &o;
  670|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  671|      0|        if (adp != NULL)
  ------------------
  |  Branch (671:13): [True: 0, False: 0]
  ------------------
  672|      0|            nid = adp->obj->nid;
  673|      0|    }
  674|     11|    ossl_obj_unlock(1);
  675|     11|    return nid;
  676|     11|}
OBJ_bsearch_:
  680|  1.00M|{
  681|  1.00M|    return OBJ_bsearch_ex_(key, base, num, size, cmp, 0);
  682|  1.00M|}
OBJ_bsearch_ex_:
  688|  1.00M|{
  689|  1.00M|    const char *p = ossl_bsearch(key, base, num, size, cmp, flags);
  690|       |
  691|       |#ifdef CHARSET_EBCDIC
  692|       |    /*
  693|       |     * THIS IS A KLUDGE - Because the *_obj is sorted in ASCII order, and I
  694|       |     * don't have perl (yet), we revert to a *LINEAR* search when the object
  695|       |     * wasn't found in the binary search.
  696|       |     */
  697|       |    if (p == NULL) {
  698|       |        const char *base_ = base;
  699|       |        int l, h, i = 0, c = 0;
  700|       |        char *p1;
  701|       |
  702|       |        for (i = 0; i < num; ++i) {
  703|       |            p1 = &(base_[i * size]);
  704|       |            c = (*cmp) (key, p1);
  705|       |            if (c == 0
  706|       |                || (c < 0 && (flags & OBJ_BSEARCH_VALUE_ON_NOMATCH)))
  707|       |                return p1;
  708|       |        }
  709|       |    }
  710|       |#endif
  711|  1.00M|    return p;
  712|  1.00M|}
OBJ_length:
  832|  32.1k|{
  833|  32.1k|    if (obj == NULL)
  ------------------
  |  Branch (833:9): [True: 0, False: 32.1k]
  ------------------
  834|      0|        return 0;
  835|  32.1k|    return obj->length;
  836|  32.1k|}
OBJ_get0_data:
  839|    159|{
  840|    159|    if (obj == NULL)
  ------------------
  |  Branch (840:9): [True: 0, False: 159]
  ------------------
  841|      0|        return NULL;
  842|    159|    return obj->data;
  843|    159|}
OBJ_obj2nid:
  851|  1.37M|{
  852|  1.37M|    return ossl_obj_obj2nid(a, 1);
  853|  1.37M|}
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|   565k|{
   94|   565k|    if (!lock)
  ------------------
  |  Branch (94:9): [True: 0, False: 565k]
  ------------------
   95|      0|        return 1;
   96|   565k|    if (!ossl_init_added_lock())
  ------------------
  |  Branch (96:9): [True: 0, False: 565k]
  ------------------
   97|      0|        return 0;
   98|   565k|    return CRYPTO_THREAD_read_lock(ossl_obj_lock);
   99|   565k|}
obj_dat.c:ossl_init_added_lock:
   75|   565k|{
   76|   565k|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   77|       |    /* Make sure we've loaded config before checking for any "added" objects */
   78|   565k|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  468|   565k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
   79|   565k|#endif
   80|   565k|    return RUN_ONCE(&ossl_obj_lock_init, obj_lock_initialise);
  ------------------
  |  |  130|   565k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 565k, False: 0]
  |  |  ------------------
  ------------------
   81|   565k|}
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|   565k|{
  103|   565k|    if (lock)
  ------------------
  |  Branch (103:9): [True: 565k, False: 0]
  ------------------
  104|   565k|        CRYPTO_THREAD_unlock(ossl_obj_lock);
  105|   565k|}
obj_dat.c:ln_cmp:
  115|    170|{
  116|    170|    return strcmp((*a)->ln, nid_objs[*b].ln);
  117|    170|}
obj_dat.c:sn_cmp:
  108|    184|{
  109|    184|    return strcmp((*a)->sn, nid_objs[*b].sn);
  110|    184|}
obj_dat.c:ossl_obj_obj2nid:
  375|  1.37M|{
  376|  1.37M|    int nid = NID_undef;
  ------------------
  |  |   18|  1.37M|#define NID_undef                       0
  ------------------
  377|  1.37M|    const unsigned int *op;
  378|  1.37M|    ADDED_OBJ ad, *adp;
  379|       |
  380|  1.37M|    if (a == NULL)
  ------------------
  |  Branch (380:9): [True: 0, False: 1.37M]
  ------------------
  381|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  382|  1.37M|    if (a->nid != NID_undef)
  ------------------
  |  |   18|  1.37M|#define NID_undef                       0
  ------------------
  |  Branch (382:9): [True: 482k, False: 888k]
  ------------------
  383|   482k|        return a->nid;
  384|   888k|    if (a->length == 0)
  ------------------
  |  Branch (384:9): [True: 0, False: 888k]
  ------------------
  385|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  386|       |
  387|   888k|    op = OBJ_bsearch_obj(&a, obj_objs, NUM_OBJ);
  ------------------
  |  | 5145|   888k|#define NUM_OBJ 1178
  ------------------
  388|   888k|    if (op != NULL)
  ------------------
  |  Branch (388:9): [True: 322k, False: 565k]
  ------------------
  389|   322k|        return nid_objs[*op].nid;
  390|   565k|    if (!ossl_obj_read_lock(lock)) {
  ------------------
  |  Branch (390:9): [True: 0, False: 565k]
  ------------------
  391|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  392|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  393|      0|    }
  394|   565k|    if (added != NULL) {
  ------------------
  |  Branch (394:9): [True: 0, False: 565k]
  ------------------
  395|      0|        ad.type = ADDED_DATA;
  ------------------
  |  |   30|      0|#define ADDED_DATA      0
  ------------------
  396|      0|        ad.obj = (ASN1_OBJECT *)a; /* casting away const is harmless here */
  397|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  398|      0|        if (adp != NULL)
  ------------------
  |  Branch (398:13): [True: 0, False: 0]
  ------------------
  399|      0|            nid = adp->obj->nid;
  400|      0|    }
  401|   565k|    ossl_obj_unlock(lock);
  402|   565k|    return nid;
  403|   565k|}
obj_dat.c:obj_cmp:
  359|  8.47M|{
  360|  8.47M|    int j;
  361|  8.47M|    const ASN1_OBJECT *a = *ap;
  362|  8.47M|    const ASN1_OBJECT *b = &nid_objs[*bp];
  363|       |
  364|  8.47M|    j = (a->length - b->length);
  365|  8.47M|    if (j)
  ------------------
  |  Branch (365:9): [True: 4.72M, False: 3.74M]
  ------------------
  366|  4.72M|        return j;
  367|  3.74M|    if (a->length == 0)
  ------------------
  |  Branch (367:9): [True: 0, False: 3.74M]
  ------------------
  368|      0|        return 0;
  369|  3.74M|    return memcmp(a->data, b->data, a->length);
  370|  3.74M|}

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

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|   127k|{
   21|   127k|    if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
  ------------------
  |  Branch (21:9): [True: 0, False: 127k]
  ------------------
   22|      0|        return 0;
   23|       |
   24|   127k|    pkt->written += len;
   25|   127k|    pkt->curr += len;
   26|   127k|    return 1;
   27|   127k|}
WPACKET_reserve_bytes:
   47|   127k|{
   48|       |    /* Internal API, so should not fail */
   49|   127k|    if (!ossl_assert(pkt->subs != NULL && len != 0))
  ------------------
  |  |   52|   255k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 127k, False: 0]
  |  |  |  Branch (52:43): [True: 127k, False: 0]
  |  |  ------------------
  |  |   53|   127k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (49:9): [True: 0, False: 127k]
  ------------------
   50|      0|        return 0;
   51|       |
   52|   127k|    if (pkt->maxsize - pkt->written < len)
  ------------------
  |  Branch (52:9): [True: 0, False: 127k]
  ------------------
   53|      0|        return 0;
   54|       |
   55|   127k|    if (pkt->buf != NULL && (pkt->buf->length - pkt->written < len)) {
  ------------------
  |  Branch (55:9): [True: 0, False: 127k]
  |  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|   127k|    if (allocbytes != NULL) {
  ------------------
  |  Branch (71:9): [True: 127k, False: 0]
  ------------------
   72|   127k|        *allocbytes = WPACKET_get_curr(pkt);
   73|   127k|        if (pkt->endfirst && *allocbytes != NULL)
  ------------------
  |  Branch (73:13): [True: 0, False: 127k]
  |  Branch (73:30): [True: 0, False: 0]
  ------------------
   74|      0|            *allocbytes -= len;
   75|   127k|    }
   76|       |
   77|   127k|    return 1;
   78|   127k|}
WPACKET_init_null:
  180|  15.9k|{
  181|  15.9k|    pkt->staticbuf = NULL;
  182|  15.9k|    pkt->buf = NULL;
  183|  15.9k|    pkt->maxsize = maxmaxsize(lenbytes);
  184|  15.9k|    pkt->endfirst = 0;
  185|       |
  186|  15.9k|    return wpacket_intern_init_len(pkt, 0);
  187|  15.9k|}
WPACKET_close:
  335|  47.7k|{
  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|  47.7k|    if (pkt->subs == NULL || pkt->subs->parent == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 47.7k]
  |  Branch (340:30): [True: 0, False: 47.7k]
  ------------------
  341|      0|        return 0;
  342|       |
  343|  47.7k|    return wpacket_intern_close(pkt, pkt->subs, 1);
  344|  47.7k|}
WPACKET_finish:
  347|  15.9k|{
  348|  15.9k|    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|  15.9k|    if (pkt->subs == NULL || pkt->subs->parent != NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 15.9k]
  |  Branch (354:30): [True: 0, False: 15.9k]
  ------------------
  355|      0|        return 0;
  356|       |
  357|  15.9k|    ret = wpacket_intern_close(pkt, pkt->subs, 1);
  358|  15.9k|    if (ret) {
  ------------------
  |  Branch (358:9): [True: 15.9k, False: 0]
  ------------------
  359|  15.9k|        OPENSSL_free(pkt->subs);
  ------------------
  |  |  115|  15.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  15.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  15.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  360|  15.9k|        pkt->subs = NULL;
  361|  15.9k|    }
  362|       |
  363|  15.9k|    return ret;
  364|  15.9k|}
WPACKET_start_sub_packet_len__:
  367|  47.7k|{
  368|  47.7k|    WPACKET_SUB *sub;
  369|  47.7k|    unsigned char *lenchars;
  370|       |
  371|       |    /* Internal API, so should not fail */
  372|  47.7k|    if (!ossl_assert(pkt->subs != NULL))
  ------------------
  |  |   52|  47.7k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  47.7k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (372:9): [True: 0, False: 47.7k]
  ------------------
  373|      0|        return 0;
  374|       |
  375|       |    /* We don't support lenbytes greater than 0 when doing endfirst writing */
  376|  47.7k|    if (lenbytes > 0 && pkt->endfirst)
  ------------------
  |  Branch (376:9): [True: 0, False: 47.7k]
  |  Branch (376:25): [True: 0, False: 0]
  ------------------
  377|      0|        return 0;
  378|       |
  379|  47.7k|    if ((sub = OPENSSL_zalloc(sizeof(*sub))) == NULL)
  ------------------
  |  |  104|  47.7k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  47.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  47.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (379:9): [True: 0, False: 47.7k]
  ------------------
  380|      0|        return 0;
  381|       |
  382|  47.7k|    sub->parent = pkt->subs;
  383|  47.7k|    pkt->subs = sub;
  384|  47.7k|    sub->pwritten = pkt->written + lenbytes;
  385|  47.7k|    sub->lenbytes = lenbytes;
  386|       |
  387|  47.7k|    if (lenbytes == 0) {
  ------------------
  |  Branch (387:9): [True: 47.7k, False: 0]
  ------------------
  388|  47.7k|        sub->packet_len = 0;
  389|  47.7k|        return 1;
  390|  47.7k|    }
  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|  47.7k|{
  402|  47.7k|    return WPACKET_start_sub_packet_len__(pkt, 0);
  403|  47.7k|}
WPACKET_put_bytes__:
  406|  95.7k|{
  407|  95.7k|    unsigned char *data;
  408|       |
  409|       |    /* Internal API, so should not fail */
  410|  95.7k|    if (!ossl_assert(size <= sizeof(uint64_t))
  ------------------
  |  |   52|   191k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   191k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (410:9): [True: 0, False: 95.7k]
  ------------------
  411|  95.7k|            || !WPACKET_allocate_bytes(pkt, size, &data)
  ------------------
  |  Branch (411:16): [True: 0, False: 95.7k]
  ------------------
  412|  95.7k|            || !put_value(data, val, size))
  ------------------
  |  Branch (412:16): [True: 0, False: 95.7k]
  ------------------
  413|      0|        return 0;
  414|       |
  415|  95.7k|    return 1;
  416|  95.7k|}
WPACKET_get_total_written:
  487|  15.9k|{
  488|       |    /* Internal API, so should not fail */
  489|  15.9k|    if (!ossl_assert(written != NULL))
  ------------------
  |  |   52|  15.9k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  15.9k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (489:9): [True: 0, False: 15.9k]
  ------------------
  490|      0|        return 0;
  491|       |
  492|  15.9k|    *written = pkt->written;
  493|       |
  494|  15.9k|    return 1;
  495|  15.9k|}
WPACKET_get_length:
  498|  15.9k|{
  499|       |    /* Internal API, so should not fail */
  500|  15.9k|    if (!ossl_assert(pkt->subs != NULL && len != NULL))
  ------------------
  |  |   52|  31.8k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 15.9k, False: 0]
  |  |  |  Branch (52:43): [True: 15.9k, False: 0]
  |  |  ------------------
  |  |   53|  15.9k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (500:9): [True: 0, False: 15.9k]
  ------------------
  501|      0|        return 0;
  502|       |
  503|  15.9k|    *len = pkt->written - pkt->subs->pwritten;
  504|       |
  505|  15.9k|    return 1;
  506|  15.9k|}
WPACKET_get_curr:
  509|   127k|{
  510|   127k|    unsigned char *buf = GETBUF(pkt);
  ------------------
  |  |   40|   127k|#define GETBUF(p)   (((p)->staticbuf != NULL) \
  |  |  ------------------
  |  |  |  Branch (40:22): [True: 0, False: 127k]
  |  |  ------------------
  |  |   41|   127k|                     ? (p)->staticbuf \
  |  |   42|   127k|                     : ((p)->buf != NULL \
  |  |  ------------------
  |  |  |  Branch (42:25): [True: 0, False: 127k]
  |  |  ------------------
  |  |   43|   127k|                        ? (unsigned char *)(p)->buf->data \
  |  |   44|   127k|                        : NULL))
  ------------------
  511|       |
  512|   127k|    if (buf == NULL)
  ------------------
  |  Branch (512:9): [True: 127k, False: 0]
  ------------------
  513|   127k|        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|  15.9k|{
  523|  15.9k|    return pkt->buf == NULL && pkt->staticbuf == NULL;
  ------------------
  |  Branch (523:12): [True: 15.9k, False: 0]
  |  Branch (523:32): [True: 15.9k, False: 0]
  ------------------
  524|  15.9k|}
packet.c:maxmaxsize:
   96|  15.9k|{
   97|  15.9k|    if (lenbytes >= sizeof(size_t) || lenbytes == 0)
  ------------------
  |  Branch (97:9): [True: 0, False: 15.9k]
  |  Branch (97:39): [True: 15.9k, False: 0]
  ------------------
   98|  15.9k|        return SIZE_MAX;
   99|       |
  100|      0|    return ((size_t)1 << (lenbytes * 8)) - 1 + lenbytes;
  101|  15.9k|}
packet.c:wpacket_intern_init_len:
  104|  15.9k|{
  105|  15.9k|    unsigned char *lenchars;
  106|       |
  107|  15.9k|    pkt->curr = 0;
  108|  15.9k|    pkt->written = 0;
  109|       |
  110|  15.9k|    if ((pkt->subs = OPENSSL_zalloc(sizeof(*pkt->subs))) == NULL)
  ------------------
  |  |  104|  15.9k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  15.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  15.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (110:9): [True: 0, False: 15.9k]
  ------------------
  111|      0|        return 0;
  112|       |
  113|  15.9k|    if (lenbytes == 0)
  ------------------
  |  Branch (113:9): [True: 15.9k, False: 0]
  ------------------
  114|  15.9k|        return 1;
  115|       |
  116|      0|    pkt->subs->pwritten = lenbytes;
  117|      0|    pkt->subs->lenbytes = lenbytes;
  118|       |
  119|      0|    if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) {
  ------------------
  |  Branch (119:9): [True: 0, False: 0]
  ------------------
  120|      0|        OPENSSL_free(pkt->subs);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|  63.7k|{
  252|  63.7k|    size_t packlen = pkt->written - sub->pwritten;
  253|       |
  254|  63.7k|    if (packlen == 0
  ------------------
  |  Branch (254:9): [True: 0, False: 63.7k]
  ------------------
  255|  63.7k|            && (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|  63.7k|    if (packlen == 0
  ------------------
  |  Branch (258:9): [True: 0, False: 63.7k]
  ------------------
  259|  63.7k|            && 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|  63.7k|    if (sub->lenbytes > 0) {
  ------------------
  |  Branch (276:9): [True: 0, False: 63.7k]
  ------------------
  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|  63.7k|    } else if (pkt->endfirst && sub->parent != NULL
  ------------------
  |  Branch (293:16): [True: 0, False: 63.7k]
  |  Branch (293:33): [True: 0, False: 0]
  ------------------
  294|  63.7k|               && (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|  63.7k|    if (doclose) {
  ------------------
  |  Branch (311:9): [True: 63.7k, False: 0]
  ------------------
  312|  63.7k|        pkt->subs = sub->parent;
  313|  63.7k|        OPENSSL_free(sub);
  ------------------
  |  |  115|  63.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  63.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  63.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  314|  63.7k|    }
  315|       |
  316|  63.7k|    return 1;
  317|  63.7k|}
packet.c:put_value:
  212|  95.7k|{
  213|  95.7k|    if (data == NULL)
  ------------------
  |  Branch (213:9): [True: 95.7k, False: 0]
  ------------------
  214|  95.7k|        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|  71.7k|{
   25|  71.7k|    if (bld != NULL)
  ------------------
  |  Branch (25:9): [True: 0, False: 71.7k]
  ------------------
   26|      0|        return OSSL_PARAM_BLD_push_int(bld, key, num);
   27|  71.7k|    p = OSSL_PARAM_locate(p, key);
   28|  71.7k|    if (p != NULL)
  ------------------
  |  Branch (28:9): [True: 0, False: 71.7k]
  ------------------
   29|      0|        return OSSL_PARAM_set_int(p, num);
   30|  71.7k|    return 1;
   31|  71.7k|}
ossl_param_build_set_utf8_string:
   46|  89.7k|{
   47|  89.7k|    if (bld != NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 89.7k]
  ------------------
   48|      0|        return OSSL_PARAM_BLD_push_utf8_string(bld, key, buf, 0);
   49|  89.7k|    p = OSSL_PARAM_locate(p, key);
   50|  89.7k|    if (p != NULL)
  ------------------
  |  Branch (50:9): [True: 0, False: 89.7k]
  ------------------
   51|      0|        return OSSL_PARAM_set_utf8_string(p, buf);
   52|  89.7k|    return 1;
   53|  89.7k|}
ossl_param_build_set_bn:
   88|    118|{
   89|    118|    if (bld != NULL)
  ------------------
  |  Branch (89:9): [True: 0, False: 118]
  ------------------
   90|      0|        return OSSL_PARAM_BLD_push_BN(bld, key, bn);
   91|       |
   92|    118|    p = OSSL_PARAM_locate(p, key);
   93|    118|    if (p != NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 118]
  ------------------
   94|      0|        return OSSL_PARAM_set_BN(p, bn) > 0;
   95|    118|    return 1;
   96|    118|}

OSSL_PARAM_locate:
   54|   746k|{
   55|   746k|    if (p != NULL && key != NULL)
  ------------------
  |  Branch (55:9): [True: 746k, False: 0]
  |  Branch (55:22): [True: 746k, False: 0]
  ------------------
   56|  2.34M|        for (; p->key != NULL; p++)
  ------------------
  |  Branch (56:16): [True: 1.86M, False: 478k]
  ------------------
   57|  1.86M|            if (strcmp(key, p->key) == 0)
  ------------------
  |  Branch (57:17): [True: 268k, False: 1.59M]
  ------------------
   58|   268k|                return p;
   59|   478k|    return NULL;
   60|   746k|}
OSSL_PARAM_locate_const:
   63|   341k|{
   64|   341k|    return OSSL_PARAM_locate((OSSL_PARAM *)p, key);
   65|   341k|}
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:
  265|      9|{
  266|      9|#ifndef OPENSSL_SMALL_FOOTPRINT
  267|      9|    switch (sizeof(int)) {
  ------------------
  |  Branch (267:13): [Folded - Ignored]
  ------------------
  268|      9|    case sizeof(int32_t):
  ------------------
  |  Branch (268:5): [True: 9, False: 0]
  ------------------
  269|      9|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
  270|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (270:5): [True: 0, False: 9]
  ------------------
  271|      0|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
  272|      9|    }
  273|      0|#endif
  274|      0|    return general_get_int(p, val, sizeof(*val));
  275|      9|}
OSSL_PARAM_set_int:
  278|  48.5k|{
  279|  48.5k|#ifndef OPENSSL_SMALL_FOOTPRINT
  280|  48.5k|    switch (sizeof(int)) {
  ------------------
  |  Branch (280:13): [Folded - Ignored]
  ------------------
  281|  48.5k|    case sizeof(int32_t):
  ------------------
  |  Branch (281:5): [True: 48.5k, False: 0]
  ------------------
  282|  48.5k|        return OSSL_PARAM_set_int32(p, (int32_t)val);
  283|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (283:5): [True: 0, False: 48.5k]
  ------------------
  284|      0|        return OSSL_PARAM_set_int64(p, (int64_t)val);
  285|  48.5k|    }
  286|      0|#endif
  287|      0|    return general_set_int(p, &val, sizeof(val));
  288|  48.5k|}
OSSL_PARAM_construct_int:
  291|   100k|{
  292|   100k|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(int));
  ------------------
  |  |  106|   100k|# define OSSL_PARAM_INTEGER              1
  ------------------
  293|   100k|}
OSSL_PARAM_get_uint:
  296|      2|{
  297|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  298|      2|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (298:13): [Folded - Ignored]
  ------------------
  299|      2|    case sizeof(uint32_t):
  ------------------
  |  Branch (299:5): [True: 2, False: 0]
  ------------------
  300|      2|        return OSSL_PARAM_get_uint32(p, (uint32_t *)val);
  301|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (301:5): [True: 0, False: 2]
  ------------------
  302|      0|        return OSSL_PARAM_get_uint64(p, (uint64_t *)val);
  303|      2|    }
  304|      0|#endif
  305|      0|    return general_get_uint(p, val, sizeof(*val));
  306|      2|}
OSSL_PARAM_set_uint:
  309|  20.7k|{
  310|  20.7k|#ifndef OPENSSL_SMALL_FOOTPRINT
  311|  20.7k|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (311:13): [Folded - Ignored]
  ------------------
  312|  20.7k|    case sizeof(uint32_t):
  ------------------
  |  Branch (312:5): [True: 20.7k, False: 0]
  ------------------
  313|  20.7k|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
  314|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (314:5): [True: 0, False: 20.7k]
  ------------------
  315|      0|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
  316|  20.7k|    }
  317|      0|#endif
  318|      0|    return general_set_uint(p, &val, sizeof(val));
  319|  20.7k|}
OSSL_PARAM_construct_uint:
  322|  20.7k|{
  323|  20.7k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|  20.7k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  324|  20.7k|                                sizeof(unsigned int));
  325|  20.7k|}
OSSL_PARAM_get_int32:
  391|      9|{
  392|      9|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (392:9): [True: 0, False: 9]
  |  Branch (392:24): [True: 0, False: 9]
  ------------------
  393|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  394|      0|        return 0;
  395|      0|    }
  396|       |
  397|      9|    if (p->data == NULL) {
  ------------------
  |  Branch (397:9): [True: 0, False: 9]
  ------------------
  398|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  399|      0|        return 0;
  400|      0|    }
  401|       |
  402|      9|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      9|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (402:9): [True: 2, False: 7]
  ------------------
  403|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  404|      2|        int64_t i64;
  405|       |
  406|      2|        switch (p->data_size) {
  ------------------
  |  Branch (406:17): [True: 0, False: 2]
  ------------------
  407|      2|        case sizeof(int32_t):
  ------------------
  |  Branch (407:9): [True: 2, False: 0]
  ------------------
  408|      2|            *val = *(const int32_t *)p->data;
  409|      2|            return 1;
  410|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (410:9): [True: 0, False: 2]
  ------------------
  411|      0|            i64 = *(const int64_t *)p->data;
  412|      0|            if (i64 >= INT32_MIN && i64 <= INT32_MAX) {
  ------------------
  |  Branch (412:17): [True: 0, False: 0]
  |  Branch (412:37): [True: 0, False: 0]
  ------------------
  413|      0|                *val = (int32_t)i64;
  414|      0|                return 1;
  415|      0|            }
  416|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  417|      0|            return 0;
  418|      2|        }
  419|      0|#endif
  420|      0|        return general_get_int(p, val, sizeof(*val));
  421|       |
  422|      7|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      7|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (422:16): [True: 7, False: 0]
  ------------------
  423|      7|#ifndef OPENSSL_SMALL_FOOTPRINT
  424|      7|        uint32_t u32;
  425|      7|        uint64_t u64;
  426|       |
  427|      7|        switch (p->data_size) {
  ------------------
  |  Branch (427:17): [True: 0, False: 7]
  ------------------
  428|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (428:9): [True: 0, False: 7]
  ------------------
  429|      0|            u32 = *(const uint32_t *)p->data;
  430|      0|            if (u32 <= INT32_MAX) {
  ------------------
  |  Branch (430:17): [True: 0, False: 0]
  ------------------
  431|      0|                *val = (int32_t)u32;
  432|      0|                return 1;
  433|      0|            }
  434|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  435|      0|            return 0;
  436|      7|        case sizeof(uint64_t):
  ------------------
  |  Branch (436:9): [True: 7, False: 0]
  ------------------
  437|      7|            u64 = *(const uint64_t *)p->data;
  438|      7|            if (u64 <= INT32_MAX) {
  ------------------
  |  Branch (438:17): [True: 7, False: 0]
  ------------------
  439|      7|                *val = (int32_t)u64;
  440|      7|                return 1;
  441|      7|            }
  442|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  443|      0|            return 0;
  444|      7|        }
  445|      0|#endif
  446|      0|        return general_get_int(p, val, sizeof(*val));
  447|       |
  448|      7|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (448:16): [True: 0, False: 0]
  ------------------
  449|      0|#ifndef OPENSSL_SYS_UEFI
  450|      0|        double d;
  451|       |
  452|      0|        switch (p->data_size) {
  ------------------
  |  Branch (452:17): [True: 0, False: 0]
  ------------------
  453|      0|        case sizeof(double):
  ------------------
  |  Branch (453:9): [True: 0, False: 0]
  ------------------
  454|      0|            d = *(const double *)p->data;
  455|      0|            if (d >= INT32_MIN && d <= INT32_MAX && d == (int32_t)d) {
  ------------------
  |  Branch (455:17): [True: 0, False: 0]
  |  Branch (455:35): [True: 0, False: 0]
  |  Branch (455:53): [True: 0, False: 0]
  ------------------
  456|      0|                *val = (int32_t)d;
  457|      0|                return 1;
  458|      0|            }
  459|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  460|      0|            return 0;
  461|      0|        }
  462|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|      0|        return 0;
  464|      0|#endif
  465|      0|    }
  466|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  467|      0|    return 0;
  468|      9|}
OSSL_PARAM_set_int32:
  471|  48.5k|{
  472|  48.5k|    if (p == NULL) {
  ------------------
  |  Branch (472:9): [True: 0, False: 48.5k]
  ------------------
  473|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  474|      0|        return 0;
  475|      0|    }
  476|  48.5k|    p->return_size = 0;
  477|  48.5k|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  48.5k|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (477:9): [True: 48.5k, False: 5]
  ------------------
  478|  48.5k|#ifndef OPENSSL_SMALL_FOOTPRINT
  479|  48.5k|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  480|  48.5k|        if (p->data == NULL)
  ------------------
  |  Branch (480:13): [True: 0, False: 48.5k]
  ------------------
  481|      0|            return 1;
  482|  48.5k|        switch (p->data_size) {
  ------------------
  |  Branch (482:17): [True: 0, False: 48.5k]
  ------------------
  483|  48.5k|        case sizeof(int32_t):
  ------------------
  |  Branch (483:9): [True: 48.5k, False: 0]
  ------------------
  484|  48.5k|            *(int32_t *)p->data = val;
  485|  48.5k|            return 1;
  486|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (486:9): [True: 0, False: 48.5k]
  ------------------
  487|      0|            p->return_size = sizeof(int64_t);
  488|      0|            *(int64_t *)p->data = (int64_t)val;
  489|      0|            return 1;
  490|  48.5k|        }
  491|      0|#endif
  492|      0|        return general_set_int(p, &val, sizeof(val));
  493|  48.5k|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER && val >= 0) {
  ------------------
  |  |  107|     10|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (493:16): [True: 5, False: 0]
  |  Branch (493:63): [True: 5, False: 0]
  ------------------
  494|      5|#ifndef OPENSSL_SMALL_FOOTPRINT
  495|      5|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  496|      5|        if (p->data == NULL)
  ------------------
  |  Branch (496:13): [True: 0, False: 5]
  ------------------
  497|      0|            return 1;
  498|      5|        switch (p->data_size) {
  ------------------
  |  Branch (498:17): [True: 0, False: 5]
  ------------------
  499|      5|        case sizeof(uint32_t):
  ------------------
  |  Branch (499:9): [True: 5, False: 0]
  ------------------
  500|      5|            *(uint32_t *)p->data = (uint32_t)val;
  501|      5|            return 1;
  502|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (502:9): [True: 0, False: 5]
  ------------------
  503|      0|            p->return_size = sizeof(uint64_t);
  504|      0|            *(uint64_t *)p->data = (uint64_t)val;
  505|      0|            return 1;
  506|      5|        }
  507|      0|#endif
  508|      0|        return general_set_int(p, &val, sizeof(val));
  509|      5|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (509:16): [True: 0, False: 0]
  ------------------
  510|      0|#ifndef OPENSSL_SYS_UEFI
  511|      0|        uint32_t u32;
  512|      0|        unsigned int shift;
  513|       |
  514|      0|        p->return_size = sizeof(double);
  515|      0|        if (p->data == NULL)
  ------------------
  |  Branch (515:13): [True: 0, False: 0]
  ------------------
  516|      0|            return 1;
  517|      0|        switch (p->data_size) {
  ------------------
  |  Branch (517:17): [True: 0, False: 0]
  ------------------
  518|      0|        case sizeof(double):
  ------------------
  |  Branch (518:9): [True: 0, False: 0]
  ------------------
  519|      0|            shift = real_shift();
  520|      0|            if (shift < 8 * sizeof(val) - 1) {
  ------------------
  |  Branch (520:17): [True: 0, False: 0]
  ------------------
  521|      0|                u32 = val < 0 ? -val : val;
  ------------------
  |  Branch (521:23): [True: 0, False: 0]
  ------------------
  522|      0|                if ((u32 >> shift) != 0) {
  ------------------
  |  Branch (522:21): [True: 0, False: 0]
  ------------------
  523|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  524|      0|                    return 0;
  525|      0|                }
  526|      0|            }
  527|      0|            *(double *)p->data = (double)val;
  528|      0|            return 1;
  529|      0|        }
  530|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  531|      0|        return 0;
  532|      0|#endif
  533|      0|    }
  534|      0|    err_bad_type;
  ------------------
  |  |   35|  48.5k|    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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  535|      0|    return 0;
  536|  48.5k|}
OSSL_PARAM_get_uint32:
  545|      2|{
  546|      2|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (546:9): [True: 0, False: 2]
  |  Branch (546:24): [True: 0, False: 2]
  ------------------
  547|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  548|      0|        return 0;
  549|      0|    }
  550|       |
  551|      2|    if (p->data == NULL) {
  ------------------
  |  Branch (551:9): [True: 0, False: 2]
  ------------------
  552|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  553|      0|        return 0;
  554|      0|    }
  555|       |
  556|      2|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      2|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (556:9): [True: 2, False: 0]
  ------------------
  557|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  558|      2|        uint64_t u64;
  559|       |
  560|      2|        switch (p->data_size) {
  ------------------
  |  Branch (560:17): [True: 0, False: 2]
  ------------------
  561|      2|        case sizeof(uint32_t):
  ------------------
  |  Branch (561:9): [True: 2, False: 0]
  ------------------
  562|      2|            *val = *(const uint32_t *)p->data;
  563|      2|            return 1;
  564|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (564:9): [True: 0, False: 2]
  ------------------
  565|      0|            u64 = *(const uint64_t *)p->data;
  566|      0|            if (u64 <= UINT32_MAX) {
  ------------------
  |  Branch (566:17): [True: 0, False: 0]
  ------------------
  567|      0|                *val = (uint32_t)u64;
  568|      0|                return 1;
  569|      0|            }
  570|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  571|      0|            return 0;
  572|      2|        }
  573|      0|#endif
  574|      0|        return general_get_uint(p, val, sizeof(*val));
  575|      2|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (575:16): [True: 0, False: 0]
  ------------------
  576|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  577|      0|        int32_t i32;
  578|      0|        int64_t i64;
  579|       |
  580|      0|        switch (p->data_size) {
  ------------------
  |  Branch (580:17): [True: 0, False: 0]
  ------------------
  581|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (581:9): [True: 0, False: 0]
  ------------------
  582|      0|            i32 = *(const int32_t *)p->data;
  583|      0|            if (i32 >= 0) {
  ------------------
  |  Branch (583:17): [True: 0, False: 0]
  ------------------
  584|      0|                *val = i32;
  585|      0|                return 1;
  586|      0|            }
  587|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   23|      0|              CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  588|      0|            return 0;
  589|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (589:9): [True: 0, False: 0]
  ------------------
  590|      0|            i64 = *(const int64_t *)p->data;
  591|      0|            if (i64 >= 0 && i64 <= UINT32_MAX) {
  ------------------
  |  Branch (591:17): [True: 0, False: 0]
  |  Branch (591:29): [True: 0, False: 0]
  ------------------
  592|      0|                *val = (uint32_t)i64;
  593|      0|                return 1;
  594|      0|            }
  595|      0|            if (i64 < 0)
  ------------------
  |  Branch (595:17): [True: 0, False: 0]
  ------------------
  596|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   23|      0|              CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  597|      0|            else
  598|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  599|      0|            return 0;
  600|      0|        }
  601|      0|#endif
  602|      0|        return general_get_uint(p, val, sizeof(*val));
  603|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (603:16): [True: 0, False: 0]
  ------------------
  604|      0|#ifndef OPENSSL_SYS_UEFI
  605|      0|        double d;
  606|       |
  607|      0|        switch (p->data_size) {
  ------------------
  |  Branch (607:17): [True: 0, False: 0]
  ------------------
  608|      0|        case sizeof(double):
  ------------------
  |  Branch (608:9): [True: 0, False: 0]
  ------------------
  609|      0|            d = *(const double *)p->data;
  610|      0|            if (d >= 0 && d <= UINT32_MAX && d == (uint32_t)d) {
  ------------------
  |  Branch (610:17): [True: 0, False: 0]
  |  Branch (610:27): [True: 0, False: 0]
  |  Branch (610:46): [True: 0, False: 0]
  ------------------
  611|      0|                *val = (uint32_t)d;
  612|      0|                return 1;
  613|      0|            }
  614|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  615|      0|            return 0;
  616|      0|        }
  617|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  618|      0|        return 0;
  619|      0|#endif
  620|      0|    }
  621|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  622|      0|    return 0;
  623|      2|}
OSSL_PARAM_set_uint32:
  626|  20.7k|{
  627|  20.7k|    if (p == NULL) {
  ------------------
  |  Branch (627:9): [True: 0, False: 20.7k]
  ------------------
  628|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  629|      0|        return 0;
  630|      0|    }
  631|  20.7k|    p->return_size = 0;
  632|       |
  633|  20.7k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  20.7k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (633:9): [True: 20.7k, False: 0]
  ------------------
  634|  20.7k|#ifndef OPENSSL_SMALL_FOOTPRINT
  635|  20.7k|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  636|  20.7k|        if (p->data == NULL)
  ------------------
  |  Branch (636:13): [True: 0, False: 20.7k]
  ------------------
  637|      0|            return 1;
  638|  20.7k|        switch (p->data_size) {
  ------------------
  |  Branch (638:17): [True: 0, False: 20.7k]
  ------------------
  639|  20.7k|        case sizeof(uint32_t):
  ------------------
  |  Branch (639:9): [True: 20.7k, False: 0]
  ------------------
  640|  20.7k|            *(uint32_t *)p->data = val;
  641|  20.7k|            return 1;
  642|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (642:9): [True: 0, False: 20.7k]
  ------------------
  643|      0|            p->return_size = sizeof(uint64_t);
  644|      0|            *(uint64_t *)p->data = val;
  645|      0|            return 1;
  646|  20.7k|        }
  647|      0|#endif
  648|      0|        return general_set_uint(p, &val, sizeof(val));
  649|  20.7k|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (649:16): [True: 0, False: 0]
  ------------------
  650|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  651|      0|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  652|      0|        if (p->data == NULL)
  ------------------
  |  Branch (652:13): [True: 0, False: 0]
  ------------------
  653|      0|            return 1;
  654|      0|        switch (p->data_size) {
  ------------------
  |  Branch (654:17): [True: 0, False: 0]
  ------------------
  655|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (655:9): [True: 0, False: 0]
  ------------------
  656|      0|            if (val <= INT32_MAX) {
  ------------------
  |  Branch (656:17): [True: 0, False: 0]
  ------------------
  657|      0|                *(int32_t *)p->data = (int32_t)val;
  658|      0|                return 1;
  659|      0|            }
  660|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  661|      0|            return 0;
  662|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (662:9): [True: 0, False: 0]
  ------------------
  663|      0|            p->return_size = sizeof(int64_t);
  664|      0|            *(int64_t *)p->data = (int64_t)val;
  665|      0|            return 1;
  666|      0|        }
  667|      0|#endif
  668|      0|        return general_set_uint(p, &val, sizeof(val));
  669|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (669:16): [True: 0, False: 0]
  ------------------
  670|      0|#ifndef OPENSSL_SYS_UEFI
  671|      0|        unsigned int shift;
  672|       |
  673|      0|        p->return_size = sizeof(double);
  674|      0|        if (p->data == NULL)
  ------------------
  |  Branch (674:13): [True: 0, False: 0]
  ------------------
  675|      0|            return 1;
  676|      0|        switch (p->data_size) {
  ------------------
  |  Branch (676:17): [True: 0, False: 0]
  ------------------
  677|      0|        case sizeof(double):
  ------------------
  |  Branch (677:9): [True: 0, False: 0]
  ------------------
  678|      0|            shift = real_shift();
  679|      0|            if (shift < 8 * sizeof(val) && (val >> shift) != 0) {
  ------------------
  |  Branch (679:17): [True: 0, False: 0]
  |  Branch (679:44): [True: 0, False: 0]
  ------------------
  680|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  681|      0|                return 0;
  682|      0|            }
  683|      0|            *(double *)p->data = (double)val;
  684|      0|            return 1;
  685|      0|        }
  686|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  687|      0|        return 0;
  688|      0|#endif
  689|      0|    }
  690|      0|    err_bad_type;
  ------------------
  |  |   35|  20.7k|    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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  691|      0|    return 0;
  692|  20.7k|}
OSSL_PARAM_get_int64:
  701|      2|{
  702|      2|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (702:9): [True: 0, False: 2]
  |  Branch (702:24): [True: 0, False: 2]
  ------------------
  703|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  704|      0|        return 0;
  705|      0|    }
  706|       |
  707|      2|    if (p->data == NULL) {
  ------------------
  |  Branch (707:9): [True: 0, False: 2]
  ------------------
  708|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  709|      0|        return 0;
  710|      0|    }
  711|       |
  712|      2|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      2|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (712:9): [True: 2, False: 0]
  ------------------
  713|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  714|      2|        switch (p->data_size) {
  ------------------
  |  Branch (714:17): [True: 0, False: 2]
  ------------------
  715|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (715:9): [True: 0, False: 2]
  ------------------
  716|      0|            *val = *(const int32_t *)p->data;
  717|      0|            return 1;
  718|      2|        case sizeof(int64_t):
  ------------------
  |  Branch (718:9): [True: 2, False: 0]
  ------------------
  719|      2|            *val = *(const int64_t *)p->data;
  720|      2|            return 1;
  721|      2|        }
  722|      0|#endif
  723|      0|        return general_get_int(p, val, sizeof(*val));
  724|      2|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (724:16): [True: 0, False: 0]
  ------------------
  725|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  726|      0|        uint64_t u64;
  727|       |
  728|      0|        switch (p->data_size) {
  ------------------
  |  Branch (728:17): [True: 0, False: 0]
  ------------------
  729|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (729:9): [True: 0, False: 0]
  ------------------
  730|      0|            *val = *(const uint32_t *)p->data;
  731|      0|            return 1;
  732|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (732:9): [True: 0, False: 0]
  ------------------
  733|      0|            u64 = *(const uint64_t *)p->data;
  734|      0|            if (u64 <= INT64_MAX) {
  ------------------
  |  Branch (734:17): [True: 0, False: 0]
  ------------------
  735|      0|                *val = (int64_t)u64;
  736|      0|                return 1;
  737|      0|            }
  738|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  739|      0|            return 0;
  740|      0|        }
  741|      0|#endif
  742|      0|        return general_get_int(p, val, sizeof(*val));
  743|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (743:16): [True: 0, False: 0]
  ------------------
  744|      0|#ifndef OPENSSL_SYS_UEFI
  745|      0|        double d;
  746|       |
  747|      0|        switch (p->data_size) {
  ------------------
  |  Branch (747:17): [True: 0, False: 0]
  ------------------
  748|      0|        case sizeof(double):
  ------------------
  |  Branch (748:9): [True: 0, False: 0]
  ------------------
  749|      0|            d = *(const double *)p->data;
  750|      0|            if (d >= INT64_MIN
  ------------------
  |  Branch (750:17): [True: 0, False: 0]
  ------------------
  751|       |                    /*
  752|       |                     * By subtracting 65535 (2^16-1) we cancel the low order
  753|       |                     * 15 bits of INT64_MAX to avoid using imprecise floating
  754|       |                     * point values.
  755|       |                     */
  756|      0|                    && d < (double)(INT64_MAX - 65535) + 65536.0
  ------------------
  |  Branch (756:24): [True: 0, False: 0]
  ------------------
  757|      0|                    && d == (int64_t)d) {
  ------------------
  |  Branch (757:24): [True: 0, False: 0]
  ------------------
  758|      0|                *val = (int64_t)d;
  759|      0|                return 1;
  760|      0|            }
  761|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  762|      0|            return 0;
  763|      0|        }
  764|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  765|      0|        return 0;
  766|      0|#endif
  767|      0|    }
  768|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  769|      0|    return 0;
  770|      2|}
OSSL_PARAM_set_uint64:
  928|  21.0k|{
  929|  21.0k|    if (p == NULL) {
  ------------------
  |  Branch (929:9): [True: 0, False: 21.0k]
  ------------------
  930|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  931|      0|        return 0;
  932|      0|    }
  933|  21.0k|    p->return_size = 0;
  934|       |
  935|  21.0k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  21.0k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (935:9): [True: 21.0k, False: 0]
  ------------------
  936|  21.0k|#ifndef OPENSSL_SMALL_FOOTPRINT
  937|  21.0k|        p->return_size = sizeof(uint64_t); /* Expected size */
  938|  21.0k|        if (p->data == NULL)
  ------------------
  |  Branch (938:13): [True: 0, False: 21.0k]
  ------------------
  939|      0|            return 1;
  940|  21.0k|        switch (p->data_size) {
  ------------------
  |  Branch (940:17): [True: 0, False: 21.0k]
  ------------------
  941|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (941:9): [True: 0, False: 21.0k]
  ------------------
  942|      0|            if (val <= UINT32_MAX) {
  ------------------
  |  Branch (942:17): [True: 0, False: 0]
  ------------------
  943|      0|                p->return_size = sizeof(uint32_t);
  944|      0|                *(uint32_t *)p->data = (uint32_t)val;
  945|      0|                return 1;
  946|      0|            }
  947|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  948|      0|            return 0;
  949|  21.0k|        case sizeof(uint64_t):
  ------------------
  |  Branch (949:9): [True: 21.0k, False: 0]
  ------------------
  950|  21.0k|            *(uint64_t *)p->data = val;
  951|  21.0k|            return 1;
  952|  21.0k|        }
  953|      0|#endif
  954|      0|        return general_set_uint(p, &val, sizeof(val));
  955|  21.0k|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (955:16): [True: 0, False: 0]
  ------------------
  956|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  957|      0|        p->return_size = sizeof(int64_t); /* Expected size */
  958|      0|        if (p->data == NULL)
  ------------------
  |  Branch (958:13): [True: 0, False: 0]
  ------------------
  959|      0|            return 1;
  960|      0|        switch (p->data_size) {
  ------------------
  |  Branch (960:17): [True: 0, False: 0]
  ------------------
  961|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (961:9): [True: 0, False: 0]
  ------------------
  962|      0|            if (val <= INT32_MAX) {
  ------------------
  |  Branch (962:17): [True: 0, False: 0]
  ------------------
  963|      0|                p->return_size = sizeof(int32_t);
  964|      0|                *(int32_t *)p->data = (int32_t)val;
  965|      0|                return 1;
  966|      0|            }
  967|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  968|      0|            return 0;
  969|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (969:9): [True: 0, False: 0]
  ------------------
  970|      0|            if (val <= INT64_MAX) {
  ------------------
  |  Branch (970:17): [True: 0, False: 0]
  ------------------
  971|      0|                *(int64_t *)p->data = (int64_t)val;
  972|      0|                return 1;
  973|      0|            }
  974|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  975|      0|            return 0;
  976|      0|        }
  977|      0|#endif
  978|      0|        return general_set_uint(p, &val, sizeof(val));
  979|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (979:16): [True: 0, False: 0]
  ------------------
  980|      0|#ifndef OPENSSL_SYS_UEFI
  981|      0|        p->return_size = sizeof(double);
  982|      0|        switch (p->data_size) {
  ------------------
  |  Branch (982:17): [True: 0, False: 0]
  ------------------
  983|      0|        case sizeof(double):
  ------------------
  |  Branch (983:9): [True: 0, False: 0]
  ------------------
  984|      0|            if ((val >> real_shift()) == 0) {
  ------------------
  |  Branch (984:17): [True: 0, False: 0]
  ------------------
  985|      0|                *(double *)p->data = (double)val;
  986|      0|                return 1;
  987|      0|            }
  988|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  989|      0|            return 0;
  990|      0|        }
  991|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  992|      0|        return 0;
  993|      0|#endif
  994|      0|    }
  995|      0|    err_bad_type;
  ------------------
  |  |   35|  21.0k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  996|      0|    return 0;
  997|  21.0k|}
OSSL_PARAM_set_size_t:
 1019|  21.0k|{
 1020|  21.0k|#ifndef OPENSSL_SMALL_FOOTPRINT
 1021|  21.0k|    switch (sizeof(size_t)) {
  ------------------
  |  Branch (1021:13): [Folded - Ignored]
  ------------------
 1022|      0|    case sizeof(uint32_t):
  ------------------
  |  Branch (1022:5): [True: 0, False: 21.0k]
  ------------------
 1023|      0|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
 1024|  21.0k|    case sizeof(uint64_t):
  ------------------
  |  Branch (1024:5): [True: 21.0k, False: 0]
  ------------------
 1025|  21.0k|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
 1026|  21.0k|    }
 1027|      0|#endif
 1028|      0|    return general_set_uint(p, &val, sizeof(val));
 1029|  21.0k|}
OSSL_PARAM_construct_size_t:
 1032|  21.0k|{
 1033|  21.0k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|  21.0k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
 1034|  21.0k|                                sizeof(size_t));
 1035|  21.0k|}
OSSL_PARAM_get_time_t:
 1038|      2|{
 1039|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
 1040|      2|    switch (sizeof(time_t)) {
  ------------------
  |  Branch (1040:13): [Folded - Ignored]
  ------------------
 1041|      0|    case sizeof(int32_t):
  ------------------
  |  Branch (1041:5): [True: 0, False: 2]
  ------------------
 1042|      0|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
 1043|      2|    case sizeof(int64_t):
  ------------------
  |  Branch (1043:5): [True: 2, False: 0]
  ------------------
 1044|      2|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
 1045|      2|    }
 1046|      0|#endif
 1047|      0|    return general_get_int(p, val, sizeof(*val));
 1048|      2|}
OSSL_PARAM_construct_time_t:
 1064|      2|{
 1065|      2|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(time_t));
  ------------------
  |  |  106|      2|# define OSSL_PARAM_INTEGER              1
  ------------------
 1066|      2|}
OSSL_PARAM_get_utf8_string:
 1356|  52.4k|{
 1357|  52.4k|    int ret = get_string_internal(p, (void **)val, &max_len, NULL,
 1358|  52.4k|                                  OSSL_PARAM_UTF8_STRING);
  ------------------
  |  |  117|  52.4k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1359|       |
 1360|       |    /*
 1361|       |     * We try to ensure that the copied string is terminated with a
 1362|       |     * NUL byte.  That should be easy, just place a NUL byte at
 1363|       |     * |((char*)*val)[p->data_size]|.
 1364|       |     * Unfortunately, we have seen cases where |p->data_size| doesn't
 1365|       |     * correctly reflect the length of the string, and just happens
 1366|       |     * to be out of bounds according to |max_len|, so in that case, we
 1367|       |     * make the extra step of trying to find the true length of the
 1368|       |     * string that |p->data| points at, and use that as an index to
 1369|       |     * place the NUL byte in |*val|.
 1370|       |     */
 1371|  52.4k|    size_t data_length = p->data_size;
 1372|       |
 1373|  52.4k|    if (ret == 0)
  ------------------
  |  Branch (1373:9): [True: 0, False: 52.4k]
  ------------------
 1374|      0|        return 0;
 1375|  52.4k|    if (data_length >= max_len)
  ------------------
  |  Branch (1375:9): [True: 0, False: 52.4k]
  ------------------
 1376|      0|        data_length = OPENSSL_strnlen(p->data, data_length);
 1377|  52.4k|    if (data_length >= max_len) {
  ------------------
  |  Branch (1377:9): [True: 0, False: 52.4k]
  ------------------
 1378|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1379|      0|        return 0;            /* No space for a terminating NUL byte */
 1380|      0|    }
 1381|  52.4k|    (*val)[data_length] = '\0';
 1382|       |
 1383|  52.4k|    return ret;
 1384|  52.4k|}
OSSL_PARAM_construct_utf8_string:
 1448|  88.8k|{
 1449|  88.8k|    if (buf != NULL && bsize == 0)
  ------------------
  |  Branch (1449:9): [True: 88.8k, False: 0]
  |  Branch (1449:24): [True: 88.8k, False: 0]
  ------------------
 1450|  88.8k|        bsize = strlen(buf);
 1451|  88.8k|    return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize);
  ------------------
  |  |  117|  88.8k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1452|  88.8k|}
OSSL_PARAM_construct_octet_string:
 1456|  52.4k|{
 1457|  52.4k|    return ossl_param_construct(key, OSSL_PARAM_OCTET_STRING, buf, bsize);
  ------------------
  |  |  123|  52.4k|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
 1458|  52.4k|}
OSSL_PARAM_get_utf8_ptr:
 1478|  72.8k|{
 1479|  72.8k|    return get_ptr_internal(p, (const void **)val, NULL, OSSL_PARAM_UTF8_PTR);
  ------------------
  |  |  141|  72.8k|# define OSSL_PARAM_UTF8_PTR             6
  ------------------
 1480|  72.8k|}
OSSL_PARAM_construct_end:
 1641|  68.5k|{
 1642|  68.5k|    OSSL_PARAM end = OSSL_PARAM_END;
  ------------------
  |  |   25|  68.5k|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1643|       |
 1644|  68.5k|    return end;
 1645|  68.5k|}
OSSL_PARAM_get_utf8_string_ptr:
 1665|  72.8k|{
 1666|  72.8k|    int rv;
 1667|       |
 1668|  72.8k|    ERR_set_mark();
 1669|  72.8k|    rv = OSSL_PARAM_get_utf8_ptr(p, val);
 1670|  72.8k|    ERR_pop_to_mark();
 1671|       |
 1672|  72.8k|    return rv || get_string_ptr_internal(p, (const void **)val, NULL,
  ------------------
  |  Branch (1672:12): [True: 0, False: 72.8k]
  |  Branch (1672:18): [True: 72.8k, False: 0]
  ------------------
 1673|  72.8k|                                         OSSL_PARAM_UTF8_STRING);
  ------------------
  |  |  117|  72.8k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1674|  72.8k|}
params.c:ossl_param_construct:
   69|   283k|{
   70|   283k|    OSSL_PARAM res;
   71|       |
   72|   283k|    res.key = key;
   73|   283k|    res.data_type = data_type;
   74|   283k|    res.data = data;
   75|   283k|    res.data_size = data_size;
   76|   283k|    res.return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|   283k|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
   77|   283k|    return res;
   78|   283k|}
params.c:get_string_internal:
 1308|  52.4k|{
 1309|  52.4k|    size_t sz, alloc_sz;
 1310|       |
 1311|  52.4k|    if ((val == NULL && used_len == NULL) || p == NULL) {
  ------------------
  |  Branch (1311:10): [True: 0, False: 52.4k]
  |  Branch (1311:25): [True: 0, False: 0]
  |  Branch (1311:46): [True: 0, False: 52.4k]
  ------------------
 1312|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1313|      0|        return 0;
 1314|      0|    }
 1315|  52.4k|    if (p->data_type != type) {
  ------------------
  |  Branch (1315:9): [True: 0, False: 52.4k]
  ------------------
 1316|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1317|      0|        return 0;
 1318|      0|    }
 1319|       |
 1320|  52.4k|    sz = p->data_size;
 1321|       |    /*
 1322|       |     * If the input size is 0, or the input string needs NUL byte
 1323|       |     * termination, allocate an extra byte.
 1324|       |     */
 1325|  52.4k|    alloc_sz = sz + (type == OSSL_PARAM_UTF8_STRING || sz == 0);
  ------------------
  |  |  117|   104k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (1325:22): [True: 52.4k, False: 0]
  |  Branch (1325:56): [True: 0, False: 0]
  ------------------
 1326|       |
 1327|  52.4k|    if (used_len != NULL)
  ------------------
  |  Branch (1327:9): [True: 0, False: 52.4k]
  ------------------
 1328|      0|        *used_len = sz;
 1329|       |
 1330|  52.4k|    if (p->data == NULL) {
  ------------------
  |  Branch (1330:9): [True: 0, False: 52.4k]
  ------------------
 1331|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1332|      0|        return 0;
 1333|      0|    }
 1334|       |
 1335|  52.4k|    if (val == NULL)
  ------------------
  |  Branch (1335:9): [True: 0, False: 52.4k]
  ------------------
 1336|      0|        return 1;
 1337|       |
 1338|  52.4k|    if (*val == NULL) {
  ------------------
  |  Branch (1338:9): [True: 52.4k, False: 0]
  ------------------
 1339|  52.4k|        char *const q = OPENSSL_malloc(alloc_sz);
  ------------------
  |  |  102|  52.4k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  52.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  52.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1340|       |
 1341|  52.4k|        if (q == NULL)
  ------------------
  |  Branch (1341:13): [True: 0, False: 52.4k]
  ------------------
 1342|      0|            return 0;
 1343|  52.4k|        *val = q;
 1344|  52.4k|        *max_len = alloc_sz;
 1345|  52.4k|    }
 1346|       |
 1347|  52.4k|    if (*max_len < sz) {
  ------------------
  |  Branch (1347:9): [True: 0, False: 52.4k]
  ------------------
 1348|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1349|      0|        return 0;
 1350|      0|    }
 1351|  52.4k|    memcpy(*val, p->data, sz);
 1352|  52.4k|    return 1;
 1353|  52.4k|}
params.c:get_ptr_internal:
 1462|  72.8k|{
 1463|  72.8k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (1463:9): [True: 0, False: 72.8k]
  |  Branch (1463:24): [True: 0, False: 72.8k]
  ------------------
 1464|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1465|      0|        return 0;
 1466|      0|    }
 1467|  72.8k|    if (p->data_type != type) {
  ------------------
  |  Branch (1467:9): [True: 72.8k, False: 0]
  ------------------
 1468|  72.8k|        err_bad_type;
  ------------------
  |  |   35|  72.8k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|  72.8k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  72.8k|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|  72.8k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|  72.8k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|  72.8k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|  72.8k|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|  72.8k|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1469|  72.8k|        return 0;
 1470|  72.8k|    }
 1471|      0|    if (used_len != NULL)
  ------------------
  |  Branch (1471:9): [True: 0, False: 0]
  ------------------
 1472|      0|        *used_len = p->data_size;
 1473|      0|    *val = *(const void **)p->data;
 1474|      0|    return 1;
 1475|  72.8k|}
params.c:get_string_ptr_internal:
 1649|  72.8k|{
 1650|  72.8k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (1650:9): [True: 0, False: 72.8k]
  |  Branch (1650:24): [True: 0, False: 72.8k]
  ------------------
 1651|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1652|      0|        return 0;
 1653|      0|    }
 1654|  72.8k|    if (p->data_type != type) {
  ------------------
  |  Branch (1654:9): [True: 0, False: 72.8k]
  ------------------
 1655|      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),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1656|      0|        return 0;
 1657|      0|    }
 1658|  72.8k|    if (used_len != NULL)
  ------------------
  |  Branch (1658:9): [True: 0, False: 72.8k]
  ------------------
 1659|      0|        *used_len = p->data_size;
 1660|  72.8k|    *val = p->data;
 1661|  72.8k|    return 1;
 1662|  72.8k|}

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

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;
  ------------------
  |  |  149|      2|# define LHASH_OF(type) struct lhash_st_##type
  ------------------
   54|       |
   55|      2|    if (property_defns != NULL) {
  ------------------
  |  Branch (55:9): [True: 2, False: 0]
  ------------------
   56|      2|        lh_PROPERTY_DEFN_ELEM_doall(property_defns,
   57|      2|                                    &property_defn_free);
   58|      2|        lh_PROPERTY_DEFN_ELEM_free(property_defns);
   59|      2|    }
   60|      2|}
ossl_property_defns_new:
   62|      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;
  ------------------
  |  |  149|    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);
  ------------------
  |  |   98|    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;
  ------------------
  |  |  149|     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);
  ------------------
  |  |   98|     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);
  ------------------
  |  |  102|     16|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|     16|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     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:
  114|      2|{
  115|      2|    OSSL_GLOBAL_PROPERTIES *globp = vglobp;
  116|       |
  117|      2|    if (globp != NULL) {
  ------------------
  |  Branch (117:9): [True: 2, False: 0]
  ------------------
  118|      2|        ossl_property_free(globp->list);
  119|      2|        OPENSSL_free(globp);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  120|      2|    }
  121|      2|}
ossl_ctx_global_properties_new:
  124|      2|{
  125|      2|    return OPENSSL_zalloc(sizeof(OSSL_GLOBAL_PROPERTIES));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  126|      2|}
ossl_ctx_global_properties:
  130|      5|{
  131|      5|    OSSL_GLOBAL_PROPERTIES *globp;
  132|       |
  133|      5|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  134|      5|    if (loadconfig && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  468|      0|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (134:9): [True: 0, False: 5]
  |  Branch (134:23): [True: 0, False: 0]
  ------------------
  135|      0|        return NULL;
  136|      5|#endif
  137|      5|    globp = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_GLOBAL_PROPERTIES);
  ------------------
  |  |  112|      5|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  138|       |
  139|      5|    return globp != NULL ? &globp->list : NULL;
  ------------------
  |  Branch (139:12): [True: 5, False: 0]
  ------------------
  140|      5|}
ossl_method_store_new:
  243|      8|{
  244|      8|    OSSL_METHOD_STORE *res;
  245|       |
  246|      8|    res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  104|      8|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  247|      8|    if (res != NULL) {
  ------------------
  |  Branch (247:9): [True: 8, False: 0]
  ------------------
  248|      8|        res->ctx = ctx;
  249|      8|        if ((res->algs = ossl_sa_ALGORITHM_new()) == NULL
  ------------------
  |  Branch (249:13): [True: 0, False: 8]
  ------------------
  250|      8|            || (res->lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (250:16): [True: 0, False: 8]
  ------------------
  251|      8|            || (res->biglock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (251:16): [True: 0, False: 8]
  ------------------
  252|      0|            ossl_method_store_free(res);
  253|      0|            return NULL;
  254|      0|        }
  255|      8|    }
  256|      8|    return res;
  257|      8|}
ossl_method_store_free:
  260|      8|{
  261|      8|    if (store != NULL) {
  ------------------
  |  Branch (261:9): [True: 8, False: 0]
  ------------------
  262|      8|        if (store->algs != NULL)
  ------------------
  |  Branch (262:13): [True: 8, False: 0]
  ------------------
  263|      8|            ossl_sa_ALGORITHM_doall_arg(store->algs, &alg_cleanup, store);
  264|      8|        ossl_sa_ALGORITHM_free(store->algs);
  265|      8|        CRYPTO_THREAD_lock_free(store->lock);
  266|      8|        CRYPTO_THREAD_lock_free(store->biglock);
  267|      8|        OPENSSL_free(store);
  ------------------
  |  |  115|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  268|      8|    }
  269|      8|}
ossl_method_lock_store:
  272|  1.47k|{
  273|  1.47k|    return store != NULL ? CRYPTO_THREAD_write_lock(store->biglock) : 0;
  ------------------
  |  Branch (273:12): [True: 1.47k, False: 0]
  ------------------
  274|  1.47k|}
ossl_method_unlock_store:
  277|  1.47k|{
  278|  1.47k|    return store != NULL ? CRYPTO_THREAD_unlock(store->biglock) : 0;
  ------------------
  |  Branch (278:12): [True: 1.47k, False: 0]
  ------------------
  279|  1.47k|}
ossl_method_store_add:
  295|    220|{
  296|    220|    ALGORITHM *alg = NULL;
  297|    220|    IMPLEMENTATION *impl;
  298|    220|    int ret = 0;
  299|    220|    int i;
  300|       |
  301|    220|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (301:9): [True: 0, False: 220]
  |  Branch (301:21): [True: 0, False: 220]
  |  Branch (301:39): [True: 0, False: 220]
  ------------------
  302|      0|        return 0;
  303|    220|    if (properties == NULL)
  ------------------
  |  Branch (303:9): [True: 0, False: 220]
  ------------------
  304|      0|        properties = "";
  305|       |
  306|    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 (306:9): [True: 0, False: 220]
  ------------------
  307|      0|        return 0;
  308|       |
  309|       |    /* Create new entry */
  310|    220|    impl = OPENSSL_malloc(sizeof(*impl));
  ------------------
  |  |  102|    220|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    220|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    220|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  311|    220|    if (impl == NULL)
  ------------------
  |  Branch (311:9): [True: 0, False: 220]
  ------------------
  312|      0|        return 0;
  313|    220|    impl->method.method = method;
  314|    220|    impl->method.up_ref = method_up_ref;
  315|    220|    impl->method.free = method_destruct;
  316|    220|    if (!ossl_method_up_ref(&impl->method)) {
  ------------------
  |  Branch (316:9): [True: 0, False: 220]
  ------------------
  317|      0|        OPENSSL_free(impl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  318|      0|        return 0;
  319|      0|    }
  320|    220|    impl->provider = prov;
  321|       |
  322|       |    /* Insert into the hash table if required */
  323|    220|    if (!ossl_property_write_lock(store)) {
  ------------------
  |  Branch (323:9): [True: 0, False: 220]
  ------------------
  324|      0|        OPENSSL_free(impl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  325|      0|        return 0;
  326|      0|    }
  327|    220|    ossl_method_cache_flush(store, nid);
  328|    220|    if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) {
  ------------------
  |  Branch (328:9): [True: 16, False: 204]
  ------------------
  329|     16|        impl->properties = ossl_parse_property(store->ctx, properties);
  330|     16|        if (impl->properties == NULL)
  ------------------
  |  Branch (330:13): [True: 0, False: 16]
  ------------------
  331|      0|            goto err;
  332|     16|        if (!ossl_prop_defn_set(store->ctx, properties, &impl->properties)) {
  ------------------
  |  Branch (332:13): [True: 0, False: 16]
  ------------------
  333|      0|            ossl_property_free(impl->properties);
  334|      0|            impl->properties = NULL;
  335|      0|            goto err;
  336|      0|        }
  337|     16|    }
  338|       |
  339|    220|    alg = ossl_method_store_retrieve(store, nid);
  340|    220|    if (alg == NULL) {
  ------------------
  |  Branch (340:9): [True: 192, False: 28]
  ------------------
  341|    192|        if ((alg = OPENSSL_zalloc(sizeof(*alg))) == NULL
  ------------------
  |  |  104|    192|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    192|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    192|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (341:13): [True: 0, False: 192]
  ------------------
  342|    192|                || (alg->impls = sk_IMPLEMENTATION_new_null()) == NULL
  ------------------
  |  Branch (342:20): [True: 0, False: 192]
  ------------------
  343|    192|                || (alg->cache = lh_QUERY_new(&query_hash, &query_cmp)) == NULL)
  ------------------
  |  Branch (343:20): [True: 0, False: 192]
  ------------------
  344|      0|            goto err;
  345|    192|        alg->nid = nid;
  346|    192|        if (!ossl_method_store_insert(store, alg))
  ------------------
  |  Branch (346:13): [True: 0, False: 192]
  ------------------
  347|      0|            goto err;
  348|    192|    }
  349|       |
  350|       |    /* Push onto stack if there isn't one there already */
  351|    279|    for (i = 0; i < sk_IMPLEMENTATION_num(alg->impls); i++) {
  ------------------
  |  Branch (351:17): [True: 59, False: 220]
  ------------------
  352|     59|        const IMPLEMENTATION *tmpimpl = sk_IMPLEMENTATION_value(alg->impls, i);
  353|       |
  354|     59|        if (tmpimpl->provider == impl->provider
  ------------------
  |  Branch (354:13): [True: 59, False: 0]
  ------------------
  355|     59|            && tmpimpl->properties == impl->properties)
  ------------------
  |  Branch (355:16): [True: 0, False: 59]
  ------------------
  356|      0|            break;
  357|     59|    }
  358|    220|    if (i == sk_IMPLEMENTATION_num(alg->impls)
  ------------------
  |  Branch (358:9): [True: 220, False: 0]
  ------------------
  359|    220|        && sk_IMPLEMENTATION_push(alg->impls, impl))
  ------------------
  |  Branch (359:12): [True: 220, False: 0]
  ------------------
  360|    220|        ret = 1;
  361|    220|    ossl_property_unlock(store);
  362|    220|    if (ret == 0)
  ------------------
  |  Branch (362:9): [True: 0, False: 220]
  ------------------
  363|      0|        impl_free(impl);
  364|    220|    return ret;
  365|       |
  366|      0|err:
  367|      0|    ossl_property_unlock(store);
  368|      0|    alg_cleanup(0, alg, NULL);
  369|      0|    impl_free(impl);
  370|      0|    return 0;
  371|    220|}
ossl_method_store_do_all:
  476|  1.47k|{
  477|  1.47k|    int i, j;
  478|  1.47k|    int numalgs, numimps;
  479|  1.47k|    STACK_OF(ALGORITHM) *tmpalgs;
  ------------------
  |  |   31|  1.47k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  480|  1.47k|    ALGORITHM *alg;
  481|       |
  482|  1.47k|    if (store != NULL) {
  ------------------
  |  Branch (482:9): [True: 1.47k, False: 0]
  ------------------
  483|       |
  484|  1.47k|        if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (484:13): [True: 0, False: 1.47k]
  ------------------
  485|      0|            return;
  486|       |       
  487|  1.47k|        tmpalgs = sk_ALGORITHM_new_reserve(NULL,
  488|  1.47k|                                           ossl_sa_ALGORITHM_num(store->algs));
  489|  1.47k|        if (tmpalgs == NULL) {
  ------------------
  |  Branch (489:13): [True: 0, False: 1.47k]
  ------------------
  490|      0|            ossl_property_unlock(store);
  491|      0|            return;
  492|      0|        }
  493|       |
  494|  1.47k|        ossl_sa_ALGORITHM_doall_arg(store->algs, alg_copy, tmpalgs);
  495|  1.47k|        ossl_property_unlock(store);
  496|  1.47k|        numalgs = sk_ALGORITHM_num(tmpalgs);
  497|  99.7k|        for (i = 0; i < numalgs; i++) {
  ------------------
  |  Branch (497:21): [True: 98.2k, False: 1.47k]
  ------------------
  498|  98.2k|            alg = sk_ALGORITHM_value(tmpalgs, i);
  499|  98.2k|            numimps = sk_IMPLEMENTATION_num(alg->impls);
  500|   217k|            for (j = 0; j < numimps; j++)
  ------------------
  |  Branch (500:25): [True: 119k, False: 98.2k]
  ------------------
  501|   119k|                alg_do_one(alg, sk_IMPLEMENTATION_value(alg->impls, j), fn, fnarg);
  502|  98.2k|        }
  503|  1.47k|        sk_ALGORITHM_free(tmpalgs);
  504|  1.47k|    }
  505|  1.47k|}
ossl_method_store_fetch:
  510|      5|{
  511|      5|    OSSL_PROPERTY_LIST **plp;
  512|      5|    ALGORITHM *alg;
  513|      5|    IMPLEMENTATION *impl, *best_impl = NULL;
  514|      5|    OSSL_PROPERTY_LIST *pq = NULL, *p2 = NULL;
  515|      5|    const OSSL_PROVIDER *prov = prov_rw != NULL ? *prov_rw : NULL;
  ------------------
  |  Branch (515:33): [True: 5, False: 0]
  ------------------
  516|      5|    int ret = 0;
  517|      5|    int j, best = -1, score, optional;
  518|       |
  519|      5|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (519:9): [True: 0, False: 5]
  |  Branch (519:21): [True: 0, False: 5]
  |  Branch (519:39): [True: 0, False: 5]
  ------------------
  520|      0|        return 0;
  521|       |
  522|      5|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  523|      5|    if (ossl_lib_ctx_is_default(store->ctx)
  ------------------
  |  Branch (523:9): [True: 5, False: 0]
  ------------------
  524|      5|            && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  468|      5|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (524:16): [True: 0, False: 5]
  ------------------
  525|      0|        return 0;
  526|      5|#endif
  527|       |
  528|       |    /* This only needs to be a read lock, because the query won't create anything */
  529|      5|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (529:9): [True: 0, False: 5]
  ------------------
  530|      0|        return 0;
  531|      5|    alg = ossl_method_store_retrieve(store, nid);
  532|      5|    if (alg == NULL) {
  ------------------
  |  Branch (532:9): [True: 0, False: 5]
  ------------------
  533|      0|        ossl_property_unlock(store);
  534|      0|        return 0;
  535|      0|    }
  536|       |
  537|      5|    if (prop_query != NULL)
  ------------------
  |  Branch (537:9): [True: 5, False: 0]
  ------------------
  538|      5|        p2 = pq = ossl_parse_query(store->ctx, prop_query, 0);
  539|      5|    plp = ossl_ctx_global_properties(store->ctx, 0);
  540|      5|    if (plp != NULL && *plp != NULL) {
  ------------------
  |  Branch (540:9): [True: 5, False: 0]
  |  Branch (540:24): [True: 0, False: 5]
  ------------------
  541|      0|        if (pq == NULL) {
  ------------------
  |  Branch (541:13): [True: 0, False: 0]
  ------------------
  542|      0|            pq = *plp;
  543|      0|        } else {
  544|      0|            p2 = ossl_property_merge(pq, *plp);
  545|      0|            ossl_property_free(pq);
  546|      0|            if (p2 == NULL)
  ------------------
  |  Branch (546:17): [True: 0, False: 0]
  ------------------
  547|      0|                goto fin;
  548|      0|            pq = p2;
  549|      0|        }
  550|      0|    }
  551|       |
  552|      5|    if (pq == NULL) {
  ------------------
  |  Branch (552:9): [True: 0, False: 5]
  ------------------
  553|      0|        for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (553:21): [True: 0, False: 0]
  ------------------
  554|      0|            if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
  ------------------
  |  Branch (554:17): [True: 0, False: 0]
  ------------------
  555|      0|                && (prov == NULL || impl->provider == prov)) {
  ------------------
  |  Branch (555:21): [True: 0, False: 0]
  |  Branch (555:37): [True: 0, False: 0]
  ------------------
  556|      0|                best_impl = impl;
  557|      0|                ret = 1;
  558|      0|                break;
  559|      0|            }
  560|      0|        }
  561|      0|        goto fin;
  562|      0|    }
  563|      5|    optional = ossl_property_has_optional(pq);
  564|      5|    for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (564:17): [True: 5, False: 0]
  ------------------
  565|      5|        if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
  ------------------
  |  Branch (565:13): [True: 5, False: 0]
  ------------------
  566|      5|            && (prov == NULL || impl->provider == prov)) {
  ------------------
  |  Branch (566:17): [True: 5, False: 0]
  |  Branch (566:33): [True: 0, False: 0]
  ------------------
  567|      5|            score = ossl_property_match_count(pq, impl->properties);
  568|      5|            if (score > best) {
  ------------------
  |  Branch (568:17): [True: 5, False: 0]
  ------------------
  569|      5|                best_impl = impl;
  570|      5|                best = score;
  571|      5|                ret = 1;
  572|      5|                if (!optional)
  ------------------
  |  Branch (572:21): [True: 5, False: 0]
  ------------------
  573|      5|                    goto fin;
  574|      5|            }
  575|      5|        }
  576|      5|    }
  577|      5|fin:
  578|      5|    if (ret && ossl_method_up_ref(&best_impl->method)) {
  ------------------
  |  Branch (578:9): [True: 5, False: 0]
  |  Branch (578:16): [True: 5, False: 0]
  ------------------
  579|      5|        *method = best_impl->method.method;
  580|      5|        if (prov_rw != NULL)
  ------------------
  |  Branch (580:13): [True: 5, False: 0]
  ------------------
  581|      5|            *prov_rw = best_impl->provider;
  582|      5|    } else {
  583|      0|        ret = 0;
  584|      0|    }
  585|      5|    ossl_property_unlock(store);
  586|      5|    ossl_property_free(p2);
  587|      5|    return ret;
  588|      5|}
ossl_method_store_cache_get:
  691|  19.3k|{
  692|  19.3k|    ALGORITHM *alg;
  693|  19.3k|    QUERY elem, *r;
  694|  19.3k|    int res = 0;
  695|       |
  696|  19.3k|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (696:9): [True: 0, False: 19.3k]
  |  Branch (696:21): [True: 0, False: 19.3k]
  |  Branch (696:38): [True: 0, False: 19.3k]
  ------------------
  697|      0|        return 0;
  698|       |
  699|  19.3k|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (699:9): [True: 0, False: 19.3k]
  ------------------
  700|      0|        return 0;
  701|  19.3k|    alg = ossl_method_store_retrieve(store, nid);
  702|  19.3k|    if (alg == NULL)
  ------------------
  |  Branch (702:9): [True: 1, False: 19.3k]
  ------------------
  703|      1|        goto err;
  704|       |
  705|  19.3k|    elem.query = prop_query;
  706|  19.3k|    elem.provider = prov;
  707|  19.3k|    r = lh_QUERY_retrieve(alg->cache, &elem);
  708|  19.3k|    if (r == NULL)
  ------------------
  |  Branch (708:9): [True: 2, False: 19.3k]
  ------------------
  709|      2|        goto err;
  710|  19.3k|    if (ossl_method_up_ref(&r->method)) {
  ------------------
  |  Branch (710:9): [True: 19.3k, False: 0]
  ------------------
  711|  19.3k|        *method = r->method.method;
  712|  19.3k|        res = 1;
  713|  19.3k|    }
  714|  19.3k|err:
  715|  19.3k|    ossl_property_unlock(store);
  716|  19.3k|    return res;
  717|  19.3k|}
ossl_method_store_cache_set:
  723|      5|{
  724|      5|    QUERY elem, *old, *p = NULL;
  725|      5|    ALGORITHM *alg;
  726|      5|    size_t len;
  727|      5|    int res = 1;
  728|       |
  729|      5|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (729:9): [True: 0, False: 5]
  |  Branch (729:21): [True: 0, False: 5]
  |  Branch (729:38): [True: 0, False: 5]
  ------------------
  730|      0|        return 0;
  731|       |
  732|      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 (732:9): [True: 0, False: 5]
  ------------------
  733|      0|        return 0;
  734|       |
  735|      5|    if (!ossl_property_write_lock(store))
  ------------------
  |  Branch (735:9): [True: 0, False: 5]
  ------------------
  736|      0|        return 0;
  737|      5|    if (store->cache_need_flush)
  ------------------
  |  Branch (737:9): [True: 0, False: 5]
  ------------------
  738|      0|        ossl_method_cache_flush_some(store);
  739|      5|    alg = ossl_method_store_retrieve(store, nid);
  740|      5|    if (alg == NULL)
  ------------------
  |  Branch (740:9): [True: 0, False: 5]
  ------------------
  741|      0|        goto err;
  742|       |
  743|      5|    if (method == NULL) {
  ------------------
  |  Branch (743:9): [True: 0, False: 5]
  ------------------
  744|      0|        elem.query = prop_query;
  745|      0|        elem.provider = prov;
  746|      0|        if ((old = lh_QUERY_delete(alg->cache, &elem)) != NULL) {
  ------------------
  |  Branch (746:13): [True: 0, False: 0]
  ------------------
  747|      0|            impl_cache_free(old);
  748|      0|            store->cache_nelem--;
  749|      0|        }
  750|      0|        goto end;
  751|      0|    }
  752|      5|    p = OPENSSL_malloc(sizeof(*p) + (len = strlen(prop_query)));
  ------------------
  |  |  102|      5|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  753|      5|    if (p != NULL) {
  ------------------
  |  Branch (753:9): [True: 5, False: 0]
  ------------------
  754|      5|        p->query = p->body;
  755|      5|        p->provider = prov;
  756|      5|        p->method.method = method;
  757|      5|        p->method.up_ref = method_up_ref;
  758|      5|        p->method.free = method_destruct;
  759|      5|        if (!ossl_method_up_ref(&p->method))
  ------------------
  |  Branch (759:13): [True: 0, False: 5]
  ------------------
  760|      0|            goto err;
  761|      5|        memcpy((char *)p->query, prop_query, len + 1);
  762|      5|        if ((old = lh_QUERY_insert(alg->cache, p)) != NULL) {
  ------------------
  |  Branch (762:13): [True: 0, False: 5]
  ------------------
  763|      0|            impl_cache_free(old);
  764|      0|            goto end;
  765|      0|        }
  766|      5|        if (!lh_QUERY_error(alg->cache)) {
  ------------------
  |  Branch (766:13): [True: 5, False: 0]
  ------------------
  767|      5|            if (++store->cache_nelem >= IMPL_CACHE_FLUSH_THRESHOLD)
  ------------------
  |  |   33|      5|#define IMPL_CACHE_FLUSH_THRESHOLD  500
  ------------------
  |  Branch (767:17): [True: 0, False: 5]
  ------------------
  768|      0|                store->cache_need_flush = 1;
  769|      5|            goto end;
  770|      5|        }
  771|      0|        ossl_method_free(&p->method);
  772|      0|    }
  773|      0|err:
  774|      0|    res = 0;
  775|      0|    OPENSSL_free(p);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  776|      5|end:
  777|      5|    ossl_property_unlock(store);
  778|      5|    return res;
  779|      0|}
property.c:alg_cleanup:
  225|    192|{
  226|    192|    OSSL_METHOD_STORE *store = arg;
  227|       |
  228|    192|    if (a != NULL) {
  ------------------
  |  Branch (228:9): [True: 192, False: 0]
  ------------------
  229|    192|        sk_IMPLEMENTATION_pop_free(a->impls, &impl_free);
  230|    192|        lh_QUERY_doall(a->cache, &impl_cache_free);
  231|    192|        lh_QUERY_free(a->cache);
  232|    192|        OPENSSL_free(a);
  ------------------
  |  |  115|    192|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    192|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    192|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  233|    192|    }
  234|    192|    if (store != NULL)
  ------------------
  |  Branch (234:9): [True: 192, False: 0]
  ------------------
  235|    192|        ossl_sa_ALGORITHM_set(store->algs, idx, NULL);
  236|    192|}
property.c:ossl_method_up_ref:
  162|  19.5k|{
  163|  19.5k|    return (*method->up_ref)(method->method);
  164|  19.5k|}
property.c:ossl_property_write_lock:
  177|    225|{
  178|    225|    return p != NULL ? CRYPTO_THREAD_write_lock(p->lock) : 0;
  ------------------
  |  Branch (178:12): [True: 225, False: 0]
  ------------------
  179|    225|}
property.c:ossl_method_store_retrieve:
  282|  19.7k|{
  283|  19.7k|    return ossl_sa_ALGORITHM_get(store->algs, nid);
  284|  19.7k|}
property.c:query_hash:
  187|  19.3k|{
  188|  19.3k|    return OPENSSL_LH_strhash(a->query);
  189|  19.3k|}
property.c:query_cmp:
  192|  19.3k|{
  193|  19.3k|    int res = strcmp(a->query, b->query);
  194|       |
  195|  19.3k|    if (res == 0 && a->provider != NULL && b->provider != NULL)
  ------------------
  |  Branch (195:9): [True: 19.3k, False: 0]
  |  Branch (195:21): [True: 19.3k, False: 0]
  |  Branch (195:44): [True: 0, False: 19.3k]
  ------------------
  196|      0|        res = b->provider > a->provider ? 1
  ------------------
  |  Branch (196:15): [True: 0, False: 0]
  ------------------
  197|      0|            : b->provider < a->provider ? -1
  ------------------
  |  Branch (197:15): [True: 0, False: 0]
  ------------------
  198|      0|            : 0;
  199|  19.3k|    return res;
  200|  19.3k|}
property.c:ossl_method_store_insert:
  287|    192|{
  288|    192|    return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg);
  289|    192|}
property.c:ossl_property_unlock:
  182|  21.0k|{
  183|  21.0k|    return p != 0 ? CRYPTO_THREAD_unlock(p->lock) : 0;
  ------------------
  |  Branch (183:12): [True: 21.0k, False: 0]
  ------------------
  184|  21.0k|}
property.c:impl_free:
  203|    220|{
  204|    220|    if (impl != NULL) {
  ------------------
  |  Branch (204:9): [True: 220, False: 0]
  ------------------
  205|    220|        ossl_method_free(&impl->method);
  206|    220|        OPENSSL_free(impl);
  ------------------
  |  |  115|    220|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    220|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    220|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  207|    220|    }
  208|    220|}
property.c:ossl_method_cache_flush_alg:
  592|     28|{
  593|     28|    store->cache_nelem -= lh_QUERY_num_items(alg->cache);
  594|     28|    impl_cache_flush_alg(0, alg);
  595|     28|}
property.c:ossl_property_read_lock:
  172|  20.8k|{
  173|  20.8k|    return p != NULL ? CRYPTO_THREAD_read_lock(p->lock) : 0;
  ------------------
  |  Branch (173:12): [True: 20.8k, False: 0]
  ------------------
  174|  20.8k|}
property.c:alg_copy:
  467|  98.2k|{
  468|  98.2k|    STACK_OF(ALGORITHM) *newalg = arg;
  ------------------
  |  |   31|  98.2k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  469|       |
  470|  98.2k|    (void)sk_ALGORITHM_push(newalg, alg);
  471|  98.2k|}
property.c:alg_do_one:
  462|   119k|{
  463|   119k|    fn(alg->nid, impl->method.method, fnarg);
  464|   119k|}
property.c:ossl_method_cache_flush:
  598|    220|{
  599|    220|    ALGORITHM *alg = ossl_method_store_retrieve(store, nid);
  600|       |
  601|    220|    if (alg != NULL)
  ------------------
  |  Branch (601:9): [True: 28, False: 192]
  ------------------
  602|     28|        ossl_method_cache_flush_alg(store, alg);
  603|    220|}
property.c:impl_cache_flush_alg:
  219|     28|{
  220|     28|    lh_QUERY_doall(alg->cache, &impl_cache_free);
  221|     28|    lh_QUERY_flush(alg->cache);
  222|     28|}
property.c:impl_cache_free:
  211|      5|{
  212|      5|    if (elem != NULL) {
  ------------------
  |  Branch (212:9): [True: 5, False: 0]
  ------------------
  213|      5|        ossl_method_free(&elem->method);
  214|      5|        OPENSSL_free(elem);
  ------------------
  |  |  115|      5|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  215|      5|    }
  216|      5|}
property.c:ossl_method_free:
  167|    225|{
  168|    225|    (*method->free)(method->method);
  169|    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:
  346|     56|{
  347|     56|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  348|     56|    OSSL_PROPERTY_LIST *res = NULL;
  349|     56|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|     56|# define STACK_OF(type) struct stack_st_##type
  ------------------
  350|     56|    const char *s = defn;
  351|     56|    int done;
  352|       |
  353|     56|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (353:9): [True: 0, False: 56]
  |  Branch (353:22): [True: 0, False: 56]
  ------------------
  354|      0|        return NULL;
  355|       |
  356|     56|    s = skip_space(s);
  357|     56|    done = *s == '\0';
  358|    269|    while (!done) {
  ------------------
  |  Branch (358:12): [True: 213, False: 56]
  ------------------
  359|    213|        const char *start = s;
  360|       |
  361|    213|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  102|    213|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    213|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    213|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  362|    213|        if (prop == NULL)
  ------------------
  |  Branch (362:13): [True: 0, False: 213]
  ------------------
  363|      0|            goto err;
  364|    213|        memset(&prop->v, 0, sizeof(prop->v));
  365|    213|        prop->optional = 0;
  366|    213|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (366:13): [True: 0, False: 213]
  ------------------
  367|      0|            goto err;
  368|    213|        prop->oper = OSSL_PROPERTY_OPER_EQ;
  369|    213|        if (prop->name_idx == 0) {
  ------------------
  |  Branch (369:13): [True: 0, False: 213]
  ------------------
  370|      0|            ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|      0|# define PROP_R_PARSE_FAILED                              108
  ------------------
  371|      0|                           "Unknown name HERE-->%s", start);
  372|      0|            goto err;
  373|      0|        }
  374|    213|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (374:13): [True: 213, False: 0]
  ------------------
  375|    213|            if (!parse_value(ctx, &s, prop, 1)) {
  ------------------
  |  Branch (375:17): [True: 0, False: 213]
  ------------------
  376|      0|                ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |   34|      0|# define PROP_R_NO_VALUE                                  107
  ------------------
  377|      0|                               "HERE-->%s", start);
  378|      0|                goto err;
  379|      0|            }
  380|    213|        } else {
  381|       |            /* A name alone means a true Boolean */
  382|      0|            prop->type = OSSL_PROPERTY_TYPE_STRING;
  383|      0|            prop->v.str_val = OSSL_PROPERTY_TRUE;
  ------------------
  |  |   37|      0|#define OSSL_PROPERTY_TRUE      1
  ------------------
  384|      0|        }
  385|       |
  386|    213|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (386:13): [True: 0, False: 213]
  ------------------
  387|      0|            goto err;
  388|    213|        prop = NULL;
  389|    213|        done = !match_ch(&s, ',');
  390|    213|    }
  391|     56|    if (*s != '\0') {
  ------------------
  |  Branch (391:9): [True: 0, False: 56]
  ------------------
  392|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |   37|      0|# define PROP_R_TRAILING_CHARACTERS                       110
  ------------------
  393|      0|                       "HERE-->%s", s);
  394|      0|        goto err;
  395|      0|    }
  396|     56|    res = stack_to_property_list(ctx, sk);
  397|       |
  398|     56|err:
  399|     56|    OPENSSL_free(prop);
  ------------------
  |  |  115|     56|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     56|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     56|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  400|     56|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  401|     56|    return res;
  402|     56|}
ossl_parse_query:
  406|      5|{
  407|      5|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|      5|# define STACK_OF(type) struct stack_st_##type
  ------------------
  408|      5|    OSSL_PROPERTY_LIST *res = NULL;
  409|      5|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  410|      5|    int done;
  411|       |
  412|      5|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (412:9): [True: 0, False: 5]
  |  Branch (412:22): [True: 0, False: 5]
  ------------------
  413|      0|        return NULL;
  414|       |
  415|      5|    s = skip_space(s);
  416|      5|    done = *s == '\0';
  417|      6|    while (!done) {
  ------------------
  |  Branch (417:12): [True: 1, False: 5]
  ------------------
  418|      1|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  102|      1|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  419|      1|        if (prop == NULL)
  ------------------
  |  Branch (419:13): [True: 0, False: 1]
  ------------------
  420|      0|            goto err;
  421|      1|        memset(&prop->v, 0, sizeof(prop->v));
  422|       |
  423|      1|        if (match_ch(&s, '-')) {
  ------------------
  |  Branch (423:13): [True: 1, False: 0]
  ------------------
  424|      1|            prop->oper = OSSL_PROPERTY_OVERRIDE;
  425|      1|            prop->optional = 0;
  426|      1|            if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (426:17): [True: 0, False: 1]
  ------------------
  427|      0|                goto err;
  428|      1|            goto skip_value;
  429|      1|        }
  430|      0|        prop->optional = match_ch(&s, '?');
  431|      0|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            goto err;
  433|       |
  434|      0|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (434:13): [True: 0, False: 0]
  ------------------
  435|      0|            prop->oper = OSSL_PROPERTY_OPER_EQ;
  436|      0|        } else if (MATCH(&s, "!=")) {
  ------------------
  |  |   43|      0|#define MATCH(s, m) match(s, m, sizeof(m) - 1)
  |  |  ------------------
  |  |  |  Branch (43:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  437|      0|            prop->oper = OSSL_PROPERTY_OPER_NE;
  438|      0|        } else {
  439|       |            /* A name alone is a Boolean comparison for true */
  440|      0|            prop->oper = OSSL_PROPERTY_OPER_EQ;
  441|      0|            prop->type = OSSL_PROPERTY_TYPE_STRING;
  442|      0|            prop->v.str_val = OSSL_PROPERTY_TRUE;
  ------------------
  |  |   37|      0|#define OSSL_PROPERTY_TRUE      1
  ------------------
  443|      0|            goto skip_value;
  444|      0|        }
  445|      0|        if (!parse_value(ctx, &s, prop, create_values))
  ------------------
  |  Branch (445:13): [True: 0, False: 0]
  ------------------
  446|      0|            prop->type = OSSL_PROPERTY_TYPE_VALUE_UNDEFINED;
  447|       |
  448|      1|skip_value:
  449|      1|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (449:13): [True: 0, False: 1]
  ------------------
  450|      0|            goto err;
  451|      1|        prop = NULL;
  452|      1|        done = !match_ch(&s, ',');
  453|      1|    }
  454|      5|    if (*s != '\0') {
  ------------------
  |  Branch (454:9): [True: 0, False: 5]
  ------------------
  455|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |   37|      0|# define PROP_R_TRAILING_CHARACTERS                       110
  ------------------
  456|      0|                       "HERE-->%s", s);
  457|      0|        goto err;
  458|      0|    }
  459|      5|    res = stack_to_property_list(ctx, sk);
  460|       |
  461|      5|err:
  462|      5|    OPENSSL_free(prop);
  ------------------
  |  |  115|      5|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|      5|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  464|      5|    return res;
  465|      5|}
ossl_property_match_count:
  473|      5|{
  474|      5|    const OSSL_PROPERTY_DEFINITION *const q = query->properties;
  475|      5|    const OSSL_PROPERTY_DEFINITION *const d = defn->properties;
  476|      5|    int i = 0, j = 0, matches = 0;
  477|      5|    OSSL_PROPERTY_OPER oper;
  478|       |
  479|      6|    while (i < query->num_properties) {
  ------------------
  |  Branch (479:12): [True: 1, False: 5]
  ------------------
  480|      1|        if ((oper = q[i].oper) == OSSL_PROPERTY_OVERRIDE) {
  ------------------
  |  Branch (480:13): [True: 1, False: 0]
  ------------------
  481|      1|            i++;
  482|      1|            continue;
  483|      1|        }
  484|      0|        if (j < defn->num_properties) {
  ------------------
  |  Branch (484:13): [True: 0, False: 0]
  ------------------
  485|      0|            if (q[i].name_idx > d[j].name_idx) {  /* skip defn, not in query */
  ------------------
  |  Branch (485:17): [True: 0, False: 0]
  ------------------
  486|      0|                j++;
  487|      0|                continue;
  488|      0|            }
  489|      0|            if (q[i].name_idx == d[j].name_idx) { /* both in defn and query */
  ------------------
  |  Branch (489:17): [True: 0, False: 0]
  ------------------
  490|      0|                const int eq = q[i].type == d[j].type
  ------------------
  |  Branch (490:32): [True: 0, False: 0]
  ------------------
  491|      0|                               && memcmp(&q[i].v, &d[j].v, sizeof(q[i].v)) == 0;
  ------------------
  |  Branch (491:35): [True: 0, False: 0]
  ------------------
  492|       |
  493|      0|                if ((eq && oper == OSSL_PROPERTY_OPER_EQ)
  ------------------
  |  Branch (493:22): [True: 0, False: 0]
  |  Branch (493:28): [True: 0, False: 0]
  ------------------
  494|      0|                    || (!eq && oper == OSSL_PROPERTY_OPER_NE))
  ------------------
  |  Branch (494:25): [True: 0, False: 0]
  |  Branch (494:32): [True: 0, False: 0]
  ------------------
  495|      0|                    matches++;
  496|      0|                else if (!q[i].optional)
  ------------------
  |  Branch (496:26): [True: 0, False: 0]
  ------------------
  497|      0|                    return -1;
  498|      0|                i++;
  499|      0|                j++;
  500|      0|                continue;
  501|      0|            }
  502|      0|        }
  503|       |
  504|       |        /*
  505|       |         * Handle the cases of a missing value and a query with no corresponding
  506|       |         * definition.  The former fails for any comparison except inequality,
  507|       |         * the latter is treated as a comparison against the Boolean false.
  508|       |         */
  509|      0|        if (q[i].type == OSSL_PROPERTY_TYPE_VALUE_UNDEFINED) {
  ------------------
  |  Branch (509:13): [True: 0, False: 0]
  ------------------
  510|      0|            if (oper == OSSL_PROPERTY_OPER_NE)
  ------------------
  |  Branch (510:17): [True: 0, False: 0]
  ------------------
  511|      0|                matches++;
  512|      0|            else if (!q[i].optional)
  ------------------
  |  Branch (512:22): [True: 0, False: 0]
  ------------------
  513|      0|                return -1;
  514|      0|        } else if (q[i].type != OSSL_PROPERTY_TYPE_STRING
  ------------------
  |  Branch (514:20): [True: 0, False: 0]
  ------------------
  515|      0|                   || (oper == OSSL_PROPERTY_OPER_EQ
  ------------------
  |  Branch (515:24): [True: 0, False: 0]
  ------------------
  516|      0|                       && q[i].v.str_val != OSSL_PROPERTY_FALSE)
  ------------------
  |  |   38|      0|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (516:27): [True: 0, False: 0]
  ------------------
  517|      0|                   || (oper == OSSL_PROPERTY_OPER_NE
  ------------------
  |  Branch (517:24): [True: 0, False: 0]
  ------------------
  518|      0|                       && q[i].v.str_val == OSSL_PROPERTY_FALSE)) {
  ------------------
  |  |   38|      0|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (518:27): [True: 0, False: 0]
  ------------------
  519|      0|            if (!q[i].optional)
  ------------------
  |  Branch (519:17): [True: 0, False: 0]
  ------------------
  520|      0|                return -1;
  521|      0|        } else {
  522|      0|            matches++;
  523|      0|        }
  524|      0|        i++;
  525|      0|    }
  526|      5|    return matches;
  527|      5|}
ossl_property_free:
  530|     63|{
  531|     63|    OPENSSL_free(p);
  ------------------
  |  |  115|     63|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     63|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     63|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  532|     63|}
ossl_property_parse_init:
  576|      2|{
  577|      2|    static const char *const predefined_names[] = {
  578|      2|        "provider",     /* Name of provider (default, legacy, fips) */
  579|      2|        "version",      /* Version number of this provider */
  580|      2|        "fips",         /* FIPS validated or FIPS supporting algorithm */
  581|      2|        "output",       /* Output type for encoders */
  582|      2|        "input",        /* Input type for decoders */
  583|      2|        "structure",    /* Structure name for encoders and decoders */
  584|      2|    };
  585|      2|    size_t i;
  586|       |
  587|     14|    for (i = 0; i < OSSL_NELEM(predefined_names); i++)
  ------------------
  |  |   14|     14|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (587:17): [True: 12, False: 2]
  ------------------
  588|     12|        if (ossl_property_name(ctx, predefined_names[i], 1) == 0)
  ------------------
  |  Branch (588:13): [True: 0, False: 12]
  ------------------
  589|      0|            goto err;
  590|       |
  591|       |    /*
  592|       |     * Pre-populate the two Boolean values. We must do them before any other
  593|       |     * values and in this order so that we get the same index as the global
  594|       |     * OSSL_PROPERTY_TRUE and OSSL_PROPERTY_FALSE values
  595|       |     */
  596|      2|    if ((ossl_property_value(ctx, "yes", 1) != OSSL_PROPERTY_TRUE)
  ------------------
  |  |   37|      2|#define OSSL_PROPERTY_TRUE      1
  ------------------
  |  Branch (596:9): [True: 0, False: 2]
  ------------------
  597|      2|        || (ossl_property_value(ctx, "no", 1) != OSSL_PROPERTY_FALSE))
  ------------------
  |  |   38|      2|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (597:12): [True: 0, False: 2]
  ------------------
  598|      0|        goto err;
  599|       |
  600|      2|    return 1;
  601|      0|err:
  602|      0|    return 0;
  603|      2|}
property_parse.c:pd_compare:
  289|    204|{
  290|    204|    const OSSL_PROPERTY_DEFINITION *pd1 = *p1;
  291|    204|    const OSSL_PROPERTY_DEFINITION *pd2 = *p2;
  292|       |
  293|    204|    if (pd1->name_idx < pd2->name_idx)
  ------------------
  |  Branch (293:9): [True: 204, False: 0]
  ------------------
  294|    204|        return -1;
  295|      0|    if (pd1->name_idx > pd2->name_idx)
  ------------------
  |  Branch (295:9): [True: 0, False: 0]
  ------------------
  296|      0|        return 1;
  297|      0|    return 0;
  298|      0|}
property_parse.c:skip_space:
   26|    859|{
   27|    859|    while (ossl_isspace(*s))
  ------------------
  |  |   82|    859|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|    859|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 0, False: 859]
  |  |  ------------------
  ------------------
   28|      0|        s++;
   29|    859|    return s;
   30|    859|}
property_parse.c:parse_name:
   58|    214|{
   59|    214|    char name[100];
   60|    214|    int err = 0;
   61|    214|    size_t i = 0;
   62|    214|    const char *s = *t;
   63|    214|    int user_name = 0;
   64|       |
   65|    214|    for (;;) {
   66|    214|        if (!ossl_isalpha(*s)) {
  ------------------
  |  |   71|    214|# define ossl_isalpha(c)        (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|    214|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    214|# define CTYPE_MASK_lower       0x1
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|    214|# define CTYPE_MASK_upper       0x2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (66:13): [True: 0, False: 214]
  ------------------
   67|      0|            ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |   30|      0|# define PROP_R_NOT_AN_IDENTIFIER                         103
  ------------------
   68|      0|                           "HERE-->%s", *t);
   69|      0|            return 0;
   70|      0|        }
   71|  1.37k|        do {
   72|  1.37k|            if (i < sizeof(name) - 1)
  ------------------
  |  Branch (72:17): [True: 1.37k, False: 0]
  ------------------
   73|  1.37k|                name[i++] = ossl_tolower(*s);
   74|      0|            else
   75|      0|                err = 1;
   76|  1.37k|        } while (*++s == '_' || ossl_isalnum(*s));
  ------------------
  |  |   70|  1.37k|# define ossl_isalnum(c)        (ossl_ctype_check((c), CTYPE_MASK_alnum))
  |  |  ------------------
  |  |  |  |   41|  1.37k|# define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  1.37k|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   27|  1.37k|# define CTYPE_MASK_lower       0x1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   28|  1.37k|# define CTYPE_MASK_upper       0x2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  1.37k|# define CTYPE_MASK_digit       0x4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (70:33): [True: 1.15k, False: 214]
  |  |  ------------------
  ------------------
  |  Branch (76:18): [True: 0, False: 1.37k]
  ------------------
   77|    214|        if (*s != '.')
  ------------------
  |  Branch (77:13): [True: 214, False: 0]
  ------------------
   78|    214|            break;
   79|      0|        user_name = 1;
   80|      0|        if (i < sizeof(name) - 1)
  ------------------
  |  Branch (80:13): [True: 0, False: 0]
  ------------------
   81|      0|            name[i++] = *s;
   82|      0|        else
   83|      0|            err = 1;
   84|      0|        s++;
   85|      0|    }
   86|    214|    name[i] = '\0';
   87|    214|    if (err) {
  ------------------
  |  Branch (87:9): [True: 0, False: 214]
  ------------------
   88|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |   27|      0|# define PROP_R_NAME_TOO_LONG                             100
  ------------------
   89|      0|        return 0;
   90|      0|    }
   91|    214|    *t = skip_space(s);
   92|    214|    *idx = ossl_property_name(ctx, name, user_name && create);
  ------------------
  |  Branch (92:42): [True: 0, False: 214]
  |  Branch (92:55): [True: 0, False: 0]
  ------------------
   93|    214|    return 1;
   94|    214|}
property_parse.c:match_ch:
   33|    428|{
   34|    428|    const char *s = *t;
   35|       |
   36|    428|    if (*s == m) {
  ------------------
  |  Branch (36:9): [True: 371, False: 57]
  ------------------
   37|    371|        *t = skip_space(s + 1);
   38|    371|        return 1;
   39|    371|    }
   40|     57|    return 0;
   41|    428|}
property_parse.c:parse_value:
  258|    213|{
  259|    213|    const char *s = *t;
  260|    213|    int r = 0;
  261|       |
  262|    213|    if (*s == '"' || *s == '\'') {
  ------------------
  |  Branch (262:9): [True: 0, False: 213]
  |  Branch (262:22): [True: 0, False: 213]
  ------------------
  263|      0|        s++;
  264|      0|        r = parse_string(ctx, &s, s[-1], res, create);
  265|    213|    } else if (*s == '+') {
  ------------------
  |  Branch (265:16): [True: 0, False: 213]
  ------------------
  266|      0|        s++;
  267|      0|        r = parse_number(&s, res);
  268|    213|    } else if (*s == '-') {
  ------------------
  |  Branch (268:16): [True: 0, False: 213]
  ------------------
  269|      0|        s++;
  270|      0|        r = parse_number(&s, res);
  271|      0|        res->v.int_val = -res->v.int_val;
  272|    213|    } else if (*s == '0' && s[1] == 'x') {
  ------------------
  |  Branch (272:16): [True: 0, False: 213]
  |  Branch (272:29): [True: 0, False: 0]
  ------------------
  273|      0|        s += 2;
  274|      0|        r = parse_hex(&s, res);
  275|    213|    } else if (*s == '0' && ossl_isdigit(s[1])) {
  ------------------
  |  Branch (275:16): [True: 0, False: 213]
  |  Branch (275:29): [True: 0, False: 0]
  ------------------
  276|      0|        s++;
  277|      0|        r = parse_oct(&s, res);
  278|    213|    } else if (ossl_isdigit(*s)) {
  ------------------
  |  Branch (278:16): [True: 0, False: 213]
  ------------------
  279|      0|        return parse_number(t, res);
  280|    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]
  |  |  ------------------
  ------------------
  281|    213|        return parse_unquoted(ctx, t, res, create);
  282|      0|    if (r)
  ------------------
  |  Branch (282:9): [True: 0, False: 0]
  ------------------
  283|      0|        *t = s;
  284|      0|    return r;
  285|    213|}
property_parse.c:parse_unquoted:
  226|    213|{
  227|    213|    char v[1000];
  228|    213|    const char *s = *t;
  229|    213|    size_t i = 0;
  230|    213|    int err = 0;
  231|       |
  232|    213|    if (*s == '\0' || *s == ',')
  ------------------
  |  Branch (232:9): [True: 0, False: 213]
  |  Branch (232:23): [True: 0, False: 213]
  ------------------
  233|      0|        return 0;
  234|  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 (234:32): [True: 1.52k, False: 0]
  |  Branch (234:53): [True: 1.36k, False: 157]
  ------------------
  235|  1.36k|        if (i < sizeof(v) - 1)
  ------------------
  |  Branch (235:13): [True: 1.36k, False: 0]
  ------------------
  236|  1.36k|            v[i++] = ossl_tolower(*s);
  237|      0|        else
  238|      0|            err = 1;
  239|  1.36k|        s++;
  240|  1.36k|    }
  241|    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 (241:9): [True: 213, False: 0]
  |  Branch (241:30): [True: 157, False: 56]
  |  Branch (241:44): [True: 0, False: 157]
  ------------------
  242|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |   28|      0|# define PROP_R_NOT_AN_ASCII_CHARACTER                    101
  ------------------
  243|      0|                       "HERE-->%s", s);
  244|      0|        return 0;
  245|      0|    }
  246|    213|    v[i] = 0;
  247|    213|    if (err)
  ------------------
  |  Branch (247:9): [True: 0, False: 213]
  ------------------
  248|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |   36|      0|# define PROP_R_STRING_TOO_LONG                           109
  ------------------
  249|    213|    else if ((res->v.str_val = ossl_property_value(ctx, v, create)) == 0)
  ------------------
  |  Branch (249:14): [True: 0, False: 213]
  ------------------
  250|      0|        err = 1;
  251|    213|    *t = skip_space(s);
  252|    213|    res->type = OSSL_PROPERTY_TYPE_STRING;
  253|    213|    return !err;
  254|    213|}
property_parse.c:stack_to_property_list:
  314|     61|{
  315|     61|    const int n = sk_OSSL_PROPERTY_DEFINITION_num(sk);
  316|     61|    OSSL_PROPERTY_LIST *r;
  317|     61|    OSSL_PROPERTY_IDX prev_name_idx = 0;
  318|     61|    int i;
  319|       |
  320|     61|    r = OPENSSL_malloc(sizeof(*r)
  ------------------
  |  |  102|    122|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     61|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     61|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (102:23): [True: 4, False: 57]
  |  |  ------------------
  ------------------
  321|     61|                       + (n <= 0 ? 0 : n - 1) * sizeof(r->properties[0]));
  322|     61|    if (r != NULL) {
  ------------------
  |  Branch (322:9): [True: 61, False: 0]
  ------------------
  323|     61|        sk_OSSL_PROPERTY_DEFINITION_sort(sk);
  324|       |
  325|     61|        r->has_optional = 0;
  326|    275|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (326:21): [True: 214, False: 61]
  ------------------
  327|    214|            r->properties[i] = *sk_OSSL_PROPERTY_DEFINITION_value(sk, i);
  328|    214|            r->has_optional |= r->properties[i].optional;
  329|       |
  330|       |            /* Check for duplicated names */
  331|    214|            if (i > 0 && r->properties[i].name_idx == prev_name_idx) {
  ------------------
  |  Branch (331:17): [True: 157, False: 57]
  |  Branch (331:26): [True: 0, False: 157]
  ------------------
  332|      0|                OPENSSL_free(r);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  333|      0|                ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  116|      0|# define ERR_LIB_PROP            55
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|      0|# define PROP_R_PARSE_FAILED                              108
  ------------------
  334|      0|                               "Duplicated name `%s'",
  335|      0|                               ossl_property_name_str(ctx, prev_name_idx));
  336|      0|                return NULL;
  337|      0|            }
  338|    214|            prev_name_idx = r->properties[i].name_idx;
  339|    214|        }
  340|     61|        r->num_properties = n;
  341|     61|    }
  342|     61|    return r;
  343|     61|}
property_parse.c:pd_free:
  301|    214|{
  302|    214|    OPENSSL_free(pd);
  ------------------
  |  |  115|    214|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    214|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    214|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  303|    214|}

ossl_property_find_property:
   26|    164|{
   27|    164|    OSSL_PROPERTY_IDX name_idx;
   28|       |
   29|    164|    if (list == NULL || name == NULL
  ------------------
  |  Branch (29:9): [True: 0, False: 164]
  |  Branch (29:25): [True: 0, False: 164]
  ------------------
   30|    164|        || (name_idx = ossl_property_name(libctx, name, 0)) == 0)
  ------------------
  |  Branch (30:12): [True: 0, False: 164]
  ------------------
   31|      0|        return NULL;
   32|       |
   33|    164|    return ossl_bsearch(&name_idx, list->properties, list->num_properties,
   34|    164|                        sizeof(*list->properties), &property_idx_cmp, 0);
   35|    164|}
ossl_property_get_string_value:
   44|    127|{
   45|    127|    const char *value = NULL;
   46|       |
   47|    127|    if (prop != NULL && prop->type == OSSL_PROPERTY_TYPE_STRING)
  ------------------
  |  Branch (47:9): [True: 127, False: 0]
  |  Branch (47:25): [True: 127, False: 0]
  ------------------
   48|    127|        value = ossl_property_value_str(libctx, prop->v.str_val);
   49|    127|    return value;
   50|    127|}
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|    283|{
   16|    283|    OSSL_PROPERTY_IDX key = *(const OSSL_PROPERTY_IDX *)keyp;
   17|    283|    const OSSL_PROPERTY_DEFINITION *defn =
   18|    283|            (const OSSL_PROPERTY_DEFINITION *)compare;
   19|       |
   20|    283|    return key - defn->name_idx;
   21|    283|}

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);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|    390|{
  254|    390|    return ossl_property_string(ctx, 1, create, s);
  255|    390|}
ossl_property_value:
  264|    217|{
  265|    217|    return ossl_property_string(ctx, 0, create, s);
  266|    217|}
ossl_property_value_str:
  269|    127|{
  270|    127|    return ossl_property_str(0, ctx, idx);
  271|    127|}
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);
  ------------------
  |  |  115|     30|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     30|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     30|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   63|     30|}
property_string.c:property_hash:
   51|    667|{
   52|    667|    return OPENSSL_LH_strhash(a->s);
   53|    667|}
property_string.c:property_cmp:
   56|    577|{
   57|    577|    return strcmp(a->s, b->s);
   58|    577|}
property_string.c:ossl_property_string:
  144|    607|{
  145|    607|    PROPERTY_STRING p, *ps, *ps_new;
  146|    607|    PROP_TABLE *t;
  147|    607|    OSSL_PROPERTY_IDX *pidx;
  148|    607|    PROPERTY_STRING_DATA *propdata
  149|    607|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |   99|    607|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  150|       |
  151|    607|    if (propdata == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 607]
  ------------------
  152|      0|        return 0;
  153|       |
  154|    607|    t = name ? propdata->prop_names : propdata->prop_values;
  ------------------
  |  Branch (154:9): [True: 390, False: 217]
  ------------------
  155|    607|    p.s = s;
  156|    607|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (156:9): [True: 0, False: 607]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  158|      0|        return 0;
  159|      0|    }
  160|    607|    ps = lh_PROPERTY_STRING_retrieve(t, &p);
  161|    607|    if (ps == NULL && create) {
  ------------------
  |  Branch (161:9): [True: 30, False: 577]
  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|    607|    CRYPTO_THREAD_unlock(propdata->lock);
  198|    607|    return ps != NULL ? ps->idx : 0;
  ------------------
  |  Branch (198:12): [True: 607, False: 0]
  ------------------
  199|    607|}
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);
  ------------------
  |  |  102|     30|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     30|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|    127|{
  219|    127|    const char *r;
  220|    127|    PROPERTY_STRING_DATA *propdata
  221|    127|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |   99|    127|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  222|       |
  223|    127|    if (propdata == NULL)
  ------------------
  |  Branch (223:9): [True: 0, False: 127]
  ------------------
  224|      0|        return NULL;
  225|       |
  226|    127|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (226:9): [True: 0, False: 127]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|    127|    r = sk_OPENSSL_CSTRING_value(name ? propdata->prop_namelist
  ------------------
  |  |  233|    254|#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: 127]
  |  |  ------------------
  ------------------
  244|    127|                                      : propdata->prop_valuelist, idx - 1);
  245|    127|#endif
  246|    127|    CRYPTO_THREAD_unlock(propdata->lock);
  247|       |
  248|    127|    return r;
  249|    127|}

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

ossl_child_prov_ctx_new:
   38|      2|{
   39|      2|    return OPENSSL_zalloc(sizeof(struct child_prov_globals));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|      2|}

ossl_prov_conf_ctx_new:
   31|      2|{
   32|      2|    PROVIDER_CONF_GLOBAL *pcgbl = OPENSSL_zalloc(sizeof(*pcgbl));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|      2|}

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

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

ossl_rand_cleanup_int:
   81|      2|{
   82|      2|# ifndef OPENSSL_NO_DEPRECATED_3_0
   83|      2|    const RAND_METHOD *meth = default_RAND_meth;
   84|       |
   85|      2|    if (!rand_inited)
  ------------------
  |  Branch (85:9): [True: 1, False: 1]
  ------------------
   86|      1|        return;
   87|       |
   88|      1|    if (meth != NULL && meth->cleanup != NULL)
  ------------------
  |  Branch (88:9): [True: 1, False: 0]
  |  Branch (88:25): [True: 0, False: 1]
  ------------------
   89|      0|        meth->cleanup();
   90|      1|    RAND_set_rand_method(NULL);
   91|      1|# endif
   92|      1|    ossl_rand_pool_cleanup();
   93|      1|# ifndef OPENSSL_NO_ENGINE
   94|      1|    CRYPTO_THREAD_lock_free(rand_engine_lock);
   95|      1|    rand_engine_lock = NULL;
   96|      1|# endif
   97|      1|# ifndef OPENSSL_NO_DEPRECATED_3_0
   98|      1|    CRYPTO_THREAD_lock_free(rand_meth_lock);
   99|      1|    rand_meth_lock = NULL;
  100|      1|# endif
  101|      1|    ossl_release_default_drbg_ctx();
  102|      1|    rand_inited = 0;
  103|      1|}
RAND_set_rand_method:
  182|      1|{
  183|      1|    return rand_set_rand_method_internal(meth, NULL);
  184|      1|}
RAND_get_rand_method:
  187|  20.5k|{
  188|  20.5k|    const RAND_METHOD *tmp_meth = NULL;
  189|       |
  190|  20.5k|    if (!RUN_ONCE(&rand_init, do_rand_init))
  ------------------
  |  |  130|  20.5k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 20.5k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (190:9): [True: 0, False: 20.5k]
  ------------------
  191|      0|        return NULL;
  192|       |
  193|  20.5k|    if (!CRYPTO_THREAD_read_lock(rand_meth_lock))
  ------------------
  |  Branch (193:9): [True: 0, False: 20.5k]
  ------------------
  194|      0|        return NULL;
  195|  20.5k|    tmp_meth = default_RAND_meth;
  196|  20.5k|    CRYPTO_THREAD_unlock(rand_meth_lock);
  197|  20.5k|    if (tmp_meth != NULL)
  ------------------
  |  Branch (197:9): [True: 20.5k, False: 1]
  ------------------
  198|  20.5k|        return tmp_meth;
  199|       |
  200|      1|    if (!CRYPTO_THREAD_write_lock(rand_meth_lock))
  ------------------
  |  Branch (200:9): [True: 0, False: 1]
  ------------------
  201|      0|        return NULL;
  202|      1|    if (default_RAND_meth == NULL) {
  ------------------
  |  Branch (202:9): [True: 1, False: 0]
  ------------------
  203|      1|#  ifndef OPENSSL_NO_ENGINE
  204|      1|        ENGINE *e;
  205|       |
  206|       |        /* If we have an engine that can do RAND, use it. */
  207|      1|        if ((e = ENGINE_get_default_RAND()) != NULL
  ------------------
  |  Branch (207:13): [True: 0, False: 1]
  ------------------
  208|      1|                && (tmp_meth = ENGINE_get_RAND(e)) != NULL) {
  ------------------
  |  Branch (208:20): [True: 0, False: 0]
  ------------------
  209|      0|            funct_ref = e;
  210|      0|            default_RAND_meth = tmp_meth;
  211|      1|        } else {
  212|      1|            ENGINE_finish(e);
  213|      1|            default_RAND_meth = &ossl_rand_meth;
  214|      1|        }
  215|       |#  else
  216|       |        default_RAND_meth = &ossl_rand_meth;
  217|       |#  endif
  218|      1|    }
  219|      1|    tmp_meth = default_RAND_meth;
  220|      1|    CRYPTO_THREAD_unlock(rand_meth_lock);
  221|      1|    return tmp_meth;
  222|      1|}
RAND_priv_bytes_ex:
  336|  20.5k|{
  337|  20.5k|    EVP_RAND_CTX *rand;
  338|  20.5k|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  339|  20.5k|    const RAND_METHOD *meth = RAND_get_rand_method();
  340|       |
  341|  20.5k|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (341:9): [True: 20.5k, False: 0]
  |  Branch (341:25): [True: 0, False: 20.5k]
  ------------------
  342|      0|        if (meth->bytes != NULL)
  ------------------
  |  Branch (342:13): [True: 0, False: 0]
  ------------------
  343|      0|            return meth->bytes(buf, num);
  344|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  345|      0|        return -1;
  346|      0|    }
  347|  20.5k|#endif
  348|       |
  349|  20.5k|    rand = RAND_get0_private(ctx);
  350|  20.5k|    if (rand != NULL)
  ------------------
  |  Branch (350:9): [True: 20.5k, False: 0]
  ------------------
  351|  20.5k|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  352|       |
  353|      0|    return 0;
  354|  20.5k|}
ossl_rand_ctx_new:
  454|      2|{
  455|      2|    RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  456|       |
  457|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (457:9): [True: 0, False: 2]
  ------------------
  458|      0|        return NULL;
  459|       |
  460|      2|#ifndef FIPS_MODULE
  461|       |    /*
  462|       |     * We need to ensure that base libcrypto thread handling has been
  463|       |     * initialised.
  464|       |     */
  465|      2|     OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  466|      2|#endif
  467|       |
  468|      2|    dgbl->lock = CRYPTO_THREAD_lock_new();
  469|      2|    if (dgbl->lock == NULL)
  ------------------
  |  Branch (469:9): [True: 0, False: 2]
  ------------------
  470|      0|        goto err1;
  471|       |
  472|      2|    if (!CRYPTO_THREAD_init_local(&dgbl->private, NULL))
  ------------------
  |  Branch (472:9): [True: 0, False: 2]
  ------------------
  473|      0|        goto err1;
  474|       |
  475|      2|    if (!CRYPTO_THREAD_init_local(&dgbl->public, NULL))
  ------------------
  |  Branch (475:9): [True: 0, False: 2]
  ------------------
  476|      0|        goto err2;
  477|       |
  478|      2|    return dgbl;
  479|       |
  480|      0| err2:
  481|      0|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  482|      0| err1:
  483|      0|    CRYPTO_THREAD_lock_free(dgbl->lock);
  484|      0|    OPENSSL_free(dgbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  485|      0|    return NULL;
  486|      0|}
ossl_rand_ctx_free:
  489|      2|{
  490|      2|    RAND_GLOBAL *dgbl = vdgbl;
  491|       |
  492|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (492:9): [True: 0, False: 2]
  ------------------
  493|      0|        return;
  494|       |
  495|      2|    CRYPTO_THREAD_lock_free(dgbl->lock);
  496|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  497|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->public);
  498|      2|    EVP_RAND_CTX_free(dgbl->primary);
  499|      2|    EVP_RAND_CTX_free(dgbl->seed);
  500|      2|    OPENSSL_free(dgbl->rng_name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  501|      2|    OPENSSL_free(dgbl->rng_cipher);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  502|      2|    OPENSSL_free(dgbl->rng_digest);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  503|      2|    OPENSSL_free(dgbl->rng_propq);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  504|      2|    OPENSSL_free(dgbl->seed_name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  505|      2|    OPENSSL_free(dgbl->seed_propq);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  506|       |
  507|      2|    OPENSSL_free(dgbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  508|      2|}
RAND_get0_primary:
  701|      1|{
  702|      1|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
  703|      1|    EVP_RAND_CTX *ret;
  704|       |
  705|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (705:9): [True: 0, False: 1]
  ------------------
  706|      0|        return NULL;
  707|       |
  708|      1|    if (!CRYPTO_THREAD_read_lock(dgbl->lock))
  ------------------
  |  Branch (708:9): [True: 0, False: 1]
  ------------------
  709|      0|        return NULL;
  710|       |
  711|      1|    ret = dgbl->primary;
  712|      1|    CRYPTO_THREAD_unlock(dgbl->lock);
  713|       |
  714|      1|    if (ret != NULL)
  ------------------
  |  Branch (714:9): [True: 0, False: 1]
  ------------------
  715|      0|        return ret;
  716|       |
  717|      1|    if (!CRYPTO_THREAD_write_lock(dgbl->lock))
  ------------------
  |  Branch (717:9): [True: 0, False: 1]
  ------------------
  718|      0|        return NULL;
  719|       |
  720|      1|    ret = dgbl->primary;
  721|      1|    if (ret != NULL) {
  ------------------
  |  Branch (721:9): [True: 0, False: 1]
  ------------------
  722|      0|        CRYPTO_THREAD_unlock(dgbl->lock);
  723|      0|        return ret;
  724|      0|    }
  725|       |
  726|      1|#ifndef FIPS_MODULE
  727|      1|    if (dgbl->seed == NULL) {
  ------------------
  |  Branch (727:9): [True: 1, False: 0]
  ------------------
  728|      1|        ERR_set_mark();
  729|      1|        dgbl->seed = rand_new_seed(ctx);
  730|      1|        ERR_pop_to_mark();
  731|      1|    }
  732|      1|#endif
  733|       |
  734|      1|    ret = dgbl->primary = rand_new_drbg(ctx, dgbl->seed,
  735|      1|                                        PRIMARY_RESEED_INTERVAL,
  ------------------
  |  |   23|      1|# define PRIMARY_RESEED_INTERVAL                 (1 << 8)
  ------------------
  736|      1|                                        PRIMARY_RESEED_TIME_INTERVAL, 1);
  ------------------
  |  |   25|      1|# define PRIMARY_RESEED_TIME_INTERVAL            (60 * 60) /* 1 hour */
  ------------------
  737|       |    /*
  738|       |    * The primary DRBG may be shared between multiple threads so we must
  739|       |    * enable locking.
  740|       |    */
  741|      1|    if (ret != NULL && !EVP_RAND_enable_locking(ret)) {
  ------------------
  |  Branch (741:9): [True: 1, False: 0]
  |  Branch (741:24): [True: 0, False: 1]
  ------------------
  742|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  743|      0|        EVP_RAND_CTX_free(ret);
  744|      0|        ret = dgbl->primary = NULL;
  745|      0|    }
  746|      1|    CRYPTO_THREAD_unlock(dgbl->lock);
  747|       |
  748|      1|    return ret;
  749|      1|}
RAND_get0_private:
  789|  20.5k|{
  790|  20.5k|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
  791|  20.5k|    EVP_RAND_CTX *rand, *primary;
  792|       |
  793|  20.5k|    if (dgbl == NULL)
  ------------------
  |  Branch (793:9): [True: 0, False: 20.5k]
  ------------------
  794|      0|        return NULL;
  795|       |
  796|  20.5k|    rand = CRYPTO_THREAD_get_local(&dgbl->private);
  797|  20.5k|    if (rand == NULL) {
  ------------------
  |  Branch (797:9): [True: 1, False: 20.5k]
  ------------------
  798|      1|        primary = RAND_get0_primary(ctx);
  799|      1|        if (primary == NULL)
  ------------------
  |  Branch (799:13): [True: 0, False: 1]
  ------------------
  800|      0|            return NULL;
  801|       |
  802|      1|        ctx = ossl_lib_ctx_get_concrete(ctx);
  803|       |        /*
  804|       |         * If the public is also NULL then this is the first time we've
  805|       |         * used this thread.
  806|       |         */
  807|      1|        if (CRYPTO_THREAD_get_local(&dgbl->public) == NULL
  ------------------
  |  Branch (807:13): [True: 1, False: 0]
  ------------------
  808|      1|                && !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
  ------------------
  |  Branch (808:20): [True: 0, False: 1]
  ------------------
  809|      0|            return NULL;
  810|      1|        rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
  ------------------
  |  |   24|      1|# define SECONDARY_RESEED_INTERVAL               (1 << 16)
  ------------------
  811|      1|                             SECONDARY_RESEED_TIME_INTERVAL, 0);
  ------------------
  |  |   26|      1|# define SECONDARY_RESEED_TIME_INTERVAL          (7 * 60)  /* 7 minutes */
  ------------------
  812|      1|        CRYPTO_THREAD_set_local(&dgbl->private, rand);
  813|      1|    }
  814|  20.5k|    return rand;
  815|  20.5k|}
rand_lib.c:do_rand_init:
   49|      1|{
   50|      1|# ifndef OPENSSL_NO_ENGINE
   51|      1|    rand_engine_lock = CRYPTO_THREAD_lock_new();
   52|      1|    if (rand_engine_lock == NULL)
  ------------------
  |  Branch (52:9): [True: 0, False: 1]
  ------------------
   53|      0|        return 0;
   54|      1|# endif
   55|       |
   56|      1|# ifndef OPENSSL_NO_DEPRECATED_3_0
   57|      1|    rand_meth_lock = CRYPTO_THREAD_lock_new();
   58|      1|    if (rand_meth_lock == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 1]
  ------------------
   59|      0|        goto err;
   60|      1|# endif
   61|       |
   62|      1|    if (!ossl_rand_pool_init())
  ------------------
  |  Branch (62:9): [True: 0, False: 1]
  ------------------
   63|      0|        goto err;
   64|       |
   65|      1|    rand_inited = 1;
   66|      1|    return 1;
   67|       |
   68|      0| err:
   69|      0|# ifndef OPENSSL_NO_DEPRECATED_3_0
   70|      0|    CRYPTO_THREAD_lock_free(rand_meth_lock);
   71|      0|    rand_meth_lock = NULL;
   72|      0|# endif
   73|      0|# ifndef OPENSSL_NO_ENGINE
   74|      0|    CRYPTO_THREAD_lock_free(rand_engine_lock);
   75|      0|    rand_engine_lock = NULL;
   76|      0|# endif
   77|      0|    return 0;
   78|      1|}
rand_lib.c:rand_set_rand_method_internal:
  166|      1|{
  167|      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 (167:9): [True: 0, False: 1]
  ------------------
  168|      0|        return 0;
  169|       |
  170|      1|    if (!CRYPTO_THREAD_write_lock(rand_meth_lock))
  ------------------
  |  Branch (170:9): [True: 0, False: 1]
  ------------------
  171|      0|        return 0;
  172|      1|#  ifndef OPENSSL_NO_ENGINE
  173|      1|    ENGINE_finish(funct_ref);
  174|      1|    funct_ref = e;
  175|      1|#  endif
  176|      1|    default_RAND_meth = meth;
  177|      1|    CRYPTO_THREAD_unlock(rand_meth_lock);
  178|      1|    return 1;
  179|      1|}
rand_lib.c:rand_get_global:
  511|  20.5k|{
  512|  20.5k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_INDEX);
  ------------------
  |  |  101|  20.5k|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  513|  20.5k|}
rand_lib.c:rand_new_seed:
  535|      1|{
  536|      1|    EVP_RAND *rand;
  537|      1|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  538|      1|    EVP_RAND_CTX *ctx = NULL;
  539|      1|    const char *propq;
  540|      1|    char *name, *props = NULL;
  541|      1|    size_t props_len;
  542|      1|    OSSL_PROPERTY_LIST *pl1, *pl2, *pl3 = NULL;
  543|       |
  544|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (544:9): [True: 0, False: 1]
  ------------------
  545|      0|        return NULL;
  546|      1|    propq = dgbl->seed_propq;
  547|      1|    if (dgbl->seed_name != NULL) {
  ------------------
  |  Branch (547:9): [True: 0, False: 1]
  ------------------
  548|      0|        name = dgbl->seed_name;
  549|      1|    } else {
  550|       |        /*
  551|       |         * Default to our internal seed source.  This isn't part of the FIPS
  552|       |         * provider so we need to override any FIPS properties.
  553|       |         */
  554|      1|        if (propq == NULL || *propq == '\0') {
  ------------------
  |  Branch (554:13): [True: 1, False: 0]
  |  Branch (554:30): [True: 0, False: 0]
  ------------------
  555|      1|            propq = "-fips";
  556|      1|        } else {
  557|      0|            pl1 = ossl_parse_query(libctx, propq, 1);
  558|      0|            if (pl1 == NULL) {
  ------------------
  |  Branch (558:17): [True: 0, False: 0]
  ------------------
  559|      0|                ERR_raise(ERR_LIB_RAND, RAND_R_INVALID_PROPERTY_QUERY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  560|      0|                return NULL;
  561|      0|            }
  562|      0|            pl2 = ossl_parse_query(libctx, "-fips", 1);
  563|      0|            if (pl2 == NULL) {
  ------------------
  |  Branch (563:17): [True: 0, False: 0]
  ------------------
  564|      0|                ossl_property_free(pl1);
  565|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  566|      0|                return NULL;
  567|      0|            }
  568|      0|            pl3 = ossl_property_merge(pl2, pl1);
  569|      0|            ossl_property_free(pl1);
  570|      0|            ossl_property_free(pl2);
  571|      0|            if (pl3 == NULL) {
  ------------------
  |  Branch (571:17): [True: 0, False: 0]
  ------------------
  572|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  573|      0|                return NULL;
  574|      0|            }
  575|      0|            props_len = ossl_property_list_to_string(libctx, pl3, NULL, 0);
  576|      0|            if (props_len == 0) {
  ------------------
  |  Branch (576:17): [True: 0, False: 0]
  ------------------
  577|       |                /* Shouldn't happen since we added a query element */
  578|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  579|      0|                goto err;
  580|      0|            } else {
  581|      0|                props = OPENSSL_malloc(props_len);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  582|      0|                if (props == NULL) {
  ------------------
  |  Branch (582:21): [True: 0, False: 0]
  ------------------
  583|      0|                    ERR_raise(ERR_LIB_RAND, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  584|      0|                    goto err;
  585|      0|                }
  586|      0|                if (ossl_property_list_to_string(libctx, pl3,
  ------------------
  |  Branch (586:21): [True: 0, False: 0]
  ------------------
  587|      0|                                                 props, props_len) == 0) {
  588|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  589|      0|                    goto err;
  590|      0|                }
  591|      0|                ossl_property_free(pl3);
  592|      0|                pl3 = NULL;
  593|      0|                propq = props;
  594|      0|            }
  595|      0|        }
  596|      1|        name = "SEED-SRC";
  597|      1|    }
  598|       |
  599|      1|    rand = EVP_RAND_fetch(libctx, name, propq);
  600|      1|    if (rand == NULL) {
  ------------------
  |  Branch (600:9): [True: 0, False: 1]
  ------------------
  601|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  602|      0|        goto err;
  603|      0|    }
  604|      1|    ctx = EVP_RAND_CTX_new(rand, NULL);
  605|      1|    EVP_RAND_free(rand);
  606|      1|    if (ctx == NULL) {
  ------------------
  |  Branch (606:9): [True: 0, False: 1]
  ------------------
  607|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  608|      0|        goto err;
  609|      0|    }
  610|      1|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, NULL)) {
  ------------------
  |  Branch (610:9): [True: 0, False: 1]
  ------------------
  611|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  612|      0|        goto err;
  613|      0|    }
  614|      1|    OPENSSL_free(props);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  615|      1|    return ctx;
  616|      0| err:
  617|      0|    EVP_RAND_CTX_free(ctx);
  618|      0|    ossl_property_free(pl3);
  619|      0|    OPENSSL_free(props);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  620|      0|    return NULL;
  621|      1|}
rand_lib.c:rand_new_drbg:
  642|      2|{
  643|      2|    EVP_RAND *rand;
  644|      2|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  645|      2|    EVP_RAND_CTX *ctx;
  646|      2|    OSSL_PARAM params[8], *p = params;
  647|      2|    const OSSL_PARAM *settables;
  648|      2|    char *name, *cipher;
  649|       |
  650|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (650:9): [True: 0, False: 2]
  ------------------
  651|      0|        return NULL;
  652|      2|    name = dgbl->rng_name != NULL ? dgbl->rng_name : "CTR-DRBG";
  ------------------
  |  Branch (652:12): [True: 0, False: 2]
  ------------------
  653|      2|    rand = EVP_RAND_fetch(libctx, name, dgbl->rng_propq);
  654|      2|    if (rand == NULL) {
  ------------------
  |  Branch (654:9): [True: 0, False: 2]
  ------------------
  655|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  656|      0|        return NULL;
  657|      0|    }
  658|      2|    ctx = EVP_RAND_CTX_new(rand, parent);
  659|      2|    EVP_RAND_free(rand);
  660|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (660:9): [True: 0, False: 2]
  ------------------
  661|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  662|      0|        return NULL;
  663|      0|    }
  664|       |
  665|      2|    settables = EVP_RAND_CTX_settable_params(ctx);
  666|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_CIPHER)) {
  ------------------
  |  |  207|      2|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  112|      2|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  |  Branch (666:9): [True: 2, False: 0]
  ------------------
  667|      2|        cipher = dgbl->rng_cipher != NULL ? dgbl->rng_cipher : "AES-256-CTR";
  ------------------
  |  Branch (667:18): [True: 0, False: 2]
  ------------------
  668|      2|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
  ------------------
  |  |  207|      2|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  112|      2|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  669|      2|                                                cipher, 0);
  670|      2|    }
  671|      2|    if (dgbl->rng_digest != NULL
  ------------------
  |  Branch (671:9): [True: 0, False: 2]
  ------------------
  672|      2|            && OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_DIGEST))
  ------------------
  |  |  208|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  113|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  |  Branch (672:16): [True: 0, False: 0]
  ------------------
  673|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_DIGEST,
  ------------------
  |  |  208|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  113|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  674|      0|                                                dgbl->rng_digest, 0);
  675|      2|    if (dgbl->rng_propq != NULL)
  ------------------
  |  Branch (675:9): [True: 0, False: 2]
  ------------------
  676|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_PROPERTIES,
  ------------------
  |  |  222|      0|# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  117|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  677|      0|                                                dgbl->rng_propq, 0);
  678|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_ALG_PARAM_MAC))
  ------------------
  |  |  116|      2|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  |  Branch (678:9): [True: 0, False: 2]
  ------------------
  679|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_ALG_PARAM_MAC, "HMAC", 0);
  ------------------
  |  |  116|      0|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  680|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_USE_DF))
  ------------------
  |  |  229|      2|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  |  Branch (680:9): [True: 2, False: 0]
  ------------------
  681|      2|        *p++ = OSSL_PARAM_construct_int(OSSL_DRBG_PARAM_USE_DF, &use_df);
  ------------------
  |  |  229|      2|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  682|      2|    *p++ = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_REQUESTS,
  ------------------
  |  |  225|      2|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  683|      2|                                     &reseed_interval);
  684|      2|    *p++ = OSSL_PARAM_construct_time_t(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL,
  ------------------
  |  |  227|      2|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  685|      2|                                       &reseed_time_interval);
  686|      2|    *p = OSSL_PARAM_construct_end();
  687|      2|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, params)) {
  ------------------
  |  Branch (687:9): [True: 0, False: 2]
  ------------------
  688|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  689|      0|        EVP_RAND_CTX_free(ctx);
  690|      0|        return NULL;
  691|      0|    }
  692|      2|    return ctx;
  693|      2|}
rand_lib.c:rand_delete_thread_state:
  516|      1|{
  517|      1|    OSSL_LIB_CTX *ctx = arg;
  518|      1|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
  519|      1|    EVP_RAND_CTX *rand;
  520|       |
  521|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (521:9): [True: 0, False: 1]
  ------------------
  522|      0|        return;
  523|       |
  524|      1|    rand = CRYPTO_THREAD_get_local(&dgbl->public);
  525|      1|    CRYPTO_THREAD_set_local(&dgbl->public, NULL);
  526|      1|    EVP_RAND_CTX_free(rand);
  527|       |
  528|      1|    rand = CRYPTO_THREAD_get_local(&dgbl->private);
  529|      1|    CRYPTO_THREAD_set_local(&dgbl->private, NULL);
  530|      1|    EVP_RAND_CTX_free(rand);
  531|      1|}

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

ossl_rand_pool_new:
   24|      1|{
   25|      1|    RAND_POOL *pool = OPENSSL_zalloc(sizeof(*pool));
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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: 1, False: 0]
  ------------------
   33|      1|        RAND_POOL_MAX_LENGTH : max_len;
  ------------------
  |  |   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
  |  |  ------------------
  ------------------
   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);
  ------------------
  |  |  125|      1|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      0|    else
   41|      0|        pool->buffer = OPENSSL_zalloc(pool->alloc_len);
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  129|      1|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|      0|        else
  103|      0|            OPENSSL_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  113|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|      1|    }
  105|       |
  106|      1|    OPENSSL_free(pool);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  107|      1|}
ossl_rand_pool_length:
  129|      1|{
  130|      1|    return pool->len;
  131|      1|}
ossl_rand_pool_detach:
  140|      1|{
  141|      1|    unsigned char *ret = pool->buffer;
  142|      1|    pool->buffer = NULL;
  143|      1|    pool->entropy = 0;
  144|      1|    return ret;
  145|      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: 1, False: 0]
  ------------------
  193|      1|        return pool->entropy_requested - pool->entropy;
  194|       |
  195|      0|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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_data(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW,
  ------------------
  |  |   97|      0|# define ERR_LIB_RAND            36
  ------------------
                      ERR_raise_data(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW,
  ------------------
  |  |   54|      0|# define RAND_R_RANDOM_POOL_OVERFLOW                      125
  ------------------
  253|      0|                       "entropy_factor=%u, entropy_needed=%zu, bytes_needed=%zu,"
  254|      0|                       "pool->max_len=%zu, pool->len=%zu",
  255|      0|                       entropy_factor, entropy_needed, bytes_needed,
  256|      0|                       pool->max_len, pool->len);
  257|      0|        return 0;
  258|      0|    }
  259|       |
  260|      1|    if (pool->len < pool->min_len &&
  ------------------
  |  Branch (260:9): [True: 1, False: 0]
  ------------------
  261|      1|        bytes_needed < pool->min_len - pool->len)
  ------------------
  |  Branch (261:9): [True: 1, False: 0]
  ------------------
  262|       |        /* to meet the min_len requirement */
  263|      1|        bytes_needed = pool->min_len - pool->len;
  264|       |
  265|       |    /*
  266|       |     * Make sure the buffer is large enough for the requested amount
  267|       |     * of data. This guarantees that existing code patterns where
  268|       |     * ossl_rand_pool_add_begin, ossl_rand_pool_add_end or ossl_rand_pool_add
  269|       |     * are used to collect entropy data without any error handling
  270|       |     * whatsoever, continue to be valid.
  271|       |     * Furthermore if the allocation here fails once, make sure that
  272|       |     * we don't fall back to a less secure or even blocking random source,
  273|       |     * as that could happen by the existing code patterns.
  274|       |     * This is not a concern for additional data, therefore that
  275|       |     * is not needed if rand_pool_grow fails in other places.
  276|       |     */
  277|      1|    if (!rand_pool_grow(pool, bytes_needed)) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1]
  ------------------
  278|       |        /* persistent error for this pool */
  279|      0|        pool->max_len = pool->len = 0;
  280|      0|        return 0;
  281|      0|    }
  282|       |
  283|      1|    return bytes_needed;
  284|      1|}
ossl_rand_pool_add_begin:
  357|      1|{
  358|      1|    if (len == 0)
  ------------------
  |  Branch (358:9): [True: 0, False: 1]
  ------------------
  359|      0|        return NULL;
  360|       |
  361|      1|    if (len > pool->max_len - pool->len) {
  ------------------
  |  Branch (361:9): [True: 0, False: 1]
  ------------------
  362|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  363|      0|        return NULL;
  364|      0|    }
  365|       |
  366|      1|    if (pool->buffer == NULL) {
  ------------------
  |  Branch (366:9): [True: 0, False: 1]
  ------------------
  367|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|      0|        return NULL;
  369|      0|    }
  370|       |
  371|       |    /*
  372|       |     * As long as the allocation request stays within the limits given
  373|       |     * by ossl_rand_pool_bytes_needed this rand_pool_grow below is guaranteed
  374|       |     * to succeed, thus no allocation happens.
  375|       |     * We have that only for cases when a pool is used to collect
  376|       |     * additional data. Then the buffer might need to grow here,
  377|       |     * and of course the caller is responsible to check the return
  378|       |     * value of this function.
  379|       |     */
  380|      1|    if (!rand_pool_grow(pool, len))
  ------------------
  |  Branch (380:9): [True: 0, False: 1]
  ------------------
  381|      0|        return NULL;
  382|       |
  383|      1|    return pool->buffer + pool->len;
  384|      1|}
ossl_rand_pool_add_end:
  396|      1|{
  397|      1|    if (len > pool->alloc_len - pool->len) {
  ------------------
  |  Branch (397:9): [True: 0, False: 1]
  ------------------
  398|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  399|      0|        return 0;
  400|      0|    }
  401|       |
  402|      1|    if (len > 0) {
  ------------------
  |  Branch (402:9): [True: 1, False: 0]
  ------------------
  403|      1|        pool->len += len;
  404|      1|        pool->entropy += entropy;
  405|      1|    }
  406|       |
  407|      1|    return 1;
  408|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  125|      0|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  217|      0|        else
  218|      0|            p = OPENSSL_zalloc(newlen);
  ------------------
  |  |  104|      0|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  129|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  224|      0|        else
  225|      0|            OPENSSL_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  113|      0|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|     20|{
   78|     20|    const unsigned char *p;
   79|     20|    int pklen;
   80|     20|    X509_ALGOR *alg;
   81|     20|    RSA *rsa = NULL;
   82|       |
   83|     20|    if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &alg, pubkey))
  ------------------
  |  Branch (83:9): [True: 0, False: 20]
  ------------------
   84|      0|        return 0;
   85|     20|    if ((rsa = d2i_RSAPublicKey(NULL, &p, pklen)) == NULL)
  ------------------
  |  Branch (85:9): [True: 5, False: 15]
  ------------------
   86|      5|        return 0;
   87|     15|    if (!ossl_rsa_param_decode(rsa, alg)) {
  ------------------
  |  Branch (87:9): [True: 1, False: 14]
  ------------------
   88|      1|        RSA_free(rsa);
   89|      1|        return 0;
   90|      1|    }
   91|       |
   92|     14|    RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK);
  ------------------
  |  |  117|     14|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
   93|     14|    switch (pkey->ameth->pkey_id) {
   94|      6|    case EVP_PKEY_RSA:
  ------------------
  |  |   60|      6|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|      6|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (94:5): [True: 6, False: 8]
  ------------------
   95|      6|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSA);
  ------------------
  |  |  118|      6|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
   96|      6|        break;
   97|      8|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   62|      8|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      8|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (97:5): [True: 8, False: 6]
  ------------------
   98|      8|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSASSAPSS);
  ------------------
  |  |  119|      8|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
   99|      8|        break;
  100|      0|    default:
  ------------------
  |  Branch (100:5): [True: 0, False: 14]
  ------------------
  101|       |        /* Leave the type bits zero */
  102|      0|        break;
  103|     14|    }
  104|       |
  105|     14|    if (!EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa)) {
  ------------------
  |  Branch (105:9): [True: 0, False: 14]
  ------------------
  106|      0|        RSA_free(rsa);
  107|      0|        return 0;
  108|      0|    }
  109|     14|    return 1;
  110|     14|}
rsa_ameth.c:int_rsa_free:
  201|     20|{
  202|     20|    RSA_free(pkey->pkey.rsa);
  203|     20|}

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

ossl_rsa_todata:
  255|     14|{
  256|     14|    int ret = 0;
  257|     14|    const BIGNUM *rsa_d = NULL, *rsa_n = NULL, *rsa_e = NULL;
  258|     14|    STACK_OF(BIGNUM_const) *factors = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|     14|# define STACK_OF(type) struct stack_st_##type
  ------------------
  259|     14|    STACK_OF(BIGNUM_const) *exps = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|     14|# define STACK_OF(type) struct stack_st_##type
  ------------------
  260|     14|    STACK_OF(BIGNUM_const) *coeffs = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|     14|# define STACK_OF(type) struct stack_st_##type
  ------------------
  261|       |
  262|     14|    if (rsa == NULL || factors == NULL || exps == NULL || coeffs == NULL)
  ------------------
  |  Branch (262:9): [True: 0, False: 14]
  |  Branch (262:24): [True: 0, False: 14]
  |  Branch (262:43): [True: 0, False: 14]
  |  Branch (262:59): [True: 0, False: 14]
  ------------------
  263|      0|        goto err;
  264|       |
  265|     14|    RSA_get0_key(rsa, &rsa_n, &rsa_e, &rsa_d);
  266|     14|    ossl_rsa_get0_all_params(rsa, factors, exps, coeffs);
  267|       |
  268|     14|    if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_N, rsa_n)
  ------------------
  |  |  434|     14|# define OSSL_PKEY_PARAM_RSA_N "n"
  ------------------
  |  Branch (268:9): [True: 0, False: 14]
  ------------------
  269|     14|        || !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_E, rsa_e))
  ------------------
  |  |  409|     14|# define OSSL_PKEY_PARAM_RSA_E "e"
  ------------------
  |  Branch (269:12): [True: 0, False: 14]
  ------------------
  270|      0|        goto err;
  271|       |
  272|       |    /* Check private key data integrity */
  273|     14|    if (include_private && rsa_d != NULL) {
  ------------------
  |  Branch (273:9): [True: 14, False: 0]
  |  Branch (273:28): [True: 0, False: 14]
  ------------------
  274|       |
  275|      0|        if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_D,
  ------------------
  |  |  405|      0|# define OSSL_PKEY_PARAM_RSA_D "d"
  ------------------
  |  Branch (275:13): [True: 0, False: 0]
  ------------------
  276|      0|                                     rsa_d)
  277|      0|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (277:16): [True: 0, False: 0]
  ------------------
  278|      0|                                                  ossl_rsa_mp_factor_names,
  279|      0|                                                  factors)
  280|      0|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (280:16): [True: 0, False: 0]
  ------------------
  281|      0|                                                  ossl_rsa_mp_exp_names, exps)
  282|      0|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (282:16): [True: 0, False: 0]
  ------------------
  283|      0|                                                  ossl_rsa_mp_coeff_names,
  284|      0|                                                  coeffs))
  285|      0|            goto err;
  286|      0|    }
  287|       |
  288|       |#if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
  289|       |    /* The acvp test results are not meant for export so check for bld == NULL */
  290|       |    if (bld == NULL)
  291|       |        ossl_rsa_acvp_test_get_params(rsa, params);
  292|       |#endif
  293|     14|    ret = 1;
  294|     14| err:
  295|     14|    sk_BIGNUM_const_free(factors);
  296|     14|    sk_BIGNUM_const_free(exps);
  297|     14|    sk_BIGNUM_const_free(coeffs);
  298|     14|    return ret;
  299|     14|}
ossl_rsa_pss_params_30_todata:
  303|      8|{
  304|      8|    if (!ossl_rsa_pss_params_30_is_unrestricted(pss)) {
  ------------------
  |  Branch (304:9): [True: 8, False: 0]
  ------------------
  305|      8|        int hashalg_nid = ossl_rsa_pss_params_30_hashalg(pss);
  306|      8|        int maskgenalg_nid = ossl_rsa_pss_params_30_maskgenalg(pss);
  307|      8|        int maskgenhashalg_nid = ossl_rsa_pss_params_30_maskgenhashalg(pss);
  308|      8|        int saltlen = ossl_rsa_pss_params_30_saltlen(pss);
  309|      8|        int default_hashalg_nid = ossl_rsa_pss_params_30_hashalg(NULL);
  310|      8|        int default_maskgenalg_nid = ossl_rsa_pss_params_30_maskgenalg(NULL);
  311|      8|        int default_maskgenhashalg_nid =
  312|      8|                ossl_rsa_pss_params_30_maskgenhashalg(NULL);
  313|      8|        const char *mdname =
  314|      8|            (hashalg_nid == default_hashalg_nid
  ------------------
  |  Branch (314:14): [True: 8, False: 0]
  ------------------
  315|      8|             ? NULL : ossl_rsa_oaeppss_nid2name(hashalg_nid));
  316|      8|        const char *mgfname =
  317|      8|            (maskgenalg_nid == default_maskgenalg_nid
  ------------------
  |  Branch (317:14): [True: 8, False: 0]
  ------------------
  318|      8|             ? NULL : ossl_rsa_oaeppss_nid2name(maskgenalg_nid));
  319|      8|        const char *mgf1mdname =
  320|      8|            (maskgenhashalg_nid == default_maskgenhashalg_nid
  ------------------
  |  Branch (320:14): [True: 8, False: 0]
  ------------------
  321|      8|             ? NULL : ossl_rsa_oaeppss_nid2name(maskgenhashalg_nid));
  322|      8|        const char *key_md = OSSL_PKEY_PARAM_RSA_DIGEST;
  ------------------
  |  |  407|      8|# define OSSL_PKEY_PARAM_RSA_DIGEST OSSL_PKEY_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  339|      8|# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|      8|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  323|      8|        const char *key_mgf = OSSL_PKEY_PARAM_RSA_MASKGENFUNC;
  ------------------
  |  |  432|      8|# define OSSL_PKEY_PARAM_RSA_MASKGENFUNC OSSL_PKEY_PARAM_MASKGENFUNC
  |  |  ------------------
  |  |  |  |  386|      8|# define OSSL_PKEY_PARAM_MASKGENFUNC "mgf"
  |  |  ------------------
  ------------------
  324|      8|        const char *key_mgf1_md = OSSL_PKEY_PARAM_RSA_MGF1_DIGEST;
  ------------------
  |  |  433|      8|# define OSSL_PKEY_PARAM_RSA_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
  |  |  ------------------
  |  |  |  |  388|      8|# define OSSL_PKEY_PARAM_MGF1_DIGEST "mgf1-digest"
  |  |  ------------------
  ------------------
  325|      8|        const char *key_saltlen = OSSL_PKEY_PARAM_RSA_PSS_SALTLEN;
  ------------------
  |  |  436|      8|# define OSSL_PKEY_PARAM_RSA_PSS_SALTLEN "saltlen"
  ------------------
  326|       |
  327|       |        /*
  328|       |         * To ensure that the key isn't seen as unrestricted by the recipient,
  329|       |         * we make sure that at least one PSS-related parameter is passed, even
  330|       |         * if it has a default value; saltlen.
  331|       |         */
  332|      8|        if ((mdname != NULL
  ------------------
  |  Branch (332:14): [True: 0, False: 8]
  ------------------
  333|      8|             && !ossl_param_build_set_utf8_string(bld, params, key_md, mdname))
  ------------------
  |  Branch (333:17): [True: 0, False: 0]
  ------------------
  334|      8|            || (mgfname != NULL
  ------------------
  |  Branch (334:17): [True: 0, False: 8]
  ------------------
  335|      8|                && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (335:20): [True: 0, False: 0]
  ------------------
  336|      0|                                                     key_mgf, mgfname))
  337|      8|            || (mgf1mdname != NULL
  ------------------
  |  Branch (337:17): [True: 0, False: 8]
  ------------------
  338|      8|                && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (338:20): [True: 0, False: 0]
  ------------------
  339|      0|                                                     key_mgf1_md, mgf1mdname))
  340|      8|            || (!ossl_param_build_set_int(bld, params, key_saltlen, saltlen)))
  ------------------
  |  Branch (340:16): [True: 0, False: 8]
  ------------------
  341|      0|            return 0;
  342|      8|    }
  343|      8|    return 1;
  344|      8|}
ossl_rsa_is_foreign:
  450|     14|{
  451|     14|#ifndef FIPS_MODULE
  452|     14|    if (rsa->engine != NULL || RSA_get_method(rsa) != RSA_PKCS1_OpenSSL())
  ------------------
  |  Branch (452:9): [True: 0, False: 14]
  |  Branch (452:32): [True: 0, False: 14]
  ------------------
  453|      0|        return 1;
  454|     14|#endif
  455|     14|    return 0;
  456|     14|}
ossl_rsa_pss_decode:
  562|      8|{
  563|      8|    RSA_PSS_PARAMS *pss;
  564|       |
  565|      8|    pss = ASN1_TYPE_unpack_sequence(ASN1_ITEM_rptr(RSA_PSS_PARAMS),
  ------------------
  |  |  426|      8|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  566|      8|                                    alg->parameter);
  567|       |
  568|      8|    if (pss == NULL)
  ------------------
  |  Branch (568:9): [True: 0, False: 8]
  ------------------
  569|      0|        return NULL;
  570|       |
  571|      8|    if (pss->maskGenAlgorithm != NULL) {
  ------------------
  |  Branch (571:9): [True: 0, False: 8]
  ------------------
  572|      0|        pss->maskHash = ossl_x509_algor_mgf1_decode(pss->maskGenAlgorithm);
  573|      0|        if (pss->maskHash == NULL) {
  ------------------
  |  Branch (573:13): [True: 0, False: 0]
  ------------------
  574|      0|            RSA_PSS_PARAMS_free(pss);
  575|      0|            return NULL;
  576|      0|        }
  577|      0|    }
  578|       |
  579|      8|    return pss;
  580|      8|}
ossl_rsa_pss_get_param_unverified:
  624|      8|{
  625|      8|    RSA_PSS_PARAMS_30 pss_params;
  626|       |
  627|       |    /* Get the defaults from the ONE place */
  628|      8|    (void)ossl_rsa_pss_params_30_set_defaults(&pss_params);
  629|       |
  630|      8|    if (pss == NULL)
  ------------------
  |  Branch (630:9): [True: 0, False: 8]
  ------------------
  631|      0|        return 0;
  632|      8|    *pmd = ossl_x509_algor_get_md(pss->hashAlgorithm);
  633|      8|    if (*pmd == NULL)
  ------------------
  |  Branch (633:9): [True: 0, False: 8]
  ------------------
  634|      0|        return 0;
  635|      8|    *pmgf1md = ossl_x509_algor_get_md(pss->maskHash);
  636|      8|    if (*pmgf1md == NULL)
  ------------------
  |  Branch (636:9): [True: 0, False: 8]
  ------------------
  637|      0|        return 0;
  638|      8|    if (pss->saltLength)
  ------------------
  |  Branch (638:9): [True: 0, False: 8]
  ------------------
  639|      0|        *psaltlen = ASN1_INTEGER_get(pss->saltLength);
  640|      8|    else
  641|      8|        *psaltlen = ossl_rsa_pss_params_30_saltlen(&pss_params);
  642|      8|    if (pss->trailerField)
  ------------------
  |  Branch (642:9): [True: 0, False: 8]
  ------------------
  643|      0|        *ptrailerField = ASN1_INTEGER_get(pss->trailerField);
  644|      8|    else
  645|      8|        *ptrailerField = ossl_rsa_pss_params_30_trailerfield(&pss_params);
  646|       |
  647|      8|    return 1;
  648|      8|}
ossl_rsa_param_decode:
  651|     15|{
  652|     15|    RSA_PSS_PARAMS *pss;
  653|     15|    const ASN1_OBJECT *algoid;
  654|     15|    const void *algp;
  655|     15|    int algptype;
  656|       |
  657|     15|    X509_ALGOR_get0(&algoid, &algptype, &algp, alg);
  658|     15|    if (OBJ_obj2nid(algoid) != EVP_PKEY_RSA_PSS)
  ------------------
  |  |   62|     15|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|     15|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (658:9): [True: 6, False: 9]
  ------------------
  659|      6|        return 1;
  660|      9|    if (algptype == V_ASN1_UNDEF)
  ------------------
  |  |   60|      9|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (660:9): [True: 0, False: 9]
  ------------------
  661|      0|        return 1;
  662|      9|    if (algptype != V_ASN1_SEQUENCE) {
  ------------------
  |  |   74|      9|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (662:9): [True: 1, False: 8]
  ------------------
  663|      1|        ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
  664|      1|        return 0;
  665|      1|    }
  666|      8|    if ((pss = ossl_rsa_pss_decode(alg)) == NULL
  ------------------
  |  Branch (666:9): [True: 0, False: 8]
  ------------------
  667|      8|        || !ossl_rsa_set0_pss_params(rsa, pss)) {
  ------------------
  |  Branch (667:12): [True: 0, False: 8]
  ------------------
  668|      0|        RSA_PSS_PARAMS_free(pss);
  669|      0|        return 0;
  670|      0|    }
  671|      8|    if (!ossl_rsa_sync_to_pss_params_30(rsa))
  ------------------
  |  Branch (671:9): [True: 0, False: 8]
  ------------------
  672|      0|        return 0;
  673|      8|    return 1;
  674|      8|}
rsa_backend.c:ossl_rsa_sync_to_pss_params_30:
  583|      8|{
  584|      8|    const RSA_PSS_PARAMS *legacy_pss = NULL;
  585|      8|    RSA_PSS_PARAMS_30 *pss = NULL;
  586|       |
  587|      8|    if (rsa != NULL
  ------------------
  |  Branch (587:9): [True: 8, False: 0]
  ------------------
  588|      8|        && (legacy_pss = RSA_get0_pss_params(rsa)) != NULL
  ------------------
  |  Branch (588:12): [True: 8, False: 0]
  ------------------
  589|      8|        && (pss = ossl_rsa_get0_pss_params_30(rsa)) != NULL) {
  ------------------
  |  Branch (589:12): [True: 8, False: 0]
  ------------------
  590|      8|        const EVP_MD *md = NULL, *mgf1md = NULL;
  591|      8|        int md_nid, mgf1md_nid, saltlen, trailerField;
  592|      8|        RSA_PSS_PARAMS_30 pss_params;
  593|       |
  594|       |        /*
  595|       |         * We don't care about the validity of the fields here, we just
  596|       |         * want to synchronise values.  Verifying here makes it impossible
  597|       |         * to even read a key with invalid values, making it hard to test
  598|       |         * a bad situation.
  599|       |         *
  600|       |         * Other routines use ossl_rsa_pss_get_param(), so the values will
  601|       |         * be checked, eventually.
  602|       |         */
  603|      8|        if (!ossl_rsa_pss_get_param_unverified(legacy_pss, &md, &mgf1md,
  ------------------
  |  Branch (603:13): [True: 0, False: 8]
  ------------------
  604|      8|                                               &saltlen, &trailerField))
  605|      0|            return 0;
  606|      8|        md_nid = EVP_MD_get_type(md);
  607|      8|        mgf1md_nid = EVP_MD_get_type(mgf1md);
  608|      8|        if (!ossl_rsa_pss_params_30_set_defaults(&pss_params)
  ------------------
  |  Branch (608:13): [True: 0, False: 8]
  ------------------
  609|      8|            || !ossl_rsa_pss_params_30_set_hashalg(&pss_params, md_nid)
  ------------------
  |  Branch (609:16): [True: 0, False: 8]
  ------------------
  610|      8|            || !ossl_rsa_pss_params_30_set_maskgenhashalg(&pss_params,
  ------------------
  |  Branch (610:16): [True: 0, False: 8]
  ------------------
  611|      8|                                                          mgf1md_nid)
  612|      8|            || !ossl_rsa_pss_params_30_set_saltlen(&pss_params, saltlen)
  ------------------
  |  Branch (612:16): [True: 0, False: 8]
  ------------------
  613|      8|            || !ossl_rsa_pss_params_30_set_trailerfield(&pss_params,
  ------------------
  |  Branch (613:16): [True: 0, False: 8]
  ------------------
  614|      8|                                                        trailerField))
  615|      0|            return 0;
  616|      8|        *pss = pss_params;
  617|      8|    }
  618|      8|    return 1;
  619|      8|}

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

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|     18|{
   36|     18|    return rsa_new_intern(NULL, NULL);
   37|     18|}
RSA_get_method:
   40|     14|{
   41|     14|    return rsa->meth;
   42|     14|}
RSA_free:
  137|     58|{
  138|     58|    int i;
  139|       |
  140|     58|    if (r == NULL)
  ------------------
  |  Branch (140:9): [True: 26, False: 32]
  ------------------
  141|     26|        return;
  142|       |
  143|     32|    CRYPTO_DOWN_REF(&r->references, &i);
  144|     32|    REF_PRINT_COUNT("RSA", r);
  ------------------
  |  |  289|     32|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|     32|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|     32|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|     32|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|     32|    if (i > 0)
  ------------------
  |  Branch (145:9): [True: 14, False: 18]
  ------------------
  146|     14|        return;
  147|     18|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|     18|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 18]
  |  |  ------------------
  ------------------
  148|       |
  149|     18|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (149:9): [True: 18, False: 0]
  |  Branch (149:28): [True: 18, False: 0]
  ------------------
  150|     18|        r->meth->finish(r);
  151|     18|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  152|     18|    ENGINE_finish(r->engine);
  153|     18|#endif
  154|       |
  155|     18|#ifndef FIPS_MODULE
  156|     18|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data);
  ------------------
  |  |  237|     18|# define CRYPTO_EX_INDEX_RSA              9
  ------------------
  157|     18|#endif
  158|       |
  159|     18|    CRYPTO_THREAD_lock_free(r->lock);
  160|     18|    CRYPTO_FREE_REF(&r->references);
  161|       |
  162|       |#ifdef FIPS_MODULE
  163|       |    BN_clear_free(r->n);
  164|       |    BN_clear_free(r->e);
  165|       |#else
  166|     18|    BN_free(r->n);
  167|     18|    BN_free(r->e);
  168|     18|#endif
  169|     18|    BN_clear_free(r->d);
  170|     18|    BN_clear_free(r->p);
  171|     18|    BN_clear_free(r->q);
  172|     18|    BN_clear_free(r->dmp1);
  173|     18|    BN_clear_free(r->dmq1);
  174|     18|    BN_clear_free(r->iqmp);
  175|       |
  176|       |#if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
  177|       |    ossl_rsa_acvp_test_free(r->acvp_test);
  178|       |#endif
  179|       |
  180|     18|#ifndef FIPS_MODULE
  181|     18|    RSA_PSS_PARAMS_free(r->pss);
  182|     18|    sk_RSA_PRIME_INFO_pop_free(r->prime_infos, ossl_rsa_multip_info_free);
  183|     18|#endif
  184|     18|    BN_BLINDING_free(r->blinding);
  185|     18|    BN_BLINDING_free(r->mt_blinding);
  186|     18|    OPENSSL_free(r);
  ------------------
  |  |  115|     18|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  187|     18|}
RSA_up_ref:
  190|     14|{
  191|     14|    int i;
  192|       |
  193|     14|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (193:9): [True: 0, False: 14]
  ------------------
  194|      0|        return 0;
  195|       |
  196|     14|    REF_PRINT_COUNT("RSA", r);
  ------------------
  |  |  289|     14|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|     14|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|     14|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|     14|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|     14|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|     14|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 14]
  |  |  ------------------
  ------------------
  198|     14|    return i > 1 ? 1 : 0;
  ------------------
  |  Branch (198:12): [True: 14, False: 0]
  ------------------
  199|     14|}
ossl_rsa_set0_libctx:
  207|     14|{
  208|     14|    r->libctx = libctx;
  209|     14|}
ossl_ifc_ffc_compute_security_bits:
  323|     14|{
  324|     14|    uint64_t x;
  325|     14|    uint32_t lx;
  326|     14|    uint16_t y, cap;
  327|       |
  328|       |    /*
  329|       |     * Look for common values as listed in standards.
  330|       |     * These values are not exactly equal to the results from the formulae in
  331|       |     * the standards but are defined to be canonical.
  332|       |     */
  333|     14|    switch (n) {
  ------------------
  |  Branch (333:13): [True: 14, False: 0]
  ------------------
  334|      0|    case 2048:      /* SP 800-56B rev 2 Appendix D and FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (334:5): [True: 0, False: 14]
  ------------------
  335|      0|        return 112;
  336|      0|    case 3072:      /* SP 800-56B rev 2 Appendix D and FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (336:5): [True: 0, False: 14]
  ------------------
  337|      0|        return 128;
  338|      0|    case 4096:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (338:5): [True: 0, False: 14]
  ------------------
  339|      0|        return 152;
  340|      0|    case 6144:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (340:5): [True: 0, False: 14]
  ------------------
  341|      0|        return 176;
  342|      0|    case 7680:      /* FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (342:5): [True: 0, False: 14]
  ------------------
  343|      0|        return 192;
  344|      0|    case 8192:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (344:5): [True: 0, False: 14]
  ------------------
  345|      0|        return 200;
  346|      0|    case 15360:     /* FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (346:5): [True: 0, False: 14]
  ------------------
  347|      0|        return 256;
  348|     14|    }
  349|       |
  350|       |    /*
  351|       |     * The first incorrect result (i.e. not accurate or off by one low) occurs
  352|       |     * for n = 699668.  The true value here is 1200.  Instead of using this n
  353|       |     * as the check threshold, the smallest n such that the correct result is
  354|       |     * 1200 is used instead.
  355|       |     */
  356|     14|    if (n >= 687737)
  ------------------
  |  Branch (356:9): [True: 0, False: 14]
  ------------------
  357|      0|        return 1200;
  358|     14|    if (n < 8)
  ------------------
  |  Branch (358:9): [True: 1, False: 13]
  ------------------
  359|      1|        return 0;
  360|       |
  361|       |    /*
  362|       |     * To ensure that the output is non-decreasing with respect to n,
  363|       |     * a cap needs to be applied to the two values where the function over
  364|       |     * estimates the strength (according to the above fast path).
  365|       |     */
  366|     13|    if (n <= 7680)
  ------------------
  |  Branch (366:9): [True: 13, False: 0]
  ------------------
  367|     13|        cap = 192;
  368|      0|    else if (n <= 15360)
  ------------------
  |  Branch (368:14): [True: 0, False: 0]
  ------------------
  369|      0|        cap = 256;
  370|      0|    else
  371|      0|        cap = 1200;
  372|       |
  373|     13|    x = n * (uint64_t)log_2;
  374|     13|    lx = ilog_e(x);
  375|     13|    y = (uint16_t)((mul2(c1_923, icbrt64(mul2(mul2(x, lx), lx))) - c4_690)
  376|     13|                   / log_2);
  377|     13|    y = (y + 4) & ~7;
  378|     13|    if (y > cap)
  ------------------
  |  Branch (378:9): [True: 0, False: 13]
  ------------------
  379|      0|        y = cap;
  380|     13|    return y;
  381|     14|}
RSA_security_bits:
  386|     14|{
  387|     14|    int bits = BN_num_bits(rsa->n);
  388|       |
  389|     14|#ifndef FIPS_MODULE
  390|     14|    if (rsa->version == RSA_ASN1_VERSION_MULTI) {
  ------------------
  |  |   60|     14|#  define RSA_ASN1_VERSION_MULTI          1
  ------------------
  |  Branch (390:9): [True: 0, False: 14]
  ------------------
  391|       |        /* This ought to mean that we have private key at hand. */
  392|      0|        int ex_primes = sk_RSA_PRIME_INFO_num(rsa->prime_infos);
  393|       |
  394|      0|        if (ex_primes <= 0 || (ex_primes + 2) > ossl_rsa_multip_cap(bits))
  ------------------
  |  Branch (394:13): [True: 0, False: 0]
  |  Branch (394:31): [True: 0, False: 0]
  ------------------
  395|      0|            return 0;
  396|      0|    }
  397|     14|#endif
  398|     14|    return ossl_ifc_ffc_compute_security_bits(bits);
  399|     14|}
RSA_get0_key:
  556|     14|{
  557|     14|    if (n != NULL)
  ------------------
  |  Branch (557:9): [True: 14, False: 0]
  ------------------
  558|     14|        *n = r->n;
  559|     14|    if (e != NULL)
  ------------------
  |  Branch (559:9): [True: 14, False: 0]
  ------------------
  560|     14|        *e = r->e;
  561|     14|    if (d != NULL)
  ------------------
  |  Branch (561:9): [True: 14, False: 0]
  ------------------
  562|     14|        *d = r->d;
  563|     14|}
RSA_get0_n:
  646|     14|{
  647|     14|    return r->n;
  648|     14|}
RSA_get0_p:
  661|     14|{
  662|     14|    return r->p;
  663|     14|}
RSA_get0_pss_params:
  686|      8|{
  687|       |#ifdef FIPS_MODULE
  688|       |    return NULL;
  689|       |#else
  690|      8|    return r->pss;
  691|      8|#endif
  692|      8|}
ossl_rsa_set0_pss_params:
  696|      8|{
  697|       |#ifdef FIPS_MODULE
  698|       |    return 0;
  699|       |#else
  700|      8|    RSA_PSS_PARAMS_free(r->pss);
  701|      8|    r->pss = pss;
  702|      8|    return 1;
  703|      8|#endif
  704|      8|}
ossl_rsa_get0_pss_params_30:
  708|     22|{
  709|     22|    return &r->pss_params;
  710|     22|}
RSA_clear_flags:
  713|     14|{
  714|     14|    r->flags &= ~flags;
  715|     14|}
RSA_test_flags:
  718|     42|{
  719|     42|    return r->flags & flags;
  720|     42|}
RSA_set_flags:
  723|     14|{
  724|     14|    r->flags |= flags;
  725|     14|}
ossl_rsa_get0_all_params:
  877|     14|{
  878|     14|#ifndef FIPS_MODULE
  879|     14|    RSA_PRIME_INFO *pinfo;
  880|     14|    int i, pnum;
  881|     14|#endif
  882|       |
  883|     14|    if (r == NULL)
  ------------------
  |  Branch (883:9): [True: 0, False: 14]
  ------------------
  884|      0|        return 0;
  885|       |
  886|       |    /* If |p| is NULL, there are no CRT parameters */
  887|     14|    if (RSA_get0_p(r) == NULL)
  ------------------
  |  Branch (887:9): [True: 14, False: 0]
  ------------------
  888|     14|        return 1;
  889|       |
  890|      0|    sk_BIGNUM_const_push(primes, RSA_get0_p(r));
  891|      0|    sk_BIGNUM_const_push(primes, RSA_get0_q(r));
  892|      0|    sk_BIGNUM_const_push(exps, RSA_get0_dmp1(r));
  893|      0|    sk_BIGNUM_const_push(exps, RSA_get0_dmq1(r));
  894|      0|    sk_BIGNUM_const_push(coeffs, RSA_get0_iqmp(r));
  895|       |
  896|      0|#ifndef FIPS_MODULE
  897|      0|    pnum = RSA_get_multi_prime_extra_count(r);
  898|      0|    for (i = 0; i < pnum; i++) {
  ------------------
  |  Branch (898:17): [True: 0, False: 0]
  ------------------
  899|      0|        pinfo = sk_RSA_PRIME_INFO_value(r->prime_infos, i);
  900|      0|        sk_BIGNUM_const_push(primes, pinfo->r);
  901|      0|        sk_BIGNUM_const_push(exps, pinfo->d);
  902|      0|        sk_BIGNUM_const_push(coeffs, pinfo->t);
  903|      0|    }
  904|      0|#endif
  905|       |
  906|      0|    return 1;
  907|     14|}
rsa_lib.c:rsa_new_intern:
   76|     18|{
   77|     18|    RSA *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|     18|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   78|       |
   79|     18|    if (ret == NULL)
  ------------------
  |  Branch (79:9): [True: 0, False: 18]
  ------------------
   80|      0|        return NULL;
   81|       |
   82|     18|    ret->lock = CRYPTO_THREAD_lock_new();
   83|     18|    if (ret->lock == NULL) {
  ------------------
  |  Branch (83:9): [True: 0, False: 18]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   85|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   86|      0|        return NULL;
   87|      0|    }
   88|       |
   89|     18|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 18]
  ------------------
   90|      0|        CRYPTO_THREAD_lock_free(ret->lock);
   91|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|      0|        return NULL;
   93|      0|    }
   94|       |
   95|     18|    ret->libctx = libctx;
   96|     18|    ret->meth = RSA_get_default_method();
   97|     18|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   98|     18|    ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |  477|     18|#  define RSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
   99|     18|    if (engine) {
  ------------------
  |  Branch (99:9): [True: 0, False: 18]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  102|      0|            goto err;
  103|      0|        }
  104|      0|        ret->engine = engine;
  105|     18|    } else {
  106|     18|        ret->engine = ENGINE_get_default_RSA();
  107|     18|    }
  108|     18|    if (ret->engine) {
  ------------------
  |  Branch (108:9): [True: 0, False: 18]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  112|      0|            goto err;
  113|      0|        }
  114|      0|    }
  115|     18|#endif
  116|       |
  117|     18|    ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |  477|     18|#  define RSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
  118|     18|#ifndef FIPS_MODULE
  119|     18|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data)) {
  ------------------
  |  |  237|     18|# define CRYPTO_EX_INDEX_RSA              9
  ------------------
  |  Branch (119:9): [True: 0, False: 18]
  ------------------
  120|      0|        goto err;
  121|      0|    }
  122|     18|#endif
  123|       |
  124|     18|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (124:9): [True: 18, False: 0]
  |  Branch (124:38): [True: 0, False: 18]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        goto err;
  127|      0|    }
  128|       |
  129|     18|    return ret;
  130|       |
  131|      0| err:
  132|      0|    RSA_free(ret);
  133|      0|    return NULL;
  134|     18|}
rsa_lib.c:ilog_e:
  280|     13|{
  281|     13|    uint32_t i, r = 0;
  282|       |
  283|       |    /*
  284|       |     * Scale down the value into the range 1 .. 2.
  285|       |     *
  286|       |     * If fractional numbers need to be processed, another loop needs
  287|       |     * to go here that checks v < scale and if so multiplies it by 2 and
  288|       |     * reduces r by scale.  This also means making r signed.
  289|       |     */
  290|     66|    while (v >= 2 * scale) {
  ------------------
  |  Branch (290:12): [True: 53, False: 13]
  ------------------
  291|     53|        v >>= 1;
  292|     53|        r += scale;
  293|     53|    }
  294|    247|    for (i = scale / 2; i != 0; i /= 2) {
  ------------------
  |  Branch (294:25): [True: 234, False: 13]
  ------------------
  295|    234|        v = mul2(v, v);
  296|    234|        if (v >= 2 * scale) {
  ------------------
  |  Branch (296:13): [True: 126, False: 108]
  ------------------
  297|    126|            v >>= 1;
  298|    126|            r += i;
  299|    126|        }
  300|    234|    }
  301|     13|    r = (r * (uint64_t)scale) / log_e;
  302|     13|    return r;
  303|     13|}
rsa_lib.c:mul2:
  244|    273|{
  245|    273|    return a * b / scale;
  246|    273|}
rsa_lib.c:icbrt64:
  256|     13|{
  257|     13|    uint64_t r = 0;
  258|     13|    uint64_t b;
  259|     13|    int s;
  260|       |
  261|    299|    for (s = 63; s >= 0; s -= 3) {
  ------------------
  |  Branch (261:18): [True: 286, False: 13]
  ------------------
  262|    286|        r <<= 1;
  263|    286|        b = 3 * r * (r + 1) + 1;
  264|    286|        if ((x >> s) >= b) {
  ------------------
  |  Branch (264:13): [True: 59, False: 227]
  ------------------
  265|     59|            x -= b << s;
  266|     59|            r++;
  267|     59|        }
  268|    286|    }
  269|     13|    return r * cbrt_scale;
  270|     13|}

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

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

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

SHA1_Init:
   55|  19.3k|{
   56|  19.3k|    memset(c, 0, sizeof(*c));
   57|  19.3k|    c->h0 = INIT_DATA_h0;
  ------------------
  |  |   48|  19.3k|#define INIT_DATA_h0 0x67452301UL
  ------------------
   58|  19.3k|    c->h1 = INIT_DATA_h1;
  ------------------
  |  |   49|  19.3k|#define INIT_DATA_h1 0xefcdab89UL
  ------------------
   59|  19.3k|    c->h2 = INIT_DATA_h2;
  ------------------
  |  |   50|  19.3k|#define INIT_DATA_h2 0x98badcfeUL
  ------------------
   60|  19.3k|    c->h3 = INIT_DATA_h3;
  ------------------
  |  |   51|  19.3k|#define INIT_DATA_h3 0x10325476UL
  ------------------
   61|  19.3k|    c->h4 = INIT_DATA_h4;
  ------------------
  |  |   52|  19.3k|#define INIT_DATA_h4 0xc3d2e1f0UL
  ------------------
   62|  19.3k|    return 1;
   63|  19.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));
  ------------------
  |  |  104|      8|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|      8|    }
  116|      8|}
ossl_sa_doall_arg:
  146|  1.48k|{
  147|  1.48k|    if (sa != NULL)
  ------------------
  |  Branch (147:9): [True: 1.48k, False: 0]
  ------------------
  148|  1.48k|        sa_doall(sa, NULL, leaf, arg);
  149|  1.48k|}
ossl_sa_num:
  152|  1.47k|{
  153|  1.47k|    return sa == NULL ? 0 : sa->nelem;
  ------------------
  |  Branch (153:12): [True: 0, False: 1.47k]
  ------------------
  154|  1.47k|}
ossl_sa_get:
  157|  19.7k|{
  158|  19.7k|    int level;
  159|  19.7k|    void **p, *r = NULL;
  160|       |
  161|  19.7k|    if (sa == NULL || sa->nelem == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 19.7k]
  |  Branch (161:23): [True: 5, False: 19.7k]
  ------------------
  162|      5|        return NULL;
  163|       |
  164|  19.7k|    if (n <= sa->top) {
  ------------------
  |  Branch (164:9): [True: 19.6k, False: 170]
  ------------------
  165|  19.6k|        p = sa->nodes;
  166|  78.0k|        for (level = sa->levels - 1; p != NULL && level > 0; level--)
  ------------------
  |  Branch (166:38): [True: 77.8k, False: 196]
  |  Branch (166:51): [True: 58.4k, False: 19.4k]
  ------------------
  167|  58.4k|            p = (void **)p[(n >> (OPENSSL_SA_BLOCK_BITS * level))
  ------------------
  |  |   34|  58.4k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
  168|  58.4k|                           & SA_BLOCK_MASK];
  ------------------
  |  |   46|  58.4k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  58.4k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  58.4k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  19.6k|        r = p == NULL ? NULL : p[n & SA_BLOCK_MASK];
  ------------------
  |  |   46|  19.4k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  19.4k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  19.4k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (169:13): [True: 196, False: 19.4k]
  ------------------
  170|  19.6k|    }
  171|  19.7k|    return r;
  172|  19.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.49k|{
   68|  1.49k|    int i[SA_BLOCK_MAX_LEVELS];
   69|  1.49k|    void *nodes[SA_BLOCK_MAX_LEVELS];
   70|  1.49k|    ossl_uintmax_t idx = 0;
   71|  1.49k|    int l = 0;
   72|       |
   73|  1.49k|    i[0] = 0;
   74|  1.49k|    nodes[0] = sa->nodes;
   75|  3.25M|    while (l >= 0) {
  ------------------
  |  Branch (75:12): [True: 3.25M, False: 1.49k]
  ------------------
   76|  3.25M|        const int n = i[l];
   77|  3.25M|        void ** const p = nodes[l];
   78|       |
   79|  3.25M|        if (n >= SA_BLOCK_MAX) {
  ------------------
  |  |   45|  3.25M|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  3.25M|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (79:13): [True: 191k, False: 3.06M]
  ------------------
   80|   191k|            if (p != NULL && node != NULL)
  ------------------
  |  Branch (80:17): [True: 191k, False: 12]
  |  Branch (80:30): [True: 379, False: 191k]
  ------------------
   81|    379|                (*node)(p);
   82|   191k|            l--;
   83|   191k|            idx >>= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|   191k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   84|  3.06M|        } else {
   85|  3.06M|            i[l] = n + 1;
   86|  3.06M|            if (p != NULL && p[n] != NULL) {
  ------------------
  |  Branch (86:17): [True: 3.06M, False: 192]
  |  Branch (86:30): [True: 288k, False: 2.77M]
  ------------------
   87|   288k|                idx = (idx & ~SA_BLOCK_MASK) | n;
  ------------------
  |  |   46|   288k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|   288k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   288k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|   288k|                if (l < sa->levels - 1) {
  ------------------
  |  Branch (88:21): [True: 190k, False: 98.4k]
  ------------------
   89|   190k|                    i[++l] = 0;
   90|   190k|                    nodes[l] = p[n];
   91|   190k|                    idx <<= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|   190k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   92|   190k|                } else if (leaf != NULL) {
  ------------------
  |  Branch (92:28): [True: 98.4k, False: 0]
  ------------------
   93|  98.4k|                    (*leaf)(idx, p[n], arg);
   94|  98.4k|                }
   95|   288k|            }
   96|  3.06M|        }
   97|  3.25M|    }
   98|  1.49k|}
sparse_array.c:sa_free_node:
  101|    379|{
  102|    379|    OPENSSL_free(p);
  ------------------
  |  |  115|    379|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    379|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    379|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|    379|}
sparse_array.c:alloc_node:
  175|    379|{
  176|    379|    return OPENSSL_zalloc(SA_BLOCK_MAX * sizeof(void *));
  ------------------
  |  |  104|    379|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    379|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    379|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|    379|}

OPENSSL_sk_set_cmp_func:
   37|  3.10k|{
   38|  3.10k|    OPENSSL_sk_compfunc old = sk->comp;
   39|       |
   40|  3.10k|    if (sk->comp != c)
  ------------------
  |  Branch (40:9): [True: 3.10k, False: 0]
  ------------------
   41|  3.10k|        sk->sorted = 0;
   42|  3.10k|    sk->comp = c;
   43|       |
   44|  3.10k|    return old;
   45|  3.10k|}
OPENSSL_sk_dup:
   48|  1.48k|{
   49|  1.48k|    OPENSSL_STACK *ret;
   50|       |
   51|  1.48k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|  1.48k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.48k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.48k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (51:9): [True: 0, False: 1.48k]
  ------------------
   52|      0|        goto err;
   53|       |
   54|  1.48k|    if (sk == NULL) {
  ------------------
  |  Branch (54:9): [True: 2, False: 1.47k]
  ------------------
   55|      2|        ret->num = 0;
   56|      2|        ret->sorted = 0;
   57|      2|        ret->comp = NULL;
   58|  1.47k|    } else {
   59|       |        /* direct structure assignment */
   60|  1.47k|        *ret = *sk;
   61|  1.47k|    }
   62|       |
   63|  1.48k|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (63:9): [True: 2, False: 1.47k]
  |  Branch (63:23): [True: 0, False: 1.47k]
  ------------------
   64|       |        /* postpone |ret->data| allocation */
   65|      2|        ret->data = NULL;
   66|      2|        ret->num_alloc = 0;
   67|      2|        return ret;
   68|      2|    }
   69|       |
   70|       |    /* duplicate |sk->data| content */
   71|  1.47k|    ret->data = OPENSSL_malloc(sizeof(*ret->data) * sk->num_alloc);
  ------------------
  |  |  102|  1.47k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.47k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.47k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   72|  1.47k|    if (ret->data == NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 1.47k]
  ------------------
   73|      0|        goto err;
   74|  1.47k|    memcpy(ret->data, sk->data, sizeof(void *) * sk->num);
   75|  1.47k|    return ret;
   76|       |
   77|      0| err:
   78|      0|    OPENSSL_sk_free(ret);
   79|      0|    return NULL;
   80|  1.47k|}
OPENSSL_sk_deep_copy:
   85|  73.0k|{
   86|  73.0k|    OPENSSL_STACK *ret;
   87|  73.0k|    int i;
   88|       |
   89|  73.0k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|  73.0k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  73.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  73.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (89:9): [True: 0, False: 73.0k]
  ------------------
   90|      0|        goto err;
   91|       |
   92|  73.0k|    if (sk == NULL) {
  ------------------
  |  Branch (92:9): [True: 1, False: 73.0k]
  ------------------
   93|      1|        ret->num = 0;
   94|      1|        ret->sorted = 0;
   95|      1|        ret->comp = NULL;
   96|  73.0k|    } else {
   97|       |        /* direct structure assignment */
   98|  73.0k|        *ret = *sk;
   99|  73.0k|    }
  100|       |
  101|  73.0k|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (101:9): [True: 1, False: 73.0k]
  |  Branch (101:23): [True: 0, False: 73.0k]
  ------------------
  102|       |        /* postpone |ret| data allocation */
  103|      1|        ret->data = NULL;
  104|      1|        ret->num_alloc = 0;
  105|      1|        return ret;
  106|      1|    }
  107|       |
  108|  73.0k|    ret->num_alloc = sk->num > min_nodes ? sk->num : min_nodes;
  ------------------
  |  Branch (108:22): [True: 36.0k, False: 37.0k]
  ------------------
  109|  73.0k|    ret->data = OPENSSL_zalloc(sizeof(*ret->data) * ret->num_alloc);
  ------------------
  |  |  104|  73.0k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  73.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  73.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  110|  73.0k|    if (ret->data == NULL)
  ------------------
  |  Branch (110:9): [True: 0, False: 73.0k]
  ------------------
  111|      0|        goto err;
  112|       |
  113|   329k|    for (i = 0; i < ret->num; ++i) {
  ------------------
  |  Branch (113:17): [True: 256k, False: 73.0k]
  ------------------
  114|   256k|        if (sk->data[i] == NULL)
  ------------------
  |  Branch (114:13): [True: 0, False: 256k]
  ------------------
  115|      0|            continue;
  116|   256k|        if ((ret->data[i] = copy_func(sk->data[i])) == NULL) {
  ------------------
  |  Branch (116:13): [True: 0, False: 256k]
  ------------------
  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|   256k|    }
  123|  73.0k|    return ret;
  124|       |
  125|      0| err:
  126|      0|    OPENSSL_sk_free(ret);
  127|      0|    return NULL;
  128|  73.0k|}
OPENSSL_sk_new_null:
  131|  3.88M|{
  132|  3.88M|    return OPENSSL_sk_new_reserve(NULL, 0);
  133|  3.88M|}
OPENSSL_sk_new:
  136|     65|{
  137|     65|    return OPENSSL_sk_new_reserve(c, 0);
  138|     65|}
OPENSSL_sk_new_reserve:
  227|  3.89M|{
  228|  3.89M|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |  104|  3.89M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.89M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.89M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  229|       |
  230|  3.89M|    if (st == NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 3.89M]
  ------------------
  231|      0|        return NULL;
  232|       |
  233|  3.89M|    st->comp = c;
  234|       |
  235|  3.89M|    if (n <= 0)
  ------------------
  |  Branch (235:9): [True: 3.88M, False: 1.47k]
  ------------------
  236|  3.88M|        return st;
  237|       |
  238|  1.47k|    if (!sk_reserve(st, n, 1)) {
  ------------------
  |  Branch (238:9): [True: 0, False: 1.47k]
  ------------------
  239|      0|        OPENSSL_sk_free(st);
  240|      0|        return NULL;
  241|      0|    }
  242|       |
  243|  1.47k|    return st;
  244|  1.47k|}
OPENSSL_sk_insert:
  259|  5.61M|{
  260|  5.61M|    if (st == NULL) {
  ------------------
  |  Branch (260:9): [True: 0, False: 5.61M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  262|      0|        return 0;
  263|      0|    }
  264|  5.61M|    if (st->num == max_nodes) {
  ------------------
  |  Branch (264:9): [True: 0, False: 5.61M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  266|      0|        return 0;
  267|      0|    }
  268|       |
  269|  5.61M|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (269:9): [True: 0, False: 5.61M]
  ------------------
  270|      0|        return 0;
  271|       |
  272|  5.61M|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (272:9): [True: 5.61M, False: 0]
  |  Branch (272:29): [True: 0, False: 0]
  ------------------
  273|  5.61M|        st->data[st->num] = data;
  274|  5.61M|    } 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|  5.61M|    st->num++;
  280|  5.61M|    st->sorted = 0;
  281|  5.61M|    return st->num;
  282|  5.61M|}
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|  5.61M|{
  399|  5.61M|    if (st == NULL)
  ------------------
  |  Branch (399:9): [True: 0, False: 5.61M]
  ------------------
  400|      0|        return 0;
  401|  5.61M|    return OPENSSL_sk_insert(st, data, st->num);
  402|  5.61M|}
OPENSSL_sk_pop_free:
  432|   892k|{
  433|   892k|    int i;
  434|       |
  435|   892k|    if (st == NULL)
  ------------------
  |  Branch (435:9): [True: 228k, False: 663k]
  ------------------
  436|   228k|        return;
  437|  5.30M|    for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (437:17): [True: 4.63M, False: 663k]
  ------------------
  438|  4.63M|        if (st->data[i] != NULL)
  ------------------
  |  Branch (438:13): [True: 4.63M, False: 535]
  ------------------
  439|  4.63M|            func((char *)st->data[i]);
  440|   663k|    OPENSSL_sk_free(st);
  441|   663k|}
OPENSSL_sk_free:
  444|  4.59M|{
  445|  4.59M|    if (st == NULL)
  ------------------
  |  Branch (445:9): [True: 632k, False: 3.96M]
  ------------------
  446|   632k|        return;
  447|  3.96M|    OPENSSL_free(st->data);
  ------------------
  |  |  115|  3.96M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.96M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.96M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  448|  3.96M|    OPENSSL_free(st);
  ------------------
  |  |  115|  3.96M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.96M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.96M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  449|  3.96M|}
OPENSSL_sk_num:
  452|  17.9M|{
  453|  17.9M|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (453:12): [True: 978k, False: 16.9M]
  ------------------
  454|  17.9M|}
OPENSSL_sk_value:
  457|  11.3M|{
  458|  11.3M|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (458:9): [True: 0, False: 11.3M]
  |  Branch (458:23): [True: 0, False: 11.3M]
  |  Branch (458:32): [True: 0, False: 11.3M]
  ------------------
  459|      0|        return NULL;
  460|  11.3M|    return (void *)st->data[i];
  461|  11.3M|}
OPENSSL_sk_set:
  464|   390k|{
  465|   390k|    if (st == NULL) {
  ------------------
  |  Branch (465:9): [True: 0, False: 390k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  467|      0|        return NULL;
  468|      0|    }
  469|   390k|    if (i < 0 || i >= st->num) {
  ------------------
  |  Branch (469:9): [True: 0, False: 390k]
  |  Branch (469:18): [True: 0, False: 390k]
  ------------------
  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),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|      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|   390k|    st->data[i] = data;
  475|   390k|    st->sorted = 0;
  476|   390k|    return (void *)st->data[i];
  477|   390k|}
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|  5.62M|{
  179|  5.62M|    const void **tmpdata;
  180|  5.62M|    int num_alloc;
  181|       |
  182|       |    /* Check to see the reservation isn't exceeding the hard limit */
  183|  5.62M|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (183:9): [True: 0, False: 5.62M]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  185|      0|        return 0;
  186|      0|    }
  187|       |
  188|       |    /* Figure out the new size */
  189|  5.62M|    num_alloc = st->num + n;
  190|  5.62M|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (190:9): [True: 708k, False: 4.91M]
  ------------------
  191|   708k|        num_alloc = min_nodes;
  192|       |
  193|       |    /* If |st->data| allocation was postponed */
  194|  5.62M|    if (st->data == NULL) {
  ------------------
  |  Branch (194:9): [True: 650k, False: 4.97M]
  ------------------
  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|   650k|        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL)
  ------------------
  |  |  104|   650k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   650k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   650k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (199:13): [True: 0, False: 650k]
  ------------------
  200|      0|            return 0;
  201|   650k|        st->num_alloc = num_alloc;
  202|   650k|        return 1;
  203|   650k|    }
  204|       |
  205|  4.97M|    if (!exact) {
  ------------------
  |  Branch (205:9): [True: 4.97M, False: 0]
  ------------------
  206|  4.97M|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (206:13): [True: 4.92M, False: 49.8k]
  ------------------
  207|  4.92M|            return 1;
  208|  49.8k|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  209|  49.8k|        if (num_alloc == 0) {
  ------------------
  |  Branch (209:13): [True: 0, False: 49.8k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  211|      0|            return 0;
  212|      0|        }
  213|  49.8k|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (213:16): [True: 0, False: 0]
  ------------------
  214|      0|        return 1;
  215|      0|    }
  216|       |
  217|  49.8k|    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
  ------------------
  |  |  109|  49.8k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  49.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  49.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  218|  49.8k|    if (tmpdata == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 49.8k]
  ------------------
  219|      0|        return 0;
  220|       |
  221|  49.8k|    st->data = tmpdata;
  222|  49.8k|    st->num_alloc = num_alloc;
  223|  49.8k|    return 1;
  224|  49.8k|}
stack.c:compute_growth:
  160|  49.8k|{
  161|  49.8k|    int err = 0;
  162|       |
  163|  99.7k|    while (current < target) {
  ------------------
  |  Branch (163:12): [True: 49.8k, False: 49.8k]
  ------------------
  164|  49.8k|        if (current >= max_nodes)
  ------------------
  |  Branch (164:13): [True: 0, False: 49.8k]
  ------------------
  165|      0|            return 0;
  166|       |
  167|  49.8k|        current = safe_muldiv_int(current, 8, 5, &err);
  168|  49.8k|        if (err != 0)
  ------------------
  |  Branch (168:13): [True: 0, False: 49.8k]
  ------------------
  169|      0|            return 0;
  170|  49.8k|        if (current >= max_nodes)
  ------------------
  |  Branch (170:13): [True: 0, False: 49.8k]
  ------------------
  171|      0|            current = max_nodes;
  172|  49.8k|    }
  173|  49.8k|    return current;
  174|  49.8k|}
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)
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  157|      2|}

ossl_rcu_write_lock:
  576|      4|{
  577|      4|    pthread_mutex_lock(&lock->write_lock);
  578|      4|    TSAN_FAKE_UNLOCK(&lock->write_lock);
  579|      4|}
ossl_rcu_write_unlock:
  582|      4|{
  583|      4|    TSAN_FAKE_LOCK(&lock->write_lock);
  584|      4|    pthread_mutex_unlock(&lock->write_lock);
  585|      4|}
ossl_synchronize_rcu:
  588|      6|{
  589|      6|    struct rcu_qp *qp;
  590|      6|    uint64_t count;
  591|      6|    struct rcu_cb_item *cb_items, *tmpcb;
  592|       |
  593|      6|    pthread_mutex_lock(&lock->write_lock);
  594|      6|    cb_items = lock->cb_items;
  595|      6|    lock->cb_items = NULL;
  596|      6|    pthread_mutex_unlock(&lock->write_lock);
  597|       |
  598|      6|    qp = update_qp(lock);
  599|       |
  600|       |    /*
  601|       |     * wait for the reader count to reach zero
  602|       |     * Note the use of __ATOMIC_ACQUIRE here to ensure that any
  603|       |     * prior __ATOMIC_RELEASE write operation in get_hold_current_qp
  604|       |     * is visible prior to our read
  605|       |     */
  606|      6|    do {
  607|      6|        count = ATOMIC_LOAD_N(uint64_t, &qp->users, __ATOMIC_ACQUIRE);
  ------------------
  |  |  122|      6|#   define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  608|      6|    } while (READER_COUNT(count) != 0);
  ------------------
  |  |  281|      6|# define READER_COUNT(x) ((uint32_t)(((uint64_t)(x) >> READER_SHIFT) & \
  |  |  ------------------
  |  |  |  |  273|      6|# define READER_SHIFT 0
  |  |  ------------------
  |  |  282|      6|                                     READER_MASK))
  |  |  ------------------
  |  |  |  |  279|      6|# define READER_MASK     (((uint64_t)1 << READER_SIZE) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  276|      6|# define READER_SIZE 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (608:14): [True: 0, False: 6]
  ------------------
  609|       |
  610|       |    /* retire in order */
  611|      6|    pthread_mutex_lock(&lock->prior_lock);
  612|      6|    while (lock->next_to_retire != ID_VAL(count))
  ------------------
  |  |  283|      6|# define ID_VAL(x)       ((uint32_t)(((uint64_t)(x) >> ID_SHIFT) & ID_MASK))
  |  |  ------------------
  |  |  |  |  274|      6|# define ID_SHIFT 32
  |  |  ------------------
  |  |               # define ID_VAL(x)       ((uint32_t)(((uint64_t)(x) >> ID_SHIFT) & ID_MASK))
  |  |  ------------------
  |  |  |  |  280|      6|# define ID_MASK         (((uint64_t)1 << ID_SIZE) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  277|      6|# define ID_SIZE 32
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (612:12): [True: 0, False: 6]
  ------------------
  613|      0|        pthread_cond_wait(&lock->prior_signal, &lock->prior_lock);
  614|      6|    lock->next_to_retire++;
  615|      6|    pthread_cond_broadcast(&lock->prior_signal);
  616|      6|    pthread_mutex_unlock(&lock->prior_lock);
  617|       |
  618|      6|    retire_qp(lock, qp);
  619|       |
  620|       |    /* handle any callbacks that we have */
  621|      6|    while (cb_items != NULL) {
  ------------------
  |  Branch (621:12): [True: 0, False: 6]
  ------------------
  622|      0|        tmpcb = cb_items;
  623|      0|        cb_items = cb_items->next;
  624|      0|        tmpcb->fn(tmpcb->data);
  625|      0|        OPENSSL_free(tmpcb);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  626|      0|    }
  627|      6|}
ossl_rcu_uptr_deref:
  651|      4|{
  652|      4|    return ATOMIC_LOAD_N(pvoid, p, __ATOMIC_ACQUIRE);
  ------------------
  |  |  122|      4|#   define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  653|      4|}
ossl_rcu_assign_uptr:
  656|      4|{
  657|      4|    ATOMIC_STORE(pvoid, p, v, __ATOMIC_RELEASE);
  ------------------
  |  |  125|      4|#  define ATOMIC_STORE(t, p, v, o) __atomic_store(p, v, o)
  ------------------
  658|      4|}
ossl_rcu_lock_new:
  661|      2|{
  662|      2|    struct rcu_lock_st *new;
  663|       |
  664|      2|    if (num_writers < 1)
  ------------------
  |  Branch (664:9): [True: 0, False: 2]
  ------------------
  665|      0|        num_writers = 1;
  666|       |
  667|      2|    ctx = ossl_lib_ctx_get_concrete(ctx);
  668|      2|    if (ctx == NULL)
  ------------------
  |  Branch (668:9): [True: 0, False: 2]
  ------------------
  669|      0|        return 0;
  670|       |
  671|      2|    new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  672|      2|    if (new == NULL)
  ------------------
  |  Branch (672:9): [True: 0, False: 2]
  ------------------
  673|      0|        return NULL;
  674|       |
  675|      2|    new->ctx = ctx;
  676|      2|    pthread_mutex_init(&new->write_lock, NULL);
  677|      2|    pthread_mutex_init(&new->prior_lock, NULL);
  678|      2|    pthread_mutex_init(&new->alloc_lock, NULL);
  679|      2|    pthread_cond_init(&new->prior_signal, NULL);
  680|      2|    pthread_cond_init(&new->alloc_signal, NULL);
  681|      2|    new->qp_group = allocate_new_qp_group(new, num_writers + 1);
  682|      2|    if (new->qp_group == NULL) {
  ------------------
  |  Branch (682:9): [True: 0, False: 2]
  ------------------
  683|      0|        OPENSSL_free(new);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  684|      0|        new = NULL;
  685|      0|    }
  686|      2|    return new;
  687|      2|}
ossl_rcu_lock_free:
  690|      2|{
  691|      2|    struct rcu_lock_st *rlock = (struct rcu_lock_st *)lock;
  692|       |
  693|      2|    if (lock == NULL)
  ------------------
  |  Branch (693:9): [True: 0, False: 2]
  ------------------
  694|      0|        return;
  695|       |
  696|       |    /* make sure we're synchronized */
  697|      2|    ossl_synchronize_rcu(rlock);
  698|       |
  699|      2|    OPENSSL_free(rlock->qp_group);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  700|       |    /* There should only be a single qp left now */
  701|      2|    OPENSSL_free(rlock);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  702|      2|}
CRYPTO_THREAD_lock_new:
  705|   112k|{
  706|   112k|# ifdef USE_RWLOCK
  707|   112k|    CRYPTO_RWLOCK *lock;
  708|       |
  709|   112k|    if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL)
  ------------------
  |  |  104|   112k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   112k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   112k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (709:9): [True: 0, False: 112k]
  ------------------
  710|       |        /* Don't set error, to avoid recursion blowup. */
  711|      0|        return NULL;
  712|       |
  713|   112k|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (713:9): [True: 0, False: 112k]
  ------------------
  714|      0|        OPENSSL_free(lock);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  715|      0|        return NULL;
  716|      0|    }
  717|       |# else
  718|       |    pthread_mutexattr_t attr;
  719|       |    CRYPTO_RWLOCK *lock;
  720|       |
  721|       |    if ((lock = OPENSSL_zalloc(sizeof(pthread_mutex_t))) == NULL)
  722|       |        /* Don't set error, to avoid recursion blowup. */
  723|       |        return NULL;
  724|       |
  725|       |    /*
  726|       |     * We don't use recursive mutexes, but try to catch errors if we do.
  727|       |     */
  728|       |    pthread_mutexattr_init(&attr);
  729|       |#  if !defined (__TANDEM) && !defined (_SPT_MODEL_)
  730|       |#   if !defined(NDEBUG) && !defined(OPENSSL_NO_MUTEX_ERRORCHECK)
  731|       |    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
  732|       |#   endif
  733|       |#  else
  734|       |    /* The SPT Thread Library does not define MUTEX attributes. */
  735|       |#  endif
  736|       |
  737|       |    if (pthread_mutex_init(lock, &attr) != 0) {
  738|       |        pthread_mutexattr_destroy(&attr);
  739|       |        OPENSSL_free(lock);
  740|       |        return NULL;
  741|       |    }
  742|       |
  743|       |    pthread_mutexattr_destroy(&attr);
  744|       |# endif
  745|       |
  746|   112k|    return lock;
  747|   112k|}
CRYPTO_THREAD_read_lock:
  750|  1.61M|{
  751|  1.61M|# ifdef USE_RWLOCK
  752|  1.61M|    if (pthread_rwlock_rdlock(lock) != 0)
  ------------------
  |  Branch (752:9): [True: 0, False: 1.61M]
  ------------------
  753|      0|        return 0;
  754|       |# else
  755|       |    if (pthread_mutex_lock(lock) != 0) {
  756|       |        assert(errno != EDEADLK && errno != EBUSY);
  757|       |        return 0;
  758|       |    }
  759|       |# endif
  760|       |
  761|  1.61M|    return 1;
  762|  1.61M|}
CRYPTO_THREAD_write_lock:
  765|  4.24k|{
  766|  4.24k|# ifdef USE_RWLOCK
  767|  4.24k|    if (pthread_rwlock_wrlock(lock) != 0)
  ------------------
  |  Branch (767:9): [True: 0, False: 4.24k]
  ------------------
  768|      0|        return 0;
  769|       |# else
  770|       |    if (pthread_mutex_lock(lock) != 0) {
  771|       |        assert(errno != EDEADLK && errno != EBUSY);
  772|       |        return 0;
  773|       |    }
  774|       |# endif
  775|       |
  776|  4.24k|    return 1;
  777|  4.24k|}
CRYPTO_THREAD_unlock:
  780|  1.61M|{
  781|  1.61M|# ifdef USE_RWLOCK
  782|  1.61M|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (782:9): [True: 0, False: 1.61M]
  ------------------
  783|      0|        return 0;
  784|       |# else
  785|       |    if (pthread_mutex_unlock(lock) != 0) {
  786|       |        assert(errno != EPERM);
  787|       |        return 0;
  788|       |    }
  789|       |# endif
  790|       |
  791|  1.61M|    return 1;
  792|  1.61M|}
CRYPTO_THREAD_lock_free:
  795|   112k|{
  796|   112k|    if (lock == NULL)
  ------------------
  |  Branch (796:9): [True: 13, False: 112k]
  ------------------
  797|     13|        return;
  798|       |
  799|   112k|# ifdef USE_RWLOCK
  800|   112k|    pthread_rwlock_destroy(lock);
  801|       |# else
  802|       |    pthread_mutex_destroy(lock);
  803|       |# endif
  804|   112k|    OPENSSL_free(lock);
  ------------------
  |  |  115|   112k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   112k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   112k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  805|       |
  806|   112k|    return;
  807|   112k|}
CRYPTO_THREAD_run_once:
  810|  10.6M|{
  811|  10.6M|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (811:9): [True: 0, False: 10.6M]
  ------------------
  812|      0|        return 0;
  813|       |
  814|  10.6M|    return 1;
  815|  10.6M|}
CRYPTO_THREAD_init_local:
  818|     14|{
  819|     14|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (819:9): [True: 0, False: 14]
  ------------------
  820|      0|        return 0;
  821|       |
  822|     14|    return 1;
  823|     14|}
CRYPTO_THREAD_get_local:
  826|  5.38M|{
  827|  5.38M|    return pthread_getspecific(*key);
  828|  5.38M|}
CRYPTO_THREAD_set_local:
  831|     18|{
  832|     18|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (832:9): [True: 0, False: 18]
  ------------------
  833|      0|        return 0;
  834|       |
  835|     18|    return 1;
  836|     18|}
CRYPTO_THREAD_cleanup_local:
  839|     14|{
  840|     14|    if (pthread_key_delete(*key) != 0)
  ------------------
  |  Branch (840:9): [True: 0, False: 14]
  ------------------
  841|      0|        return 0;
  842|       |
  843|     14|    return 1;
  844|     14|}
CRYPTO_atomic_add:
  857|  2.96k|{
  858|  2.96k|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  859|  2.96k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (859:9): [Folded - Ignored]
  ------------------
  860|  2.96k|        *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);
  861|  2.96k|        return 1;
  862|  2.96k|    }
  863|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  864|       |    /* This will work for all future Solaris versions. */
  865|       |    if (ret != NULL) {
  866|       |        *ret = atomic_add_int_nv((volatile unsigned int *)val, amount);
  867|       |        return 1;
  868|       |    }
  869|       |# endif
  870|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (870:9): [True: 0, False: 0]
  |  Branch (870:25): [True: 0, False: 0]
  ------------------
  871|      0|        return 0;
  872|       |
  873|      0|    *val += amount;
  874|      0|    *ret  = *val;
  875|       |
  876|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (876:9): [True: 0, False: 0]
  ------------------
  877|      0|        return 0;
  878|       |
  879|      0|    return 1;
  880|      0|}
CRYPTO_atomic_or:
  936|      4|{
  937|      4|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  938|      4|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (938:9): [Folded - Ignored]
  ------------------
  939|      4|        *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
  940|      4|        return 1;
  941|      4|    }
  942|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  943|       |    /* This will work for all future Solaris versions. */
  944|       |    if (ret != NULL) {
  945|       |        *ret = atomic_or_64_nv(val, op);
  946|       |        return 1;
  947|       |    }
  948|       |# endif
  949|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (949:9): [True: 0, False: 0]
  |  Branch (949:25): [True: 0, False: 0]
  ------------------
  950|      0|        return 0;
  951|      0|    *val |= op;
  952|      0|    *ret  = *val;
  953|       |
  954|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (954:9): [True: 0, False: 0]
  ------------------
  955|      0|        return 0;
  956|       |
  957|      0|    return 1;
  958|      0|}
CRYPTO_atomic_load:
  961|  5.33M|{
  962|  5.33M|# if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE) && !defined(BROKEN_CLANG_ATOMICS)
  963|  5.33M|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (963:9): [Folded - Ignored]
  ------------------
  964|  5.33M|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
  965|  5.33M|        return 1;
  966|  5.33M|    }
  967|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  968|       |    /* This will work for all future Solaris versions. */
  969|       |    if (ret != NULL) {
  970|       |        *ret = atomic_or_64_nv(val, 0);
  971|       |        return 1;
  972|       |    }
  973|       |# endif
  974|      0|    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (974:9): [True: 0, False: 0]
  |  Branch (974:25): [True: 0, False: 0]
  ------------------
  975|      0|        return 0;
  976|      0|    *ret  = *val;
  977|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (977:9): [True: 0, False: 0]
  ------------------
  978|      0|        return 0;
  979|       |
  980|      0|    return 1;
  981|      0|}
openssl_get_fork_id:
 1037|  20.5k|{
 1038|  20.5k|    return getpid();
 1039|  20.5k|}
threads_pthread.c:update_qp:
  501|      6|{
  502|      6|    uint64_t new_id;
  503|      6|    uint32_t current_idx;
  504|       |
  505|      6|    pthread_mutex_lock(&lock->alloc_lock);
  506|       |
  507|       |    /*
  508|       |     * we need at least one qp to be available with one
  509|       |     * left over, so that readers can start working on
  510|       |     * one that isn't yet being waited on
  511|       |     */
  512|      6|    while (lock->group_count - lock->writers_alloced < 2)
  ------------------
  |  Branch (512:12): [True: 0, False: 6]
  ------------------
  513|       |        /* we have to wait for one to be free */
  514|      0|        pthread_cond_wait(&lock->alloc_signal, &lock->alloc_lock);
  515|       |
  516|      6|    current_idx = lock->current_alloc_idx;
  517|       |
  518|       |    /* Allocate the qp */
  519|      6|    lock->writers_alloced++;
  520|       |
  521|       |    /* increment the allocation index */
  522|      6|    lock->current_alloc_idx =
  523|      6|        (lock->current_alloc_idx + 1) % lock->group_count;
  524|       |
  525|       |    /* get and insert a new id */
  526|      6|    new_id = VAL_ID(lock->id_ctr);
  ------------------
  |  |  285|      6|# define VAL_ID(x)       ((uint64_t)x << ID_SHIFT)
  |  |  ------------------
  |  |  |  |  274|      6|# define ID_SHIFT 32
  |  |  ------------------
  ------------------
  527|      6|    lock->id_ctr++;
  528|       |
  529|       |    /*
  530|       |     * Even though we are under a write side lock here
  531|       |     * We need to use atomic instructions to ensure that the results
  532|       |     * of this update are published to the read side prior to updating the
  533|       |     * reader idx below
  534|       |     */
  535|      6|    ATOMIC_AND_FETCH(&lock->qp_group[current_idx].users, ID_MASK,
  ------------------
  |  |  130|      6|#  define ATOMIC_AND_FETCH(p, m, o) __atomic_and_fetch(p, m, o)
  ------------------
  536|      6|                     __ATOMIC_RELEASE);
  537|      6|    ATOMIC_OR_FETCH(&lock->qp_group[current_idx].users, new_id,
  ------------------
  |  |  131|      6|#  define ATOMIC_OR_FETCH(p, m, o) __atomic_or_fetch(p, m, o)
  ------------------
  538|      6|                    __ATOMIC_RELEASE);
  539|       |
  540|       |    /*
  541|       |     * Update the reader index to be the prior qp.
  542|       |     * Note the use of __ATOMIC_RELEASE here is based on the corresponding use
  543|       |     * of __ATOMIC_ACQUIRE in get_hold_current_qp, as we want any publication
  544|       |     * of this value to be seen on the read side immediately after it happens
  545|       |     */
  546|      6|    ATOMIC_STORE_N(uint32_t, &lock->reader_idx, lock->current_alloc_idx,
  ------------------
  |  |  124|      6|#  define ATOMIC_STORE_N(t, p, v, o) __atomic_store_n(p, v, o)
  ------------------
  547|      6|                   __ATOMIC_RELEASE);
  548|       |
  549|       |    /* wake up any waiters */
  550|      6|    pthread_cond_signal(&lock->alloc_signal);
  551|      6|    pthread_mutex_unlock(&lock->alloc_lock);
  552|      6|    return &lock->qp_group[current_idx];
  553|      6|}
threads_pthread.c:retire_qp:
  556|      6|{
  557|      6|    pthread_mutex_lock(&lock->alloc_lock);
  558|      6|    lock->writers_alloced--;
  559|      6|    pthread_cond_signal(&lock->alloc_signal);
  560|      6|    pthread_mutex_unlock(&lock->alloc_lock);
  561|      6|}
threads_pthread.c:allocate_new_qp_group:
  567|      2|{
  568|      2|    struct rcu_qp *new =
  569|      2|        OPENSSL_zalloc(sizeof(*new) * count);
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  570|       |
  571|      2|    lock->group_count = count;
  572|      2|    return new;
  573|      2|}

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|  80.6k|{
  180|  80.6k|    if (!cache)
  ------------------
  |  Branch (180:9): [True: 80.6k, False: 0]
  ------------------
  181|  80.6k|        return;
  182|      0|    ossl_policy_data_free(cache->anyPolicy);
  183|      0|    sk_X509_POLICY_DATA_pop_free(cache->data, ossl_policy_data_free);
  184|      0|    OPENSSL_free(cache);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  185|      0|}

DIST_POINT_set_dpname:
  485|  2.24k|{
  486|  2.24k|    int i;
  487|  2.24k|    STACK_OF(X509_NAME_ENTRY) *frag;
  ------------------
  |  |   31|  2.24k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  488|  2.24k|    X509_NAME_ENTRY *ne;
  489|       |
  490|  2.24k|    if (dpn == NULL || dpn->type != 1)
  ------------------
  |  Branch (490:9): [True: 1.36k, False: 878]
  |  Branch (490:24): [True: 149, False: 729]
  ------------------
  491|  1.51k|        return 1;
  492|    729|    frag = dpn->name.relativename;
  493|    729|    X509_NAME_free(dpn->dpname); /* just in case it was already set */
  494|    729|    dpn->dpname = X509_NAME_dup(iname);
  495|    729|    if (dpn->dpname == NULL)
  ------------------
  |  Branch (495:9): [True: 291, False: 438]
  ------------------
  496|    291|        return 0;
  497|    894|    for (i = 0; i < sk_X509_NAME_ENTRY_num(frag); i++) {
  ------------------
  |  |  204|    894|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (497:17): [True: 456, False: 438]
  ------------------
  498|    456|        ne = sk_X509_NAME_ENTRY_value(frag, i);
  ------------------
  |  |  205|    456|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
  499|    456|        if (!X509_NAME_add_entry(dpn->dpname, ne, -1, i ? 0 : 1))
  ------------------
  |  Branch (499:13): [True: 0, False: 456]
  |  Branch (499:55): [True: 31, False: 425]
  ------------------
  500|      0|            goto err;
  501|    456|    }
  502|       |    /* generate cached encoding of name */
  503|    438|    if (i2d_X509_NAME(dpn->dpname, NULL) >= 0)
  ------------------
  |  Branch (503:9): [True: 350, False: 88]
  ------------------
  504|    350|        return 1;
  505|       |
  506|     88| err:
  507|     88|    X509_NAME_free(dpn->dpname);
  508|     88|    dpn->dpname = NULL;
  509|     88|    return 0;
  510|    438|}
v3_crld.c:dpn_cb:
  307|  33.9k|{
  308|  33.9k|    DIST_POINT_NAME *dpn = (DIST_POINT_NAME *)*pval;
  309|       |
  310|  33.9k|    switch (operation) {
  ------------------
  |  Branch (310:13): [True: 21.1k, False: 12.8k]
  ------------------
  311|  6.40k|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  743|  6.40k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (311:5): [True: 6.40k, False: 27.5k]
  ------------------
  312|  6.40k|        dpn->dpname = NULL;
  313|  6.40k|        break;
  314|       |
  315|  6.40k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  6.40k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (315:5): [True: 6.40k, False: 27.5k]
  ------------------
  316|  6.40k|        X509_NAME_free(dpn->dpname);
  317|  6.40k|        break;
  318|  33.9k|    }
  319|  33.9k|    return 1;
  320|  33.9k|}

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

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:
   79|      1|{
   80|       |#if defined (_WIN32)
   81|       |    RUN_ONCE(&openssldir_setup_init, do_openssldir_setup);
   82|       |    return x509_cert_areaptr;
   83|       |#else
   84|      1|    return X509_CERT_AREA;
  ------------------
  |  |   84|      1|#  define X509_CERT_AREA          OPENSSLDIR
  ------------------
   85|      1|#endif
   86|      1|}

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

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

X509_EXTENSION_get_object:
  253|   247k|{
  254|   247k|    if (ex == NULL)
  ------------------
  |  Branch (254:9): [True: 0, False: 247k]
  ------------------
  255|      0|        return NULL;
  256|   247k|    return ex->object;
  257|   247k|}
X509_EXTENSION_get_data:
  260|  45.0k|{
  261|  45.0k|    if (ex == NULL)
  ------------------
  |  Branch (261:9): [True: 0, False: 45.0k]
  ------------------
  262|      0|        return NULL;
  263|  45.0k|    return &ex->value;
  264|  45.0k|}
X509_EXTENSION_get_critical:
  267|   103k|{
  268|   103k|    if (ex == NULL)
  ------------------
  |  Branch (268:9): [True: 0, False: 103k]
  ------------------
  269|      0|        return 0;
  270|   103k|    if (ex->critical > 0)
  ------------------
  |  Branch (270:9): [True: 10.0k, False: 93.2k]
  ------------------
  271|  10.0k|        return 1;
  272|  93.2k|    return 0;
  273|   103k|}

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

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

X509_CRL_digest:
  607|  19.3k|{
  608|  19.3k|    if (type == NULL) {
  ------------------
  |  Branch (608:9): [True: 0, False: 19.3k]
  ------------------
  609|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  610|      0|        return 0;
  611|      0|    }
  612|  19.3k|    if (EVP_MD_is_a(type, SN_sha1)
  ------------------
  |  | 2310|  19.3k|#define SN_sha1         "SHA1"
  ------------------
  |  Branch (612:9): [True: 19.3k, False: 0]
  ------------------
  613|  19.3k|            && (data->flags & EXFLAG_SET) != 0
  ------------------
  |  |  659|  19.3k|# define EXFLAG_SET              0x100
  ------------------
  |  Branch (613:16): [True: 0, False: 19.3k]
  ------------------
  614|  19.3k|            && (data->flags & EXFLAG_NO_FINGERPRINT) == 0) {
  ------------------
  |  |  671|      0|# define EXFLAG_NO_FINGERPRINT   0x100000
  ------------------
  |  Branch (614:16): [True: 0, False: 0]
  ------------------
  615|       |        /* Asking for SHA1; always computed in CRL d2i. */
  616|      0|        if (len != NULL)
  ------------------
  |  Branch (616:13): [True: 0, False: 0]
  ------------------
  617|      0|            *len = sizeof(data->sha1_hash);
  618|      0|        memcpy(md, data->sha1_hash, sizeof(data->sha1_hash));
  619|      0|        return 1;
  620|      0|    }
  621|  19.3k|    return
  622|  19.3k|        ossl_asn1_item_digest_ex(ASN1_ITEM_rptr(X509_CRL), type, (char *)data,
  ------------------
  |  |  426|  19.3k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  623|  19.3k|                                 md, len, data->libctx, data->propq);
  624|  19.3k|}

x_crl.c:crl_inf_cb:
   49|   118k|{
   50|   118k|    X509_CRL_INFO *a = (X509_CRL_INFO *)*pval;
   51|       |
   52|   118k|    if (!a || !a->revoked)
  ------------------
  |  Branch (52:9): [True: 0, False: 118k]
  |  Branch (52:15): [True: 112k, False: 6.21k]
  ------------------
   53|   112k|        return 1;
   54|  6.21k|    switch (operation) {
  ------------------
  |  Branch (54:13): [True: 3.11k, False: 3.10k]
  ------------------
   55|       |        /*
   56|       |         * Just set cmp function here. We don't sort because that would
   57|       |         * affect the output of X509_CRL_print().
   58|       |         */
   59|  3.10k|    case ASN1_OP_D2I_POST:
  ------------------
  |  |  747|  3.10k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (59:5): [True: 3.10k, False: 3.11k]
  ------------------
   60|  3.10k|        (void)sk_X509_REVOKED_set_cmp_func(a->revoked, X509_REVOKED_cmp);
  ------------------
  |  |  129|  3.10k|#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|  3.10k|        break;
   62|  6.21k|    }
   63|  6.21k|    return 1;
   64|  6.21k|}
x_crl.c:crl_cb:
  160|   177k|{
  161|   177k|    X509_CRL *crl = (X509_CRL *)*pval;
  162|   177k|    STACK_OF(X509_EXTENSION) *exts;
  ------------------
  |  |   31|   177k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  163|   177k|    X509_EXTENSION *ext;
  164|   177k|    int idx, i;
  165|       |
  166|   177k|    switch (operation) {
  ------------------
  |  Branch (166:13): [True: 98.3k, False: 78.8k]
  ------------------
  167|  19.8k|    case ASN1_OP_D2I_PRE:
  ------------------
  |  |  746|  19.8k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (167:5): [True: 19.8k, False: 157k]
  ------------------
  168|  19.8k|        if (crl->meth->crl_free) {
  ------------------
  |  Branch (168:13): [True: 0, False: 19.8k]
  ------------------
  169|      0|            if (!crl->meth->crl_free(crl))
  ------------------
  |  Branch (169:17): [True: 0, False: 0]
  ------------------
  170|      0|                return 0;
  171|      0|        }
  172|  19.8k|        AUTHORITY_KEYID_free(crl->akid);
  173|  19.8k|        ISSUING_DIST_POINT_free(crl->idp);
  174|  19.8k|        ASN1_INTEGER_free(crl->crl_number);
  175|  19.8k|        ASN1_INTEGER_free(crl->base_crl_number);
  176|  19.8k|        sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
  ------------------
  |  |  285|  19.8k|#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|  39.6k|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  743|  39.6k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (179:5): [True: 19.8k, False: 157k]
  ------------------
  180|  39.6k|        crl->idp = NULL;
  181|  39.6k|        crl->akid = NULL;
  182|  39.6k|        crl->flags = 0;
  183|  39.6k|        crl->idp_flags = 0;
  184|  39.6k|        crl->idp_reasons = CRLDP_ALL_REASONS;
  ------------------
  |  |  309|  39.6k|# define CRLDP_ALL_REASONS       0x807f
  ------------------
  185|  39.6k|        crl->meth = default_crl_method;
  186|  39.6k|        crl->meth_data = NULL;
  187|  39.6k|        crl->issuers = NULL;
  188|  39.6k|        crl->crl_number = NULL;
  189|  39.6k|        crl->base_crl_number = NULL;
  190|  39.6k|        break;
  191|       |
  192|  19.3k|    case ASN1_OP_D2I_POST:
  ------------------
  |  |  747|  19.3k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (192:5): [True: 19.3k, False: 157k]
  ------------------
  193|  19.3k|        if (!X509_CRL_digest(crl, EVP_sha1(), crl->sha1_hash, NULL))
  ------------------
  |  Branch (193:13): [True: 0, False: 19.3k]
  ------------------
  194|      0|            crl->flags |= EXFLAG_NO_FINGERPRINT;
  ------------------
  |  |  671|      0|# define EXFLAG_NO_FINGERPRINT   0x100000
  ------------------
  195|  19.3k|        crl->idp = X509_CRL_get_ext_d2i(crl,
  196|  19.3k|                                        NID_issuing_distribution_point, &i,
  ------------------
  |  | 2698|  19.3k|#define NID_issuing_distribution_point          770
  ------------------
  197|  19.3k|                                        NULL);
  198|  19.3k|        if (crl->idp != NULL) {
  ------------------
  |  Branch (198:13): [True: 2.24k, False: 17.0k]
  ------------------
  199|  2.24k|            if (!setup_idp(crl, crl->idp))
  ------------------
  |  Branch (199:17): [True: 379, False: 1.86k]
  ------------------
  200|    379|                crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|    379|# define EXFLAG_INVALID          0x80
  ------------------
  201|  2.24k|        }
  202|  17.0k|        else if (i != -1) {
  ------------------
  |  Branch (202:18): [True: 12.1k, False: 4.94k]
  ------------------
  203|  12.1k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|  12.1k|# define EXFLAG_INVALID          0x80
  ------------------
  204|  12.1k|        }
  205|       |
  206|  19.3k|        crl->akid = X509_CRL_get_ext_d2i(crl,
  207|  19.3k|                                         NID_authority_key_identifier, &i,
  ------------------
  |  | 2733|  19.3k|#define NID_authority_key_identifier            90
  ------------------
  208|  19.3k|                                         NULL);
  209|  19.3k|        if (crl->akid == NULL && i != -1)
  ------------------
  |  Branch (209:13): [True: 19.2k, False: 54]
  |  Branch (209:34): [True: 3.13k, False: 16.1k]
  ------------------
  210|  3.13k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|  3.13k|# define EXFLAG_INVALID          0x80
  ------------------
  211|       |
  212|  19.3k|        crl->crl_number = X509_CRL_get_ext_d2i(crl,
  213|  19.3k|                                               NID_crl_number, &i, NULL);
  ------------------
  |  | 2678|  19.3k|#define NID_crl_number          88
  ------------------
  214|  19.3k|        if (crl->crl_number == NULL && i != -1)
  ------------------
  |  Branch (214:13): [True: 18.0k, False: 1.25k]
  |  Branch (214:40): [True: 2.52k, False: 15.5k]
  ------------------
  215|  2.52k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|  2.52k|# define EXFLAG_INVALID          0x80
  ------------------
  216|       |
  217|  19.3k|        crl->base_crl_number = X509_CRL_get_ext_d2i(crl,
  218|  19.3k|                                                    NID_delta_crl, &i,
  ------------------
  |  | 2693|  19.3k|#define NID_delta_crl           140
  ------------------
  219|  19.3k|                                                    NULL);
  220|  19.3k|        if (crl->base_crl_number == NULL && i != -1)
  ------------------
  |  Branch (220:13): [True: 19.2k, False: 64]
  |  Branch (220:45): [True: 1.29k, False: 17.9k]
  ------------------
  221|  1.29k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|  1.29k|# define EXFLAG_INVALID          0x80
  ------------------
  222|       |        /* Delta CRLs must have CRL number */
  223|  19.3k|        if (crl->base_crl_number && !crl->crl_number)
  ------------------
  |  Branch (223:13): [True: 64, False: 19.2k]
  |  Branch (223:37): [True: 54, False: 10]
  ------------------
  224|     54|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|     54|# 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|  19.3k|        exts = crl->crl.extensions;
  234|       |
  235|  46.2k|        for (idx = 0; idx < sk_X509_EXTENSION_num(exts); idx++) {
  ------------------
  |  |  235|  46.2k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (235:23): [True: 27.4k, False: 18.7k]
  ------------------
  236|  27.4k|            int nid;
  237|  27.4k|            ext = sk_X509_EXTENSION_value(exts, idx);
  ------------------
  |  |  236|  27.4k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  238|  27.4k|            nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext));
  239|  27.4k|            if (nid == NID_freshest_crl)
  ------------------
  |  | 2773|  27.4k|#define NID_freshest_crl                857
  ------------------
  |  Branch (239:17): [True: 846, False: 26.6k]
  ------------------
  240|    846|                crl->flags |= EXFLAG_FRESHEST;
  ------------------
  |  |  664|    846|# define EXFLAG_FRESHEST         0x1000
  ------------------
  241|  27.4k|            if (X509_EXTENSION_get_critical(ext)) {
  ------------------
  |  Branch (241:17): [True: 4.93k, False: 22.5k]
  ------------------
  242|       |                /* We handle IDP and deltas */
  243|  4.93k|                if ((nid == NID_issuing_distribution_point)
  ------------------
  |  | 2698|  4.93k|#define NID_issuing_distribution_point          770
  ------------------
  |  Branch (243:21): [True: 4.08k, False: 848]
  ------------------
  244|  4.93k|                    || (nid == NID_authority_key_identifier)
  ------------------
  |  | 2733|    848|#define NID_authority_key_identifier            90
  ------------------
  |  Branch (244:24): [True: 47, False: 801]
  ------------------
  245|  4.93k|                    || (nid == NID_delta_crl))
  ------------------
  |  | 2693|    801|#define NID_delta_crl           140
  ------------------
  |  Branch (245:24): [True: 212, False: 589]
  ------------------
  246|  4.34k|                    continue;
  247|    589|                crl->flags |= EXFLAG_CRITICAL;
  ------------------
  |  |  660|    589|# define EXFLAG_CRITICAL         0x200
  ------------------
  248|    589|                break;
  249|  4.93k|            }
  250|  27.4k|        }
  251|       |
  252|  19.3k|        if (!crl_set_issuers(crl))
  ------------------
  |  Branch (252:13): [True: 0, False: 19.3k]
  ------------------
  253|      0|            return 0;
  254|       |
  255|  19.3k|        if (crl->meth->crl_init) {
  ------------------
  |  Branch (255:13): [True: 0, False: 19.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|  19.3k|        crl->flags |= EXFLAG_SET;
  ------------------
  |  |  659|  19.3k|# define EXFLAG_SET              0x100
  ------------------
  261|  19.3k|        break;
  262|       |
  263|  19.8k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  19.8k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (263:5): [True: 19.8k, False: 157k]
  ------------------
  264|  19.8k|        if (crl->meth != NULL && crl->meth->crl_free != NULL) {
  ------------------
  |  Branch (264:13): [True: 19.8k, False: 0]
  |  Branch (264:34): [True: 0, False: 19.8k]
  ------------------
  265|      0|            if (!crl->meth->crl_free(crl))
  ------------------
  |  Branch (265:17): [True: 0, False: 0]
  ------------------
  266|      0|                return 0;
  267|      0|        }
  268|  19.8k|        AUTHORITY_KEYID_free(crl->akid);
  269|  19.8k|        ISSUING_DIST_POINT_free(crl->idp);
  270|  19.8k|        ASN1_INTEGER_free(crl->crl_number);
  271|  19.8k|        ASN1_INTEGER_free(crl->base_crl_number);
  272|  19.8k|        sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
  ------------------
  |  |  285|  19.8k|#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|  19.8k|        OPENSSL_free(crl->propq);
  ------------------
  |  |  115|  19.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  19.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  19.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  274|  19.8k|        break;
  275|      0|    case ASN1_OP_DUP_POST:
  ------------------
  |  |  757|      0|# define ASN1_OP_DUP_POST        15
  ------------------
  |  Branch (275:5): [True: 0, False: 177k]
  ------------------
  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|   177k|    }
  284|   177k|    return 1;
  285|   177k|}
x_crl.c:setup_idp:
  290|  2.24k|{
  291|  2.24k|    int idp_only = 0;
  292|       |
  293|       |    /* Set various flags according to IDP */
  294|  2.24k|    crl->idp_flags |= IDP_PRESENT;
  ------------------
  |  |  601|  2.24k|# define IDP_PRESENT     0x1
  ------------------
  295|  2.24k|    if (idp->onlyuser > 0) {
  ------------------
  |  Branch (295:9): [True: 12, False: 2.23k]
  ------------------
  296|     12|        idp_only++;
  297|     12|        crl->idp_flags |= IDP_ONLYUSER;
  ------------------
  |  |  605|     12|# define IDP_ONLYUSER    0x4
  ------------------
  298|     12|    }
  299|  2.24k|    if (idp->onlyCA > 0) {
  ------------------
  |  Branch (299:9): [True: 680, False: 1.56k]
  ------------------
  300|    680|        idp_only++;
  301|    680|        crl->idp_flags |= IDP_ONLYCA;
  ------------------
  |  |  607|    680|# define IDP_ONLYCA      0x8
  ------------------
  302|    680|    }
  303|  2.24k|    if (idp->onlyattr > 0) {
  ------------------
  |  Branch (303:9): [True: 36, False: 2.21k]
  ------------------
  304|     36|        idp_only++;
  305|     36|        crl->idp_flags |= IDP_ONLYATTR;
  ------------------
  |  |  609|     36|# define IDP_ONLYATTR    0x10
  ------------------
  306|     36|    }
  307|       |
  308|  2.24k|    if (idp_only > 1)
  ------------------
  |  Branch (308:9): [True: 11, False: 2.23k]
  ------------------
  309|     11|        crl->idp_flags |= IDP_INVALID;
  ------------------
  |  |  603|     11|# define IDP_INVALID     0x2
  ------------------
  310|       |
  311|  2.24k|    if (idp->indirectCRL > 0)
  ------------------
  |  Branch (311:9): [True: 12, False: 2.23k]
  ------------------
  312|     12|        crl->idp_flags |= IDP_INDIRECT;
  ------------------
  |  |  611|     12|# define IDP_INDIRECT    0x20
  ------------------
  313|       |
  314|  2.24k|    if (idp->onlysomereasons) {
  ------------------
  |  Branch (314:9): [True: 148, False: 2.09k]
  ------------------
  315|    148|        crl->idp_flags |= IDP_REASONS;
  ------------------
  |  |  613|    148|# define IDP_REASONS     0x40
  ------------------
  316|    148|        if (idp->onlysomereasons->length > 0)
  ------------------
  |  Branch (316:13): [True: 10, False: 138]
  ------------------
  317|     10|            crl->idp_reasons = idp->onlysomereasons->data[0];
  318|    148|        if (idp->onlysomereasons->length > 1)
  ------------------
  |  Branch (318:13): [True: 10, False: 138]
  ------------------
  319|     10|            crl->idp_reasons |= (idp->onlysomereasons->data[1] << 8);
  320|    148|        crl->idp_reasons &= CRLDP_ALL_REASONS;
  ------------------
  |  |  309|    148|# define CRLDP_ALL_REASONS       0x807f
  ------------------
  321|    148|    }
  322|       |
  323|  2.24k|    return DIST_POINT_set_dpname(idp->distpoint, X509_CRL_get_issuer(crl));
  324|  2.24k|}
x_crl.c:crl_set_issuers:
   83|  19.3k|{
   84|       |
   85|  19.3k|    int i, j;
   86|  19.3k|    GENERAL_NAMES *gens, *gtmp;
   87|  19.3k|    STACK_OF(X509_REVOKED) *revoked;
  ------------------
  |  |   31|  19.3k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   88|       |
   89|  19.3k|    revoked = X509_CRL_get_REVOKED(crl);
   90|       |
   91|  19.3k|    gens = NULL;
   92|  49.9k|    for (i = 0; i < sk_X509_REVOKED_num(revoked); i++) {
  ------------------
  |  |  105|  49.9k|#define sk_X509_REVOKED_num(sk) OPENSSL_sk_num(ossl_check_const_X509_REVOKED_sk_type(sk))
  ------------------
  |  Branch (92:17): [True: 32.6k, False: 17.3k]
  ------------------
   93|  32.6k|        X509_REVOKED *rev = sk_X509_REVOKED_value(revoked, i);
  ------------------
  |  |  106|  32.6k|#define sk_X509_REVOKED_value(sk, idx) ((X509_REVOKED *)OPENSSL_sk_value(ossl_check_const_X509_REVOKED_sk_type(sk), (idx)))
  ------------------
   94|  32.6k|        STACK_OF(X509_EXTENSION) *exts;
  ------------------
  |  |   31|  32.6k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   95|  32.6k|        ASN1_ENUMERATED *reason;
   96|  32.6k|        X509_EXTENSION *ext;
   97|       |
   98|  32.6k|        gtmp = X509_REVOKED_get_ext_d2i(rev,
   99|  32.6k|                                        NID_certificate_issuer, &j, NULL);
  ------------------
  |  | 2703|  32.6k|#define NID_certificate_issuer          771
  ------------------
  100|  32.6k|        if (gtmp == NULL && j != -1) {
  ------------------
  |  Branch (100:13): [True: 29.1k, False: 3.51k]
  |  Branch (100:29): [True: 244, False: 28.8k]
  ------------------
  101|    244|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|    244|# define EXFLAG_INVALID          0x80
  ------------------
  102|    244|            return 1;
  103|    244|        }
  104|       |
  105|  32.3k|        if (gtmp != NULL) {
  ------------------
  |  Branch (105:13): [True: 3.51k, False: 28.8k]
  ------------------
  106|  3.51k|            if (crl->issuers == NULL) {
  ------------------
  |  Branch (106:17): [True: 512, False: 3.00k]
  ------------------
  107|    512|                crl->issuers = sk_GENERAL_NAMES_new_null();
  ------------------
  |  |  274|    512|#define sk_GENERAL_NAMES_new_null() ((STACK_OF(GENERAL_NAMES) *)OPENSSL_sk_new_null())
  ------------------
  108|    512|                if (crl->issuers == NULL) {
  ------------------
  |  Branch (108:21): [True: 0, False: 512]
  ------------------
  109|      0|                    GENERAL_NAMES_free(gtmp);
  110|      0|                    return 0;
  111|      0|                }
  112|    512|            }
  113|  3.51k|            if (!sk_GENERAL_NAMES_push(crl->issuers, gtmp)) {
  ------------------
  |  |  281|  3.51k|#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: 3.51k]
  ------------------
  114|      0|                GENERAL_NAMES_free(gtmp);
  115|      0|                return 0;
  116|      0|            }
  117|  3.51k|            gens = gtmp;
  118|  3.51k|        }
  119|  32.3k|        rev->issuer = gens;
  120|       |
  121|  32.3k|        reason = X509_REVOKED_get_ext_d2i(rev, NID_crl_reason, &j, NULL);
  ------------------
  |  | 2683|  32.3k|#define NID_crl_reason          141
  ------------------
  122|  32.3k|        if (reason == NULL && j != -1) {
  ------------------
  |  Branch (122:13): [True: 15.4k, False: 16.9k]
  |  Branch (122:31): [True: 1.76k, False: 13.6k]
  ------------------
  123|  1.76k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|  1.76k|# define EXFLAG_INVALID          0x80
  ------------------
  124|  1.76k|            return 1;
  125|  1.76k|        }
  126|       |
  127|  30.6k|        if (reason != NULL) {
  ------------------
  |  Branch (127:13): [True: 16.9k, False: 13.6k]
  ------------------
  128|  16.9k|            rev->reason = ASN1_ENUMERATED_get(reason);
  129|  16.9k|            ASN1_ENUMERATED_free(reason);
  130|  16.9k|        } else
  131|  13.6k|            rev->reason = CRL_REASON_NONE;
  ------------------
  |  |  311|  13.6k|# define CRL_REASON_NONE                         -1
  ------------------
  132|       |
  133|       |        /* Check for critical CRL entry extensions */
  134|       |
  135|  30.6k|        exts = rev->extensions;
  136|       |
  137|  61.0k|        for (j = 0; j < sk_X509_EXTENSION_num(exts); j++) {
  ------------------
  |  |  235|  61.0k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (137:21): [True: 30.7k, False: 30.2k]
  ------------------
  138|  30.7k|            ext = sk_X509_EXTENSION_value(exts, j);
  ------------------
  |  |  236|  30.7k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  139|  30.7k|            if (X509_EXTENSION_get_critical(ext)) {
  ------------------
  |  Branch (139:17): [True: 324, False: 30.3k]
  ------------------
  140|    324|                if (OBJ_obj2nid(X509_EXTENSION_get_object(ext))
  ------------------
  |  Branch (140:21): [True: 0, False: 324]
  ------------------
  141|    324|                    == NID_certificate_issuer)
  ------------------
  |  | 2703|    324|#define NID_certificate_issuer          771
  ------------------
  142|      0|                    continue;
  143|    324|                crl->flags |= EXFLAG_CRITICAL;
  ------------------
  |  |  660|    324|# define EXFLAG_CRITICAL         0x200
  ------------------
  144|    324|                break;
  145|    324|            }
  146|  30.7k|        }
  147|       |
  148|  30.6k|    }
  149|       |
  150|  17.3k|    return 1;
  151|       |
  152|  19.3k|}

x_name.c:x509_name_ex_new:
   91|   205k|{
   92|   205k|    X509_NAME *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|   205k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   205k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   205k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|       |
   94|   205k|    if (ret == NULL)
  ------------------
  |  Branch (94:9): [True: 0, False: 205k]
  ------------------
   95|      0|        return 0;
   96|   205k|    if ((ret->entries = sk_X509_NAME_ENTRY_new_null()) == NULL) {
  ------------------
  |  |  207|   205k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (96:9): [True: 0, False: 205k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   98|      0|        goto err;
   99|      0|    }
  100|   205k|    if ((ret->bytes = BUF_MEM_new()) == NULL) {
  ------------------
  |  Branch (100:9): [True: 0, False: 205k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  102|      0|        goto err;
  103|      0|    }
  104|   205k|    ret->modified = 1;
  105|   205k|    *val = (ASN1_VALUE *)ret;
  106|   205k|    return 1;
  107|       |
  108|      0| err:
  109|      0|    if (ret) {
  ------------------
  |  Branch (109:9): [True: 0, False: 0]
  ------------------
  110|      0|        sk_X509_NAME_ENTRY_free(ret->entries);
  ------------------
  |  |  210|      0|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  111|      0|        OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|      0|    }
  113|      0|    return 0;
  114|   205k|}
x_name.c:x509_name_ex_free:
  117|   205k|{
  118|   205k|    X509_NAME *a;
  119|       |
  120|   205k|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 205k]
  |  Branch (120:25): [True: 0, False: 205k]
  ------------------
  121|      0|        return;
  122|   205k|    a = (X509_NAME *)*pval;
  123|       |
  124|   205k|    BUF_MEM_free(a->bytes);
  125|   205k|    sk_X509_NAME_ENTRY_pop_free(a->entries, X509_NAME_ENTRY_free);
  ------------------
  |  |  218|   205k|#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|   205k|    OPENSSL_free(a->canon_enc);
  ------------------
  |  |  115|   205k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   205k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   205k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  127|   205k|    OPENSSL_free(a);
  ------------------
  |  |  115|   205k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   205k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   205k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  128|   205k|    *pval = NULL;
  129|   205k|}
x_name.c:x509_name_ex_d2i:
  145|   104k|{
  146|   104k|    const unsigned char *p = *in, *q;
  147|   104k|    union {
  148|   104k|        STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
  149|   104k|        ASN1_VALUE *a;
  150|   104k|    } intname = {
  151|   104k|        NULL
  152|   104k|    };
  153|   104k|    union {
  154|   104k|        X509_NAME *x;
  155|   104k|        ASN1_VALUE *a;
  156|   104k|    } nm = {
  157|   104k|        NULL
  158|   104k|    };
  159|   104k|    int i, j, ret;
  160|   104k|    STACK_OF(X509_NAME_ENTRY) *entries;
  ------------------
  |  |   31|   104k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  161|   104k|    X509_NAME_ENTRY *entry;
  162|       |
  163|   104k|    if (len > X509_NAME_MAX)
  ------------------
  |  |   24|   104k|#define X509_NAME_MAX (1024 * 1024)
  ------------------
  |  Branch (163:9): [True: 0, False: 104k]
  ------------------
  164|      0|        len = X509_NAME_MAX;
  ------------------
  |  |   24|      0|#define X509_NAME_MAX (1024 * 1024)
  ------------------
  165|   104k|    q = p;
  166|       |
  167|       |    /* Get internal representation of Name */
  168|   104k|    ret = ASN1_item_ex_d2i(&intname.a,
  169|   104k|                           &p, len, ASN1_ITEM_rptr(X509_NAME_INTERNAL),
  ------------------
  |  |  426|   104k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  170|   104k|                           tag, aclass, opt, ctx);
  171|       |
  172|   104k|    if (ret <= 0)
  ------------------
  |  Branch (172:9): [True: 2.04k, False: 102k]
  ------------------
  173|  2.04k|        return ret;
  174|       |
  175|   102k|    if (*val)
  ------------------
  |  Branch (175:9): [True: 102k, False: 442]
  ------------------
  176|   102k|        x509_name_ex_free(val, NULL);
  177|   102k|    if (!x509_name_ex_new(&nm.a, NULL))
  ------------------
  |  Branch (177:9): [True: 0, False: 102k]
  ------------------
  178|      0|        goto err;
  179|       |    /* We've decoded it: now cache encoding */
  180|   102k|    if (!BUF_MEM_grow(nm.x->bytes, p - q))
  ------------------
  |  Branch (180:9): [True: 0, False: 102k]
  ------------------
  181|      0|        goto err;
  182|   102k|    memcpy(nm.x->bytes->data, q, p - q);
  183|       |
  184|       |    /* Convert internal representation to X509_NAME structure */
  185|  3.18M|    for (i = 0; i < sk_STACK_OF_X509_NAME_ENTRY_num(intname.s); i++) {
  ------------------
  |  Branch (185:17): [True: 3.07M, False: 102k]
  ------------------
  186|  3.07M|        entries = sk_STACK_OF_X509_NAME_ENTRY_value(intname.s, i);
  187|  3.46M|        for (j = 0; j < sk_X509_NAME_ENTRY_num(entries); j++) {
  ------------------
  |  |  204|  3.46M|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (187:21): [True: 390k, False: 3.07M]
  ------------------
  188|   390k|            entry = sk_X509_NAME_ENTRY_value(entries, j);
  ------------------
  |  |  205|   390k|#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|   390k|            entry->set = i;
  190|   390k|            if (!sk_X509_NAME_ENTRY_push(nm.x->entries, entry))
  ------------------
  |  |  214|   390k|#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: 390k]
  ------------------
  191|      0|                goto err;
  192|   390k|            (void)sk_X509_NAME_ENTRY_set(entries, j, NULL);
  ------------------
  |  |  220|   390k|#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|   390k|        }
  194|  3.07M|    }
  195|   102k|    ret = x509_name_canon(nm.x);
  196|   102k|    if (!ret)
  ------------------
  |  Branch (196:9): [True: 208, False: 102k]
  ------------------
  197|    208|        goto err;
  198|   102k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  199|   102k|                                         local_sk_X509_NAME_ENTRY_free);
  200|   102k|    nm.x->modified = 0;
  201|   102k|    *val = nm.a;
  202|   102k|    *in = p;
  203|   102k|    return ret;
  204|       |
  205|    208| err:
  206|    208|    if (nm.x != NULL)
  ------------------
  |  Branch (206:9): [True: 208, False: 0]
  ------------------
  207|    208|        X509_NAME_free(nm.x);
  208|    208|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  209|    208|                                         local_sk_X509_NAME_ENTRY_pop_free);
  210|    208|    ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    208|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    208|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    208|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    208|     ERR_set_error)
  |  |  ------------------
  ------------------
  211|    208|    return 0;
  212|   102k|}
x_name.c:x509_name_canon:
  311|   102k|{
  312|   102k|    unsigned char *p;
  313|   102k|    STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname;
  ------------------
  |  |   31|   102k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  314|   102k|    STACK_OF(X509_NAME_ENTRY) *entries = NULL;
  ------------------
  |  |   31|   102k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  315|   102k|    X509_NAME_ENTRY *entry, *tmpentry = NULL;
  316|   102k|    int i, set = -1, ret = 0, len;
  317|       |
  318|   102k|    OPENSSL_free(a->canon_enc);
  ------------------
  |  |  115|   102k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   102k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   102k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  319|   102k|    a->canon_enc = NULL;
  320|       |    /* Special case: empty X509_NAME => null encoding */
  321|   102k|    if (sk_X509_NAME_ENTRY_num(a->entries) == 0) {
  ------------------
  |  |  204|   102k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (321:9): [True: 97.5k, False: 5.40k]
  ------------------
  322|  97.5k|        a->canon_enclen = 0;
  323|  97.5k|        return 1;
  324|  97.5k|    }
  325|  5.40k|    intname = sk_STACK_OF_X509_NAME_ENTRY_new_null();
  326|  5.40k|    if (intname == NULL) {
  ------------------
  |  Branch (326:9): [True: 0, False: 5.40k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  328|      0|        goto err;
  329|      0|    }
  330|   555k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
  ------------------
  |  |  204|   555k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (330:17): [True: 550k, False: 5.11k]
  ------------------
  331|   550k|        entry = sk_X509_NAME_ENTRY_value(a->entries, i);
  ------------------
  |  |  205|   550k|#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|   550k|        if (entry->set != set) {
  ------------------
  |  Branch (332:13): [True: 274k, False: 275k]
  ------------------
  333|   274k|            entries = sk_X509_NAME_ENTRY_new_null();
  ------------------
  |  |  207|   274k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  334|   274k|            if (entries == NULL)
  ------------------
  |  Branch (334:17): [True: 0, False: 274k]
  ------------------
  335|      0|                goto err;
  336|   274k|            if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries)) {
  ------------------
  |  Branch (336:17): [True: 0, False: 274k]
  ------------------
  337|      0|                sk_X509_NAME_ENTRY_free(entries);
  ------------------
  |  |  210|      0|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  338|      0|                ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  339|      0|                goto err;
  340|      0|            }
  341|   274k|            set = entry->set;
  342|   274k|        }
  343|   550k|        tmpentry = X509_NAME_ENTRY_new();
  344|   550k|        if (tmpentry == NULL) {
  ------------------
  |  Branch (344:13): [True: 0, False: 550k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  346|      0|            goto err;
  347|      0|        }
  348|   550k|        tmpentry->object = OBJ_dup(entry->object);
  349|   550k|        if (tmpentry->object == NULL) {
  ------------------
  |  Branch (349:13): [True: 0, False: 550k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  351|      0|            goto err;
  352|      0|        }
  353|   550k|        if (!asn1_string_canon(tmpentry->value, entry->value))
  ------------------
  |  Branch (353:13): [True: 296, False: 550k]
  ------------------
  354|    296|            goto err;
  355|   550k|        if (!sk_X509_NAME_ENTRY_push(entries, tmpentry)) {
  ------------------
  |  |  214|   550k|#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: 550k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  357|      0|            goto err;
  358|      0|        }
  359|   550k|        tmpentry = NULL;
  360|   550k|    }
  361|       |
  362|       |    /* Finally generate encoding */
  363|  5.11k|    len = i2d_name_canon(intname, NULL);
  364|  5.11k|    if (len < 0)
  ------------------
  |  Branch (364:9): [True: 0, False: 5.11k]
  ------------------
  365|      0|        goto err;
  366|  5.11k|    a->canon_enclen = len;
  367|       |
  368|  5.11k|    p = OPENSSL_malloc(a->canon_enclen);
  ------------------
  |  |  102|  5.11k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.11k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.11k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  369|  5.11k|    if (p == NULL)
  ------------------
  |  Branch (369:9): [True: 0, False: 5.11k]
  ------------------
  370|      0|        goto err;
  371|       |
  372|  5.11k|    a->canon_enc = p;
  373|       |
  374|  5.11k|    i2d_name_canon(intname, &p);
  375|       |
  376|  5.11k|    ret = 1;
  377|       |
  378|  5.40k| err:
  379|  5.40k|    X509_NAME_ENTRY_free(tmpentry);
  380|  5.40k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
  381|  5.40k|                                         local_sk_X509_NAME_ENTRY_pop_free);
  382|  5.40k|    return ret;
  383|  5.11k|}
x_name.c:asn1_string_canon:
  393|   550k|{
  394|   550k|    unsigned char *to, *from;
  395|   550k|    int len, i;
  396|       |
  397|       |    /* If type not in bitmask just copy string across */
  398|   550k|    if (!(ASN1_tag2bit(in->type) & ASN1_MASK_CANON)) {
  ------------------
  |  |  388|   550k|        (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  117|   550k|# define B_ASN1_UTF8STRING       0x2000
  |  |  ------------------
  |  |                       (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  115|   550k|# define B_ASN1_BMPSTRING        0x0800
  |  |  ------------------
  |  |                       (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  112|   550k|# define B_ASN1_UNIVERSALSTRING  0x0100
  |  |  ------------------
  |  |  389|   550k|        | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  103|   550k|# define B_ASN1_PRINTABLESTRING  0x0002
  |  |  ------------------
  |  |                       | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  104|   550k|# define B_ASN1_T61STRING        0x0004
  |  |  ------------------
  |  |                       | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  107|   550k|# define B_ASN1_IA5STRING        0x0010
  |  |  ------------------
  |  |  390|   550k|        | B_ASN1_VISIBLESTRING)
  |  |  ------------------
  |  |  |  |  110|   550k|# define B_ASN1_VISIBLESTRING    0x0040
  |  |  ------------------
  ------------------
  |  Branch (398:9): [True: 372k, False: 178k]
  ------------------
  399|   372k|        if (!ASN1_STRING_copy(out, in))
  ------------------
  |  Branch (399:13): [True: 0, False: 372k]
  ------------------
  400|      0|            return 0;
  401|   372k|        return 1;
  402|   372k|    }
  403|       |
  404|   178k|    out->type = V_ASN1_UTF8STRING;
  ------------------
  |  |   73|   178k|# define V_ASN1_UTF8STRING               12
  ------------------
  405|   178k|    out->length = ASN1_STRING_to_UTF8(&out->data, in);
  406|   178k|    if (out->length == -1)
  ------------------
  |  Branch (406:9): [True: 296, False: 177k]
  ------------------
  407|    296|        return 0;
  408|       |
  409|   177k|    to = out->data;
  410|   177k|    from = to;
  411|       |
  412|   177k|    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|   178k|    while (len > 0 && ossl_isspace(*from)) {
  ------------------
  |  |   82|  22.2k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  22.2k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 491, False: 21.7k]
  |  |  ------------------
  ------------------
  |  Branch (422:12): [True: 22.2k, False: 156k]
  ------------------
  423|    491|        from++;
  424|    491|        len--;
  425|    491|    }
  426|       |
  427|   177k|    to = from + len;
  428|       |
  429|       |    /* Ignore trailing spaces */
  430|   178k|    while (len > 0 && ossl_isspace(to[-1])) {
  ------------------
  |  |   82|  22.0k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  22.0k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 297, False: 21.7k]
  |  |  ------------------
  ------------------
  |  Branch (430:12): [True: 22.0k, False: 156k]
  ------------------
  431|    297|        to--;
  432|    297|        len--;
  433|    297|    }
  434|       |
  435|   177k|    to = out->data;
  436|       |
  437|   177k|    i = 0;
  438|  17.8M|    while (i < len) {
  ------------------
  |  Branch (438:12): [True: 17.7M, False: 177k]
  ------------------
  439|       |        /* If not ASCII set just copy across */
  440|  17.7M|        if (!ossl_isascii(*from)) {
  ------------------
  |  |   75|  17.7M|# define ossl_isascii(c)        (((c) & ~127) == 0)
  ------------------
  |  Branch (440:13): [True: 16.8M, False: 870k]
  ------------------
  441|  16.8M|            *to++ = *from++;
  442|  16.8M|            i++;
  443|  16.8M|        }
  444|       |        /* Collapse multiple spaces */
  445|   870k|        else if (ossl_isspace(*from)) {
  ------------------
  |  |   82|   870k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|   870k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 37.5k, False: 833k]
  |  |  ------------------
  ------------------
  446|       |            /* Copy one space across */
  447|  37.5k|            *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|  39.7k|            do {
  454|  39.7k|                from++;
  455|  39.7k|                i++;
  456|  39.7k|            }
  457|  39.7k|            while (ossl_isspace(*from));
  ------------------
  |  |   82|  39.7k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  39.7k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 2.17k, False: 37.5k]
  |  |  ------------------
  ------------------
  458|   833k|        } else {
  459|   833k|            *to++ = ossl_tolower(*from);
  460|   833k|            from++;
  461|   833k|            i++;
  462|   833k|        }
  463|  17.7M|    }
  464|       |
  465|   177k|    out->length = to - out->data;
  466|       |
  467|   177k|    return 1;
  468|       |
  469|   178k|}
x_name.c:i2d_name_canon:
  473|  10.2k|{
  474|  10.2k|    int i, len, ltmp;
  475|  10.2k|    const ASN1_VALUE *v;
  476|  10.2k|    STACK_OF(ASN1_VALUE) *intname = (STACK_OF(ASN1_VALUE) *)_intname;
  ------------------
  |  |   31|  10.2k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  477|       |
  478|  10.2k|    len = 0;
  479|   558k|    for (i = 0; i < sk_ASN1_VALUE_num(intname); i++) {
  ------------------
  |  |  898|   558k|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (479:17): [True: 548k, False: 10.2k]
  ------------------
  480|   548k|        v = sk_ASN1_VALUE_value(intname, i);
  ------------------
  |  |  899|   548k|#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
  ------------------
  481|   548k|        ltmp = ASN1_item_ex_i2d(&v, in,
  482|   548k|                                ASN1_ITEM_rptr(X509_NAME_ENTRIES), -1, -1);
  ------------------
  |  |  426|   548k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  483|   548k|        if (ltmp < 0 || len > INT_MAX - ltmp)
  ------------------
  |  Branch (483:13): [True: 0, False: 548k]
  |  Branch (483:25): [True: 0, False: 548k]
  ------------------
  484|      0|            return -1;
  485|   548k|        len += ltmp;
  486|   548k|    }
  487|  10.2k|    return len;
  488|  10.2k|}
x_name.c:local_sk_X509_NAME_ENTRY_free:
  132|  3.16M|{
  133|  3.16M|    sk_X509_NAME_ENTRY_free(ne);
  ------------------
  |  |  210|  3.16M|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  134|  3.16M|}
x_name.c:local_sk_X509_NAME_ENTRY_pop_free:
  137|   275k|{
  138|   275k|    sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free);
  ------------------
  |  |  218|   275k|#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|   275k|}
x_name.c:x509_name_ex_i2d:
  216|  4.64k|{
  217|  4.64k|    int ret;
  218|  4.64k|    X509_NAME *a = (X509_NAME *)*val;
  219|       |
  220|  4.64k|    if (a->modified) {
  ------------------
  |  Branch (220:9): [True: 425, False: 4.21k]
  ------------------
  221|    425|        ret = x509_name_encode(a);
  222|    425|        if (ret < 0)
  ------------------
  |  Branch (222:13): [True: 0, False: 425]
  ------------------
  223|      0|            return ret;
  224|    425|        ret = x509_name_canon(a);
  225|    425|        if (!ret)
  ------------------
  |  Branch (225:13): [True: 88, False: 337]
  ------------------
  226|     88|            return -1;
  227|    425|    }
  228|  4.55k|    ret = a->bytes->length;
  229|  4.55k|    if (out != NULL) {
  ------------------
  |  Branch (229:9): [True: 1.07k, False: 3.48k]
  ------------------
  230|  1.07k|        memcpy(*out, a->bytes->data, ret);
  231|  1.07k|        *out += ret;
  232|  1.07k|    }
  233|  4.55k|    return ret;
  234|  4.64k|}
x_name.c:x509_name_encode:
  237|    425|{
  238|    425|    union {
  239|    425|        STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
  240|    425|        const ASN1_VALUE *a;
  241|    425|    } intname = {
  242|    425|        NULL
  243|    425|    };
  244|    425|    int len;
  245|    425|    unsigned char *p;
  246|    425|    STACK_OF(X509_NAME_ENTRY) *entries = NULL;
  ------------------
  |  |   31|    425|# define STACK_OF(type) struct stack_st_##type
  ------------------
  247|    425|    X509_NAME_ENTRY *entry;
  248|    425|    int i, set = -1;
  249|       |
  250|    425|    intname.s = sk_STACK_OF_X509_NAME_ENTRY_new_null();
  251|    425|    if (!intname.s)
  ------------------
  |  Branch (251:9): [True: 0, False: 425]
  ------------------
  252|      0|        goto cerr;
  253|   160k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
  ------------------
  |  |  204|   160k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (253:17): [True: 159k, False: 425]
  ------------------
  254|   159k|        entry = sk_X509_NAME_ENTRY_value(a->entries, i);
  ------------------
  |  |  205|   159k|#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|   159k|        if (entry->set != set) {
  ------------------
  |  Branch (255:13): [True: 83.7k, False: 75.9k]
  ------------------
  256|  83.7k|            entries = sk_X509_NAME_ENTRY_new_null();
  ------------------
  |  |  207|  83.7k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  257|  83.7k|            if (!entries)
  ------------------
  |  Branch (257:17): [True: 0, False: 83.7k]
  ------------------
  258|      0|                goto cerr;
  259|  83.7k|            if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname.s, entries)) {
  ------------------
  |  Branch (259:17): [True: 0, False: 83.7k]
  ------------------
  260|      0|                sk_X509_NAME_ENTRY_free(entries);
  ------------------
  |  |  210|      0|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  261|      0|                goto cerr;
  262|      0|            }
  263|  83.7k|            set = entry->set;
  264|  83.7k|        }
  265|   159k|        if (!sk_X509_NAME_ENTRY_push(entries, entry))
  ------------------
  |  |  214|   159k|#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: 159k]
  ------------------
  266|      0|            goto cerr;
  267|   159k|    }
  268|    425|    len = ASN1_item_ex_i2d(&intname.a, NULL,
  269|    425|                           ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1);
  ------------------
  |  |  426|    425|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  270|    425|    if (!BUF_MEM_grow(a->bytes, len)) {
  ------------------
  |  Branch (270:9): [True: 0, False: 425]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        goto err;
  273|      0|    }
  274|    425|    p = (unsigned char *)a->bytes->data;
  275|    425|    ASN1_item_ex_i2d(&intname.a,
  276|    425|                     &p, ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1);
  ------------------
  |  |  426|    425|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  277|    425|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  278|    425|                                         local_sk_X509_NAME_ENTRY_free);
  279|    425|    a->modified = 0;
  280|    425|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  36.5k|{
   72|  36.5k|    X509_PUBKEY *xpub = OPENSSL_zalloc(sizeof(*xpub));
  ------------------
  |  |  104|  36.5k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  36.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  36.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|       |
   74|  36.5k|    if (xpub == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 36.5k]
  ------------------
   75|      0|        return NULL;
   76|  36.5k|    return (X509_PUBKEY *)ASN1_item_d2i_ex((ASN1_VALUE **)&xpub, pp, len,
   77|  36.5k|                                           ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
  ------------------
  |  |  426|  36.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   78|  36.5k|                                           libctx, propq);
   79|  36.5k|}
ossl_X509_PUBKEY_INTERNAL_free:
   82|  72.9k|{
   83|  72.9k|    ASN1_item_free((ASN1_VALUE *)xpub, ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL));
  ------------------
  |  |  426|  72.9k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   84|  72.9k|}
X509_PUBKEY_get0:
  456|  36.4k|{
  457|  36.4k|    if (key == NULL) {
  ------------------
  |  Branch (457:9): [True: 0, False: 36.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  459|      0|        return NULL;
  460|      0|    }
  461|       |
  462|  36.4k|    if (key->pkey == NULL) {
  ------------------
  |  Branch (462:9): [True: 20.4k, False: 15.9k]
  ------------------
  463|       |        /* We failed to decode the key when we loaded it, or it was never set */
  464|  20.4k|        ERR_raise(ERR_LIB_EVP, EVP_R_DECODE_ERROR);
  ------------------
  |  |  401|  20.4k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  20.4k|    (ERR_new(),                                                 \
  |  |  |  |  404|  20.4k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  20.4k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  20.4k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  20.4k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  20.4k|     ERR_set_error)
  |  |  ------------------
  ------------------
  465|  20.4k|        return NULL;
  466|  20.4k|    }
  467|       |
  468|  15.9k|    return key->pkey;
  469|  36.4k|}
X509_PUBKEY_get:
  472|  36.4k|{
  473|  36.4k|    EVP_PKEY *ret = X509_PUBKEY_get0(key);
  474|       |
  475|  36.4k|    if (ret != NULL && !EVP_PKEY_up_ref(ret)) {
  ------------------
  |  Branch (475:9): [True: 15.9k, False: 20.4k]
  |  Branch (475:24): [True: 0, False: 15.9k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  477|      0|        ret = NULL;
  478|      0|    }
  479|  36.4k|    return ret;
  480|  36.4k|}
ossl_d2i_PUBKEY_legacy:
  536|  36.5k|{
  537|  36.5k|    return d2i_PUBKEY_int(a, pp, length, NULL, NULL, 1, d2i_X509_PUBKEY);
  538|  36.5k|}
d2i_RSA_PUBKEY:
  606|     20|{
  607|     20|    EVP_PKEY *pkey;
  608|     20|    RSA *key = NULL;
  609|     20|    const unsigned char *q;
  610|       |
  611|     20|    q = *pp;
  612|     20|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  613|     20|    if (pkey == NULL)
  ------------------
  |  Branch (613:9): [True: 6, False: 14]
  ------------------
  614|      6|        return NULL;
  615|     14|    key = EVP_PKEY_get1_RSA(pkey);
  616|     14|    EVP_PKEY_free(pkey);
  617|     14|    if (key == NULL)
  ------------------
  |  Branch (617:9): [True: 0, False: 14]
  ------------------
  618|      0|        return NULL;
  619|     14|    *pp = q;
  620|     14|    if (a != NULL) {
  ------------------
  |  Branch (620:9): [True: 0, False: 14]
  ------------------
  621|      0|        RSA_free(*a);
  622|      0|        *a = key;
  623|      0|    }
  624|     14|    return key;
  625|     14|}
ossl_d2i_DH_PUBKEY:
  647|      3|{
  648|      3|    EVP_PKEY *pkey;
  649|      3|    DH *key = NULL;
  650|      3|    const unsigned char *q;
  651|       |
  652|      3|    q = *pp;
  653|      3|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  654|      3|    if (pkey == NULL)
  ------------------
  |  Branch (654:9): [True: 3, False: 0]
  ------------------
  655|      3|        return NULL;
  656|      0|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_DH)
  ------------------
  |  |   68|      0|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|      0|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
  |  Branch (656:9): [True: 0, False: 0]
  ------------------
  657|      0|        key = EVP_PKEY_get1_DH(pkey);
  658|      0|    EVP_PKEY_free(pkey);
  659|      0|    if (key == NULL)
  ------------------
  |  Branch (659:9): [True: 0, False: 0]
  ------------------
  660|      0|        return NULL;
  661|      0|    *pp = q;
  662|      0|    if (a != NULL) {
  ------------------
  |  Branch (662:9): [True: 0, False: 0]
  ------------------
  663|      0|        DH_free(*a);
  664|      0|        *a = key;
  665|      0|    }
  666|      0|    return key;
  667|      0|}
ossl_d2i_DHx_PUBKEY:
  688|    393|{
  689|    393|    EVP_PKEY *pkey;
  690|    393|    DH *key = NULL;
  691|    393|    const unsigned char *q;
  692|       |
  693|    393|    q = *pp;
  694|    393|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  695|    393|    if (pkey == NULL)
  ------------------
  |  Branch (695:9): [True: 375, False: 18]
  ------------------
  696|    375|        return NULL;
  697|     18|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_DHX)
  ------------------
  |  |   69|     18|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5299|     18|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (697:9): [True: 18, False: 0]
  ------------------
  698|     18|        key = EVP_PKEY_get1_DH(pkey);
  699|     18|    EVP_PKEY_free(pkey);
  700|     18|    if (key == NULL)
  ------------------
  |  Branch (700:9): [True: 0, False: 18]
  ------------------
  701|      0|        return NULL;
  702|     18|    *pp = q;
  703|     18|    if (a != NULL) {
  ------------------
  |  Branch (703:9): [True: 0, False: 18]
  ------------------
  704|      0|        DH_free(*a);
  705|      0|        *a = key;
  706|      0|    }
  707|     18|    return key;
  708|     18|}
d2i_DSA_PUBKEY:
  731|  1.61k|{
  732|  1.61k|    EVP_PKEY *pkey;
  733|  1.61k|    DSA *key = NULL;
  734|  1.61k|    const unsigned char *q;
  735|       |
  736|  1.61k|    q = *pp;
  737|  1.61k|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  738|  1.61k|    if (pkey == NULL)
  ------------------
  |  Branch (738:9): [True: 1.58k, False: 34]
  ------------------
  739|  1.58k|        return NULL;
  740|     34|    key = EVP_PKEY_get1_DSA(pkey);
  741|     34|    EVP_PKEY_free(pkey);
  742|     34|    if (key == NULL)
  ------------------
  |  Branch (742:9): [True: 0, False: 34]
  ------------------
  743|      0|        return NULL;
  744|     34|    *pp = q;
  745|     34|    if (a != NULL) {
  ------------------
  |  Branch (745:9): [True: 0, False: 34]
  ------------------
  746|      0|        DSA_free(*a);
  747|      0|        *a = key;
  748|      0|    }
  749|     34|    return key;
  750|     34|}
ossl_d2i_DSA_PUBKEY:
  754|  1.61k|{
  755|  1.61k|    DSA *key = NULL;
  756|  1.61k|    const unsigned char *data;
  757|  1.61k|    const BIGNUM *p, *q, *g;
  758|       |
  759|  1.61k|    data = *pp;
  760|  1.61k|    key = d2i_DSA_PUBKEY(NULL, &data, length);
  761|  1.61k|    if (key == NULL)
  ------------------
  |  Branch (761:9): [True: 1.58k, False: 34]
  ------------------
  762|  1.58k|        return NULL;
  763|     34|    DSA_get0_pqg(key, &p, &q, &g);
  764|     34|    if (p == NULL || q == NULL || g == NULL) {
  ------------------
  |  Branch (764:9): [True: 30, False: 4]
  |  Branch (764:22): [True: 0, False: 4]
  |  Branch (764:35): [True: 0, False: 4]
  ------------------
  765|     30|        DSA_free(key);
  766|     30|        return NULL;
  767|     30|    }
  768|      4|    *pp = data;
  769|      4|    if (a != NULL) {
  ------------------
  |  Branch (769:9): [True: 0, False: 4]
  ------------------
  770|      0|        DSA_free(*a);
  771|      0|        *a = key;
  772|      0|    }
  773|      4|    return key;
  774|     34|}
d2i_EC_PUBKEY:
  797|  34.4k|{
  798|  34.4k|    EVP_PKEY *pkey;
  799|  34.4k|    EC_KEY *key = NULL;
  800|  34.4k|    const unsigned char *q;
  801|  34.4k|    int type;
  802|       |
  803|  34.4k|    q = *pp;
  804|  34.4k|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  805|  34.4k|    if (pkey == NULL)
  ------------------
  |  Branch (805:9): [True: 18.4k, False: 15.9k]
  ------------------
  806|  18.4k|        return NULL;
  807|  15.9k|    type = EVP_PKEY_get_id(pkey);
  808|  15.9k|    if (type == EVP_PKEY_EC || type == EVP_PKEY_SM2)
  ------------------
  |  |   70|  15.9k|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|  31.8k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
                  if (type == EVP_PKEY_EC || type == EVP_PKEY_SM2)
  ------------------
  |  |   71|      0|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|      0|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (808:9): [True: 15.9k, False: 0]
  |  Branch (808:32): [True: 0, False: 0]
  ------------------
  809|  15.9k|        key = EVP_PKEY_get1_EC_KEY(pkey);
  810|  15.9k|    EVP_PKEY_free(pkey);
  811|  15.9k|    if (key == NULL)
  ------------------
  |  Branch (811:9): [True: 0, False: 15.9k]
  ------------------
  812|      0|        return NULL;
  813|  15.9k|    *pp = q;
  814|  15.9k|    if (a != NULL) {
  ------------------
  |  Branch (814:9): [True: 0, False: 15.9k]
  ------------------
  815|      0|        EC_KEY_free(*a);
  816|      0|        *a = key;
  817|      0|    }
  818|  15.9k|    return key;
  819|  15.9k|}
ossl_d2i_ED25519_PUBKEY:
  842|      5|{
  843|      5|    EVP_PKEY *pkey;
  844|      5|    ECX_KEY *key = NULL;
  845|      5|    const unsigned char *q;
  846|       |
  847|      5|    q = *pp;
  848|      5|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  849|      5|    if (pkey == NULL)
  ------------------
  |  Branch (849:9): [True: 5, False: 0]
  ------------------
  850|      5|        return NULL;
  851|      0|    key = ossl_evp_pkey_get1_ED25519(pkey);
  852|      0|    EVP_PKEY_free(pkey);
  853|      0|    if (key == NULL)
  ------------------
  |  Branch (853:9): [True: 0, False: 0]
  ------------------
  854|      0|        return NULL;
  855|      0|    *pp = q;
  856|      0|    if (a != NULL) {
  ------------------
  |  Branch (856:9): [True: 0, False: 0]
  ------------------
  857|      0|        ossl_ecx_key_free(*a);
  858|      0|        *a = key;
  859|      0|    }
  860|      0|    return key;
  861|      0|}
ossl_d2i_ED448_PUBKEY:
  883|      6|{
  884|      6|    EVP_PKEY *pkey;
  885|      6|    ECX_KEY *key = NULL;
  886|      6|    const unsigned char *q;
  887|       |
  888|      6|    q = *pp;
  889|      6|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  890|      6|    if (pkey == NULL)
  ------------------
  |  Branch (890:9): [True: 6, False: 0]
  ------------------
  891|      6|        return NULL;
  892|      0|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_ED448)
  ------------------
  |  |   82|      0|# define EVP_PKEY_ED448 NID_ED448
  |  |  ------------------
  |  |  |  | 5508|      0|#define NID_ED448               1088
  |  |  ------------------
  ------------------
  |  Branch (892:9): [True: 0, False: 0]
  ------------------
  893|      0|        key = ossl_evp_pkey_get1_ED448(pkey);
  894|      0|    EVP_PKEY_free(pkey);
  895|      0|    if (key == NULL)
  ------------------
  |  Branch (895:9): [True: 0, False: 0]
  ------------------
  896|      0|        return NULL;
  897|      0|    *pp = q;
  898|      0|    if (a != NULL) {
  ------------------
  |  Branch (898:9): [True: 0, False: 0]
  ------------------
  899|      0|        ossl_ecx_key_free(*a);
  900|      0|        *a = key;
  901|      0|    }
  902|      0|    return key;
  903|      0|}
ossl_d2i_X25519_PUBKEY:
  925|     61|{
  926|     61|    EVP_PKEY *pkey;
  927|     61|    ECX_KEY *key = NULL;
  928|     61|    const unsigned char *q;
  929|       |
  930|     61|    q = *pp;
  931|     61|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  932|     61|    if (pkey == NULL)
  ------------------
  |  Branch (932:9): [True: 61, False: 0]
  ------------------
  933|     61|        return NULL;
  934|      0|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_X25519)
  ------------------
  |  |   79|      0|# define EVP_PKEY_X25519 NID_X25519
  |  |  ------------------
  |  |  |  | 5496|      0|#define NID_X25519              1034
  |  |  ------------------
  ------------------
  |  Branch (934:9): [True: 0, False: 0]
  ------------------
  935|      0|        key = ossl_evp_pkey_get1_X25519(pkey);
  936|      0|    EVP_PKEY_free(pkey);
  937|      0|    if (key == NULL)
  ------------------
  |  Branch (937:9): [True: 0, False: 0]
  ------------------
  938|      0|        return NULL;
  939|      0|    *pp = q;
  940|      0|    if (a != NULL) {
  ------------------
  |  Branch (940:9): [True: 0, False: 0]
  ------------------
  941|      0|        ossl_ecx_key_free(*a);
  942|      0|        *a = key;
  943|      0|    }
  944|      0|    return key;
  945|      0|}
ossl_d2i_X448_PUBKEY:
  967|     10|{
  968|     10|    EVP_PKEY *pkey;
  969|     10|    ECX_KEY *key = NULL;
  970|     10|    const unsigned char *q;
  971|       |
  972|     10|    q = *pp;
  973|     10|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  974|     10|    if (pkey == NULL)
  ------------------
  |  Branch (974:9): [True: 10, False: 0]
  ------------------
  975|     10|        return NULL;
  976|      0|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_X448)
  ------------------
  |  |   81|      0|# define EVP_PKEY_X448 NID_X448
  |  |  ------------------
  |  |  |  | 5500|      0|#define NID_X448                1035
  |  |  ------------------
  ------------------
  |  Branch (976:9): [True: 0, False: 0]
  ------------------
  977|      0|        key = ossl_evp_pkey_get1_X448(pkey);
  978|      0|    EVP_PKEY_free(pkey);
  979|      0|    if (key == NULL)
  ------------------
  |  Branch (979:9): [True: 0, False: 0]
  ------------------
  980|      0|        return NULL;
  981|      0|    *pp = q;
  982|      0|    if (a != NULL) {
  ------------------
  |  Branch (982:9): [True: 0, False: 0]
  ------------------
  983|      0|        ossl_ecx_key_free(*a);
  984|      0|        *a = key;
  985|      0|    }
  986|      0|    return key;
  987|      0|}
X509_PUBKEY_get0_param:
 1031|  72.8k|{
 1032|  72.8k|    if (ppkalg)
  ------------------
  |  Branch (1032:9): [True: 0, False: 72.8k]
  ------------------
 1033|      0|        *ppkalg = pub->algor->algorithm;
 1034|  72.8k|    if (pk) {
  ------------------
  |  Branch (1034:9): [True: 36.4k, False: 36.4k]
  ------------------
 1035|  36.4k|        *pk = pub->public_key->data;
 1036|  36.4k|        *ppklen = pub->public_key->length;
 1037|  36.4k|    }
 1038|  72.8k|    if (pa)
  ------------------
  |  Branch (1038:9): [True: 72.8k, False: 0]
  ------------------
 1039|  72.8k|        *pa = pub->algor;
 1040|  72.8k|    return 1;
 1041|  72.8k|}
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|  40.3k|{
  114|  40.3k|    X509_PUBKEY *ret;
  115|       |
  116|  40.3k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|  40.3k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  40.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  40.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (116:9): [True: 0, False: 40.3k]
  ------------------
  117|      0|        return 0;
  118|  40.3k|    if (!x509_pubkey_ex_populate((ASN1_VALUE **)&ret, NULL)
  ------------------
  |  Branch (118:9): [True: 0, False: 40.3k]
  ------------------
  119|  40.3k|        || !x509_pubkey_set0_libctx(ret, libctx, propq)) {
  ------------------
  |  Branch (119:12): [True: 0, False: 40.3k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  123|  40.3k|    } else {
  124|  40.3k|        *pval = (ASN1_VALUE *)ret;
  125|  40.3k|    }
  126|       |
  127|  40.3k|    return ret != NULL;
  128|  40.3k|}
x_pubkey.c:x509_pubkey_ex_populate:
  101|   116k|{
  102|   116k|    X509_PUBKEY *pubkey = (X509_PUBKEY *)*pval;
  103|       |
  104|   116k|    return (pubkey->algor != NULL
  ------------------
  |  Branch (104:13): [True: 40.0k, False: 76.8k]
  ------------------
  105|   116k|            || (pubkey->algor = X509_ALGOR_new()) != NULL)
  ------------------
  |  Branch (105:16): [True: 76.8k, False: 0]
  ------------------
  106|   116k|        && (pubkey->public_key != NULL
  ------------------
  |  Branch (106:13): [True: 40.0k, False: 76.8k]
  ------------------
  107|   116k|            || (pubkey->public_key = ASN1_BIT_STRING_new()) != NULL);
  ------------------
  |  Branch (107:16): [True: 76.8k, False: 0]
  ------------------
  108|   116k|}
x_pubkey.c:x509_pubkey_ex_d2i_ex:
  135|  76.6k|{
  136|  76.6k|    const unsigned char *in_saved = *in;
  137|  76.6k|    size_t publen;
  138|  76.6k|    X509_PUBKEY *pubkey;
  139|  76.6k|    int ret;
  140|  76.6k|    OSSL_DECODER_CTX *dctx = NULL;
  141|  76.6k|    unsigned char *tmpbuf = NULL;
  142|       |
  143|  76.6k|    if (*pval == NULL && !x509_pubkey_ex_new_ex(pval, it, libctx, propq))
  ------------------
  |  Branch (143:9): [True: 0, False: 76.6k]
  |  Branch (143:26): [True: 0, False: 0]
  ------------------
  144|      0|        return 0;
  145|  76.6k|    if (!x509_pubkey_ex_populate(pval, NULL)) {
  ------------------
  |  Branch (145:9): [True: 0, False: 76.6k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  147|      0|        return 0;
  148|      0|    }
  149|       |
  150|       |    /* This ensures that |*in| advances properly no matter what */
  151|  76.6k|    if ((ret = ASN1_item_ex_d2i(pval, in, len,
  ------------------
  |  Branch (151:9): [True: 139, False: 76.4k]
  ------------------
  152|  76.6k|                                ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
  ------------------
  |  |  426|  76.6k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  153|  76.6k|                                tag, aclass, opt, ctx)) <= 0)
  154|    139|        return ret;
  155|       |
  156|  76.4k|    publen = *in - in_saved;
  157|  76.4k|    if (!ossl_assert(publen > 0)) {
  ------------------
  |  |   52|  76.4k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  76.4k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (157:9): [True: 0, False: 76.4k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  159|      0|        return 0;
  160|      0|    }
  161|       |
  162|  76.4k|    pubkey = (X509_PUBKEY *)*pval;
  163|  76.4k|    EVP_PKEY_free(pubkey->pkey);
  164|  76.4k|    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|  76.4k|    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|  76.4k|    if ((ret = x509_pubkey_decode(&pubkey->pkey, pubkey)) == -1) {
  ------------------
  |  Branch (177:9): [True: 0, False: 76.4k]
  ------------------
  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|  76.4k|    if (ret <= 0 && !pubkey->flag_force_legacy) {
  ------------------
  |  Branch (184:9): [True: 60.4k, False: 15.9k]
  |  Branch (184:21): [True: 40.0k, False: 20.4k]
  ------------------
  185|  40.0k|        const unsigned char *p;
  186|  40.0k|        char txtoidname[OSSL_MAX_NAME_SIZE];
  187|  40.0k|        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|  40.0k|        if (aclass != V_ASN1_UNIVERSAL) {
  ------------------
  |  |   47|  40.0k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (193:13): [True: 0, False: 40.0k]
  ------------------
  194|      0|            tmpbuf = OPENSSL_memdup(in_saved, publen);
  ------------------
  |  |  117|      0|        CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|  40.0k|        p = in_saved;
  201|       |
  202|  40.0k|        if (OBJ_obj2txt(txtoidname, sizeof(txtoidname),
  ------------------
  |  Branch (202:13): [True: 0, False: 40.0k]
  ------------------
  203|  40.0k|                        pubkey->algor->algorithm, 0) <= 0) {
  204|      0|            ERR_clear_last_mark();
  205|      0|            goto end;
  206|      0|        }
  207|  40.0k|        if ((dctx =
  ------------------
  |  Branch (207:13): [True: 40.0k, False: 0]
  ------------------
  208|  40.0k|             OSSL_DECODER_CTX_new_for_pkey(&pubkey->pkey,
  209|  40.0k|                                           "DER", "SubjectPublicKeyInfo",
  210|  40.0k|                                           txtoidname, EVP_PKEY_PUBLIC_KEY,
  ------------------
  |  |   92|  40.0k|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |   88|  40.0k|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  ------------------
  |  |  |  |  |  |  574|  40.0k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  569|  40.0k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  40.0k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  570|  40.0k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  568|  40.0k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  211|  40.0k|                                           pubkey->libctx,
  212|  40.0k|                                           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|  40.0k|            if (OSSL_DECODER_from_data(dctx, &p, &slen)) {
  ------------------
  |  Branch (217:17): [True: 15.9k, False: 24.0k]
  ------------------
  218|  15.9k|                if (slen != 0) {
  ------------------
  |  Branch (218:21): [True: 0, False: 15.9k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  225|      0|                    goto end;
  226|      0|                }
  227|  15.9k|            }
  228|  40.0k|    }
  229|       |
  230|  76.4k|    ERR_pop_to_mark();
  231|  76.4k|    ret = 1;
  232|  76.4k| end:
  233|  76.4k|    OSSL_DECODER_CTX_free(dctx);
  234|  76.4k|    OPENSSL_free(tmpbuf);
  ------------------
  |  |  115|  76.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  76.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  76.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  235|  76.4k|    return ret;
  236|  76.4k|}
x_pubkey.c:x509_pubkey_set0_libctx:
   49|  76.8k|{
   50|  76.8k|    if (x != NULL) {
  ------------------
  |  Branch (50:9): [True: 76.8k, False: 0]
  ------------------
   51|  76.8k|        x->libctx = libctx;
   52|  76.8k|        OPENSSL_free(x->propq);
  ------------------
  |  |  115|  76.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  76.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  76.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   53|  76.8k|        x->propq = NULL;
   54|  76.8k|        if (propq != NULL) {
  ------------------
  |  Branch (54:13): [True: 0, False: 76.8k]
  ------------------
   55|      0|            x->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|  76.8k|    }
   60|  76.8k|    return 1;
   61|  76.8k|}
x_pubkey.c:x509_pubkey_ex_free:
   87|  76.7k|{
   88|  76.7k|    X509_PUBKEY *pubkey;
   89|       |
   90|  76.7k|    if (pval != NULL && (pubkey = (X509_PUBKEY *)*pval) != NULL) {
  ------------------
  |  Branch (90:9): [True: 76.7k, False: 0]
  |  Branch (90:25): [True: 76.7k, False: 0]
  ------------------
   91|  76.7k|        X509_ALGOR_free(pubkey->algor);
   92|  76.7k|        ASN1_BIT_STRING_free(pubkey->public_key);
   93|  76.7k|        EVP_PKEY_free(pubkey->pkey);
   94|  76.7k|        OPENSSL_free(pubkey->propq);
  ------------------
  |  |  115|  76.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  76.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  76.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   95|  76.7k|        OPENSSL_free(pubkey);
  ------------------
  |  |  115|  76.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  76.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  76.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   96|  76.7k|        *pval = NULL;
   97|  76.7k|    }
   98|  76.7k|}
x_pubkey.c:x509_pubkey_decode:
  405|  76.4k|{
  406|  76.4k|    EVP_PKEY *pkey;
  407|  76.4k|    int nid;
  408|       |
  409|  76.4k|    nid = OBJ_obj2nid(key->algor->algorithm);
  410|  76.4k|    if (!key->flag_force_legacy) {
  ------------------
  |  Branch (410:9): [True: 40.0k, False: 36.4k]
  ------------------
  411|  40.0k|#ifndef OPENSSL_NO_ENGINE
  412|  40.0k|        ENGINE *e = NULL;
  413|       |
  414|  40.0k|        e = ENGINE_get_pkey_meth_engine(nid);
  415|  40.0k|        if (e == NULL)
  ------------------
  |  Branch (415:13): [True: 40.0k, False: 0]
  ------------------
  416|  40.0k|            return 0;
  417|      0|        ENGINE_finish(e);
  418|       |#else
  419|       |        return 0;
  420|       |#endif
  421|      0|    }
  422|       |
  423|  36.4k|    pkey = EVP_PKEY_new();
  424|  36.4k|    if (pkey == NULL) {
  ------------------
  |  Branch (424:9): [True: 0, False: 36.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  426|      0|        return -1;
  427|      0|    }
  428|       |
  429|  36.4k|    if (!EVP_PKEY_set_type(pkey, nid)) {
  ------------------
  |  Branch (429:9): [True: 0, False: 36.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  431|      0|        goto error;
  432|      0|    }
  433|       |
  434|  36.4k|    if (pkey->ameth->pub_decode) {
  ------------------
  |  Branch (434:9): [True: 36.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|  36.4k|        if (!pkey->ameth->pub_decode(pkey, key))
  ------------------
  |  Branch (440:13): [True: 20.4k, False: 15.9k]
  ------------------
  441|  20.4k|            goto error;
  442|  36.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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  444|      0|        goto error;
  445|      0|    }
  446|       |
  447|  15.9k|    *ppkey = pkey;
  448|  15.9k|    return 1;
  449|       |
  450|  20.4k| error:
  451|  20.4k|    EVP_PKEY_free(pkey);
  452|  20.4k|    return 0;
  453|  36.4k|}
x_pubkey.c:d2i_PUBKEY_int:
  494|  36.5k|{
  495|  36.5k|    X509_PUBKEY *xpk, *xpk2 = NULL, **pxpk = NULL;
  496|  36.5k|    EVP_PKEY *pktmp = NULL;
  497|  36.5k|    const unsigned char *q;
  498|       |
  499|  36.5k|    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|  36.5k|    if (libctx != NULL || propq != NULL || force_legacy) {
  ------------------
  |  Branch (506:9): [True: 0, False: 36.5k]
  |  Branch (506:27): [True: 0, False: 36.5k]
  |  Branch (506:44): [True: 36.5k, False: 0]
  ------------------
  507|  36.5k|        xpk2 = OPENSSL_zalloc(sizeof(*xpk2));
  ------------------
  |  |  104|  36.5k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  36.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  36.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  508|  36.5k|        if (xpk2 == NULL)
  ------------------
  |  Branch (508:13): [True: 0, False: 36.5k]
  ------------------
  509|      0|            return NULL;
  510|  36.5k|        if (!x509_pubkey_set0_libctx(xpk2, libctx, propq))
  ------------------
  |  Branch (510:13): [True: 0, False: 36.5k]
  ------------------
  511|      0|            goto end;
  512|  36.5k|        xpk2->flag_force_legacy = !!force_legacy;
  513|  36.5k|        pxpk = &xpk2;
  514|  36.5k|    }
  515|  36.5k|    xpk = d2i_x509_pubkey(pxpk, &q, length);
  516|  36.5k|    if (xpk == NULL)
  ------------------
  |  Branch (516:9): [True: 89, False: 36.4k]
  ------------------
  517|     89|        goto end;
  518|  36.4k|    pktmp = X509_PUBKEY_get(xpk);
  519|  36.4k|    X509_PUBKEY_free(xpk);
  520|  36.4k|    xpk2 = NULL;                 /* We know that xpk == xpk2 */
  521|  36.4k|    if (pktmp == NULL)
  ------------------
  |  Branch (521:9): [True: 20.4k, False: 15.9k]
  ------------------
  522|  20.4k|        goto end;
  523|  15.9k|    *pp = q;
  524|  15.9k|    if (a != NULL) {
  ------------------
  |  Branch (524:9): [True: 0, False: 15.9k]
  ------------------
  525|      0|        EVP_PKEY_free(*a);
  526|      0|        *a = pktmp;
  527|      0|    }
  528|  36.5k| end:
  529|  36.5k|    X509_PUBKEY_free(xpk2);
  530|  36.5k|    return pktmp;
  531|  15.9k|}

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

FuzzerInitialize:
   21|      2|{
   22|      2|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  463|      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|  7.99k|{
   30|  7.99k|    CMS_ContentInfo *cms;
   31|  7.99k|    BIO *in;
   32|       |
   33|  7.99k|    if (len == 0)
  ------------------
  |  Branch (33:9): [True: 0, False: 7.99k]
  ------------------
   34|      0|        return 0;
   35|       |
   36|  7.99k|    in = BIO_new(BIO_s_mem());
   37|  7.99k|    OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
  ------------------
  |  |  434|  7.99k|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (434:12): [True: 7.99k, False: 0]
  |  |  ------------------
  ------------------
   38|  7.99k|    cms = d2i_CMS_bio(in, NULL);
   39|  7.99k|    if (cms != NULL) {
  ------------------
  |  Branch (39:9): [True: 1.08k, False: 6.91k]
  ------------------
   40|  1.08k|        BIO *out = BIO_new(BIO_s_null());
   41|       |
   42|  1.08k|        i2d_CMS_bio(out, cms);
   43|  1.08k|        BIO_free(out);
   44|  1.08k|        CMS_ContentInfo_free(cms);
   45|  1.08k|    }
   46|       |
   47|  7.99k|    BIO_free(in);
   48|  7.99k|    ERR_clear_error();
   49|       |
   50|  7.99k|    return 0;
   51|  7.99k|}

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

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

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

evp_fetch.c:ossl_assert_int:
   45|  59.1k|{
   46|  59.1k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 59.1k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  59.1k|    return expr;
   50|  59.1k|}
p_lib.c:ossl_assert_int:
   45|   248k|{
   46|   248k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 248k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   248k|    return expr;
   50|   248k|}
core_fetch.c:ossl_assert_int:
   45|  1.48k|{
   46|  1.48k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.48k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.48k|    return expr;
   50|  1.48k|}
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.48k|{
   46|  1.48k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.48k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.48k|    return expr;
   50|  1.48k|}
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|  76.4k|{
   46|  76.4k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 76.4k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  76.4k|    return expr;
   50|  76.4k|}
bio_print.c:ossl_assert_int:
   45|  4.99M|{
   46|  4.99M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 4.99M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  4.99M|    return expr;
   50|  4.99M|}
decoder_lib.c:ossl_assert_int:
   45|   199k|{
   46|   199k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 199k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   199k|    return expr;
   50|   199k|}
decoder_meth.c:ossl_assert_int:
   45|   349k|{
   46|   349k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 349k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   349k|    return expr;
   50|   349k|}
evp_enc.c:ossl_assert_int:
   45|  61.7k|{
   46|  61.7k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 61.7k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  61.7k|    return expr;
   50|  61.7k|}
packet.c:ossl_assert_int:
   45|   302k|{
   46|   302k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 302k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   302k|    return expr;
   50|   302k|}

bio_lib.c:CRYPTO_NEW_REF:
  268|   158k|{
  269|   158k|    refcnt->val = n;
  270|   158k|    return 1;
  271|   158k|}
bio_lib.c:CRYPTO_FREE_REF:
  273|   158k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|   158k|{
  275|   158k|}
bio_lib.c:CRYPTO_DOWN_REF:
   50|   231k|{
   51|   231k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|   231k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 158k, False: 72.9k]
  ------------------
   53|   158k|        atomic_thread_fence(memory_order_acquire);
   54|   231k|    return 1;
   55|   231k|}
bio_lib.c:CRYPTO_UP_REF:
   34|  72.9k|{
   35|  72.9k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  72.9k|    return 1;
   37|  72.9k|}
digest.c:CRYPTO_NEW_REF:
  268|     27|{
  269|     27|    refcnt->val = n;
  270|     27|    return 1;
  271|     27|}
digest.c:CRYPTO_UP_REF:
   34|  38.6k|{
   35|  38.6k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  38.6k|    return 1;
   37|  38.6k|}
digest.c:CRYPTO_DOWN_REF:
   50|  38.7k|{
   51|  38.7k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  38.7k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 27, False: 38.6k]
  ------------------
   53|     27|        atomic_thread_fence(memory_order_acquire);
   54|  38.7k|    return 1;
   55|  38.7k|}
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|   102k|{
   35|   102k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|   102k|    return 1;
   37|   102k|}
keymgmt_meth.c:CRYPTO_DOWN_REF:
   50|   102k|{
   51|   102k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|   102k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 18, False: 102k]
  ------------------
   53|     18|        atomic_thread_fence(memory_order_acquire);
   54|   102k|    return 1;
   55|   102k|}
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|  52.4k|{
  269|  52.4k|    refcnt->val = n;
  270|  52.4k|    return 1;
  271|  52.4k|}
p_lib.c:CRYPTO_FREE_REF:
  273|  52.4k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  52.4k|{
  275|  52.4k|}
p_lib.c:CRYPTO_UP_REF:
   34|  15.9k|{
   35|  15.9k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  15.9k|    return 1;
   37|  15.9k|}
p_lib.c:CRYPTO_DOWN_REF:
   50|  68.4k|{
   51|  68.4k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  68.4k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 52.4k, False: 15.9k]
  ------------------
   53|  52.4k|        atomic_thread_fence(memory_order_acquire);
   54|  68.4k|    return 1;
   55|  68.4k|}
provider_core.c:CRYPTO_UP_REF:
   34|  1.69k|{
   35|  1.69k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  1.69k|    return 1;
   37|  1.69k|}
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.70k|{
   51|  1.70k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  1.70k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 1, False: 1.69k]
  ------------------
   53|      1|        atomic_thread_fence(memory_order_acquire);
   54|  1.70k|    return 1;
   55|  1.70k|}
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|     18|{
  269|     18|    refcnt->val = n;
  270|     18|    return 1;
  271|     18|}
rsa_lib.c:CRYPTO_DOWN_REF:
   50|     32|{
   51|     32|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|     32|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 18, False: 14]
  ------------------
   53|     18|        atomic_thread_fence(memory_order_acquire);
   54|     32|    return 1;
   55|     32|}
rsa_lib.c:CRYPTO_FREE_REF:
  273|     18|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|     18|{
  275|     18|}
rsa_lib.c:CRYPTO_UP_REF:
   34|     14|{
   35|     14|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|     14|    return 1;
   37|     14|}
tasn_utl.c:CRYPTO_NEW_REF:
  268|  60.1k|{
  269|  60.1k|    refcnt->val = n;
  270|  60.1k|    return 1;
  271|  60.1k|}
tasn_utl.c:CRYPTO_FREE_REF:
  273|  60.1k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  60.1k|{
  275|  60.1k|}
tasn_utl.c:CRYPTO_DOWN_REF:
   50|  60.1k|{
   51|  60.1k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  60.1k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 60.1k, False: 0]
  ------------------
   53|  60.1k|        atomic_thread_fence(memory_order_acquire);
   54|  60.1k|    return 1;
   55|  60.1k|}
ossl_core_bio.c:CRYPTO_UP_REF:
   34|  73.0k|{
   35|  73.0k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  73.0k|    return 1;
   37|  73.0k|}
ossl_core_bio.c:CRYPTO_DOWN_REF:
   50|   146k|{
   51|   146k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|   146k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 72.9k, False: 73.0k]
  ------------------
   53|  72.9k|        atomic_thread_fence(memory_order_acquire);
   54|   146k|    return 1;
   55|   146k|}
ossl_core_bio.c:CRYPTO_FREE_REF:
  273|  72.9k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  72.9k|{
  275|  72.9k|}
ossl_core_bio.c:CRYPTO_NEW_REF:
  268|  72.9k|{
  269|  72.9k|    refcnt->val = n;
  270|  72.9k|    return 1;
  271|  72.9k|}
dh_lib.c:CRYPTO_NEW_REF:
  268|     91|{
  269|     91|    refcnt->val = n;
  270|     91|    return 1;
  271|     91|}
dh_lib.c:CRYPTO_DOWN_REF:
   50|    109|{
   51|    109|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|    109|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 91, False: 18]
  ------------------
   53|     91|        atomic_thread_fence(memory_order_acquire);
   54|    109|    return 1;
   55|    109|}
dh_lib.c:CRYPTO_FREE_REF:
  273|     91|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|     91|{
  275|     91|}
dh_lib.c:CRYPTO_UP_REF:
   34|     18|{
   35|     18|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|     18|    return 1;
   37|     18|}
dsa_lib.c:CRYPTO_NEW_REF:
  268|    167|{
  269|    167|    refcnt->val = n;
  270|    167|    return 1;
  271|    167|}
dsa_lib.c:CRYPTO_DOWN_REF:
   50|    201|{
   51|    201|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|    201|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 167, False: 34]
  ------------------
   53|    167|        atomic_thread_fence(memory_order_acquire);
   54|    201|    return 1;
   55|    201|}
dsa_lib.c:CRYPTO_FREE_REF:
  273|    167|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|    167|{
  275|    167|}
dsa_lib.c:CRYPTO_UP_REF:
   34|     34|{
   35|     34|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|     34|    return 1;
   37|     34|}
ec_key.c:CRYPTO_DOWN_REF:
   50|  50.2k|{
   51|  50.2k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  50.2k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 34.3k, False: 15.9k]
  ------------------
   53|  34.3k|        atomic_thread_fence(memory_order_acquire);
   54|  50.2k|    return 1;
   55|  50.2k|}
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|  15.9k|{
   35|  15.9k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  15.9k|    return 1;
   37|  15.9k|}
ec_kmeth.c:CRYPTO_NEW_REF:
  268|  34.3k|{
  269|  34.3k|    refcnt->val = n;
  270|  34.3k|    return 1;
  271|  34.3k|}
decoder_meth.c:CRYPTO_UP_REF:
   34|   185k|{
   35|   185k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|   185k|    return 1;
   37|   185k|}
decoder_meth.c:CRYPTO_DOWN_REF:
   50|   185k|{
   51|   185k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|   185k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 40, False: 185k]
  ------------------
   53|     40|        atomic_thread_fence(memory_order_acquire);
   54|   185k|    return 1;
   55|   185k|}
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|    141|{
   35|    141|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|    141|    return 1;
   37|    141|}
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|    271|{
   51|    271|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|    271|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 130, False: 141]
  ------------------
   53|    130|        atomic_thread_fence(memory_order_acquire);
   54|    271|    return 1;
   55|    271|}
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|  49.8k|    {                                                                        \
  323|  49.8k|        int e2 = 0;                                                          \
  324|  49.8k|        type q, r, x, y;                                                     \
  325|  49.8k|                                                                             \
  326|  49.8k|        if (c == 0) {                                                        \
  ------------------
  |  Branch (326:13): [True: 0, False: 49.8k]
  ------------------
  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|  49.8k|        x = safe_mul_ ## type_name(a, b, &e2);                               \
  331|  49.8k|        if (!e2)                                                             \
  ------------------
  |  Branch (331:13): [True: 49.8k, False: 0]
  ------------------
  332|  49.8k|            return safe_div_ ## type_name(x, c, err);                        \
  333|  49.8k|        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|  49.8k|    }
stack.c:safe_mul_int:
  136|  49.8k|    {                                                                        \
  137|  49.8k|        type r;                                                              \
  138|  49.8k|                                                                             \
  139|  49.8k|        if (!__builtin_mul_overflow(a, b, &r))                               \
  ------------------
  |  Branch (139:13): [True: 49.8k, False: 0]
  ------------------
  140|  49.8k|            return r;                                                        \
  141|  49.8k|        *err |= 1;                                                           \
  142|      0|        return (a < 0) ^ (b < 0) ? min : max;                                \
  ------------------
  |  Branch (142:16): [True: 0, False: 0]
  ------------------
  143|  49.8k|    }
stack.c:safe_div_int:
  199|  49.8k|    {                                                                        \
  200|  49.8k|        if (b == 0) {                                                        \
  ------------------
  |  Branch (200:13): [True: 0, False: 49.8k]
  ------------------
  201|      0|            *err |= 1;                                                       \
  202|      0|            return a < 0 ? min : max;                                        \
  ------------------
  |  Branch (202:20): [True: 0, False: 0]
  ------------------
  203|      0|        }                                                                    \
  204|  49.8k|        if (b == -1 && a == min) {                                           \
  ------------------
  |  Branch (204:13): [True: 0, False: 49.8k]
  |  Branch (204:24): [True: 0, False: 0]
  ------------------
  205|      0|            *err |= 1;                                                       \
  206|      0|            return max;                                                      \
  207|      0|        }                                                                    \
  208|  49.8k|        return a / b;                                                        \
  209|  49.8k|    }

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|  3.25k|{
   23|  3.25k|    return value >= SURROGATE_MIN && value <= SURROGATE_MAX;
  ------------------
  |  Branch (23:12): [True: 1.17k, False: 2.07k]
  |  Branch (23:38): [True: 10, False: 1.16k]
  ------------------
   24|  3.25k|}
a_mbstr.c:is_unicode_valid:
   27|  9.32M|{
   28|  9.32M|    return value <= UNICODE_MAX && !is_unicode_surrogate(value);
  ------------------
  |  Branch (28:12): [True: 9.32M, False: 43]
  |  Branch (28:36): [True: 9.32M, False: 20]
  ------------------
   29|  9.32M|}
a_mbstr.c:is_unicode_surrogate:
   22|  9.32M|{
   23|  9.32M|    return value >= SURROGATE_MIN && value <= SURROGATE_MAX;
  ------------------
  |  Branch (23:12): [True: 1.76k, False: 9.31M]
  |  Branch (23:38): [True: 20, False: 1.74k]
  ------------------
   24|  9.32M|}

CMS_ContentInfo_free:
  816|  1.08k|        { \
  817|  1.08k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  1.08k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  1.08k|        }
OTHERNAME_it:
  166|  4.20k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  4.20k|        { \
  |  |   96|  4.20k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  4.20k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  4.20k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  4.20k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  4.20k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  4.20k|                tname##_seq_tt,\
  170|  4.20k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  4.20k|                NULL,\
  172|  4.20k|                sizeof(stname),\
  173|  4.20k|                #tname \
  174|  4.20k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  4.20k|                }; \
  |  |  103|  4.20k|        return &local_it; \
  |  |  104|  4.20k|        }
  ------------------
EDIPARTYNAME_it:
  166|    328|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    328|        { \
  |  |   96|    328|                static const ASN1_ITEM local_it = {
  ------------------
  167|    328|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    328|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    328|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    328|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    328|                tname##_seq_tt,\
  170|    328|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    328|                NULL,\
  172|    328|                sizeof(stname),\
  173|    328|                #tname \
  174|    328|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    328|                }; \
  |  |  103|    328|        return &local_it; \
  |  |  104|    328|        }
  ------------------
GENERAL_NAME_it:
  320|  9.64k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  9.64k|        { \
  |  |   96|  9.64k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  9.64k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  9.64k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  9.64k|                offsetof(stname,selname) ,\
  323|  9.64k|                tname##_ch_tt,\
  324|  9.64k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  9.64k|                NULL,\
  326|  9.64k|                sizeof(stname),\
  327|  9.64k|                #stname \
  328|  9.64k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  9.64k|                }; \
  |  |  103|  9.64k|        return &local_it; \
  |  |  104|  9.64k|        }
  ------------------
GENERAL_NAMES_it:
  113|  87.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  87.8k|        { \
  |  |   96|  87.8k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  87.8k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  87.8k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  87.8k|                -1,\
  116|  87.8k|                &tname##_item_tt,\
  117|  87.8k|                0,\
  118|  87.8k|                NULL,\
  119|  87.8k|                0,\
  120|  87.8k|                #tname \
  121|  87.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  87.8k|                }; \
  |  |  103|  87.8k|        return &local_it; \
  |  |  104|  87.8k|        }
  ------------------
GENERAL_NAMES_free:
  816|  84.1k|        { \
  817|  84.1k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  84.1k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  84.1k|        }
X509_ATTRIBUTE_it:
  166|  14.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  14.6k|        { \
  |  |   96|  14.6k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  14.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  14.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  14.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  14.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  14.6k|                tname##_seq_tt,\
  170|  14.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  14.6k|                NULL,\
  172|  14.6k|                sizeof(stname),\
  173|  14.6k|                #tname \
  174|  14.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  14.6k|                }; \
  |  |  103|  14.6k|        return &local_it; \
  |  |  104|  14.6k|        }
  ------------------
X509_REVOKED_it:
  166|   131k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   131k|        { \
  |  |   96|   131k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   131k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   131k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   131k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   131k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   131k|                tname##_seq_tt,\
  170|   131k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   131k|                NULL,\
  172|   131k|                sizeof(stname),\
  173|   131k|                #tname \
  174|   131k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   131k|                }; \
  |  |  103|   131k|        return &local_it; \
  |  |  104|   131k|        }
  ------------------
X509_CRL_INFO_it:
  247|   118k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   118k|        { \
  |  |   96|   118k|                static const ASN1_ITEM local_it = {
  ------------------
  248|   118k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   118k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|   118k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   118k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|   118k|                tname##_seq_tt,\
  251|   118k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|   118k|                &tname##_aux,\
  253|   118k|                sizeof(stname),\
  254|   118k|                #tname \
  255|   118k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   118k|                }; \
  |  |  103|   118k|        return &local_it; \
  |  |  104|   118k|        }
  ------------------
X509_CRL_it:
  247|  59.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  59.8k|        { \
  |  |   96|  59.8k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  59.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  59.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  59.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  59.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  59.8k|                tname##_seq_tt,\
  251|  59.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  59.8k|                &tname##_aux,\
  253|  59.8k|                sizeof(stname),\
  254|  59.8k|                #tname \
  255|  59.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  59.8k|                }; \
  |  |  103|  59.8k|        return &local_it; \
  |  |  104|  59.8k|        }
  ------------------
X509_EXTENSION_it:
  166|   283k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   283k|        { \
  |  |   96|   283k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   283k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   283k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   283k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   283k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   283k|                tname##_seq_tt,\
  170|   283k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   283k|                NULL,\
  172|   283k|                sizeof(stname),\
  173|   283k|                #tname \
  174|   283k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   283k|                }; \
  |  |  103|   283k|        return &local_it; \
  |  |  104|   283k|        }
  ------------------
X509_NAME_ENTRY_it:
  166|  3.83M|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  3.83M|        { \
  |  |   96|  3.83M|                static const ASN1_ITEM local_it = {
  ------------------
  167|  3.83M|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  3.83M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  3.83M|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  3.83M|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  3.83M|                tname##_seq_tt,\
  170|  3.83M|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  3.83M|                NULL,\
  172|  3.83M|                sizeof(stname),\
  173|  3.83M|                #tname \
  174|  3.83M|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.83M|                }; \
  |  |  103|  3.83M|        return &local_it; \
  |  |  104|  3.83M|        }
  ------------------
X509_NAME_ENTRY_new:
  812|   550k|        { \
  813|   550k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   550k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|   550k|        } \
X509_NAME_ENTRY_free:
  816|   946k|        { \
  817|   946k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   946k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   946k|        }
X509_NAME_ENTRY_dup:
  855|    456|        { \
  856|    456|        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
  ------------------
  |  |  426|    456|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  857|    456|        }
X509_NAME_it:
  775|   322k|        ASN1_ITEM_start(sname) \
  ------------------
  |  |   95|   322k|        { \
  |  |   96|   322k|                static const ASN1_ITEM local_it = {
  ------------------
  776|   322k|                ASN1_ITYPE_EXTERN, \
  ------------------
  |  |   84|   322k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  777|   322k|                tag, \
  778|   322k|                NULL, \
  779|   322k|                0, \
  780|   322k|                &fptrs, \
  781|   322k|                0, \
  782|   322k|                #sname \
  783|   322k|        ASN1_ITEM_end(sname)
  ------------------
  |  |  102|   322k|                }; \
  |  |  103|   322k|        return &local_it; \
  |  |  104|   322k|        }
  ------------------
i2d_X509_NAME:
  830|    438|        { \
  831|    438|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|    438|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    438|        }
X509_NAME_free:
  816|  7.42k|        { \
  817|  7.42k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  7.42k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  7.42k|        }
X509_NAME_dup:
  855|    729|        { \
  856|    729|        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
  ------------------
  |  |  426|    729|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  857|    729|        }
x_name.c:X509_NAME_INTERNAL_it:
  124|   105k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|   105k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|   105k|        { \
  |  |  |  |   96|   105k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  125|   105k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|   105k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  126|   105k|                -1,\
  127|   105k|                &tname##_item_tt,\
  128|   105k|                0,\
  129|   105k|                NULL,\
  130|   105k|                0,\
  131|   105k|                #tname \
  132|   105k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   105k|                }; \
  |  |  103|   105k|        return &local_it; \
  |  |  104|   105k|        }
  ------------------
x_name.c:X509_NAME_ENTRIES_it:
  124|  3.86M|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  3.86M|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  3.86M|        { \
  |  |  |  |   96|  3.86M|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  125|  3.86M|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  3.86M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  126|  3.86M|                -1,\
  127|  3.86M|                &tname##_item_tt,\
  128|  3.86M|                0,\
  129|  3.86M|                NULL,\
  130|  3.86M|                0,\
  131|  3.86M|                #tname \
  132|  3.86M|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.86M|                }; \
  |  |  103|  3.86M|        return &local_it; \
  |  |  104|  3.86M|        }
  ------------------
X509_PUBKEY_it:
  775|   230k|        ASN1_ITEM_start(sname) \
  ------------------
  |  |   95|   230k|        { \
  |  |   96|   230k|                static const ASN1_ITEM local_it = {
  ------------------
  776|   230k|                ASN1_ITYPE_EXTERN, \
  ------------------
  |  |   84|   230k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  777|   230k|                tag, \
  778|   230k|                NULL, \
  779|   230k|                0, \
  780|   230k|                &fptrs, \
  781|   230k|                0, \
  782|   230k|                #sname \
  783|   230k|        ASN1_ITEM_end(sname)
  ------------------
  |  |  102|   230k|                }; \
  |  |  103|   230k|        return &local_it; \
  |  |  104|   230k|        }
  ------------------
d2i_X509_PUBKEY:
  826|  36.5k|        { \
  827|  36.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  36.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  36.5k|        } \
X509_PUBKEY_free:
  816|  72.9k|        { \
  817|  72.9k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  72.9k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  72.9k|        }
x_pubkey.c:X509_PUBKEY_INTERNAL_it:
  178|   186k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|   186k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|   186k|        { \
  |  |  |  |   96|   186k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|   186k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   186k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|   186k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   186k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|   186k|                tname##_seq_tt,\
  182|   186k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|   186k|                NULL,\
  184|   186k|                sizeof(stname),\
  185|   186k|                #stname \
  186|   186k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   186k|                }; \
  |  |  103|   186k|        return &local_it; \
  |  |  104|   186k|        }
  ------------------
X509_CINF_it:
  247|   121k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   121k|        { \
  |  |   96|   121k|                static const ASN1_ITEM local_it = {
  ------------------
  248|   121k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   121k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|   121k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   121k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|   121k|                tname##_seq_tt,\
  251|   121k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|   121k|                &tname##_aux,\
  253|   121k|                sizeof(stname),\
  254|   121k|                #tname \
  255|   121k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   121k|                }; \
  |  |  103|   121k|        return &local_it; \
  |  |  104|   121k|        }
  ------------------
X509_it:
  247|   118k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   118k|        { \
  |  |   96|   118k|                static const ASN1_ITEM local_it = {
  ------------------
  248|   118k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   118k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|   118k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   118k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|   118k|                tname##_seq_tt,\
  251|   118k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|   118k|                &tname##_aux,\
  253|   118k|                sizeof(stname),\
  254|   118k|                #tname \
  255|   118k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   118k|                }; \
  |  |  103|   118k|        return &local_it; \
  |  |  104|   118k|        }
  ------------------
X509_free:
  816|  3.98k|        { \
  817|  3.98k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  3.98k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  3.98k|        }
X509_CERT_AUX_it:
  166|  80.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  80.6k|        { \
  |  |   96|  80.6k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  80.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  80.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  80.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  80.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  80.6k|                tname##_seq_tt,\
  170|  80.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  80.6k|                NULL,\
  172|  80.6k|                sizeof(stname),\
  173|  80.6k|                #tname \
  174|  80.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  80.6k|                }; \
  |  |  103|  80.6k|        return &local_it; \
  |  |  104|  80.6k|        }
  ------------------
X509_CERT_AUX_free:
  816|  80.6k|        { \
  817|  80.6k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  80.6k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  80.6k|        }
ASN1_TIME_it:
  770|   559k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   559k|        { \
  |  |   96|   559k|                static const ASN1_ITEM local_it = {
  ------------------
  771|   559k|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|   559k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|   559k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   559k|                }; \
  |  |  103|   559k|        return &local_it; \
  |  |  104|   559k|        }
  ------------------
ASN1_OCTET_STRING_it:
  764|   387k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   387k|        { \
  |  |   96|   387k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   387k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   387k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   387k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   387k|                }; \
  |  |  103|   387k|        return &local_it; \
  |  |  104|   387k|        }
  ------------------
ASN1_INTEGER_it:
  764|   572k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   572k|        { \
  |  |   96|   572k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   572k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   572k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   572k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   572k|                }; \
  |  |  103|   572k|        return &local_it; \
  |  |  104|   572k|        }
  ------------------
d2i_ASN1_INTEGER:
  826|    134|        { \
  827|    134|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|    134|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|    134|        } \
ASN1_ENUMERATED_it:
  764|  18.6k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  18.6k|        { \
  |  |   96|  18.6k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  18.6k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  18.6k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  18.6k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  18.6k|                }; \
  |  |  103|  18.6k|        return &local_it; \
  |  |  104|  18.6k|        }
  ------------------
ASN1_BIT_STRING_it:
  764|   755k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   755k|        { \
  |  |   96|   755k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   755k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   755k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   755k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   755k|                }; \
  |  |  103|   755k|        return &local_it; \
  |  |  104|   755k|        }
  ------------------
ASN1_IA5STRING_it:
  764|  5.76k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  5.76k|        { \
  |  |   96|  5.76k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  5.76k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  5.76k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  5.76k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  5.76k|                }; \
  |  |  103|  5.76k|        return &local_it; \
  |  |  104|  5.76k|        }
  ------------------
ASN1_GENERALIZEDTIME_it:
  764|  14.2k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  14.2k|        { \
  |  |   96|  14.2k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  14.2k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  14.2k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  14.2k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  14.2k|                }; \
  |  |  103|  14.2k|        return &local_it; \
  |  |  104|  14.2k|        }
  ------------------
ASN1_OBJECT_it:
  764|  6.50M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  6.50M|        { \
  |  |   96|  6.50M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  6.50M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  6.50M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  6.50M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  6.50M|                }; \
  |  |  103|  6.50M|        return &local_it; \
  |  |  104|  6.50M|        }
  ------------------
ASN1_ANY_it:
  764|  4.38M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  4.38M|        { \
  |  |   96|  4.38M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  4.38M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  4.38M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  4.38M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  4.38M|                }; \
  |  |  103|  4.38M|        return &local_it; \
  |  |  104|  4.38M|        }
  ------------------
ASN1_SEQUENCE_it:
  764|   289k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   289k|        { \
  |  |   96|   289k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   289k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   289k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   289k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   289k|                }; \
  |  |  103|   289k|        return &local_it; \
  |  |  104|   289k|        }
  ------------------
ASN1_TYPE_new:
  812|   432k|        { \
  813|   432k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   432k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|   432k|        } \
ASN1_TYPE_free:
  816|  3.55k|        { \
  817|  3.55k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  3.55k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  3.55k|        }
ASN1_PRINTABLE_it:
  770|  5.28M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  5.28M|        { \
  |  |   96|  5.28M|                static const ASN1_ITEM local_it = {
  ------------------
  771|  5.28M|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|  5.28M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|  5.28M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  5.28M|                }; \
  |  |  103|  5.28M|        return &local_it; \
  |  |  104|  5.28M|        }
  ------------------
DIRECTORYSTRING_it:
  770|     42|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|     42|        { \
  |  |   96|     42|                static const ASN1_ITEM local_it = {
  ------------------
  771|     42|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|     42|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|     42|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|     42|                }; \
  |  |  103|     42|        return &local_it; \
  |  |  104|     42|        }
  ------------------
ASN1_FBOOLEAN_it:
  764|   594k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   594k|        { \
  |  |   96|   594k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   594k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   594k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   594k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   594k|                }; \
  |  |  103|   594k|        return &local_it; \
  |  |  104|   594k|        }
  ------------------
ASN1_OCTET_STRING_NDEF_it:
  764|  25.8k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  25.8k|        { \
  |  |   96|  25.8k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  25.8k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  25.8k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  25.8k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  25.8k|                }; \
  |  |  103|  25.8k|        return &local_it; \
  |  |  104|  25.8k|        }
  ------------------
X509_ALGOR_it:
  166|   843k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   843k|        { \
  |  |   96|   843k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   843k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   843k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   843k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   843k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   843k|                tname##_seq_tt,\
  170|   843k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   843k|                NULL,\
  172|   843k|                sizeof(stname),\
  173|   843k|                #tname \
  174|   843k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   843k|                }; \
  |  |  103|   843k|        return &local_it; \
  |  |  104|   843k|        }
  ------------------
X509_ALGOR_new:
  812|  76.8k|        { \
  813|  76.8k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  76.8k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  76.8k|        } \
X509_ALGOR_free:
  816|  76.7k|        { \
  817|  76.7k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  76.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  76.7k|        }
X509_VAL_it:
  166|   120k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   120k|        { \
  |  |   96|   120k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   120k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   120k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   120k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   120k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   120k|                tname##_seq_tt,\
  170|   120k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   120k|                NULL,\
  172|   120k|                sizeof(stname),\
  173|   120k|                #tname \
  174|   120k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   120k|                }; \
  |  |  103|   120k|        return &local_it; \
  |  |  104|   120k|        }
  ------------------
CMS_IssuerAndSerialNumber_it:
  166|  12.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.9k|        { \
  |  |   96|  12.9k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.9k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.9k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.9k|                tname##_seq_tt,\
  170|  12.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.9k|                NULL,\
  172|  12.9k|                sizeof(stname),\
  173|  12.9k|                #tname \
  174|  12.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.9k|                }; \
  |  |  103|  12.9k|        return &local_it; \
  |  |  104|  12.9k|        }
  ------------------
CMS_CertificateChoices_it:
  320|   296k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   296k|        { \
  |  |   96|   296k|                static const ASN1_ITEM local_it = {
  ------------------
  321|   296k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|   296k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|   296k|                offsetof(stname,selname) ,\
  323|   296k|                tname##_ch_tt,\
  324|   296k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|   296k|                NULL,\
  326|   296k|                sizeof(stname),\
  327|   296k|                #stname \
  328|   296k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   296k|                }; \
  |  |  103|   296k|        return &local_it; \
  |  |  104|   296k|        }
  ------------------
CMS_SignerInfo_it:
  247|  11.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.8k|        { \
  |  |   96|  11.8k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  11.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  11.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  11.8k|                tname##_seq_tt,\
  251|  11.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  11.8k|                &tname##_aux,\
  253|  11.8k|                sizeof(stname),\
  254|  11.8k|                #tname \
  255|  11.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.8k|                }; \
  |  |  103|  11.8k|        return &local_it; \
  |  |  104|  11.8k|        }
  ------------------
CMS_RevocationInfoChoice_it:
  320|  45.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  45.7k|        { \
  |  |   96|  45.7k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  45.7k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  45.7k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  45.7k|                offsetof(stname,selname) ,\
  323|  45.7k|                tname##_ch_tt,\
  324|  45.7k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  45.7k|                NULL,\
  326|  45.7k|                sizeof(stname),\
  327|  45.7k|                #stname \
  328|  45.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  45.7k|                }; \
  |  |  103|  45.7k|        return &local_it; \
  |  |  104|  45.7k|        }
  ------------------
CMS_SignedData_it:
  218|  2.97k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  2.97k|        { \
  |  |   96|  2.97k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  2.97k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  2.97k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  2.97k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  2.97k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  2.97k|                tname##_seq_tt,\
  222|  2.97k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  2.97k|                NULL,\
  224|  2.97k|                sizeof(tname),\
  225|  2.97k|                #tname \
  226|  2.97k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.97k|                }; \
  |  |  103|  2.97k|        return &local_it; \
  |  |  104|  2.97k|        }
  ------------------
CMS_EncryptedContentInfo_it:
  270|  5.67k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  5.67k|        { \
  |  |   96|  5.67k|                static const ASN1_ITEM local_it = {
  ------------------
  271|  5.67k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  5.67k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  272|  5.67k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  5.67k|# define V_ASN1_SEQUENCE                 16
  ------------------
  273|  5.67k|                tname##_seq_tt,\
  274|  5.67k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  275|  5.67k|                &tname##_aux,\
  276|  5.67k|                sizeof(stname),\
  277|  5.67k|                #stname \
  278|  5.67k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  5.67k|                }; \
  |  |  103|  5.67k|        return &local_it; \
  |  |  104|  5.67k|        }
  ------------------
CMS_KeyTransRecipientInfo_it:
  166|  17.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  17.6k|        { \
  |  |   96|  17.6k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  17.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  17.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  17.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  17.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  17.6k|                tname##_seq_tt,\
  170|  17.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  17.6k|                NULL,\
  172|  17.6k|                sizeof(stname),\
  173|  17.6k|                #tname \
  174|  17.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  17.6k|                }; \
  |  |  103|  17.6k|        return &local_it; \
  |  |  104|  17.6k|        }
  ------------------
CMS_OtherKeyAttribute_it:
  166|  14.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  14.2k|        { \
  |  |   96|  14.2k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  14.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  14.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  14.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  14.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  14.2k|                tname##_seq_tt,\
  170|  14.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  14.2k|                NULL,\
  172|  14.2k|                sizeof(stname),\
  173|  14.2k|                #tname \
  174|  14.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  14.2k|                }; \
  |  |  103|  14.2k|        return &local_it; \
  |  |  104|  14.2k|        }
  ------------------
CMS_RecipientKeyIdentifier_it:
  166|  7.70k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  7.70k|        { \
  |  |   96|  7.70k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  7.70k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  7.70k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  7.70k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  7.70k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  7.70k|                tname##_seq_tt,\
  170|  7.70k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  7.70k|                NULL,\
  172|  7.70k|                sizeof(stname),\
  173|  7.70k|                #tname \
  174|  7.70k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  7.70k|                }; \
  |  |  103|  7.70k|        return &local_it; \
  |  |  104|  7.70k|        }
  ------------------
CMS_RecipientEncryptedKey_it:
  247|  10.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  10.0k|        { \
  |  |   96|  10.0k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  10.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  10.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  10.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  10.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  10.0k|                tname##_seq_tt,\
  251|  10.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  10.0k|                &tname##_aux,\
  253|  10.0k|                sizeof(stname),\
  254|  10.0k|                #tname \
  255|  10.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  10.0k|                }; \
  |  |  103|  10.0k|        return &local_it; \
  |  |  104|  10.0k|        }
  ------------------
CMS_OriginatorPublicKey_it:
  166|     10|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     10|        { \
  |  |   96|     10|                static const ASN1_ITEM local_it = {
  ------------------
  167|     10|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     10|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     10|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     10|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     10|                tname##_seq_tt,\
  170|     10|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     10|                NULL,\
  172|     10|                sizeof(stname),\
  173|     10|                #tname \
  174|     10|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     10|                }; \
  |  |  103|     10|        return &local_it; \
  |  |  104|     10|        }
  ------------------
CMS_KeyAgreeRecipientInfo_it:
  247|  18.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  18.7k|        { \
  |  |   96|  18.7k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  18.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  18.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  18.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  18.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  18.7k|                tname##_seq_tt,\
  251|  18.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  18.7k|                &tname##_aux,\
  253|  18.7k|                sizeof(stname),\
  254|  18.7k|                #tname \
  255|  18.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  18.7k|                }; \
  |  |  103|  18.7k|        return &local_it; \
  |  |  104|  18.7k|        }
  ------------------
CMS_KEKRecipientInfo_it:
  166|  7.81k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  7.81k|        { \
  |  |   96|  7.81k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  7.81k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  7.81k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  7.81k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  7.81k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  7.81k|                tname##_seq_tt,\
  170|  7.81k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  7.81k|                NULL,\
  172|  7.81k|                sizeof(stname),\
  173|  7.81k|                #tname \
  174|  7.81k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  7.81k|                }; \
  |  |  103|  7.81k|        return &local_it; \
  |  |  104|  7.81k|        }
  ------------------
CMS_PasswordRecipientInfo_it:
  166|  14.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  14.3k|        { \
  |  |   96|  14.3k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  14.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  14.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  14.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  14.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  14.3k|                tname##_seq_tt,\
  170|  14.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  14.3k|                NULL,\
  172|  14.3k|                sizeof(stname),\
  173|  14.3k|                #tname \
  174|  14.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  14.3k|                }; \
  |  |  103|  14.3k|        return &local_it; \
  |  |  104|  14.3k|        }
  ------------------
CMS_RecipientInfo_it:
  344|  53.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  53.3k|        { \
  |  |   96|  53.3k|                static const ASN1_ITEM local_it = {
  ------------------
  345|  53.3k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  53.3k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  346|  53.3k|                offsetof(stname,selname) ,\
  347|  53.3k|                tname##_ch_tt,\
  348|  53.3k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  349|  53.3k|                &tname##_aux,\
  350|  53.3k|                sizeof(stname),\
  351|  53.3k|                #stname \
  352|  53.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  53.3k|                }; \
  |  |  103|  53.3k|        return &local_it; \
  |  |  104|  53.3k|        }
  ------------------
CMS_EnvelopedData_it:
  218|  3.43k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  3.43k|        { \
  |  |   96|  3.43k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  3.43k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  3.43k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  3.43k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  3.43k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  3.43k|                tname##_seq_tt,\
  222|  3.43k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  3.43k|                NULL,\
  224|  3.43k|                sizeof(tname),\
  225|  3.43k|                #tname \
  226|  3.43k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.43k|                }; \
  |  |  103|  3.43k|        return &local_it; \
  |  |  104|  3.43k|        }
  ------------------
CMS_DigestedData_it:
  218|    261|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    261|        { \
  |  |   96|    261|                static const ASN1_ITEM local_it = {
  ------------------
  219|    261|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|    261|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|    261|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    261|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|    261|                tname##_seq_tt,\
  222|    261|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|    261|                NULL,\
  224|    261|                sizeof(tname),\
  225|    261|                #tname \
  226|    261|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    261|                }; \
  |  |  103|    261|        return &local_it; \
  |  |  104|    261|        }
  ------------------
CMS_EncryptedData_it:
  218|  1.21k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.21k|        { \
  |  |   96|  1.21k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  1.21k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  1.21k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  1.21k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.21k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  1.21k|                tname##_seq_tt,\
  222|  1.21k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  1.21k|                NULL,\
  224|  1.21k|                sizeof(tname),\
  225|  1.21k|                #tname \
  226|  1.21k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.21k|                }; \
  |  |  103|  1.21k|        return &local_it; \
  |  |  104|  1.21k|        }
  ------------------
CMS_AuthEnvelopedData_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_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.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  10.1k|        { \
  |  |   96|  10.1k|                static const ASN1_ITEM local_it = {
  ------------------
  271|  10.1k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  10.1k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  272|  10.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  10.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  273|  10.1k|                tname##_seq_tt,\
  274|  10.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  275|  10.1k|                &tname##_aux,\
  276|  10.1k|                sizeof(stname),\
  277|  10.1k|                #stname \
  278|  10.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  10.1k|                }; \
  |  |  103|  10.1k|        return &local_it; \
  |  |  104|  10.1k|        }
  ------------------
cms_asn1.c:CMS_OtherCertificateFormat_it:
  178|  1.14k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  1.14k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  1.14k|        { \
  |  |  |  |   96|  1.14k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  1.14k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.14k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  1.14k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.14k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  1.14k|                tname##_seq_tt,\
  182|  1.14k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  1.14k|                NULL,\
  184|  1.14k|                sizeof(stname),\
  185|  1.14k|                #stname \
  186|  1.14k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.14k|                }; \
  |  |  103|  1.14k|        return &local_it; \
  |  |  104|  1.14k|        }
  ------------------
cms_asn1.c:CMS_SignerIdentifier_it:
  332|  27.4k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  27.4k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  27.4k|        { \
  |  |  |  |   96|  27.4k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  27.4k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  27.4k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  27.4k|                offsetof(stname,selname) ,\
  335|  27.4k|                tname##_ch_tt,\
  336|  27.4k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  27.4k|                NULL,\
  338|  27.4k|                sizeof(stname),\
  339|  27.4k|                #stname \
  340|  27.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  27.4k|                }; \
  |  |  103|  27.4k|        return &local_it; \
  |  |  104|  27.4k|        }
  ------------------
cms_asn1.c:CMS_OtherRevocationInfoFormat_it:
  178|    720|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    720|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    720|        { \
  |  |  |  |   96|    720|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|    720|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    720|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|    720|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    720|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|    720|                tname##_seq_tt,\
  182|    720|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|    720|                NULL,\
  184|    720|                sizeof(stname),\
  185|    720|                #stname \
  186|    720|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    720|                }; \
  |  |  103|    720|        return &local_it; \
  |  |  104|    720|        }
  ------------------
cms_asn1.c:CMS_EncapsulatedContentInfo_it:
  229|  12.8k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  12.8k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  12.8k|        { \
  |  |  |  |   96|  12.8k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  230|  12.8k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  12.8k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  231|  12.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  232|  12.8k|                tname##_seq_tt,\
  233|  12.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  234|  12.8k|                NULL,\
  235|  12.8k|                sizeof(tname),\
  236|  12.8k|                #tname \
  237|  12.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.8k|                }; \
  |  |  103|  12.8k|        return &local_it; \
  |  |  104|  12.8k|        }
  ------------------
cms_asn1.c:CMS_KeyAgreeRecipientIdentifier_it:
  332|  9.35k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  9.35k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  9.35k|        { \
  |  |  |  |   96|  9.35k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  9.35k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  9.35k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  9.35k|                offsetof(stname,selname) ,\
  335|  9.35k|                tname##_ch_tt,\
  336|  9.35k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  9.35k|                NULL,\
  338|  9.35k|                sizeof(stname),\
  339|  9.35k|                #stname \
  340|  9.35k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  9.35k|                }; \
  |  |  103|  9.35k|        return &local_it; \
  |  |  104|  9.35k|        }
  ------------------
cms_asn1.c:CMS_OriginatorIdentifierOrKey_it:
  332|  16.5k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  16.5k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  16.5k|        { \
  |  |  |  |   96|  16.5k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  16.5k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  16.5k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  16.5k|                offsetof(stname,selname) ,\
  335|  16.5k|                tname##_ch_tt,\
  336|  16.5k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  16.5k|                NULL,\
  338|  16.5k|                sizeof(stname),\
  339|  16.5k|                #stname \
  340|  16.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  16.5k|                }; \
  |  |  103|  16.5k|        return &local_it; \
  |  |  104|  16.5k|        }
  ------------------
cms_asn1.c:CMS_KEKIdentifier_it:
  178|  2.21k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  2.21k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  2.21k|        { \
  |  |  |  |   96|  2.21k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  2.21k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  2.21k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  2.21k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  2.21k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  2.21k|                tname##_seq_tt,\
  182|  2.21k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  2.21k|                NULL,\
  184|  2.21k|                sizeof(stname),\
  185|  2.21k|                #stname \
  186|  2.21k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.21k|                }; \
  |  |  103|  2.21k|        return &local_it; \
  |  |  104|  2.21k|        }
  ------------------
cms_asn1.c:CMS_OtherRecipientInfo_it:
  178|  20.2k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  20.2k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  20.2k|        { \
  |  |  |  |   96|  20.2k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  20.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  20.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  20.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  20.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  20.2k|                tname##_seq_tt,\
  182|  20.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  20.2k|                NULL,\
  184|  20.2k|                sizeof(stname),\
  185|  20.2k|                #stname \
  186|  20.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  20.2k|                }; \
  |  |  103|  20.2k|        return &local_it; \
  |  |  104|  20.2k|        }
  ------------------
cms_asn1.c:CMS_OriginatorInfo_it:
  178|  23.6k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  23.6k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  23.6k|        { \
  |  |  |  |   96|  23.6k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  23.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  23.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  23.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  23.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  23.6k|                tname##_seq_tt,\
  182|  23.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  23.6k|                NULL,\
  184|  23.6k|                sizeof(stname),\
  185|  23.6k|                #stname \
  186|  23.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  23.6k|                }; \
  |  |  103|  23.6k|        return &local_it; \
  |  |  104|  23.6k|        }
  ------------------
cms_asn1.c:CMS_ContentInfo_adb:
  463|  33.2k|        { \
  464|  33.2k|        static const ASN1_ADB internal_adb = \
  465|  33.2k|                {\
  466|  33.2k|                flags,\
  467|  33.2k|                offsetof(name, field),\
  468|  33.2k|                adb_cb,\
  469|  33.2k|                name##_adbtbl,\
  470|  33.2k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  33.2k|                def,\
  472|  33.2k|                none\
  473|  33.2k|                }; \
  474|  33.2k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  33.2k|        } \
cms_asn1.c:CMS_AuthenticatedData_it:
  229|  8.24k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  8.24k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  8.24k|        { \
  |  |  |  |   96|  8.24k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  230|  8.24k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  8.24k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  231|  8.24k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  8.24k|# define V_ASN1_SEQUENCE                 16
  ------------------
  232|  8.24k|                tname##_seq_tt,\
  233|  8.24k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  234|  8.24k|                NULL,\
  235|  8.24k|                sizeof(tname),\
  236|  8.24k|                #tname \
  237|  8.24k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  8.24k|                }; \
  |  |  103|  8.24k|        return &local_it; \
  |  |  104|  8.24k|        }
  ------------------
DHparams_it:
  247|      1|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      1|        { \
  |  |   96|      1|                static const ASN1_ITEM local_it = {
  ------------------
  248|      1|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      1|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|      1|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      1|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|      1|                tname##_seq_tt,\
  251|      1|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|      1|                &tname##_aux,\
  253|      1|                sizeof(stname),\
  254|      1|                #tname \
  255|      1|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      1|                }; \
  |  |  103|      1|        return &local_it; \
  |  |  104|      1|        }
  ------------------
d2i_DHparams:
  826|      1|        { \
  827|      1|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|      1|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|      1|        } \
d2i_int_dhx:
  826|     90|        { \
  827|     90|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     90|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|     90|        } \
dh_asn1.c:DHxparams_it:
  178|     90|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     90|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     90|        { \
  |  |  |  |   96|     90|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|     90|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     90|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|     90|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     90|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|     90|                tname##_seq_tt,\
  182|     90|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|     90|                NULL,\
  184|     90|                sizeof(stname),\
  185|     90|                #stname \
  186|     90|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     90|                }; \
  |  |  103|     90|        return &local_it; \
  |  |  104|     90|        }
  ------------------
dh_asn1.c:DHvparams_it:
  178|    273|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    273|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    273|        { \
  |  |  |  |   96|    273|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|    273|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    273|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|    273|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    273|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|    273|                tname##_seq_tt,\
  182|    273|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|    273|                NULL,\
  184|    273|                sizeof(stname),\
  185|    273|                #stname \
  186|    273|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    273|                }; \
  |  |  103|    273|        return &local_it; \
  |  |  104|    273|        }
  ------------------
d2i_DSAparams:
  826|     21|        { \
  827|     21|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     21|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|     21|        } \
d2i_DSAPublicKey:
  826|     36|        { \
  827|     36|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     36|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|     36|        } \
dsa_asn1.c:DSAparams_it:
  258|     21|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     21|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     21|        { \
  |  |  |  |   96|     21|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|     21|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     21|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|     21|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     21|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|     21|                tname##_seq_tt,\
  262|     21|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|     21|                &tname##_aux,\
  264|     21|                sizeof(stname),\
  265|     21|                #stname \
  266|     21|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     21|                }; \
  |  |  103|     21|        return &local_it; \
  |  |  104|     21|        }
  ------------------
dsa_asn1.c:DSAPublicKey_it:
  258|     36|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     36|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     36|        { \
  |  |  |  |   96|     36|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|     36|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     36|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|     36|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     36|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|     36|                tname##_seq_tt,\
  262|     36|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|     36|                &tname##_aux,\
  264|     36|                sizeof(stname),\
  265|     36|                #stname \
  266|     36|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     36|                }; \
  |  |  103|     36|        return &local_it; \
  |  |  104|     36|        }
  ------------------
ECPARAMETERS_it:
  166|  1.71k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.71k|        { \
  |  |   96|  1.71k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  1.71k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.71k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  1.71k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.71k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  1.71k|                tname##_seq_tt,\
  170|  1.71k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  1.71k|                NULL,\
  172|  1.71k|                sizeof(stname),\
  173|  1.71k|                #tname \
  174|  1.71k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.71k|                }; \
  |  |  103|  1.71k|        return &local_it; \
  |  |  104|  1.71k|        }
  ------------------
ECPKPARAMETERS_it:
  320|  1.71k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.71k|        { \
  |  |   96|  1.71k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  1.71k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  1.71k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  1.71k|                offsetof(stname,selname) ,\
  323|  1.71k|                tname##_ch_tt,\
  324|  1.71k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  1.71k|                NULL,\
  326|  1.71k|                sizeof(stname),\
  327|  1.71k|                #stname \
  328|  1.71k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.71k|                }; \
  |  |  103|  1.71k|        return &local_it; \
  |  |  104|  1.71k|        }
  ------------------
d2i_ECPKPARAMETERS:
  826|    856|        { \
  827|    856|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|    856|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|    856|        } \
ECPKPARAMETERS_free:
  816|    856|        { \
  817|    856|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|    856|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|    856|        }
ec_asn1.c:X9_62_FIELDID_it:
  178|  1.75k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  1.75k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  1.75k|        { \
  |  |  |  |   96|  1.75k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  1.75k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.75k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  1.75k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.75k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  1.75k|                tname##_seq_tt,\
  182|  1.75k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  1.75k|                NULL,\
  184|  1.75k|                sizeof(stname),\
  185|  1.75k|                #stname \
  186|  1.75k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.75k|                }; \
  |  |  103|  1.75k|        return &local_it; \
  |  |  104|  1.75k|        }
  ------------------
ec_asn1.c:X9_62_FIELDID_adb:
  463|  1.76k|        { \
  464|  1.76k|        static const ASN1_ADB internal_adb = \
  465|  1.76k|                {\
  466|  1.76k|                flags,\
  467|  1.76k|                offsetof(name, field),\
  468|  1.76k|                adb_cb,\
  469|  1.76k|                name##_adbtbl,\
  470|  1.76k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  1.76k|                def,\
  472|  1.76k|                none\
  473|  1.76k|                }; \
  474|  1.76k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  1.76k|        } \
ec_asn1.c:X9_62_CURVE_it:
  178|  1.71k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  1.71k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  1.71k|        { \
  |  |  |  |   96|  1.71k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  1.71k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.71k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  1.71k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.71k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  1.71k|                tname##_seq_tt,\
  182|  1.71k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  1.71k|                NULL,\
  184|  1.71k|                sizeof(stname),\
  185|  1.71k|                #stname \
  186|  1.71k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.71k|                }; \
  |  |  103|  1.71k|        return &local_it; \
  |  |  104|  1.71k|        }
  ------------------
RSAPublicKey_it:
  247|     20|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     20|        { \
  |  |   96|     20|                static const ASN1_ITEM local_it = {
  ------------------
  248|     20|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     20|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|     20|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     20|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|     20|                tname##_seq_tt,\
  251|     20|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|     20|                &tname##_aux,\
  253|     20|                sizeof(stname),\
  254|     20|                #tname \
  255|     20|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     20|                }; \
  |  |  103|     20|        return &local_it; \
  |  |  104|     20|        }
  ------------------
RSA_PSS_PARAMS_it:
  247|     34|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     34|        { \
  |  |   96|     34|                static const ASN1_ITEM local_it = {
  ------------------
  248|     34|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     34|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|     34|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     34|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|     34|                tname##_seq_tt,\
  251|     34|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|     34|                &tname##_aux,\
  253|     34|                sizeof(stname),\
  254|     34|                #tname \
  255|     34|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     34|                }; \
  |  |  103|     34|        return &local_it; \
  |  |  104|     34|        }
  ------------------
RSA_PSS_PARAMS_free:
  816|     26|        { \
  817|     26|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|     26|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|     26|        }
d2i_RSAPublicKey:
  826|     20|        { \
  827|     20|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     20|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|     20|        } \
AUTHORITY_KEYID_it:
  166|   123k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   123k|        { \
  |  |   96|   123k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   123k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   123k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   123k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   123k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   123k|                tname##_seq_tt,\
  170|   123k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   123k|                NULL,\
  172|   123k|                sizeof(stname),\
  173|   123k|                #tname \
  174|   123k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   123k|                }; \
  |  |  103|   123k|        return &local_it; \
  |  |  104|   123k|        }
  ------------------
AUTHORITY_KEYID_free:
  816|   120k|        { \
  817|   120k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   120k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   120k|        }
ASIdentifiers_it:
  166|  80.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  80.6k|        { \
  |  |   96|  80.6k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  80.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  80.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  80.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  80.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  80.6k|                tname##_seq_tt,\
  170|  80.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  80.6k|                NULL,\
  172|  80.6k|                sizeof(stname),\
  173|  80.6k|                #tname \
  174|  80.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  80.6k|                }; \
  |  |  103|  80.6k|        return &local_it; \
  |  |  104|  80.6k|        }
  ------------------
ASIdentifiers_free:
  816|  80.6k|        { \
  817|  80.6k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  80.6k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  80.6k|        }
DIST_POINT_NAME_it:
  344|  49.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  49.4k|        { \
  |  |   96|  49.4k|                static const ASN1_ITEM local_it = {
  ------------------
  345|  49.4k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  49.4k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  346|  49.4k|                offsetof(stname,selname) ,\
  347|  49.4k|                tname##_ch_tt,\
  348|  49.4k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  349|  49.4k|                &tname##_aux,\
  350|  49.4k|                sizeof(stname),\
  351|  49.4k|                #stname \
  352|  49.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  49.4k|                }; \
  |  |  103|  49.4k|        return &local_it; \
  |  |  104|  49.4k|        }
  ------------------
CRL_DIST_POINTS_it:
  113|  80.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  80.6k|        { \
  |  |   96|  80.6k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  80.6k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  80.6k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  80.6k|                -1,\
  116|  80.6k|                &tname##_item_tt,\
  117|  80.6k|                0,\
  118|  80.6k|                NULL,\
  119|  80.6k|                0,\
  120|  80.6k|                #tname \
  121|  80.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  80.6k|                }; \
  |  |  103|  80.6k|        return &local_it; \
  |  |  104|  80.6k|        }
  ------------------
CRL_DIST_POINTS_free:
  816|  80.6k|        { \
  817|  80.6k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  80.6k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  80.6k|        }
ISSUING_DIST_POINT_it:
  166|  54.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  54.0k|        { \
  |  |   96|  54.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  54.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  54.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  54.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  54.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  54.0k|                tname##_seq_tt,\
  170|  54.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  54.0k|                NULL,\
  172|  54.0k|                sizeof(stname),\
  173|  54.0k|                #tname \
  174|  54.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  54.0k|                }; \
  |  |  103|  54.0k|        return &local_it; \
  |  |  104|  54.0k|        }
  ------------------
ISSUING_DIST_POINT_free:
  816|  39.6k|        { \
  817|  39.6k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  39.6k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  39.6k|        }
NAME_CONSTRAINTS_it:
  166|  80.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  80.6k|        { \
  |  |   96|  80.6k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  80.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  80.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  80.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  80.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  80.6k|                tname##_seq_tt,\
  170|  80.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  80.6k|                NULL,\
  172|  80.6k|                sizeof(stname),\
  173|  80.6k|                #tname \
  174|  80.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  80.6k|                }; \
  |  |  103|  80.6k|        return &local_it; \
  |  |  104|  80.6k|        }
  ------------------
NAME_CONSTRAINTS_free:
  816|  80.6k|        { \
  817|  80.6k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  80.6k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  80.6k|        }

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

err.c:ERR_GET_LIB:
  242|  8.74k|{
  243|  8.74k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|  8.74k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  8.74k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 8.74k]
  |  |  ------------------
  ------------------
  244|      0|        return ERR_LIB_SYS;
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
  245|  8.74k|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  226|  8.74k|# define ERR_LIB_OFFSET                 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  227|  8.74k|# define ERR_LIB_MASK                   0xFF
  ------------------
  246|  8.74k|}
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|   525k|{
  257|   525k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|   525k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|   525k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 525k]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|   525k|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|   525k|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|   525k|}
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.04k|{
  243|  4.04k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|  4.04k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  4.04k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 4.04k]
  |  |  ------------------
  ------------------
  244|      0|        return ERR_LIB_SYS;
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
  245|  4.04k|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  226|  4.04k|# define ERR_LIB_OFFSET                 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  227|  4.04k|# define ERR_LIB_MASK                   0xFF
  ------------------
  246|  4.04k|}
ecp_oct.c:ERR_GET_REASON:
  256|  4.04k|{
  257|  4.04k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|  4.04k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  4.04k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 4.04k]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|  4.04k|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|  4.04k|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|  4.04k|}
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|  2.76k|{
  243|  2.76k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|  2.76k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  2.76k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 2.76k]
  |  |  ------------------
  ------------------
  244|      0|        return ERR_LIB_SYS;
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
  245|  2.76k|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  226|  2.76k|# define ERR_LIB_OFFSET                 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  227|  2.76k|# define ERR_LIB_MASK                   0xFF
  ------------------
  246|  2.76k|}
ec2_oct.c:ERR_GET_REASON:
  256|  2.76k|{
  257|  2.76k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|  2.76k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  2.76k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 2.76k]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|  2.76k|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|  2.76k|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|  2.76k|}

err.c:ossl_check_ERR_STRING_DATA_lh_type:
  196|  8.67k|    { \
  197|  8.67k|        return (OPENSSL_LHASH *)lh; \
  198|  8.67k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_hashfunc_type:
  206|      2|    { \
  207|      2|        return (OPENSSL_LH_HASHFUNC)hfn; \
  208|      2|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_compfunc_type:
  201|      2|    { \
  202|      2|        return (OPENSSL_LH_COMPFUNC)cmp; \
  203|      2|    } \
err.c:lh_ERR_STRING_DATA_hash_thunk:
  160|  8.67k|    { \
  161|  8.67k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  162|  8.67k|        return hfn_conv((const type *)data); \
  163|  8.67k|    } \
err.c:lh_ERR_STRING_DATA_comp_thunk:
  165|  5.88k|    { \
  166|  5.88k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  167|  5.88k|        return cfn_conv((const type *)da, (const type *)db); \
  168|  5.88k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  181|  8.53k|    { \
  182|  8.53k|        return ptr; \
  183|  8.53k|    } \
err.c:ossl_check_const_ERR_STRING_DATA_lh_plain_type:
  186|    136|    { \
  187|    136|        return ptr; \
  188|    136|    } \
core_namemap.c:lh_NAMENUM_ENTRY_num_items:
  284|  16.1k|    { \
  285|  16.1k|        return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
  286|  16.1k|    } \
core_namemap.c:lh_NAMENUM_ENTRY_doall_DOALL_NAMES_DATA:
  354|  16.1k|    { \
  355|  16.1k|        OPENSSL_LH_doall_arg_thunk((OPENSSL_LHASH *)lh, \
  356|  16.1k|                             lh_##type##_doall_##argtype##_thunk, \
  357|  16.1k|                             (OPENSSL_LH_DOALL_FUNCARG)fn, \
  358|  16.1k|                             (void *)arg); \
  359|  16.1k|    } \
core_namemap.c:lh_NAMENUM_ENTRY_doall_DOALL_NAMES_DATA_thunk:
  346|  6.50M|    { \
  347|  6.50M|        void (*fn_conv)(cbargtype *, argtype *) = (void (*)(cbargtype *, argtype *))fn; \
  348|  6.50M|        fn_conv((cbargtype *)node, (argtype *)arg); \
  349|  6.50M|    } \
core_namemap.c:lh_NAMENUM_ENTRY_retrieve:
  274|   227k|    { \
  275|   227k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|   227k|    } \
core_namemap.c:lh_NAMENUM_ENTRY_insert:
  264|    404|    { \
  265|    404|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|    404|    } \
core_namemap.c:lh_NAMENUM_ENTRY_error:
  279|    404|    { \
  280|    404|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|    404|    } \
core_namemap.c:lh_NAMENUM_ENTRY_new:
  317|      2|    { \
  318|      2|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      2|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      2|                                lh_##type##_doall_thunk, \
  321|      2|                                lh_##type##_doall_arg_thunk); \
  322|      2|    } \
core_namemap.c:lh_NAMENUM_ENTRY_hfn_thunk:
  243|   227k|    { \
  244|   227k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|   227k|        return hfn_conv((const type *)data); \
  246|   227k|    } \
core_namemap.c:lh_NAMENUM_ENTRY_cfn_thunk:
  248|   223k|    { \
  249|   223k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|   223k|        return cfn_conv((const type *)da, (const type *)db); \
  251|   223k|    } \
core_namemap.c:lh_NAMENUM_ENTRY_doall_thunk:
  299|    404|    { \
  300|    404|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|    404|        doall_conv((type *)node); \
  302|    404|    } \
core_namemap.c:lh_NAMENUM_ENTRY_doall:
  311|      2|    { \
  312|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      2|    } \
core_namemap.c:lh_NAMENUM_ENTRY_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
o_names.c:lh_OBJ_NAME_new:
  317|      1|    { \
  318|      1|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      1|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      1|                                lh_##type##_doall_thunk, \
  321|      1|                                lh_##type##_doall_arg_thunk); \
  322|      1|    } \
o_names.c:lh_OBJ_NAME_hfn_thunk:
  243|  1.31k|    { \
  244|  1.31k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  1.31k|        return hfn_conv((const type *)data); \
  246|  1.31k|    } \
o_names.c:lh_OBJ_NAME_cfn_thunk:
  248|    918|    { \
  249|    918|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|    918|        return cfn_conv((const type *)da, (const type *)db); \
  251|    918|    } \
o_names.c:lh_OBJ_NAME_doall_thunk:
  299|    543|    { \
  300|    543|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|    543|        doall_conv((type *)node); \
  302|    543|    } \
o_names.c:lh_OBJ_NAME_retrieve:
  274|    651|    { \
  275|    651|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    651|    } \
o_names.c:lh_OBJ_NAME_insert:
  264|    424|    { \
  265|    424|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|    424|    } \
o_names.c:lh_OBJ_NAME_error:
  279|    242|    { \
  280|    242|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|    242|    } \
o_names.c:lh_OBJ_NAME_delete:
  269|    242|    { \
  270|    242|        return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
  271|    242|    } \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL:
  354|      2|    { \
  355|      2|        OPENSSL_LH_doall_arg_thunk((OPENSSL_LHASH *)lh, \
  356|      2|                             lh_##type##_doall_##argtype##_thunk, \
  357|      2|                             (OPENSSL_LH_DOALL_FUNCARG)fn, \
  358|      2|                             (void *)arg); \
  359|      2|    } \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL_thunk:
  346|    484|    { \
  347|    484|        void (*fn_conv)(cbargtype *, argtype *) = (void (*)(cbargtype *, argtype *))fn; \
  348|    484|        fn_conv((cbargtype *)node, (argtype *)arg); \
  349|    484|    } \
o_names.c:lh_OBJ_NAME_get_down_load:
  289|      4|    { \
  290|      4|        return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
  291|      4|    } \
o_names.c:lh_OBJ_NAME_set_down_load:
  294|      7|    { \
  295|      7|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
  296|      7|    } \
o_names.c:lh_OBJ_NAME_doall:
  311|      4|    { \
  312|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      4|    } \
o_names.c:lh_OBJ_NAME_free:
  254|      1|    { \
  255|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall:
  311|      2|    { \
  312|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_new:
  317|      2|    { \
  318|      2|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      2|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      2|                                lh_##type##_doall_thunk, \
  321|      2|                                lh_##type##_doall_arg_thunk); \
  322|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_hfn_thunk:
  243|    252|    { \
  244|    252|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|    252|        return hfn_conv((const type *)data); \
  246|    252|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_cfn_thunk:
  248|    204|    { \
  249|    204|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|    204|        return cfn_conv((const type *)da, (const type *)db); \
  251|    204|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall_thunk:
  299|     16|    { \
  300|     16|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     16|        doall_conv((type *)node); \
  302|     16|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_retrieve:
  274|    236|    { \
  275|    236|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    236|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_insert:
  264|     16|    { \
  265|     16|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     16|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_error:
  279|     16|    { \
  280|     16|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     16|    } \
property.c:lh_QUERY_doall:
  311|    220|    { \
  312|    220|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|    220|    } \
property.c:lh_QUERY_free:
  254|    192|    { \
  255|    192|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|    192|    } \
property.c:lh_QUERY_new:
  317|    192|    { \
  318|    192|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|    192|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|    192|                                lh_##type##_doall_thunk, \
  321|    192|                                lh_##type##_doall_arg_thunk); \
  322|    192|    } \
property.c:lh_QUERY_hfn_thunk:
  243|  19.3k|    { \
  244|  19.3k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  19.3k|        return hfn_conv((const type *)data); \
  246|  19.3k|    } \
property.c:lh_QUERY_cfn_thunk:
  248|  19.3k|    { \
  249|  19.3k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  19.3k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  19.3k|    } \
property.c:lh_QUERY_doall_thunk:
  299|      5|    { \
  300|      5|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|      5|        doall_conv((type *)node); \
  302|      5|    } \
property.c:lh_QUERY_num_items:
  284|     28|    { \
  285|     28|        return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
  286|     28|    } \
property.c:lh_QUERY_flush:
  259|     28|    { \
  260|     28|        OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \
  261|     28|    } \
property.c:lh_QUERY_retrieve:
  274|  19.3k|    { \
  275|  19.3k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  19.3k|    } \
property.c:lh_QUERY_insert:
  264|      5|    { \
  265|      5|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|      5|    } \
property.c:lh_QUERY_error:
  279|      5|    { \
  280|      5|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|      5|    } \
property_string.c:lh_PROPERTY_STRING_doall:
  311|      4|    { \
  312|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      4|    } \
property_string.c:lh_PROPERTY_STRING_free:
  254|      4|    { \
  255|      4|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      4|    } \
property_string.c:lh_PROPERTY_STRING_new:
  317|      4|    { \
  318|      4|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      4|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      4|                                lh_##type##_doall_thunk, \
  321|      4|                                lh_##type##_doall_arg_thunk); \
  322|      4|    } \
property_string.c:lh_PROPERTY_STRING_hfn_thunk:
  243|    667|    { \
  244|    667|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|    667|        return hfn_conv((const type *)data); \
  246|    667|    } \
property_string.c:lh_PROPERTY_STRING_cfn_thunk:
  248|    577|    { \
  249|    577|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|    577|        return cfn_conv((const type *)da, (const type *)db); \
  251|    577|    } \
property_string.c:lh_PROPERTY_STRING_doall_thunk:
  299|     30|    { \
  300|     30|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     30|        doall_conv((type *)node); \
  302|     30|    } \
property_string.c:lh_PROPERTY_STRING_retrieve:
  274|    637|    { \
  275|    637|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    637|    } \
property_string.c:lh_PROPERTY_STRING_insert:
  264|     30|    { \
  265|     30|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     30|    } \
property_string.c:lh_PROPERTY_STRING_error:
  279|     30|    { \
  280|     30|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     30|    } \
store_register.c:lh_OSSL_STORE_LOADER_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_new:
  317|      2|    { \
  318|      2|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      2|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      2|                                lh_##type##_doall_thunk, \
  321|      2|                                lh_##type##_doall_arg_thunk); \
  322|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_hfn_thunk:
  243|  41.4k|    { \
  244|  41.4k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  41.4k|        return hfn_conv((const type *)data); \
  246|  41.4k|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_cfn_thunk:
  248|  39.2k|    { \
  249|  39.2k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  39.2k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  39.2k|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall_thunk:
  299|    731|    { \
  300|    731|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|    731|        doall_conv((type *)node); \
  302|    731|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall:
  311|      2|    { \
  312|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_retrieve:
  274|  40.7k|    { \
  275|  40.7k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  40.7k|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_insert:
  264|    731|    { \
  265|    731|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|    731|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_error:
  279|    731|    { \
  280|    731|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|    731|    } \

obj_dat.c:OBJ_bsearch_ln:
  129|     16|      { \
  130|     16|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|     16|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|     16|      } \
obj_dat.c:ln_cmp_BSEARCH_CMP_FN:
  123|    170|      { \
  124|    170|      type1 const *a = a_; \
  125|    170|      type2 const *b = b_; \
  126|    170|      return nm##_cmp(a,b); \
  127|    170|      } \
obj_dat.c:OBJ_bsearch_sn:
  129|     18|      { \
  130|     18|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|     18|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|     18|      } \
obj_dat.c:sn_cmp_BSEARCH_CMP_FN:
  123|    184|      { \
  124|    184|      type1 const *a = a_; \
  125|    184|      type2 const *b = b_; \
  126|    184|      return nm##_cmp(a,b); \
  127|    184|      } \
obj_dat.c:OBJ_bsearch_obj:
  129|   888k|      { \
  130|   888k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|   888k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|   888k|      } \
obj_dat.c:obj_cmp_BSEARCH_CMP_FN:
  123|  8.47M|      { \
  124|  8.47M|      type1 const *a = a_; \
  125|  8.47M|      type2 const *b = b_; \
  126|  8.47M|      return nm##_cmp(a,b); \
  127|  8.47M|      } \
ameth_lib.c:OBJ_bsearch_ameth:
  129|  68.4k|      { \
  130|  68.4k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  68.4k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  68.4k|      } \
ameth_lib.c:ameth_cmp_BSEARCH_CMP_FN:
  123|  74.5k|      { \
  124|  74.5k|      type1 const *a = a_; \
  125|  74.5k|      type2 const *b = b_; \
  126|  74.5k|      return nm##_cmp(a,b); \
  127|  74.5k|      } \
v3_lib.c:OBJ_bsearch_ext:
  129|  45.0k|      { \
  130|  45.0k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  45.0k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  45.0k|      } \
v3_lib.c:ext_cmp_BSEARCH_CMP_FN:
  123|   202k|      { \
  124|   202k|      type1 const *a = a_; \
  125|   202k|      type2 const *b = b_; \
  126|   202k|      return nm##_cmp(a,b); \
  127|   202k|      } \

cms_lib.c:sk_CMS_CertificateChoices_num:
   70|  28.6k|    { \
   71|  28.6k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  28.6k|    } \
cms_lib.c:sk_CMS_CertificateChoices_value:
   74|  28.3k|    { \
   75|  28.3k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  28.3k|    } \
cms_sd.c:ossl_check_const_CMS_SignerInfo_sk_type:
   44|  3.61k|    { \
   45|  3.61k|        return (const OPENSSL_STACK *)sk; \
   46|  3.61k|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_sk_type:
   48|  52.4k|    { \
   49|  52.4k|        return (OPENSSL_STACK *)sk; \
   50|  52.4k|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_freefunc_type:
   60|  52.4k|    { \
   61|  52.4k|        return (OPENSSL_sk_freefunc)fr; \
   62|  52.4k|    }
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|   652k|    { \
   71|   652k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|   652k|    } \
ex_data.c:ossl_check_void_sk_type:
   48|   326k|    { \
   49|   326k|        return (OPENSSL_STACK *)sk; \
   50|   326k|    } \
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|  4.43k|    { \
   75|  4.43k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  4.43k|    } \
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.47k|    { \
  160|  1.47k|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  161|  1.47k|    } \
provider_core.c:sk_OSSL_PROVIDER_num:
   70|  1.47k|    { \
   71|  1.47k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  1.47k|    } \
provider_core.c:sk_OSSL_PROVIDER_free:
   94|  1.47k|    { \
   95|  1.47k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|  1.47k|    } \
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|  98.7k|    { \
   71|  98.7k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  98.7k|    } \
property.c:sk_IMPLEMENTATION_value:
   74|   119k|    { \
   75|   119k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|   119k|    } \
property.c:sk_IMPLEMENTATION_push:
  111|    220|    { \
  112|    220|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|    220|    } \
property.c:sk_ALGORITHM_new_reserve:
   86|  1.47k|    { \
   87|  1.47k|        return (STACK_OF(t1) *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); \
   88|  1.47k|    } \
property.c:sk_ALGORITHM_push:
  111|  98.2k|    { \
  112|  98.2k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|  98.2k|    } \
property.c:sk_ALGORITHM_num:
   70|  1.47k|    { \
   71|  1.47k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  1.47k|    } \
property.c:sk_ALGORITHM_value:
   74|  98.2k|    { \
   75|  98.2k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  98.2k|    } \
property.c:sk_ALGORITHM_free:
   94|  1.47k|    { \
   95|  1.47k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|  1.47k|    } \
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|    214|    { \
  112|    214|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|    214|    } \
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|    214|    { \
   75|    214|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|    214|    } \
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|    127|    { \
   45|    127|        return (const OPENSSL_STACK *)sk; \
   46|    127|    } \
rsa_backend.c:sk_BIGNUM_const_new_null:
   82|     42|    { \
   83|     42|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|     42|    } \
rsa_backend.c:sk_BIGNUM_const_free:
   94|     42|    { \
   95|     42|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|     42|    } \
rsa_lib.c:sk_RSA_PRIME_INFO_pop_free:
  127|     18|    { \
  128|     18|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|     18|    } \
rsa_ossl.c:sk_RSA_PRIME_INFO_num:
   70|     18|    { \
   71|     18|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|     18|    } \
x509name.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   44|    708|    { \
   45|    708|        return (const OPENSSL_STACK *)sk; \
   46|    708|    } \
x509name.c:ossl_check_X509_NAME_ENTRY_sk_type:
   48|    456|    { \
   49|    456|        return (OPENSSL_STACK *)sk; \
   50|    456|    } \
x509name.c:ossl_check_X509_NAME_ENTRY_type:
   40|    456|    { \
   41|    456|        return ptr; \
   42|    456|    } \
x_crl.c:ossl_check_GENERAL_NAMES_sk_type:
   48|  43.2k|    { \
   49|  43.2k|        return (OPENSSL_STACK *)sk; \
   50|  43.2k|    } \
x_crl.c:ossl_check_GENERAL_NAMES_freefunc_type:
   60|  39.6k|    { \
   61|  39.6k|        return (OPENSSL_sk_freefunc)fr; \
   62|  39.6k|    }
x_crl.c:ossl_check_const_X509_EXTENSION_sk_type:
   44|   165k|    { \
   45|   165k|        return (const OPENSSL_STACK *)sk; \
   46|   165k|    } \
x_crl.c:ossl_check_const_X509_REVOKED_sk_type:
   44|  82.5k|    { \
   45|  82.5k|        return (const OPENSSL_STACK *)sk; \
   46|  82.5k|    } \
x_crl.c:ossl_check_GENERAL_NAMES_type:
   40|  3.51k|    { \
   41|  3.51k|        return ptr; \
   42|  3.51k|    } \
x_crl.c:ossl_check_X509_REVOKED_compfunc_type:
   52|  3.10k|    { \
   53|  3.10k|        return (OPENSSL_sk_compfunc)cmp; \
   54|  3.10k|    } \
x_crl.c:ossl_check_X509_REVOKED_sk_type:
   48|  3.10k|    { \
   49|  3.10k|        return (OPENSSL_STACK *)sk; \
   50|  3.10k|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_sk_type:
   48|  5.13M|    { \
   49|  5.13M|        return (OPENSSL_STACK *)sk; \
   50|  5.13M|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_freefunc_type:
   60|   480k|    { \
   61|   480k|        return (OPENSSL_sk_freefunc)fr; \
   62|   480k|    }
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_num:
   70|  3.18M|    { \
   71|  3.18M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  3.18M|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_value:
   74|  3.07M|    { \
   75|  3.07M|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  3.07M|    } \
x_name.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   44|  5.38M|    { \
   45|  5.38M|        return (const OPENSSL_STACK *)sk; \
   46|  5.38M|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_type:
   40|  1.49M|    { \
   41|  1.49M|        return ptr; \
   42|  1.49M|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_new_null:
   82|  5.83k|    { \
   83|  5.83k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|  5.83k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_push:
  111|   358k|    { \
  112|   358k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|   358k|    } \
x_name.c:ossl_check_const_ASN1_VALUE_sk_type:
   44|  1.10M|    { \
   45|  1.10M|        return (const OPENSSL_STACK *)sk; \
   46|  1.10M|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_pop_free:
  127|   108k|    { \
  128|   108k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|   108k|    } \
x_x509.c:ossl_check_IPAddressFamily_sk_type:
   48|  80.6k|    { \
   49|  80.6k|        return (OPENSSL_STACK *)sk; \
   50|  80.6k|    } \
x_x509.c:ossl_check_IPAddressFamily_freefunc_type:
   60|  80.6k|    { \
   61|  80.6k|        return (OPENSSL_sk_freefunc)fr; \
   62|  80.6k|    }
tasn_dec.c:ossl_check_const_ASN1_VALUE_sk_type:
   44|  5.77k|    { \
   45|  5.77k|        return (const OPENSSL_STACK *)sk; \
   46|  5.77k|    } \
tasn_dec.c:ossl_check_ASN1_VALUE_sk_type:
   48|  4.05M|    { \
   49|  4.05M|        return (OPENSSL_STACK *)sk; \
   50|  4.05M|    } \
tasn_dec.c:ossl_check_ASN1_VALUE_type:
   40|  4.05M|    { \
   41|  4.05M|        return ptr; \
   42|  4.05M|    } \
tasn_enc.c:sk_const_ASN1_VALUE_num:
   70|  7.49M|    { \
   71|  7.49M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  7.49M|    } \
tasn_enc.c:sk_const_ASN1_VALUE_value:
   74|  5.22M|    { \
   75|  5.22M|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  5.22M|    } \
tasn_fre.c:ossl_check_const_ASN1_VALUE_sk_type:
   44|  1.62M|    { \
   45|  1.62M|        return (const OPENSSL_STACK *)sk; \
   46|  1.62M|    } \
tasn_fre.c:ossl_check_ASN1_VALUE_sk_type:
   48|   444k|    { \
   49|   444k|        return (OPENSSL_STACK *)sk; \
   50|   444k|    } \
cms_env.c:ossl_check_const_CMS_RecipientInfo_sk_type:
   44|  7.94k|    { \
   45|  7.94k|        return (const OPENSSL_STACK *)sk; \
   46|  7.94k|    } \
conf_mod.c:sk_CONF_IMODULE_free:
   94|      4|    { \
   95|      4|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      4|    } \
conf_mod.c:sk_CONF_MODULE_dup:
  159|      2|    { \
  160|      2|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  161|      2|    } \
conf_mod.c:sk_CONF_MODULE_new_null:
   82|      2|    { \
   83|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|      2|    } \
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|      6|    { \
   95|      6|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      6|    } \
conf_mod.c:sk_CONF_MODULE_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
conf_mod.c:sk_CONF_IMODULE_num:
   70|      2|    { \
   71|      2|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      2|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_new_null:
   82|     12|    { \
   83|     12|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|     12|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_push:
  111|     61|    { \
  112|     61|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|     61|    } \
decoder_lib.c:sk_OSSL_DECODER_new_null:
   82|     12|    { \
   83|     12|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|     12|    } \
decoder_lib.c:sk_OSSL_DECODER_push:
  111|    480|    { \
  112|    480|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|    480|    } \
decoder_lib.c:sk_OSSL_DECODER_num:
   70|     12|    { \
   71|     12|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|     12|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_num:
   70|  73.0k|    { \
   71|  73.0k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  73.0k|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_value:
   74|   238k|    { \
   75|   238k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|   238k|    } \
decoder_lib.c:sk_OSSL_DECODER_value:
   74|  4.88k|    { \
   75|  4.88k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  4.88k|    } \
decoder_lib.c:sk_OSSL_DECODER_pop_free:
  127|     12|    { \
  128|     12|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|     12|    } \
decoder_meth.c:sk_OSSL_DECODER_INSTANCE_pop_free:
  127|  40.7k|    { \
  128|  40.7k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|  40.7k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_new_null:
   82|    731|    { \
   83|    731|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|    731|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_push:
  111|     13|    { \
  112|     13|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|     13|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_num:
   70|  30.5k|    { \
   71|  30.5k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  30.5k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_value:
   74|  16.2k|    { \
   75|  16.2k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  16.2k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_pop_free:
  127|  37.2k|    { \
  128|  37.2k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|  37.2k|    } \
decoder_pkey.c:sk_OSSL_DECODER_INSTANCE_deep_copy:
  165|  36.5k|    { \
  166|  36.5k|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  167|  36.5k|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  168|  36.5k|                                            (OPENSSL_sk_freefunc)freefunc); \
  169|  36.5k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_deep_copy:
  165|  36.5k|    { \
  166|  36.5k|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  167|  36.5k|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  168|  36.5k|                                            (OPENSSL_sk_freefunc)freefunc); \
  169|  36.5k|    } \
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|  52.4k|    { \
  128|  52.4k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|  52.4k|    } \
comp_methods.c:ossl_check_SSL_COMP_compfunc_type:
   52|      2|    { \
   53|      2|        return (OPENSSL_sk_compfunc)cmp; \
   54|      2|    } \
comp_methods.c:ossl_check_SSL_COMP_sk_type:
   48|      2|    { \
   49|      2|        return (OPENSSL_STACK *)sk; \
   50|      2|    } \
comp_methods.c:ossl_check_SSL_COMP_freefunc_type:
   60|      2|    { \
   61|      2|        return (OPENSSL_sk_freefunc)fr; \
   62|      2|    }
v3_crld.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   44|  1.35k|    { \
   45|  1.35k|        return (const OPENSSL_STACK *)sk; \
   46|  1.35k|    } \
v3_lib.c:ossl_check_const_X509_EXTENSION_sk_type:
   44|   482k|    { \
   45|   482k|        return (const OPENSSL_STACK *)sk; \
   46|   482k|    } \

ossl_prov_bio_from_dispatch:
   27|      1|{
   28|     53|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (28:12): [True: 52, False: 1]
  ------------------
   29|     52|        switch (fns->function_id) {
  ------------------
  |  Branch (29:17): [True: 42, False: 10]
  ------------------
   30|      1|        case OSSL_FUNC_BIO_NEW_FILE:
  ------------------
  |  |  149|      1|#define OSSL_FUNC_BIO_NEW_FILE                40
  ------------------
  |  Branch (30:9): [True: 1, False: 51]
  ------------------
   31|      1|            if (c_bio_new_file == NULL)
  ------------------
  |  Branch (31:17): [True: 1, False: 0]
  ------------------
   32|      1|                c_bio_new_file = OSSL_FUNC_BIO_new_file(fns);
   33|      1|            break;
   34|      1|        case OSSL_FUNC_BIO_NEW_MEMBUF:
  ------------------
  |  |  150|      1|#define OSSL_FUNC_BIO_NEW_MEMBUF              41
  ------------------
  |  Branch (34:9): [True: 1, False: 51]
  ------------------
   35|      1|            if (c_bio_new_membuf == NULL)
  ------------------
  |  Branch (35:17): [True: 1, False: 0]
  ------------------
   36|      1|                c_bio_new_membuf = OSSL_FUNC_BIO_new_membuf(fns);
   37|      1|            break;
   38|      1|        case OSSL_FUNC_BIO_READ_EX:
  ------------------
  |  |  151|      1|#define OSSL_FUNC_BIO_READ_EX                 42
  ------------------
  |  Branch (38:9): [True: 1, False: 51]
  ------------------
   39|      1|            if (c_bio_read_ex == NULL)
  ------------------
  |  Branch (39:17): [True: 1, False: 0]
  ------------------
   40|      1|                c_bio_read_ex = OSSL_FUNC_BIO_read_ex(fns);
   41|      1|            break;
   42|      1|        case OSSL_FUNC_BIO_WRITE_EX:
  ------------------
  |  |  152|      1|#define OSSL_FUNC_BIO_WRITE_EX                43
  ------------------
  |  Branch (42:9): [True: 1, False: 51]
  ------------------
   43|      1|            if (c_bio_write_ex == NULL)
  ------------------
  |  Branch (43:17): [True: 1, False: 0]
  ------------------
   44|      1|                c_bio_write_ex = OSSL_FUNC_BIO_write_ex(fns);
   45|      1|            break;
   46|      1|        case OSSL_FUNC_BIO_GETS:
  ------------------
  |  |  158|      1|#define OSSL_FUNC_BIO_GETS                    49
  ------------------
  |  Branch (46:9): [True: 1, False: 51]
  ------------------
   47|      1|            if (c_bio_gets == NULL)
  ------------------
  |  Branch (47:17): [True: 1, False: 0]
  ------------------
   48|      1|                c_bio_gets = OSSL_FUNC_BIO_gets(fns);
   49|      1|            break;
   50|      1|        case OSSL_FUNC_BIO_PUTS:
  ------------------
  |  |  157|      1|#define OSSL_FUNC_BIO_PUTS                    48
  ------------------
  |  Branch (50:9): [True: 1, False: 51]
  ------------------
   51|      1|            if (c_bio_puts == NULL)
  ------------------
  |  Branch (51:17): [True: 1, False: 0]
  ------------------
   52|      1|                c_bio_puts = OSSL_FUNC_BIO_puts(fns);
   53|      1|            break;
   54|      1|        case OSSL_FUNC_BIO_CTRL:
  ------------------
  |  |  159|      1|#define OSSL_FUNC_BIO_CTRL                    50
  ------------------
  |  Branch (54:9): [True: 1, False: 51]
  ------------------
   55|      1|            if (c_bio_ctrl == NULL)
  ------------------
  |  Branch (55:17): [True: 1, False: 0]
  ------------------
   56|      1|                c_bio_ctrl = OSSL_FUNC_BIO_ctrl(fns);
   57|      1|            break;
   58|      1|        case OSSL_FUNC_BIO_UP_REF:
  ------------------
  |  |  153|      1|#define OSSL_FUNC_BIO_UP_REF                  44
  ------------------
  |  Branch (58:9): [True: 1, False: 51]
  ------------------
   59|      1|            if (c_bio_up_ref == NULL)
  ------------------
  |  Branch (59:17): [True: 1, False: 0]
  ------------------
   60|      1|                c_bio_up_ref = OSSL_FUNC_BIO_up_ref(fns);
   61|      1|            break;
   62|      1|        case OSSL_FUNC_BIO_FREE:
  ------------------
  |  |  154|      1|#define OSSL_FUNC_BIO_FREE                    45
  ------------------
  |  Branch (62:9): [True: 1, False: 51]
  ------------------
   63|      1|            if (c_bio_free == NULL)
  ------------------
  |  Branch (63:17): [True: 1, False: 0]
  ------------------
   64|      1|                c_bio_free = OSSL_FUNC_BIO_free(fns);
   65|      1|            break;
   66|      1|        case OSSL_FUNC_BIO_VPRINTF:
  ------------------
  |  |  155|      1|#define OSSL_FUNC_BIO_VPRINTF                 46
  ------------------
  |  Branch (66:9): [True: 1, False: 51]
  ------------------
   67|      1|            if (c_bio_vprintf == NULL)
  ------------------
  |  Branch (67:17): [True: 1, False: 0]
  ------------------
   68|      1|                c_bio_vprintf = OSSL_FUNC_BIO_vprintf(fns);
   69|      1|            break;
   70|     52|        }
   71|     52|    }
   72|       |
   73|      1|    return 1;
   74|      1|}
ossl_prov_bio_read_ex:
   92|  1.11M|{
   93|  1.11M|    if (c_bio_read_ex == NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 1.11M]
  ------------------
   94|      0|        return 0;
   95|  1.11M|    return c_bio_read_ex(bio, data, data_len, bytes_read);
   96|  1.11M|}
ossl_prov_bio_up_ref:
  128|  73.0k|{
  129|  73.0k|    if (c_bio_up_ref == NULL)
  ------------------
  |  Branch (129:9): [True: 0, False: 73.0k]
  ------------------
  130|      0|        return 0;
  131|  73.0k|    return c_bio_up_ref(bio);
  132|  73.0k|}
ossl_prov_bio_free:
  135|  73.0k|{
  136|  73.0k|    if (c_bio_free == NULL)
  ------------------
  |  Branch (136:9): [True: 0, False: 73.0k]
  ------------------
  137|      0|        return 0;
  138|  73.0k|    return c_bio_free(bio);
  139|  73.0k|}
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|  73.0k|{
  228|  73.0k|    BIO *outbio;
  229|  73.0k|    BIO_METHOD *corebiometh = ossl_prov_ctx_get0_core_bio_method(provctx);
  230|       |
  231|  73.0k|    if (corebiometh == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 73.0k]
  ------------------
  232|      0|        return NULL;
  233|       |
  234|  73.0k|    if ((outbio = BIO_new(corebiometh)) == NULL)
  ------------------
  |  Branch (234:9): [True: 0, False: 73.0k]
  ------------------
  235|      0|        return NULL;
  236|  73.0k|    if (!ossl_prov_bio_up_ref(corebio)) {
  ------------------
  |  Branch (236:9): [True: 0, False: 73.0k]
  ------------------
  237|      0|        BIO_free(outbio);
  238|      0|        return NULL;
  239|      0|    }
  240|  73.0k|    BIO_set_data(outbio, corebio);
  241|  73.0k|    return outbio;
  242|  73.0k|}
bio_prov.c:bio_core_read_ex:
  166|  1.11M|{
  167|  1.11M|    return ossl_prov_bio_read_ex(BIO_get_data(bio), data, data_len, bytes_read);
  168|  1.11M|}
bio_prov.c:bio_core_new:
  192|  73.0k|{
  193|  73.0k|    BIO_set_init(bio, 1);
  194|       |
  195|  73.0k|    return 1;
  196|  73.0k|}
bio_prov.c:bio_core_free:
  199|  73.0k|{
  200|  73.0k|    BIO_set_init(bio, 0);
  201|  73.0k|    ossl_prov_bio_free(BIO_get_data(bio));
  202|       |
  203|  73.0k|    return 1;
  204|  73.0k|}

ossl_prov_ctx_new:
   15|      1|{
   16|      1|    return OPENSSL_zalloc(sizeof(PROV_CTX));
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   17|      1|}
ossl_prov_ctx_free:
   20|      1|{
   21|      1|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|  52.4k|{
   44|  52.4k|    if (ctx == NULL)
  ------------------
  |  Branch (44:9): [True: 0, False: 52.4k]
  ------------------
   45|      0|        return NULL;
   46|  52.4k|    return ctx->libctx;
   47|  52.4k|}
ossl_prov_ctx_get0_core_bio_method:
   57|  73.0k|{
   58|  73.0k|    if (ctx == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 73.0k]
  ------------------
   59|      0|        return NULL;
   60|  73.0k|    return ctx->corebiometh;
   61|  73.0k|}

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

ossl_prov_cache_exported_algorithms:
  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|     53|    for (; in->function_id != 0; in++) {
  ------------------
  |  Branch (585:12): [True: 52, False: 1]
  ------------------
  586|     52|        switch (in->function_id) {
  587|      1|        case OSSL_FUNC_CORE_GETTABLE_PARAMS:
  ------------------
  |  |   64|      1|# define OSSL_FUNC_CORE_GETTABLE_PARAMS        1
  ------------------
  |  Branch (587:9): [True: 1, False: 51]
  ------------------
  588|      1|            c_gettable_params = OSSL_FUNC_core_gettable_params(in);
  589|      1|            break;
  590|      1|        case OSSL_FUNC_CORE_GET_PARAMS:
  ------------------
  |  |   67|      1|# define OSSL_FUNC_CORE_GET_PARAMS             2
  ------------------
  |  Branch (590:9): [True: 1, False: 51]
  ------------------
  591|      1|            c_get_params = OSSL_FUNC_core_get_params(in);
  592|      1|            break;
  593|      1|        case OSSL_FUNC_CORE_GET_LIBCTX:
  ------------------
  |  |   74|      1|# define OSSL_FUNC_CORE_GET_LIBCTX             4
  ------------------
  |  Branch (593:9): [True: 1, False: 51]
  ------------------
  594|      1|            c_get_libctx = OSSL_FUNC_core_get_libctx(in);
  595|      1|            break;
  596|     49|        default:
  ------------------
  |  Branch (596:9): [True: 49, False: 3]
  ------------------
  597|       |            /* Just ignore anything we don't understand */
  598|     49|            break;
  599|     52|        }
  600|     52|    }
  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.47k|{
  522|  1.47k|    *no_cache = 0;
  523|  1.47k|    switch (operation_id) {
  ------------------
  |  Branch (523:13): [True: 0, False: 1.47k]
  ------------------
  524|      1|    case OSSL_OP_DIGEST:
  ------------------
  |  |  275|      1|# define OSSL_OP_DIGEST                              1
  ------------------
  |  Branch (524:5): [True: 1, False: 1.47k]
  ------------------
  525|      1|        return deflt_digests;
  526|      2|    case OSSL_OP_CIPHER:
  ------------------
  |  |  276|      2|# define OSSL_OP_CIPHER                              2   /* Symmetric Ciphers */
  ------------------
  |  Branch (526:5): [True: 2, False: 1.47k]
  ------------------
  527|      2|        return exported_ciphers;
  528|      0|    case OSSL_OP_MAC:
  ------------------
  |  |  277|      0|# define OSSL_OP_MAC                                 3
  ------------------
  |  Branch (528:5): [True: 0, False: 1.47k]
  ------------------
  529|      0|        return deflt_macs;
  530|      0|    case OSSL_OP_KDF:
  ------------------
  |  |  278|      0|# define OSSL_OP_KDF                                 4
  ------------------
  |  Branch (530:5): [True: 0, False: 1.47k]
  ------------------
  531|      0|        return deflt_kdfs;
  532|      2|    case OSSL_OP_RAND:
  ------------------
  |  |  279|      2|# define OSSL_OP_RAND                                5
  ------------------
  |  Branch (532:5): [True: 2, False: 1.47k]
  ------------------
  533|      2|        return deflt_rands;
  534|    731|    case OSSL_OP_KEYMGMT:
  ------------------
  |  |  280|    731|# define OSSL_OP_KEYMGMT                            10
  ------------------
  |  Branch (534:5): [True: 731, False: 748]
  ------------------
  535|    731|        return deflt_keymgmt;
  536|      0|    case OSSL_OP_KEYEXCH:
  ------------------
  |  |  281|      0|# define OSSL_OP_KEYEXCH                            11
  ------------------
  |  Branch (536:5): [True: 0, False: 1.47k]
  ------------------
  537|      0|        return deflt_keyexch;
  538|      0|    case OSSL_OP_SIGNATURE:
  ------------------
  |  |  282|      0|# define OSSL_OP_SIGNATURE                          12
  ------------------
  |  Branch (538:5): [True: 0, False: 1.47k]
  ------------------
  539|      0|        return deflt_signature;
  540|      0|    case OSSL_OP_ASYM_CIPHER:
  ------------------
  |  |  283|      0|# define OSSL_OP_ASYM_CIPHER                        13
  ------------------
  |  Branch (540:5): [True: 0, False: 1.47k]
  ------------------
  541|      0|        return deflt_asym_cipher;
  542|      0|    case OSSL_OP_KEM:
  ------------------
  |  |  284|      0|# define OSSL_OP_KEM                                14
  ------------------
  |  Branch (542:5): [True: 0, False: 1.47k]
  ------------------
  543|      0|        return deflt_asym_kem;
  544|      0|    case OSSL_OP_ENCODER:
  ------------------
  |  |  286|      0|# define OSSL_OP_ENCODER                            20
  ------------------
  |  Branch (544:5): [True: 0, False: 1.47k]
  ------------------
  545|      0|        return deflt_encoder;
  546|    743|    case OSSL_OP_DECODER:
  ------------------
  |  |  287|    743|# define OSSL_OP_DECODER                            21
  ------------------
  |  Branch (546:5): [True: 743, False: 736]
  ------------------
  547|    743|        return deflt_decoder;
  548|      0|    case OSSL_OP_STORE:
  ------------------
  |  |  288|      0|# define OSSL_OP_STORE                              22
  ------------------
  |  Branch (548:5): [True: 0, False: 1.47k]
  ------------------
  549|      0|        return deflt_store;
  550|  1.47k|    }
  551|      0|    return NULL;
  552|  1.47k|}

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));
  ------------------
  |  |  113|      5|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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,           \
  ------------------
  |  |  303|      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,           \
  ------------------
  |  |  303|      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,           \
  ------------------
  |  |  303|      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,           \
  ------------------
  |  |  303|      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;
  ------------------
  |  |  168|      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
  ------------------
  |  |  168|      4|#  define AESNI_CBC_HMAC_SHA_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  ------------------
  |  |  |  Branch (168: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)                                                             \
  |  |  ------------------
  |  |  |  |  186|      3|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (186: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)                                                             \
  |  |  ------------------
  |  |  |  |  186|      2|#  define AESNI_CAPABLE   (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (186: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|  41.1k|{
   24|  41.1k|    int ret;
   25|  41.1k|    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
   26|  41.1k|    AES_KEY *ks = &adat->ks.ks;
   27|       |
   28|  41.1k|    dat->ks = ks;
   29|       |
   30|  41.1k|    if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  302|  82.3k|# define         EVP_CIPH_ECB_MODE               0x1
  ------------------
                  if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  303|  20.5k|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (30:10): [True: 20.5k, False: 20.5k]
  |  Branch (30:44): [True: 0, False: 20.5k]
  ------------------
   31|  41.1k|        && !dat->enc) {
  ------------------
  |  Branch (31:12): [True: 0, False: 20.5k]
  ------------------
   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 ?
  ------------------
  |  |  303|      0|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (34:27): [True: 0, False: 0]
  ------------------
   35|      0|            (cbc128_f) aesni_cbc_encrypt : NULL;
   36|  41.1k|    } else {
   37|  41.1k|        ret = aesni_set_encrypt_key(key, keylen * 8, ks);
   38|  41.1k|        dat->block = (block128_f) aesni_encrypt;
   39|  41.1k|        if (dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  303|  41.1k|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (39:13): [True: 0, False: 41.1k]
  ------------------
   40|      0|            dat->stream.cbc = (cbc128_f) aesni_cbc_encrypt;
   41|  41.1k|        else if (dat->mode == EVP_CIPH_CTR_MODE)
  ------------------
  |  |  306|  41.1k|# define         EVP_CIPH_CTR_MODE               0x5
  ------------------
  |  Branch (41:18): [True: 20.5k, False: 20.5k]
  ------------------
   42|  20.5k|            dat->stream.ctr = (ctr128_f) aesni_ctr32_encrypt_blocks;
   43|  20.5k|        else
   44|  20.5k|            dat->stream.cbc = NULL;
   45|  41.1k|    }
   46|       |
   47|  41.1k|    if (ret < 0) {
  ------------------
  |  Branch (47:9): [True: 0, False: 41.1k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   49|      0|        return 0;
   50|      0|    }
   51|       |
   52|  41.1k|    return 1;
   53|  41.1k|}
cipher_aes_hw.c:cipher_hw_aesni_ecb:
   67|  20.5k|{
   68|  20.5k|    if (len < ctx->blocksize)
  ------------------
  |  Branch (68:9): [True: 0, False: 20.5k]
  ------------------
   69|      0|        return 1;
   70|       |
   71|  20.5k|    aesni_ecb_encrypt(in, out, len, ctx->ks, ctx->enc);
   72|       |
   73|  20.5k|    return 1;
   74|  20.5k|}

cipher_aes_ocb.c:aes_256_ocb_get_params:
  522|      1|static int aes_##kbits##_##mode##_get_params(OSSL_PARAM params[])              \
  523|      1|{                                                                              \
  524|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  525|      1|                                          flags, kbits, blkbits, ivbits);      \
  526|      1|}                                                                              \
cipher_aes_ocb.c:cipher_ocb_gettable_ctx_params:
  482|      3|{
  483|      3|    return cipher_ocb_known_gettable_ctx_params;
  484|      3|}
cipher_aes_ocb.c:aes_192_ocb_get_params:
  522|      1|static int aes_##kbits##_##mode##_get_params(OSSL_PARAM params[])              \
  523|      1|{                                                                              \
  524|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  525|      1|                                          flags, kbits, blkbits, ivbits);      \
  526|      1|}                                                                              \
cipher_aes_ocb.c:aes_128_ocb_get_params:
  522|      1|static int aes_##kbits##_##mode##_get_params(OSSL_PARAM params[])              \
  523|      1|{                                                                              \
  524|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  525|      1|                                          flags, kbits, blkbits, ivbits);      \
  526|      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)
  |  |  ------------------
  |  |  |  |   45|      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)
  |  |  ------------------
  |  |  |  |   46|      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
  |  |  ------------------
  |  |  |  |   45|      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:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   46|      1|                                          flags, kbits, blkbits, ivbits);      \
   47|      1|}                                                                              \
cipher_tdes.c:tdes_ede3_cbc_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   46|      1|                                          flags, kbits, blkbits, ivbits);      \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede3_ofb_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   46|      1|                                          flags, kbits, blkbits, ivbits);      \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   46|      1|                                          flags, kbits, blkbits, ivbits);      \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb1_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   46|      1|                                          flags, kbits, blkbits, ivbits);      \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb8_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   46|      1|                                          flags, kbits, blkbits, ivbits);      \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede2_ecb_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   46|      1|                                          flags, kbits, blkbits, ivbits);      \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede2_cbc_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   46|      1|                                          flags, kbits, blkbits, ivbits);      \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede2_ofb_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   46|      1|                                          flags, kbits, blkbits, ivbits);      \
   47|      1|}                                                                              \
cipher_tdes_default.c:tdes_ede2_cfb_get_params:
   43|      1|static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
   44|      1|{                                                                              \
   45|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
   46|      1|                                          flags, kbits, blkbits, ivbits);      \
   47|      1|}                                                                              \

cipher_tdes_wrap.c:tdes_wrap_get_params:
  179|      1|static int tdes_wrap_get_params(OSSL_PARAM params[])                           \
  180|      1|{                                                                              \
  181|      1|    return ossl_cipher_generic_get_params(params, EVP_CIPH_WRAP_MODE, flags,   \
  ------------------
  |  |  310|      1|# define         EVP_CIPH_WRAP_MODE              0x10002
  ------------------
  182|      1|                                          kbits, blkbits, ivbits);             \
  183|      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);
  ------------------
  |  |  176|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  155|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  169|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  167|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  183|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  172|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  175|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  166|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  174|    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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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:
  160|     14|{
  161|     14|    return cipher_aead_known_gettable_ctx_params;
  162|     14|}
ossl_cipher_generic_reset_ctx:
  180|      5|{
  181|      5|    if (ctx != NULL && ctx->alloced) {
  ------------------
  |  Branch (181:9): [True: 5, False: 0]
  |  Branch (181:24): [True: 0, False: 5]
  ------------------
  182|      0|        OPENSSL_free(ctx->tlsmac);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  183|      0|        ctx->alloced = 0;
  184|      0|        ctx->tlsmac = NULL;
  185|      0|    }
  186|      5|}
ossl_cipher_generic_einit:
  231|  61.7k|{
  232|  61.7k|    return cipher_generic_init_internal((PROV_CIPHER_CTX *)vctx, key, keylen,
  233|  61.7k|                                        iv, ivlen, params, 1);
  234|  61.7k|}
ossl_cipher_generic_block_update:
  250|  20.5k|{
  251|  20.5k|    size_t outlint = 0;
  252|  20.5k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  253|  20.5k|    size_t blksz = ctx->blocksize;
  254|  20.5k|    size_t nextblocks;
  255|       |
  256|  20.5k|    if (!ctx->key_set) {
  ------------------
  |  Branch (256:9): [True: 0, False: 20.5k]
  ------------------
  257|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NO_KEY_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  258|      0|        return 0;
  259|      0|    }
  260|       |
  261|  20.5k|    if (ctx->tlsversion > 0) {
  ------------------
  |  Branch (261:9): [True: 0, False: 20.5k]
  ------------------
  262|       |        /*
  263|       |         * Each update call corresponds to a TLS record and is individually
  264|       |         * padded
  265|       |         */
  266|       |
  267|       |        /* Sanity check inputs */
  268|      0|        if (in == NULL
  ------------------
  |  Branch (268:13): [True: 0, False: 0]
  ------------------
  269|      0|                || in != out
  ------------------
  |  Branch (269:20): [True: 0, False: 0]
  ------------------
  270|      0|                || outsize < inl
  ------------------
  |  Branch (270:20): [True: 0, False: 0]
  ------------------
  271|      0|                || !ctx->pad) {
  ------------------
  |  Branch (271:20): [True: 0, False: 0]
  ------------------
  272|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  273|      0|            return 0;
  274|      0|        }
  275|       |
  276|      0|        if (ctx->enc) {
  ------------------
  |  Branch (276:13): [True: 0, False: 0]
  ------------------
  277|      0|            unsigned char padval;
  278|      0|            size_t padnum, loop;
  279|       |
  280|       |            /* Add padding */
  281|       |
  282|      0|            padnum = blksz - (inl % blksz);
  283|       |
  284|      0|            if (outsize < inl + padnum) {
  ------------------
  |  Branch (284:17): [True: 0, False: 0]
  ------------------
  285|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  286|      0|                return 0;
  287|      0|            }
  288|       |
  289|      0|            if (padnum > MAX_PADDING) {
  ------------------
  |  |  245|      0|#define MAX_PADDING 256
  ------------------
  |  Branch (289:17): [True: 0, False: 0]
  ------------------
  290|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  291|      0|                return 0;
  292|      0|            }
  293|      0|            padval = (unsigned char)(padnum - 1);
  294|      0|            if (ctx->tlsversion == SSL3_VERSION) {
  ------------------
  |  |   23|      0|# define SSL3_VERSION                    0x0300
  ------------------
  |  Branch (294:17): [True: 0, False: 0]
  ------------------
  295|      0|                if (padnum > 1)
  ------------------
  |  Branch (295:21): [True: 0, False: 0]
  ------------------
  296|      0|                    memset(out + inl, 0, padnum - 1);
  297|      0|                *(out + inl + padnum - 1) = padval;
  298|      0|            } else {
  299|       |                /* we need to add 'padnum' padding bytes of value padval */
  300|      0|                for (loop = inl; loop < inl + padnum; loop++)
  ------------------
  |  Branch (300:34): [True: 0, False: 0]
  ------------------
  301|      0|                    out[loop] = padval;
  302|      0|            }
  303|      0|            inl += padnum;
  304|      0|        }
  305|       |
  306|      0|        if ((inl % blksz) != 0) {
  ------------------
  |  Branch (306:13): [True: 0, False: 0]
  ------------------
  307|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  308|      0|            return 0;
  309|      0|        }
  310|       |
  311|       |
  312|       |        /* Shouldn't normally fail */
  313|      0|        if (!ctx->hw->cipher(ctx, out, in, inl)) {
  ------------------
  |  Branch (313:13): [True: 0, False: 0]
  ------------------
  314|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  315|      0|            return 0;
  316|      0|        }
  317|       |
  318|      0|        if (ctx->alloced) {
  ------------------
  |  Branch (318:13): [True: 0, False: 0]
  ------------------
  319|      0|            OPENSSL_free(ctx->tlsmac);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  320|      0|            ctx->alloced = 0;
  321|      0|            ctx->tlsmac = NULL;
  322|      0|        }
  323|       |
  324|       |        /* This only fails if padding is publicly invalid */
  325|      0|        *outl = inl;
  326|      0|        if (!ctx->enc
  ------------------
  |  Branch (326:13): [True: 0, False: 0]
  ------------------
  327|      0|            && !ossl_cipher_tlsunpadblock(ctx->libctx, ctx->tlsversion,
  ------------------
  |  Branch (327:16): [True: 0, False: 0]
  ------------------
  328|      0|                                          out, outl,
  329|      0|                                          blksz, &ctx->tlsmac, &ctx->alloced,
  330|      0|                                          ctx->tlsmacsize, 0)) {
  331|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  332|      0|            return 0;
  333|      0|        }
  334|      0|        return 1;
  335|      0|    }
  336|       |
  337|  20.5k|    if (ctx->bufsz != 0)
  ------------------
  |  Branch (337:9): [True: 0, False: 20.5k]
  ------------------
  338|      0|        nextblocks = ossl_cipher_fillblock(ctx->buf, &ctx->bufsz, blksz,
  339|      0|                                           &in, &inl);
  340|  20.5k|    else
  341|  20.5k|        nextblocks = inl & ~(blksz-1);
  342|       |
  343|       |    /*
  344|       |     * If we're decrypting and we end an update on a block boundary we hold
  345|       |     * the last block back in case this is the last update call and the last
  346|       |     * block is padded.
  347|       |     */
  348|  20.5k|    if (ctx->bufsz == blksz && (ctx->enc || inl > 0 || !ctx->pad)) {
  ------------------
  |  Branch (348:9): [True: 0, False: 20.5k]
  |  Branch (348:33): [True: 0, False: 0]
  |  Branch (348:45): [True: 0, False: 0]
  |  Branch (348:56): [True: 0, False: 0]
  ------------------
  349|      0|        if (outsize < blksz) {
  ------------------
  |  Branch (349:13): [True: 0, False: 0]
  ------------------
  350|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  351|      0|            return 0;
  352|      0|        }
  353|      0|        if (!ctx->hw->cipher(ctx, out, ctx->buf, blksz)) {
  ------------------
  |  Branch (353:13): [True: 0, False: 0]
  ------------------
  354|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  355|      0|            return 0;
  356|      0|        }
  357|      0|        ctx->bufsz = 0;
  358|      0|        outlint = blksz;
  359|      0|        out += blksz;
  360|      0|    }
  361|  20.5k|    if (nextblocks > 0) {
  ------------------
  |  Branch (361:9): [True: 20.5k, False: 0]
  ------------------
  362|  20.5k|        if (!ctx->enc && ctx->pad && nextblocks == inl) {
  ------------------
  |  Branch (362:13): [True: 0, False: 20.5k]
  |  Branch (362:26): [True: 0, False: 0]
  |  Branch (362:38): [True: 0, False: 0]
  ------------------
  363|      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 (363:17): [True: 0, False: 0]
  ------------------
  364|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  365|      0|                return 0;
  366|      0|            }
  367|      0|            nextblocks -= blksz;
  368|      0|        }
  369|  20.5k|        outlint += nextblocks;
  370|  20.5k|        if (outsize < outlint) {
  ------------------
  |  Branch (370:13): [True: 0, False: 20.5k]
  ------------------
  371|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  372|      0|            return 0;
  373|      0|        }
  374|  20.5k|    }
  375|  20.5k|    if (nextblocks > 0) {
  ------------------
  |  Branch (375:9): [True: 20.5k, False: 0]
  ------------------
  376|  20.5k|        if (!ctx->hw->cipher(ctx, out, in, nextblocks)) {
  ------------------
  |  Branch (376:13): [True: 0, False: 20.5k]
  ------------------
  377|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  378|      0|            return 0;
  379|      0|        }
  380|  20.5k|        in += nextblocks;
  381|  20.5k|        inl -= nextblocks;
  382|  20.5k|    }
  383|  20.5k|    if (inl != 0
  ------------------
  |  Branch (383:9): [True: 0, False: 20.5k]
  ------------------
  384|  20.5k|        && !ossl_cipher_trailingdata(ctx->buf, &ctx->bufsz, blksz, &in, &inl)) {
  ------------------
  |  Branch (384:12): [True: 0, False: 0]
  ------------------
  385|       |        /* ERR_raise already called */
  386|      0|        return 0;
  387|      0|    }
  388|       |
  389|  20.5k|    *outl = outlint;
  390|  20.5k|    return inl == 0;
  391|  20.5k|}
ossl_cipher_generic_stream_update:
  470|  20.5k|{
  471|  20.5k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  472|       |
  473|  20.5k|    if (!ctx->key_set) {
  ------------------
  |  Branch (473:9): [True: 0, False: 20.5k]
  ------------------
  474|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NO_KEY_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  475|      0|        return 0;
  476|      0|    }
  477|       |
  478|  20.5k|    if (inl == 0) {
  ------------------
  |  Branch (478:9): [True: 0, False: 20.5k]
  ------------------
  479|      0|        *outl = 0;
  480|      0|        return 1;
  481|      0|    }
  482|       |
  483|  20.5k|    if (outsize < inl) {
  ------------------
  |  Branch (483:9): [True: 0, False: 20.5k]
  ------------------
  484|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  485|      0|        return 0;
  486|      0|    }
  487|       |
  488|  20.5k|    if (!ctx->hw->cipher(ctx, out, in, inl)) {
  ------------------
  |  Branch (488:9): [True: 0, False: 20.5k]
  ------------------
  489|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  490|      0|        return 0;
  491|      0|    }
  492|       |
  493|  20.5k|    *outl = inl;
  494|  20.5k|    if (!ctx->enc && ctx->tlsversion > 0) {
  ------------------
  |  Branch (494:9): [True: 0, False: 20.5k]
  |  Branch (494:22): [True: 0, False: 0]
  ------------------
  495|       |        /*
  496|       |        * Remove any TLS padding. Only used by cipher_aes_cbc_hmac_sha1_hw.c and
  497|       |        * cipher_aes_cbc_hmac_sha256_hw.c
  498|       |        */
  499|      0|        if (ctx->removetlspad) {
  ------------------
  |  Branch (499:13): [True: 0, False: 0]
  ------------------
  500|       |            /*
  501|       |             * We should have already failed in the cipher() call above if this
  502|       |             * isn't true.
  503|       |             */
  504|      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 (504:17): [True: 0, False: 0]
  ------------------
  505|      0|                return 0;
  506|       |            /* The actual padding length */
  507|      0|            *outl -= out[inl - 1] + 1;
  508|      0|        }
  509|       |
  510|       |        /* TLS MAC and explicit IV if relevant. We should have already failed
  511|       |         * in the cipher() call above if *outl is too short.
  512|       |         */
  513|      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 (513:13): [True: 0, False: 0]
  ------------------
  514|      0|            return 0;
  515|      0|        *outl -= ctx->removetlsfixed;
  516|       |
  517|       |        /* Extract the MAC if there is one */
  518|      0|        if (ctx->tlsmacsize > 0) {
  ------------------
  |  Branch (518:13): [True: 0, False: 0]
  ------------------
  519|      0|            if (*outl < ctx->tlsmacsize)
  ------------------
  |  Branch (519:17): [True: 0, False: 0]
  ------------------
  520|      0|                return 0;
  521|       |
  522|      0|            ctx->tlsmac = out + *outl - ctx->tlsmacsize;
  523|      0|            *outl -= ctx->tlsmacsize;
  524|      0|        }
  525|      0|    }
  526|       |
  527|  20.5k|    return 1;
  528|  20.5k|}
ossl_cipher_generic_get_ctx_params:
  575|      7|{
  576|      7|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  577|      7|    OSSL_PARAM *p;
  578|       |
  579|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  174|      7|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  580|      7|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->ivlen)) {
  ------------------
  |  Branch (580:9): [True: 2, False: 5]
  |  Branch (580:22): [True: 0, False: 2]
  ------------------
  581|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  582|      0|        return 0;
  583|      0|    }
  584|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_PADDING);
  ------------------
  |  |  178|      7|# define OSSL_CIPHER_PARAM_PADDING "padding"
  ------------------
  585|      7|    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->pad)) {
  ------------------
  |  Branch (585:9): [True: 0, False: 7]
  |  Branch (585:22): [True: 0, False: 0]
  ------------------
  586|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  587|      0|        return 0;
  588|      0|    }
  589|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IV);
  ------------------
  |  |  173|      7|# define OSSL_CIPHER_PARAM_IV "iv"
  ------------------
  590|      7|    if (p != NULL
  ------------------
  |  Branch (590:9): [True: 0, False: 7]
  ------------------
  591|      7|        && !OSSL_PARAM_set_octet_ptr(p, &ctx->oiv, ctx->ivlen)
  ------------------
  |  Branch (591:12): [True: 0, False: 0]
  ------------------
  592|      7|        && !OSSL_PARAM_set_octet_string(p, &ctx->oiv, ctx->ivlen)) {
  ------------------
  |  Branch (592:12): [True: 0, False: 0]
  ------------------
  593|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  594|      0|        return 0;
  595|      0|    }
  596|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_UPDATED_IV);
  ------------------
  |  |  195|      7|# define OSSL_CIPHER_PARAM_UPDATED_IV "updated-iv"
  ------------------
  597|      7|    if (p != NULL
  ------------------
  |  Branch (597:9): [True: 0, False: 7]
  ------------------
  598|      7|        && !OSSL_PARAM_set_octet_ptr(p, &ctx->iv, ctx->ivlen)
  ------------------
  |  Branch (598:12): [True: 0, False: 0]
  ------------------
  599|      7|        && !OSSL_PARAM_set_octet_string(p, &ctx->iv, ctx->ivlen)) {
  ------------------
  |  Branch (599:12): [True: 0, False: 0]
  ------------------
  600|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  601|      0|        return 0;
  602|      0|    }
  603|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_NUM);
  ------------------
  |  |  177|      7|# define OSSL_CIPHER_PARAM_NUM "num"
  ------------------
  604|      7|    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->num)) {
  ------------------
  |  Branch (604:9): [True: 0, False: 7]
  |  Branch (604:22): [True: 0, False: 0]
  ------------------
  605|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  606|      0|        return 0;
  607|      0|    }
  608|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  175|      7|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  609|      7|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->keylen)) {
  ------------------
  |  Branch (609:9): [True: 5, False: 2]
  |  Branch (609:22): [True: 0, False: 5]
  ------------------
  610|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  611|      0|        return 0;
  612|      0|    }
  613|      7|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS_MAC);
  ------------------
  |  |  192|      7|# define OSSL_CIPHER_PARAM_TLS_MAC "tls-mac"
  ------------------
  614|      7|    if (p != NULL
  ------------------
  |  Branch (614:9): [True: 0, False: 7]
  ------------------
  615|      7|        && !OSSL_PARAM_set_octet_ptr(p, ctx->tlsmac, ctx->tlsmacsize)) {
  ------------------
  |  Branch (615:12): [True: 0, False: 0]
  ------------------
  616|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  617|      0|        return 0;
  618|      0|    }
  619|      7|    return 1;
  620|      7|}
ossl_cipher_generic_set_ctx_params:
  623|  61.7k|{
  624|  61.7k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  625|  61.7k|    const OSSL_PARAM *p;
  626|       |
  627|  61.7k|    if (params == NULL)
  ------------------
  |  Branch (627:9): [True: 61.7k, False: 0]
  ------------------
  628|  61.7k|        return 1;
  629|       |
  630|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_PADDING);
  ------------------
  |  |  178|      0|# define OSSL_CIPHER_PARAM_PADDING "padding"
  ------------------
  631|      0|    if (p != NULL) {
  ------------------
  |  Branch (631:9): [True: 0, False: 0]
  ------------------
  632|      0|        unsigned int pad;
  633|       |
  634|      0|        if (!OSSL_PARAM_get_uint(p, &pad)) {
  ------------------
  |  Branch (634:13): [True: 0, False: 0]
  ------------------
  635|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  636|      0|            return 0;
  637|      0|        }
  638|      0|        ctx->pad = pad ? 1 : 0;
  ------------------
  |  Branch (638:20): [True: 0, False: 0]
  ------------------
  639|      0|    }
  640|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_USE_BITS);
  ------------------
  |  |  196|      0|# define OSSL_CIPHER_PARAM_USE_BITS "use-bits"
  ------------------
  641|      0|    if (p != NULL) {
  ------------------
  |  Branch (641:9): [True: 0, False: 0]
  ------------------
  642|      0|        unsigned int bits;
  643|       |
  644|      0|        if (!OSSL_PARAM_get_uint(p, &bits)) {
  ------------------
  |  Branch (644:13): [True: 0, False: 0]
  ------------------
  645|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  646|      0|            return 0;
  647|      0|        }
  648|      0|        ctx->use_bits = bits ? 1 : 0;
  ------------------
  |  Branch (648:25): [True: 0, False: 0]
  ------------------
  649|      0|    }
  650|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_VERSION);
  ------------------
  |  |  194|      0|# define OSSL_CIPHER_PARAM_TLS_VERSION "tls-version"
  ------------------
  651|      0|    if (p != NULL) {
  ------------------
  |  Branch (651:9): [True: 0, False: 0]
  ------------------
  652|      0|        if (!OSSL_PARAM_get_uint(p, &ctx->tlsversion)) {
  ------------------
  |  Branch (652:13): [True: 0, False: 0]
  ------------------
  653|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  654|      0|            return 0;
  655|      0|        }
  656|      0|    }
  657|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_MAC_SIZE);
  ------------------
  |  |  193|      0|# define OSSL_CIPHER_PARAM_TLS_MAC_SIZE "tls-mac-size"
  ------------------
  658|      0|    if (p != NULL) {
  ------------------
  |  Branch (658:9): [True: 0, False: 0]
  ------------------
  659|      0|        if (!OSSL_PARAM_get_size_t(p, &ctx->tlsmacsize)) {
  ------------------
  |  Branch (659:13): [True: 0, False: 0]
  ------------------
  660|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  661|      0|            return 0;
  662|      0|        }
  663|      0|    }
  664|      0|    p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_NUM);
  ------------------
  |  |  177|      0|# define OSSL_CIPHER_PARAM_NUM "num"
  ------------------
  665|      0|    if (p != NULL) {
  ------------------
  |  Branch (665:9): [True: 0, False: 0]
  ------------------
  666|      0|        unsigned int num;
  667|       |
  668|      0|        if (!OSSL_PARAM_get_uint(p, &num)) {
  ------------------
  |  Branch (668:13): [True: 0, False: 0]
  ------------------
  669|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  670|      0|            return 0;
  671|      0|        }
  672|      0|        ctx->num = num;
  673|      0|    }
  674|      0|    return 1;
  675|      0|}
ossl_cipher_generic_initiv:
  679|  20.5k|{
  680|  20.5k|    if (ivlen != ctx->ivlen
  ------------------
  |  Branch (680:9): [True: 0, False: 20.5k]
  ------------------
  681|  20.5k|        || ivlen > sizeof(ctx->iv)) {
  ------------------
  |  Branch (681:12): [True: 0, False: 20.5k]
  ------------------
  682|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  683|      0|        return 0;
  684|      0|    }
  685|  20.5k|    ctx->iv_set = 1;
  686|  20.5k|    memcpy(ctx->iv, iv, ivlen);
  687|  20.5k|    memcpy(ctx->oiv, iv, ivlen);
  688|  20.5k|    return 1;
  689|  20.5k|}
ossl_cipher_generic_initkey:
  695|      5|{
  696|      5|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  697|       |
  698|      5|    if ((flags & PROV_CIPHER_FLAG_INVERSE_CIPHER) != 0)
  ------------------
  |  |   46|      5|# define PROV_CIPHER_FLAG_INVERSE_CIPHER   0x0200
  ------------------
  |  Branch (698:9): [True: 0, False: 5]
  ------------------
  699|      0|        ctx->inverse_cipher = 1;
  700|      5|    if ((flags & PROV_CIPHER_FLAG_VARIABLE_LENGTH) != 0)
  ------------------
  |  |   45|      5|# define PROV_CIPHER_FLAG_VARIABLE_LENGTH  0x0100
  ------------------
  |  Branch (700:9): [True: 0, False: 5]
  ------------------
  701|      0|        ctx->variable_keylength = 1;
  702|       |
  703|      5|    ctx->pad = 1;
  704|      5|    ctx->keylen = ((kbits) / 8);
  705|      5|    ctx->ivlen = ((ivbits) / 8);
  706|      5|    ctx->hw = hw;
  707|      5|    ctx->mode = mode;
  708|      5|    ctx->blocksize = blkbits / 8;
  709|      5|    if (provctx != NULL)
  ------------------
  |  Branch (709:9): [True: 5, False: 0]
  ------------------
  710|      5|        ctx->libctx = PROV_LIBCTX_OF(provctx); /* used for rand */
  ------------------
  |  |   29|      5|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  711|      5|}
ciphercommon.c:cipher_generic_init_internal:
  192|  61.7k|{
  193|  61.7k|    ctx->num = 0;
  194|  61.7k|    ctx->bufsz = 0;
  195|  61.7k|    ctx->updated = 0;
  196|  61.7k|    ctx->enc = enc ? 1 : 0;
  ------------------
  |  Branch (196:16): [True: 61.7k, False: 0]
  ------------------
  197|       |
  198|  61.7k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (198:9): [True: 0, False: 61.7k]
  ------------------
  199|      0|        return 0;
  200|       |
  201|  61.7k|    if (iv != NULL && ctx->mode != EVP_CIPH_ECB_MODE) {
  ------------------
  |  |  302|  20.5k|# define         EVP_CIPH_ECB_MODE               0x1
  ------------------
  |  Branch (201:9): [True: 20.5k, False: 41.1k]
  |  Branch (201:23): [True: 20.5k, False: 0]
  ------------------
  202|  20.5k|        if (!ossl_cipher_generic_initiv(ctx, iv, ivlen))
  ------------------
  |  Branch (202:13): [True: 0, False: 20.5k]
  ------------------
  203|      0|            return 0;
  204|  20.5k|    }
  205|  61.7k|    if (iv == NULL && ctx->iv_set
  ------------------
  |  Branch (205:9): [True: 41.1k, False: 20.5k]
  |  Branch (205:23): [True: 20.5k, False: 20.5k]
  ------------------
  206|  61.7k|        && (ctx->mode == EVP_CIPH_CBC_MODE
  ------------------
  |  |  303|  41.1k|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (206:13): [True: 0, False: 20.5k]
  ------------------
  207|  20.5k|            || ctx->mode == EVP_CIPH_CFB_MODE
  ------------------
  |  |  304|  41.1k|# define         EVP_CIPH_CFB_MODE               0x3
  ------------------
  |  Branch (207:16): [True: 0, False: 20.5k]
  ------------------
  208|  20.5k|            || ctx->mode == EVP_CIPH_OFB_MODE))
  ------------------
  |  |  305|  20.5k|# define         EVP_CIPH_OFB_MODE               0x4
  ------------------
  |  Branch (208:16): [True: 0, False: 20.5k]
  ------------------
  209|       |        /* reset IV for these modes to keep compatibility with 1.1.1 */
  210|      0|        memcpy(ctx->iv, ctx->oiv, ctx->ivlen);
  211|       |
  212|  61.7k|    if (key != NULL) {
  ------------------
  |  Branch (212:9): [True: 41.1k, False: 20.5k]
  ------------------
  213|  41.1k|        if (ctx->variable_keylength == 0) {
  ------------------
  |  Branch (213:13): [True: 41.1k, False: 0]
  ------------------
  214|  41.1k|            if (keylen != ctx->keylen) {
  ------------------
  |  Branch (214:17): [True: 0, False: 41.1k]
  ------------------
  215|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  216|      0|                return 0;
  217|      0|            }
  218|  41.1k|        } else {
  219|      0|            ctx->keylen = keylen;
  220|      0|        }
  221|  41.1k|        if (!ctx->hw->init(ctx, key, ctx->keylen))
  ------------------
  |  Branch (221:13): [True: 0, False: 41.1k]
  ------------------
  222|      0|            return 0;
  223|  41.1k|        ctx->key_set = 1;
  224|  41.1k|    }
  225|  61.7k|    return ossl_cipher_generic_set_ctx_params(ctx, params);
  226|  61.7k|}

ossl_cipher_hw_generic_ctr:
  113|  20.5k|{
  114|  20.5k|    unsigned int num = dat->num;
  115|       |
  116|  20.5k|    if (dat->stream.ctr)
  ------------------
  |  Branch (116:9): [True: 20.5k, False: 0]
  ------------------
  117|  20.5k|        CRYPTO_ctr128_encrypt_ctr32(in, out, len, dat->ks, dat->iv, dat->buf,
  118|  20.5k|                                    &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|  20.5k|    dat->num = num;
  123|       |
  124|  20.5k|    return 1;
  125|  20.5k|}

blake2_prov.c:blake2s256_get_params:
  161|      1|static int blake##variantsize##_get_params(OSSL_PARAM params[]) \
  162|      1|{ \
  163|      1|    return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  164|      1|} \
blake2_prov.c:blake2b512_get_params:
  161|      1|static int blake##variantsize##_get_params(OSSL_PARAM params[]) \
  162|      1|{ \
  163|      1|    return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  164|      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);
  ------------------
  |  |  200|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  203|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  205|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  199|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  19.3k|{
   44|  19.3k|    const OSSL_PARAM *p;
   45|  19.3k|    SHA_CTX *ctx = (SHA_CTX *)vctx;
   46|       |
   47|  19.3k|    if (ctx == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 19.3k]
  ------------------
   48|      0|        return 0;
   49|  19.3k|    if (params == NULL)
  ------------------
  |  Branch (49:9): [True: 19.3k, False: 0]
  ------------------
   50|  19.3k|        return 1;
   51|       |
   52|      0|    p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_SSL3_MS);
  ------------------
  |  |  204|      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,
  ------------------
  |  |  409|      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|  74.1k|{
  130|  74.1k|    struct der2key_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  74.1k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  74.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  74.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  131|       |
  132|  74.1k|    if (ctx != NULL) {
  ------------------
  |  Branch (132:9): [True: 74.1k, False: 0]
  ------------------
  133|  74.1k|        ctx->provctx = provctx;
  134|  74.1k|        ctx->desc = desc;
  135|  74.1k|    }
  136|  74.1k|    return ctx;
  137|  74.1k|}
decode_der2key.c:dh_adjust:
  377|     18|{
  378|     18|    ossl_dh_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|     18|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  379|     18|}
decode_der2key.c:der2key_freectx:
  162|  74.1k|{
  163|  74.1k|    struct der2key_ctx_st *ctx = vctx;
  164|       |
  165|  74.1k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  74.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  74.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  74.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  166|  74.1k|}
decode_der2key.c:PrivateKeyInfo_der2dh_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:der2key_check_selection:
  170|  24.1k|{
  171|       |    /*
  172|       |     * The selections are kinda sorta "levels", i.e. each selection given
  173|       |     * here is assumed to include those following.
  174|       |     */
  175|  24.1k|    int checks[] = {
  176|  24.1k|        OSSL_KEYMGMT_SELECT_PRIVATE_KEY,
  ------------------
  |  |  567|  24.1k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  177|  24.1k|        OSSL_KEYMGMT_SELECT_PUBLIC_KEY,
  ------------------
  |  |  568|  24.1k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  178|  24.1k|        OSSL_KEYMGMT_SELECT_ALL_PARAMETERS
  ------------------
  |  |  574|  24.1k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  ------------------
  |  |  |  |  569|  24.1k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  |  |  575|  24.1k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  570|  24.1k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
  179|  24.1k|    };
  180|  24.1k|    size_t i;
  181|       |
  182|       |    /* The decoder implementations made here support guessing */
  183|  24.1k|    if (selection == 0)
  ------------------
  |  Branch (183:9): [True: 0, False: 24.1k]
  ------------------
  184|      0|        return 1;
  185|       |
  186|  48.2k|    for (i = 0; i < OSSL_NELEM(checks); i++) {
  ------------------
  |  |   14|  48.2k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (186:17): [True: 48.2k, False: 0]
  ------------------
  187|  48.2k|        int check1 = (selection & checks[i]) != 0;
  188|  48.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|  48.2k|        if (check1)
  ------------------
  |  Branch (194:13): [True: 24.1k, False: 24.1k]
  ------------------
  195|  24.1k|            return check2;
  196|  48.2k|    }
  197|       |
  198|       |    /* This should be dead code, but just to be safe... */
  199|      0|    return 0;
  200|  24.1k|}
decode_der2key.c:der2key_decode:
  205|  36.5k|{
  206|  36.5k|    struct der2key_ctx_st *ctx = vctx;
  207|  36.5k|    unsigned char *der = NULL;
  208|  36.5k|    const unsigned char *derp;
  209|  36.5k|    long der_len = 0;
  210|  36.5k|    void *key = NULL;
  211|  36.5k|    int ok = 0;
  212|       |
  213|  36.5k|    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|  36.5k|    if (selection == 0)
  ------------------
  |  Branch (222:9): [True: 0, False: 36.5k]
  ------------------
  223|      0|        selection = ctx->desc->selection_mask;
  224|  36.5k|    if ((selection & ctx->desc->selection_mask) == 0) {
  ------------------
  |  Branch (224:9): [True: 0, False: 36.5k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  226|      0|        return 0;
  227|      0|    }
  228|       |
  229|  36.5k|    ok = ossl_read_der(ctx->provctx, cin, &der, &der_len);
  230|  36.5k|    if (!ok)
  ------------------
  |  Branch (230:9): [True: 9, False: 36.5k]
  ------------------
  231|      9|        goto next;
  232|       |
  233|  36.5k|    ok = 0; /* Assume that we fail */
  234|       |
  235|  36.5k|    ERR_set_mark();
  236|  36.5k|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  567|  36.5k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (236:9): [True: 0, False: 36.5k]
  ------------------
  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|  36.5k|    if (key == NULL && (selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
  ------------------
  |  |  568|  36.5k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (252:9): [True: 36.5k, False: 0]
  |  Branch (252:24): [True: 36.5k, False: 0]
  ------------------
  253|  36.5k|        derp = der;
  254|  36.5k|        if (ctx->desc->d2i_PUBKEY != NULL)
  ------------------
  |  Branch (254:13): [True: 36.5k, False: 36]
  ------------------
  255|  36.5k|            key = ctx->desc->d2i_PUBKEY(NULL, &derp, der_len);
  256|     36|        else if (ctx->desc->d2i_public_key != NULL)
  ------------------
  |  Branch (256:18): [True: 36, False: 0]
  ------------------
  257|     36|            key = ctx->desc->d2i_public_key(NULL, &derp, der_len);
  258|  36.5k|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (258:13): [True: 20.6k, False: 15.9k]
  |  Branch (258:28): [True: 20.6k, False: 0]
  ------------------
  259|  20.6k|            ERR_clear_last_mark();
  260|  20.6k|            goto next;
  261|  20.6k|        }
  262|  36.5k|    }
  263|  15.9k|    if (key == NULL && (selection & OSSL_KEYMGMT_SELECT_ALL_PARAMETERS) != 0) {
  ------------------
  |  |  574|      0|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  ------------------
  |  |  |  |  569|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  |  |  575|      0|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  570|      0|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
  |  Branch (263:9): [True: 0, False: 15.9k]
  |  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|  15.9k|    if (key == NULL)
  ------------------
  |  Branch (272:9): [True: 0, False: 15.9k]
  ------------------
  273|      0|        ERR_clear_last_mark();
  274|  15.9k|    else
  275|  15.9k|        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|  15.9k|    if (key != NULL
  ------------------
  |  Branch (284:9): [True: 15.9k, False: 0]
  ------------------
  285|  15.9k|        && ctx->desc->check_key != NULL
  ------------------
  |  Branch (285:12): [True: 15.9k, False: 22]
  ------------------
  286|  15.9k|        && !ctx->desc->check_key(key, ctx)) {
  ------------------
  |  Branch (286:12): [True: 0, False: 15.9k]
  ------------------
  287|      0|        ctx->desc->free_key(key);
  288|      0|        key = NULL;
  289|      0|    }
  290|       |
  291|  15.9k|    if (key != NULL && ctx->desc->adjust_key != NULL)
  ------------------
  |  Branch (291:9): [True: 15.9k, False: 0]
  |  Branch (291:24): [True: 15.9k, False: 0]
  ------------------
  292|  15.9k|        ctx->desc->adjust_key(key, ctx);
  293|       |
  294|  36.5k| next:
  295|       |    /*
  296|       |     * Indicated that we successfully decoded something, or not at all.
  297|       |     * Ending up "empty handed" is not an error.
  298|       |     */
  299|  36.5k|    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|  36.5k|    OPENSSL_free(der);
  ------------------
  |  |  115|  36.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  36.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  36.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  307|  36.5k|    der = NULL;
  308|       |
  309|  36.5k|    if (key != NULL) {
  ------------------
  |  Branch (309:9): [True: 15.9k, False: 20.6k]
  ------------------
  310|  15.9k|        OSSL_PARAM params[4];
  311|  15.9k|        int object_type = OSSL_OBJECT_PKEY;
  ------------------
  |  |   29|  15.9k|# define OSSL_OBJECT_PKEY               2 /* EVP_PKEY * */
  ------------------
  312|       |
  313|  15.9k|        params[0] =
  314|  15.9k|            OSSL_PARAM_construct_int(OSSL_OBJECT_PARAM_TYPE, &object_type);
  ------------------
  |  |  331|  15.9k|# define OSSL_OBJECT_PARAM_TYPE "type"
  ------------------
  315|  15.9k|        params[1] =
  316|  15.9k|            OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  328|  15.9k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  317|  15.9k|                                             (char *)ctx->desc->keytype_name,
  318|  15.9k|                                             0);
  319|       |        /* The address of the key becomes the octet string */
  320|  15.9k|        params[2] =
  321|  15.9k|            OSSL_PARAM_construct_octet_string(OSSL_OBJECT_PARAM_REFERENCE,
  ------------------
  |  |  330|  15.9k|# define OSSL_OBJECT_PARAM_REFERENCE "reference"
  ------------------
  322|  15.9k|                                              &key, sizeof(key));
  323|  15.9k|        params[3] = OSSL_PARAM_construct_end();
  324|       |
  325|  15.9k|        ok = data_cb(params, data_cbarg);
  326|  15.9k|    }
  327|       |
  328|  36.5k| end:
  329|  36.5k|    ctx->desc->free_key(key);
  330|  36.5k|    OPENSSL_free(der);
  ------------------
  |  |  115|  36.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  36.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  36.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  331|       |
  332|  36.5k|    return ok;
  333|  36.5k|}
decode_der2key.c:SubjectPublicKeyInfo_der2dh_newctx:
  762|      4|    {                                                                   \
  763|      4|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|      4|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dh_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:type_specific_params_der2dh_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:DH_der2dh_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2dhx_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dhx_newctx:
  762|    395|    {                                                                   \
  763|    395|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|    395|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dhx_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:type_specific_params_der2dhx_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:DHX_der2dhx_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:dsa_adjust:
  412|      4|{
  413|      4|    ossl_dsa_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|      4|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  414|      4|}
decode_der2key.c:PrivateKeyInfo_der2dsa_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dsa_newctx:
  762|  1.62k|    {                                                                   \
  763|  1.62k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  1.62k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dsa_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:type_specific_der2dsa_newctx:
  762|  1.62k|    {                                                                   \
  763|  1.62k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  1.62k|    }                                                                   \
decode_der2key.c:type_specific_der2dsa_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:DSA_der2dsa_newctx:
  762|  1.62k|    {                                                                   \
  763|  1.62k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  1.62k|    }                                                                   \
decode_der2key.c:DSA_der2dsa_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:ec_check:
  436|  15.9k|{
  437|       |    /* We're trying to be clever by comparing two truths */
  438|       |
  439|  15.9k|    int sm2 = (EC_KEY_get_flags(key) & EC_FLAG_SM2_RANGE) != 0;
  ------------------
  |  |  962|  15.9k|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
  440|       |
  441|  15.9k|    return sm2 == (ctx->desc->evp_type == EVP_PKEY_SM2);
  ------------------
  |  |   71|  15.9k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|  15.9k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  442|  15.9k|}
decode_der2key.c:ec_adjust:
  445|  15.9k|{
  446|  15.9k|    ossl_ec_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|  15.9k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  447|  15.9k|}
decode_der2key.c:PrivateKeyInfo_der2ec_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ec_newctx:
  762|  34.3k|    {                                                                   \
  763|  34.3k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  34.3k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ec_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2ec_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:EC_der2ec_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2x25519_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x25519_newctx:
  762|     62|    {                                                                   \
  763|     62|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|     62|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x25519_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2x448_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x448_newctx:
  762|     11|    {                                                                   \
  763|     11|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|     11|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x448_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed25519_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed25519_newctx:
  762|      6|    {                                                                   \
  763|      6|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|      6|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed25519_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed448_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed448_newctx:
  762|      7|    {                                                                   \
  763|      7|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|      7|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed448_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2sm2_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2sm2_newctx:
  762|  34.3k|    {                                                                   \
  763|  34.3k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  34.3k|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2sm2_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2sm2_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:rsa_check:
  546|     14|{
  547|     14|    switch (RSA_test_flags(key, RSA_FLAG_TYPE_MASK)) {
  ------------------
  |  |  117|     14|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  |  Branch (547:13): [True: 0, False: 14]
  ------------------
  548|      6|    case RSA_FLAG_TYPE_RSA:
  ------------------
  |  |  118|      6|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  |  Branch (548:5): [True: 6, False: 8]
  ------------------
  549|      6|        return ctx->desc->evp_type == EVP_PKEY_RSA;
  ------------------
  |  |   60|      6|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|      6|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  550|      8|    case RSA_FLAG_TYPE_RSASSAPSS:
  ------------------
  |  |  119|      8|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (550:5): [True: 8, False: 6]
  ------------------
  551|      8|        return ctx->desc->evp_type == EVP_PKEY_RSA_PSS;
  ------------------
  |  |   62|      8|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      8|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  552|     14|    }
  553|       |
  554|       |    /* Currently unsupported RSA key type */
  555|      0|    return 0;
  556|     14|}
decode_der2key.c:rsa_adjust:
  559|     14|{
  560|     14|    ossl_rsa_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|     14|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  561|     14|}
decode_der2key.c:PrivateKeyInfo_der2rsa_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsa_newctx:
  762|     10|    {                                                                   \
  763|     10|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|     10|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsa_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:type_specific_keypair_der2rsa_newctx:
  762|     10|    {                                                                   \
  763|     10|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|     10|    }                                                                   \
decode_der2key.c:type_specific_keypair_der2rsa_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:RSA_der2rsa_newctx:
  762|     10|    {                                                                   \
  763|     10|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|     10|    }                                                                   \
decode_der2key.c:RSA_der2rsa_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2rsapss_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsapss_newctx:
  762|     13|    {                                                                   \
  763|     13|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|     13|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsapss_does_selection:
  767|    731|    {                                                                   \
  768|    731|        return der2key_check_selection(selection,                       \
  769|    731|                                       &kind##_##keytype##_desc);       \
  770|    731|    }                                                                   \

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

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

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

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

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

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

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

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|  19.3k|static void *name##_newctx(void *prov_ctx)                                     \
   56|  19.3k|{                                                                              \
   57|  19.3k|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|  19.3k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  19.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  19.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 19.3k, False: 0]
  ------------------
   58|  19.3k|    return ctx;                                                                \
   59|  19.3k|}                                                                              \
sha2_prov.c:sha1_internal_final:
   41|  19.3k|                                 size_t outsz)                                 \
   42|  19.3k|{                                                                              \
   43|  19.3k|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 19.3k, False: 0]
  |  Branch (43:35): [True: 19.3k, False: 0]
  |  Branch (43:56): [True: 19.3k, False: 0]
  ------------------
   44|  19.3k|        *outl = dgstsize;                                                      \
   45|  19.3k|        return 1;                                                              \
   46|  19.3k|    }                                                                          \
   47|  19.3k|    return 0;                                                                  \
   48|  19.3k|}
sha2_prov.c:sha1_freectx:
   60|  19.3k|static void name##_freectx(void *vctx)                                         \
   61|  19.3k|{                                                                              \
   62|  19.3k|    CTX *ctx = (CTX *)vctx;                                                    \
   63|  19.3k|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|  19.3k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  19.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  19.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|  19.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|  19.3k|static int name##_internal_init(void *ctx, const OSSL_PARAM params[])          \
  105|  19.3k|{                                                                              \
  106|  19.3k|    return ossl_prov_is_running()                                              \
  ------------------
  |  Branch (106:12): [True: 19.3k, False: 0]
  ------------------
  107|  19.3k|           && init(ctx)                                                        \
  ------------------
  |  Branch (107:15): [True: 19.3k, False: 0]
  ------------------
  108|  19.3k|           && set_ctx_params(ctx, params);                                     \
  ------------------
  |  Branch (108:15): [True: 19.3k, False: 0]
  ------------------
  109|  19.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:
  821|     18|{
  822|     18|    DH *dh = NULL;
  823|       |
  824|     18|    if (ossl_prov_is_running() && reference_sz == sizeof(dh)) {
  ------------------
  |  Branch (824:9): [True: 18, False: 0]
  |  Branch (824:35): [True: 18, False: 0]
  ------------------
  825|       |        /* The contents of the reference is the address to our object */
  826|     18|        dh = *(DH **)reference;
  827|       |        /* We grabbed, so we detach it */
  828|     18|        *(DH **)reference = NULL;
  829|     18|        return dh;
  830|     18|    }
  831|      0|    return NULL;
  832|     18|}
dh_kmgmt.c:dh_freedata:
  126|     18|{
  127|     18|    DH_free(keydata);
  128|     18|}
dh_kmgmt.c:dh_get_params:
  316|     18|{
  317|     18|    DH *dh = key;
  318|     18|    OSSL_PARAM *p;
  319|       |
  320|     18|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  333|     18|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (320:9): [True: 18, False: 0]
  ------------------
  321|     18|        && !OSSL_PARAM_set_int(p, DH_bits(dh)))
  ------------------
  |  Branch (321:12): [True: 0, False: 18]
  ------------------
  322|      0|        return 0;
  323|     18|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  447|     18|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (323:9): [True: 18, False: 0]
  ------------------
  324|     18|        && !OSSL_PARAM_set_int(p, DH_security_bits(dh)))
  ------------------
  |  Branch (324:12): [True: 0, False: 18]
  ------------------
  325|      0|        return 0;
  326|     18|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  387|     18|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (326:9): [True: 18, False: 0]
  ------------------
  327|     18|        && !OSSL_PARAM_set_int(p, DH_size(dh)))
  ------------------
  |  Branch (327:12): [True: 0, False: 18]
  ------------------
  328|      0|        return 0;
  329|     18|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL) {
  ------------------
  |  |  363|     18|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
  |  Branch (329:9): [True: 0, False: 18]
  ------------------
  330|      0|        if (p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (330:13): [True: 0, False: 0]
  ------------------
  331|      0|            return 0;
  332|      0|        p->return_size = ossl_dh_key2buf(dh, (unsigned char **)&p->data,
  333|      0|                                         p->data_size, 0);
  334|      0|        if (p->return_size == 0)
  ------------------
  |  Branch (334:13): [True: 0, False: 0]
  ------------------
  335|      0|            return 0;
  336|      0|    }
  337|       |
  338|     18|    return ossl_dh_params_todata(dh, NULL, params)
  ------------------
  |  Branch (338:12): [True: 18, False: 0]
  ------------------
  339|     18|        && ossl_dh_key_todata(dh, NULL, params, 1);
  ------------------
  |  Branch (339:12): [True: 18, False: 0]
  ------------------
  340|     18|}

dsa_kmgmt.c:dsa_load:
  658|      4|{
  659|      4|    DSA *dsa = NULL;
  660|       |
  661|      4|    if (ossl_prov_is_running() && reference_sz == sizeof(dsa)) {
  ------------------
  |  Branch (661:9): [True: 4, False: 0]
  |  Branch (661:35): [True: 4, False: 0]
  ------------------
  662|       |        /* The contents of the reference is the address to our object */
  663|      4|        dsa = *(DSA **)reference;
  664|       |        /* We grabbed, so we detach it */
  665|      4|        *(DSA **)reference = NULL;
  666|      4|        return dsa;
  667|      4|    }
  668|      0|    return NULL;
  669|      4|}
dsa_kmgmt.c:dsa_freedata:
  125|      4|{
  126|      4|    DSA_free(keydata);
  127|      4|}
dsa_kmgmt.c:dsa_get_params:
  312|      4|{
  313|      4|    DSA *dsa = key;
  314|      4|    OSSL_PARAM *p;
  315|       |
  316|      4|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  333|      4|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (316:9): [True: 4, False: 0]
  ------------------
  317|      4|        && !OSSL_PARAM_set_int(p, DSA_bits(dsa)))
  ------------------
  |  Branch (317:12): [True: 0, False: 4]
  ------------------
  318|      0|        return 0;
  319|      4|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  447|      4|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (319:9): [True: 4, False: 0]
  ------------------
  320|      4|        && !OSSL_PARAM_set_int(p, DSA_security_bits(dsa)))
  ------------------
  |  Branch (320:12): [True: 0, False: 4]
  ------------------
  321|      0|        return 0;
  322|      4|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  387|      4|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (322:9): [True: 4, False: 0]
  ------------------
  323|      4|        && !OSSL_PARAM_set_int(p, DSA_size(dsa)))
  ------------------
  |  Branch (323:12): [True: 0, False: 4]
  ------------------
  324|      0|        return 0;
  325|      4|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  335|      4|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (325:9): [True: 0, False: 4]
  ------------------
  326|      4|        && !OSSL_PARAM_set_utf8_string(p, DSA_DEFAULT_MD))
  ------------------
  |  |   48|      0|#define DSA_DEFAULT_MD "SHA256"
  ------------------
  |  Branch (326:12): [True: 0, False: 0]
  ------------------
  327|      0|        return 0;
  328|      4|    return ossl_ffc_params_todata(ossl_dsa_get0_params(dsa), NULL, params)
  ------------------
  |  Branch (328:12): [True: 4, False: 0]
  ------------------
  329|      4|           && dsa_key_todata(dsa, NULL, params, 1);
  ------------------
  |  Branch (329:15): [True: 4, False: 0]
  ------------------
  330|      4|}
dsa_kmgmt.c:dsa_key_todata:
   99|      4|{
  100|      4|    const BIGNUM *priv = NULL, *pub = NULL;
  101|       |
  102|      4|    if (dsa == NULL)
  ------------------
  |  Branch (102:9): [True: 0, False: 4]
  ------------------
  103|      0|        return 0;
  104|       |
  105|      4|    DSA_get0_key(dsa, &pub, &priv);
  106|      4|    if (include_private
  ------------------
  |  Branch (106:9): [True: 4, False: 0]
  ------------------
  107|      4|        && priv != NULL
  ------------------
  |  Branch (107:12): [True: 0, False: 4]
  ------------------
  108|      4|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PRIV_KEY, priv))
  ------------------
  |  |  391|      0|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  |  Branch (108:12): [True: 0, False: 0]
  ------------------
  109|      0|        return 0;
  110|      4|    if (pub != NULL
  ------------------
  |  Branch (110:9): [True: 4, False: 0]
  ------------------
  111|      4|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PUB_KEY, pub))
  ------------------
  |  |  393|      4|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  |  Branch (111:12): [True: 0, False: 4]
  ------------------
  112|      0|        return 0;
  113|       |
  114|      4|    return 1;
  115|      4|}

ec_kmgmt.c:ec_load:
 1401|  15.9k|{
 1402|  15.9k|    return common_load(reference, reference_sz, 0);
 1403|  15.9k|}
ec_kmgmt.c:common_load:
 1383|  15.9k|{
 1384|  15.9k|    EC_KEY *ec = NULL;
 1385|       |
 1386|  15.9k|    if (ossl_prov_is_running() && reference_sz == sizeof(ec)) {
  ------------------
  |  Branch (1386:9): [True: 15.9k, False: 0]
  |  Branch (1386:35): [True: 15.9k, False: 0]
  ------------------
 1387|       |        /* The contents of the reference is the address to our object */
 1388|  15.9k|        ec = *(EC_KEY **)reference;
 1389|       |
 1390|  15.9k|        if (!common_check_sm2(ec, sm2_wanted))
  ------------------
  |  Branch (1390:13): [True: 0, False: 15.9k]
  ------------------
 1391|      0|            return NULL;
 1392|       |
 1393|       |        /* We grabbed, so we detach it */
 1394|  15.9k|        *(EC_KEY **)reference = NULL;
 1395|  15.9k|        return ec;
 1396|  15.9k|    }
 1397|      0|    return NULL;
 1398|  15.9k|}
ec_kmgmt.c:common_check_sm2:
  376|  15.9k|{
  377|  15.9k|    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|  15.9k|    if ((ecg = EC_KEY_get0_group(ec)) == NULL
  ------------------
  |  Branch (383:9): [True: 0, False: 15.9k]
  ------------------
  384|  15.9k|        || (sm2_wanted ^ (EC_GROUP_get_curve_name(ecg) == NID_sm2)))
  ------------------
  |  | 1232|  15.9k|#define NID_sm2         1172
  ------------------
  |  Branch (384:12): [True: 0, False: 15.9k]
  ------------------
  385|      0|        return 0;
  386|  15.9k|    return 1;
  387|  15.9k|}
ec_kmgmt.c:ec_freedata:
  299|  15.9k|{
  300|  15.9k|    EC_KEY_free(keydata);
  301|  15.9k|}
ec_kmgmt.c:ec_get_params:
  768|  15.9k|{
  769|  15.9k|    return common_get_params(key, params, 0);
  770|  15.9k|}
ec_kmgmt.c:common_get_params:
  637|  15.9k|{
  638|  15.9k|    int ret = 0;
  639|  15.9k|    EC_KEY *eck = key;
  640|  15.9k|    const EC_GROUP *ecg = NULL;
  641|  15.9k|    OSSL_PARAM *p;
  642|  15.9k|    unsigned char *pub_key = NULL, *genbuf = NULL;
  643|  15.9k|    OSSL_LIB_CTX *libctx;
  644|  15.9k|    const char *propq;
  645|  15.9k|    BN_CTX *bnctx = NULL;
  646|       |
  647|  15.9k|    ecg = EC_KEY_get0_group(eck);
  648|  15.9k|    if (ecg == NULL) {
  ------------------
  |  Branch (648:9): [True: 0, False: 15.9k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  650|      0|        return 0;
  651|      0|    }
  652|       |
  653|  15.9k|    libctx = ossl_ec_key_get_libctx(eck);
  654|  15.9k|    propq = ossl_ec_key_get0_propq(eck);
  655|       |
  656|  15.9k|    bnctx = BN_CTX_new_ex(libctx);
  657|  15.9k|    if (bnctx == NULL)
  ------------------
  |  Branch (657:9): [True: 0, False: 15.9k]
  ------------------
  658|      0|        return 0;
  659|  15.9k|    BN_CTX_start(bnctx);
  660|       |
  661|  15.9k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  387|  15.9k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (661:9): [True: 15.9k, False: 0]
  ------------------
  662|  15.9k|        && !OSSL_PARAM_set_int(p, ECDSA_size(eck)))
  ------------------
  |  Branch (662:12): [True: 0, False: 15.9k]
  ------------------
  663|      0|        goto err;
  664|  15.9k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  333|  15.9k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (664:9): [True: 15.9k, False: 0]
  ------------------
  665|  15.9k|        && !OSSL_PARAM_set_int(p, EC_GROUP_order_bits(ecg)))
  ------------------
  |  Branch (665:12): [True: 0, False: 15.9k]
  ------------------
  666|      0|        goto err;
  667|  15.9k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL) {
  ------------------
  |  |  447|  15.9k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (667:9): [True: 15.9k, False: 0]
  ------------------
  668|  15.9k|        int ecbits, sec_bits;
  669|       |
  670|  15.9k|        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|  15.9k|        if (ecbits >= 512)
  ------------------
  |  Branch (688:13): [True: 147, False: 15.7k]
  ------------------
  689|    147|            sec_bits = 256;
  690|  15.7k|        else if (ecbits >= 384)
  ------------------
  |  Branch (690:18): [True: 1.37k, False: 14.4k]
  ------------------
  691|  1.37k|            sec_bits = 192;
  692|  14.4k|        else if (ecbits >= 256)
  ------------------
  |  Branch (692:18): [True: 2.30k, False: 12.0k]
  ------------------
  693|  2.30k|            sec_bits = 128;
  694|  12.0k|        else if (ecbits >= 224)
  ------------------
  |  Branch (694:18): [True: 1.66k, False: 10.4k]
  ------------------
  695|  1.66k|            sec_bits = 112;
  696|  10.4k|        else if (ecbits >= 160)
  ------------------
  |  Branch (696:18): [True: 330, False: 10.0k]
  ------------------
  697|    330|            sec_bits = 80;
  698|  10.0k|        else
  699|  10.0k|            sec_bits = ecbits / 2;
  700|       |
  701|  15.9k|        if (!OSSL_PARAM_set_int(p, sec_bits))
  ------------------
  |  Branch (701:13): [True: 0, False: 15.9k]
  ------------------
  702|      0|            goto err;
  703|  15.9k|    }
  704|       |
  705|  15.9k|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (705:9): [True: 0, False: 15.9k]
  ------------------
  706|  15.9k|                               OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS))
  ------------------
  |  |  351|  15.9k|# define OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS "decoded-from-explicit"
  ------------------
  707|  15.9k|            != 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|  15.9k|    if (!sm2) {
  ------------------
  |  Branch (715:9): [True: 15.9k, False: 0]
  ------------------
  716|  15.9k|        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  335|  15.9k|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (716:13): [True: 0, False: 15.9k]
  ------------------
  717|  15.9k|                && !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|  15.9k|    } else {
  720|      0|        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  335|      0|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (720:13): [True: 0, False: 0]
  ------------------
  721|      0|                && !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|      0|    }
  724|       |
  725|       |    /* SM2 doesn't support this PARAM */
  726|  15.9k|    if (!sm2) {
  ------------------
  |  Branch (726:9): [True: 15.9k, False: 0]
  ------------------
  727|  15.9k|        p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_USE_COFACTOR_ECDH);
  ------------------
  |  |  448|  15.9k|# define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH OSSL_PKEY_PARAM_USE_COFACTOR_FLAG
  |  |  ------------------
  |  |  |  |  449|  15.9k|# define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag"
  |  |  ------------------
  ------------------
  728|  15.9k|        if (p != NULL) {
  ------------------
  |  Branch (728:13): [True: 0, False: 15.9k]
  ------------------
  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|  15.9k|    }
  738|  15.9k|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (738:9): [True: 0, False: 15.9k]
  ------------------
  739|  15.9k|                               OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL) {
  ------------------
  |  |  363|  15.9k|# 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  15.9k|    ret = ec_get_ecm_params(ecg, params)
  ------------------
  |  Branch (753:11): [True: 15.9k, False: 0]
  ------------------
  754|  15.9k|          && ossl_ec_group_todata(ecg, NULL, params, libctx, propq, bnctx,
  ------------------
  |  Branch (754:14): [True: 15.9k, False: 0]
  ------------------
  755|  15.9k|                                  &genbuf)
  756|  15.9k|          && key_to_params(eck, NULL, params, 1, &pub_key)
  ------------------
  |  Branch (756:14): [True: 15.9k, False: 0]
  ------------------
  757|  15.9k|          && otherparams_to_params(eck, NULL, params);
  ------------------
  |  Branch (757:14): [True: 15.9k, False: 0]
  ------------------
  758|  15.9k|err:
  759|  15.9k|    OPENSSL_free(genbuf);
  ------------------
  |  |  115|  15.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  15.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  15.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  760|  15.9k|    OPENSSL_free(pub_key);
  ------------------
  |  |  115|  15.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  15.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  15.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  761|  15.9k|    BN_CTX_end(bnctx);
  762|  15.9k|    BN_CTX_free(bnctx);
  763|  15.9k|    return ret;
  764|  15.9k|}
ec_kmgmt.c:ec_get_ecm_params:
  585|  15.9k|{
  586|       |#ifdef OPENSSL_NO_EC2M
  587|       |    return 1;
  588|       |#else
  589|  15.9k|    int ret = 0, m;
  590|  15.9k|    unsigned int k1 = 0, k2 = 0, k3 = 0;
  591|  15.9k|    int basis_nid;
  592|  15.9k|    const char *basis_name = NULL;
  593|  15.9k|    int fid = EC_GROUP_get_field_type(group);
  594|       |
  595|  15.9k|    if (fid != NID_X9_62_characteristic_two_field)
  ------------------
  |  |  156|  15.9k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (595:9): [True: 5.43k, False: 10.4k]
  ------------------
  596|  5.43k|        return 1;
  597|       |
  598|  10.4k|    basis_nid = EC_GROUP_get_basis_type(group);
  599|  10.4k|    if (basis_nid == NID_X9_62_tpBasis)
  ------------------
  |  |  168|  10.4k|#define NID_X9_62_tpBasis               682
  ------------------
  |  Branch (599:9): [True: 1.08k, False: 9.40k]
  ------------------
  600|  1.08k|        basis_name = SN_X9_62_tpBasis;
  ------------------
  |  |  167|  1.08k|#define SN_X9_62_tpBasis                "tpBasis"
  ------------------
  601|  9.40k|    else if (basis_nid == NID_X9_62_ppBasis)
  ------------------
  |  |  172|  9.40k|#define NID_X9_62_ppBasis               683
  ------------------
  |  Branch (601:14): [True: 9.40k, False: 0]
  ------------------
  602|  9.40k|        basis_name = SN_X9_62_ppBasis;
  ------------------
  |  |  171|  9.40k|#define SN_X9_62_ppBasis                "ppBasis"
  ------------------
  603|      0|    else
  604|      0|        goto err;
  605|       |
  606|  10.4k|    m = EC_GROUP_get_degree(group);
  607|  10.4k|    if (!ossl_param_build_set_int(NULL, params, OSSL_PKEY_PARAM_EC_CHAR2_M, m)
  ------------------
  |  |  344|  10.4k|# define OSSL_PKEY_PARAM_EC_CHAR2_M "m"
  ------------------
  |  Branch (607:9): [True: 0, False: 10.4k]
  ------------------
  608|  10.4k|        || !ossl_param_build_set_utf8_string(NULL, params,
  ------------------
  |  Branch (608:12): [True: 0, False: 10.4k]
  ------------------
  609|  10.4k|                                             OSSL_PKEY_PARAM_EC_CHAR2_TYPE,
  ------------------
  |  |  349|  10.4k|# define OSSL_PKEY_PARAM_EC_CHAR2_TYPE "basis-type"
  ------------------
  610|  10.4k|                                             basis_name))
  611|      0|        goto err;
  612|       |
  613|  10.4k|    if (basis_nid == NID_X9_62_tpBasis) {
  ------------------
  |  |  168|  10.4k|#define NID_X9_62_tpBasis               682
  ------------------
  |  Branch (613:9): [True: 1.08k, False: 9.40k]
  ------------------
  614|  1.08k|        if (!EC_GROUP_get_trinomial_basis(group, &k1)
  ------------------
  |  Branch (614:13): [True: 0, False: 1.08k]
  ------------------
  615|  1.08k|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (615:16): [True: 0, False: 1.08k]
  ------------------
  616|  1.08k|                                         OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS,
  ------------------
  |  |  348|  1.08k|# define OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS "tp"
  ------------------
  617|  1.08k|                                         (int)k1))
  618|      0|            goto err;
  619|  9.40k|    } else {
  620|  9.40k|        if (!EC_GROUP_get_pentanomial_basis(group, &k1, &k2, &k3)
  ------------------
  |  Branch (620:13): [True: 0, False: 9.40k]
  ------------------
  621|  9.40k|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (621:16): [True: 0, False: 9.40k]
  ------------------
  622|  9.40k|                                         OSSL_PKEY_PARAM_EC_CHAR2_PP_K1, (int)k1)
  ------------------
  |  |  345|  9.40k|# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K1 "k1"
  ------------------
  623|  9.40k|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (623:16): [True: 0, False: 9.40k]
  ------------------
  624|  9.40k|                                         OSSL_PKEY_PARAM_EC_CHAR2_PP_K2, (int)k2)
  ------------------
  |  |  346|  9.40k|# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K2 "k2"
  ------------------
  625|  9.40k|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (625:16): [True: 0, False: 9.40k]
  ------------------
  626|  9.40k|                                         OSSL_PKEY_PARAM_EC_CHAR2_PP_K3, (int)k3))
  ------------------
  |  |  347|  9.40k|# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K3 "k3"
  ------------------
  627|      0|            goto err;
  628|  9.40k|    }
  629|  10.4k|    ret = 1;
  630|  10.4k|err:
  631|  10.4k|    return ret;
  632|  10.4k|#endif /* OPENSSL_NO_EC2M */
  633|  10.4k|}
ec_kmgmt.c:key_to_params:
  114|  15.9k|{
  115|  15.9k|    BIGNUM *x = NULL, *y = NULL;
  116|  15.9k|    const BIGNUM *priv_key = NULL;
  117|  15.9k|    const EC_POINT *pub_point = NULL;
  118|  15.9k|    const EC_GROUP *ecg = NULL;
  119|  15.9k|    size_t pub_key_len = 0;
  120|  15.9k|    int ret = 0;
  121|  15.9k|    BN_CTX *bnctx = NULL;
  122|       |
  123|  15.9k|    if (eckey == NULL
  ------------------
  |  Branch (123:9): [True: 0, False: 15.9k]
  ------------------
  124|  15.9k|        || (ecg = EC_KEY_get0_group(eckey)) == NULL)
  ------------------
  |  Branch (124:12): [True: 0, False: 15.9k]
  ------------------
  125|      0|        return 0;
  126|       |
  127|  15.9k|    priv_key = EC_KEY_get0_private_key(eckey);
  128|  15.9k|    pub_point = EC_KEY_get0_public_key(eckey);
  129|       |
  130|  15.9k|    if (pub_point != NULL) {
  ------------------
  |  Branch (130:9): [True: 15.9k, False: 0]
  ------------------
  131|  15.9k|        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|  15.9k|        bnctx = BN_CTX_new_ex(ossl_ec_key_get_libctx(eckey));
  137|  15.9k|        if (bnctx == NULL)
  ------------------
  |  Branch (137:13): [True: 0, False: 15.9k]
  ------------------
  138|      0|            goto err;
  139|       |
  140|       |
  141|       |        /* If we are doing a get then check first before decoding the point */
  142|  15.9k|        if (tmpl == NULL) {
  ------------------
  |  Branch (142:13): [True: 15.9k, False: 0]
  ------------------
  143|  15.9k|            p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_PUB_KEY);
  ------------------
  |  |  393|  15.9k|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  144|  15.9k|            px = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_EC_PUB_X);
  ------------------
  |  |  360|  15.9k|# define OSSL_PKEY_PARAM_EC_PUB_X "qx"
  ------------------
  145|  15.9k|            py = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_EC_PUB_Y);
  ------------------
  |  |  361|  15.9k|# define OSSL_PKEY_PARAM_EC_PUB_Y "qy"
  ------------------
  146|  15.9k|        }
  147|       |
  148|  15.9k|        if (p != NULL || tmpl != NULL) {
  ------------------
  |  Branch (148:13): [True: 0, False: 15.9k]
  |  Branch (148:26): [True: 0, False: 15.9k]
  ------------------
  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,
  ------------------
  |  |  393|      0|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  157|      0|                                                      *pub_key, pub_key_len))
  158|      0|                goto err;
  159|      0|        }
  160|  15.9k|        if (px != NULL || py != NULL) {
  ------------------
  |  Branch (160:13): [True: 0, False: 15.9k]
  |  Branch (160:27): [True: 0, False: 15.9k]
  ------------------
  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))
  ------------------
  |  |  360|      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))
  ------------------
  |  |  361|      0|# define OSSL_PKEY_PARAM_EC_PUB_Y "qy"
  ------------------
  181|      0|                goto err;
  182|      0|        }
  183|  15.9k|    }
  184|       |
  185|  15.9k|    if (priv_key != NULL && include_private) {
  ------------------
  |  Branch (185:9): [True: 0, False: 15.9k]
  |  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,
  ------------------
  |  |  391|      0|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  229|      0|                                         priv_key, sz))
  230|      0|            goto err;
  231|      0|    }
  232|  15.9k|    ret = 1;
  233|  15.9k| err:
  234|  15.9k|    BN_CTX_free(bnctx);
  235|  15.9k|    return ret;
  236|  15.9k|}
ec_kmgmt.c:otherparams_to_params:
  241|  15.9k|{
  242|  15.9k|    int ecdh_cofactor_mode = 0, group_check = 0;
  243|  15.9k|    const char *name = NULL;
  244|  15.9k|    point_conversion_form_t format;
  245|       |
  246|  15.9k|    if (ec == NULL)
  ------------------
  |  Branch (246:9): [True: 0, False: 15.9k]
  ------------------
  247|      0|        return 0;
  248|       |
  249|  15.9k|    format = EC_KEY_get_conv_form(ec);
  250|  15.9k|    name = ossl_ec_pt_format_id2name((int)format);
  251|  15.9k|    if (name != NULL
  ------------------
  |  Branch (251:9): [True: 15.5k, False: 328]
  ------------------
  252|  15.9k|        && !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (252:12): [True: 0, False: 15.5k]
  ------------------
  253|  15.5k|                                             OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT,
  ------------------
  |  |  359|  15.5k|# define OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT "point-format"
  ------------------
  254|  15.5k|                                             name))
  255|      0|        return 0;
  256|       |
  257|  15.9k|    group_check = EC_KEY_get_flags(ec) & EC_FLAG_CHECK_NAMED_GROUP_MASK;
  ------------------
  |  |  967|  15.9k|    (EC_FLAG_CHECK_NAMED_GROUP | EC_FLAG_CHECK_NAMED_GROUP_NIST)
  |  |  ------------------
  |  |  |  |  964|  15.9k|#  define EC_FLAG_CHECK_NAMED_GROUP      0x2000
  |  |  ------------------
  |  |                   (EC_FLAG_CHECK_NAMED_GROUP | EC_FLAG_CHECK_NAMED_GROUP_NIST)
  |  |  ------------------
  |  |  |  |  965|  15.9k|#  define EC_FLAG_CHECK_NAMED_GROUP_NIST 0x4000
  |  |  ------------------
  ------------------
  258|  15.9k|    name = ossl_ec_check_group_type_id2name(group_check);
  259|  15.9k|    if (name != NULL
  ------------------
  |  Branch (259:9): [True: 15.9k, False: 0]
  ------------------
  260|  15.9k|        && !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (260:12): [True: 0, False: 15.9k]
  ------------------
  261|  15.9k|                                             OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE,
  ------------------
  |  |  355|  15.9k|# define OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE "group-check"
  ------------------
  262|  15.9k|                                             name))
  263|      0|        return 0;
  264|       |
  265|  15.9k|    if ((EC_KEY_get_enc_flags(ec) & EC_PKEY_NO_PUBKEY) != 0
  ------------------
  |  |  959|  15.9k|#  define EC_PKEY_NO_PUBKEY       0x002
  ------------------
  |  Branch (265:9): [True: 0, False: 15.9k]
  ------------------
  266|  15.9k|            && !ossl_param_build_set_int(tmpl, params,
  ------------------
  |  Branch (266:16): [True: 0, False: 0]
  ------------------
  267|      0|                                         OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 0))
  ------------------
  |  |  356|      0|# define OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC "include-public"
  ------------------
  268|      0|        return 0;
  269|       |
  270|  15.9k|    ecdh_cofactor_mode =
  271|  15.9k|        (EC_KEY_get_flags(ec) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0;
  ------------------
  |  |  963|  15.9k|#  define EC_FLAG_COFACTOR_ECDH          0x1000
  ------------------
  |  Branch (271:9): [True: 0, False: 15.9k]
  ------------------
  272|  15.9k|    return ossl_param_build_set_int(tmpl, params,
  273|  15.9k|                                    OSSL_PKEY_PARAM_USE_COFACTOR_ECDH,
  ------------------
  |  |  448|  15.9k|# define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH OSSL_PKEY_PARAM_USE_COFACTOR_FLAG
  |  |  ------------------
  |  |  |  |  449|  15.9k|# define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag"
  |  |  ------------------
  ------------------
  274|  15.9k|                                    ecdh_cofactor_mode);
  275|  15.9k|}

rsa_kmgmt.c:rsa_load:
  673|      6|{
  674|      6|    return common_load(reference, reference_sz, RSA_FLAG_TYPE_RSA);
  ------------------
  |  |  118|      6|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  675|      6|}
rsa_kmgmt.c:common_load:
  655|     14|{
  656|     14|    RSA *rsa = NULL;
  657|       |
  658|     14|    if (ossl_prov_is_running() && reference_sz == sizeof(rsa)) {
  ------------------
  |  Branch (658:9): [True: 14, False: 0]
  |  Branch (658:35): [True: 14, False: 0]
  ------------------
  659|       |        /* The contents of the reference is the address to our object */
  660|     14|        rsa = *(RSA **)reference;
  661|       |
  662|     14|        if (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK) != expected_rsa_type)
  ------------------
  |  |  117|     14|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  |  Branch (662:13): [True: 0, False: 14]
  ------------------
  663|      0|            return NULL;
  664|       |
  665|       |        /* We grabbed, so we detach it */
  666|     14|        *(RSA **)reference = NULL;
  667|     14|        return rsa;
  668|     14|    }
  669|      0|    return NULL;
  670|     14|}
rsa_kmgmt.c:rsa_freedata:
  111|     14|{
  112|     14|    RSA_free(keydata);
  113|     14|}
rsa_kmgmt.c:rsa_get_params:
  331|     14|{
  332|     14|    RSA *rsa = key;
  333|     14|    const RSA_PSS_PARAMS_30 *pss_params = ossl_rsa_get0_pss_params_30(rsa);
  334|     14|    int rsa_type = RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK);
  ------------------
  |  |  117|     14|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  335|     14|    OSSL_PARAM *p;
  336|     14|    int empty = RSA_get0_n(rsa) == NULL;
  337|       |
  338|     14|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  333|     14|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (338:9): [True: 14, False: 0]
  ------------------
  339|     14|        && (empty || !OSSL_PARAM_set_int(p, RSA_bits(rsa))))
  ------------------
  |  Branch (339:13): [True: 0, False: 14]
  |  Branch (339:22): [True: 0, False: 14]
  ------------------
  340|      0|        return 0;
  341|     14|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  447|     14|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (341:9): [True: 14, False: 0]
  ------------------
  342|     14|        && (empty || !OSSL_PARAM_set_int(p, RSA_security_bits(rsa))))
  ------------------
  |  Branch (342:13): [True: 0, False: 14]
  |  Branch (342:22): [True: 0, False: 14]
  ------------------
  343|      0|        return 0;
  344|     14|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  387|     14|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (344:9): [True: 14, False: 0]
  ------------------
  345|     14|        && (empty || !OSSL_PARAM_set_int(p, RSA_size(rsa))))
  ------------------
  |  Branch (345:13): [True: 0, False: 14]
  |  Branch (345:22): [True: 0, False: 14]
  ------------------
  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|     14|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  335|     14|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (352:9): [True: 0, False: 14]
  ------------------
  353|     14|        && (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|     14|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (363:9): [True: 0, False: 14]
  ------------------
  364|     14|                               OSSL_PKEY_PARAM_MANDATORY_DIGEST)) != NULL
  ------------------
  |  |  385|     14|# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
  ------------------
  365|     14|        && rsa_type == RSA_FLAG_TYPE_RSASSAPSS
  ------------------
  |  |  119|     14|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (365:12): [True: 0, False: 0]
  ------------------
  366|     14|        && !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|     14|    return (rsa_type != RSA_FLAG_TYPE_RSASSAPSS
  ------------------
  |  |  119|     28|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (373:13): [True: 6, False: 8]
  ------------------
  374|     14|            || ossl_rsa_pss_params_30_todata(pss_params, NULL, params))
  ------------------
  |  Branch (374:16): [True: 8, False: 0]
  ------------------
  375|     14|        && ossl_rsa_todata(rsa, NULL, params, 1);
  ------------------
  |  Branch (375:12): [True: 14, False: 0]
  ------------------
  376|     14|}
rsa_kmgmt.c:rsapss_load:
  678|      8|{
  679|      8|    return common_load(reference, reference_sz, RSA_FLAG_TYPE_RSASSAPSS);
  ------------------
  |  |  119|      8|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  680|      8|}

ossl_drbg_lock:
   55|  41.1k|{
   56|  41.1k|    return 1;
   57|  41.1k|}
ossl_drbg_unlock:
   61|  41.1k|{
   62|  41.1k|}
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);
  ------------------
  |  |  123|      2|        CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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);
  ------------------
  |  |  129|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  129|      2|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  191|      2|}
ossl_prov_drbg_nonce_ctx_new:
  282|      2|{
  283|      2|    PROV_DRBG_NONCE_GLOBAL *dngbl = OPENSSL_zalloc(sizeof(*dngbl));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  284|       |
  285|      2|    if (dngbl == NULL)
  ------------------
  |  Branch (285:9): [True: 0, False: 2]
  ------------------
  286|      0|        return NULL;
  287|       |
  288|      2|    dngbl->rand_nonce_lock = CRYPTO_THREAD_lock_new();
  289|      2|    if (dngbl->rand_nonce_lock == NULL) {
  ------------------
  |  Branch (289:9): [True: 0, False: 2]
  ------------------
  290|      0|        OPENSSL_free(dngbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  291|      0|        return NULL;
  292|      0|    }
  293|       |
  294|      2|    return dngbl;
  295|      2|}
ossl_prov_drbg_nonce_ctx_free:
  298|      2|{
  299|      2|    PROV_DRBG_NONCE_GLOBAL *dngbl = vdngbl;
  300|       |
  301|      2|    if (dngbl == NULL)
  ------------------
  |  Branch (301:9): [True: 0, False: 2]
  ------------------
  302|      0|        return;
  303|       |
  304|      2|    CRYPTO_THREAD_lock_free(dngbl->rand_nonce_lock);
  305|       |
  306|      2|    OPENSSL_free(dngbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  307|      2|}
ossl_prov_drbg_instantiate:
  362|      2|{
  363|      2|    unsigned char *nonce = NULL, *entropy = NULL;
  364|      2|    size_t noncelen = 0, entropylen = 0;
  365|      2|    size_t min_entropy, min_entropylen, max_entropylen;
  366|       |
  367|      2|    if (strength > drbg->strength) {
  ------------------
  |  Branch (367:9): [True: 0, False: 2]
  ------------------
  368|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  369|      0|        goto end;
  370|      0|    }
  371|      2|    min_entropy = drbg->strength;
  372|      2|    min_entropylen = drbg->min_entropylen;
  373|      2|    max_entropylen = drbg->max_entropylen;
  374|       |
  375|      2|    if (pers == NULL) {
  ------------------
  |  Branch (375:9): [True: 2, False: 0]
  ------------------
  376|      2|        pers = (const unsigned char *)ossl_pers_string;
  377|      2|        perslen = sizeof(ossl_pers_string);
  378|      2|    }
  379|      2|    if (perslen > drbg->max_perslen) {
  ------------------
  |  Branch (379:9): [True: 0, False: 2]
  ------------------
  380|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  381|      0|        goto end;
  382|      0|    }
  383|       |
  384|      2|    if (drbg->state != EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1297|      2|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
  |  Branch (384:9): [True: 0, False: 2]
  ------------------
  385|      0|        if (drbg->state == EVP_RAND_STATE_ERROR)
  ------------------
  |  | 1299|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  |  Branch (385:13): [True: 0, False: 0]
  ------------------
  386|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  387|      0|        else
  388|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  389|      0|        goto end;
  390|      0|    }
  391|       |
  392|      2|    drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1299|      2|# define EVP_RAND_STATE_ERROR            2
  ------------------
  393|       |
  394|      2|    if (drbg->min_noncelen > 0) {
  ------------------
  |  Branch (394:9): [True: 1, False: 1]
  ------------------
  395|      1|        if (drbg->parent_nonce != NULL) {
  ------------------
  |  Branch (395:13): [True: 0, False: 1]
  ------------------
  396|      0|            noncelen = drbg->parent_nonce(drbg->parent, NULL, drbg->strength,
  397|      0|                                          drbg->min_noncelen,
  398|      0|                                          drbg->max_noncelen);
  399|      0|            if (noncelen == 0) {
  ------------------
  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  401|      0|                goto end;
  402|      0|            }
  403|      0|            nonce = OPENSSL_malloc(noncelen);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  404|      0|            if (nonce == NULL) {
  ------------------
  |  Branch (404:17): [True: 0, False: 0]
  ------------------
  405|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  406|      0|                goto end;
  407|      0|            }
  408|      0|            if (noncelen != drbg->parent_nonce(drbg->parent, nonce,
  ------------------
  |  Branch (408:17): [True: 0, False: 0]
  ------------------
  409|      0|                                               drbg->strength,
  410|      0|                                               drbg->min_noncelen,
  411|      0|                                               drbg->max_noncelen)) {
  412|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  413|      0|                goto end;
  414|      0|            }
  415|      0|#ifndef PROV_RAND_GET_RANDOM_NONCE
  416|      1|        } else if (drbg->parent != NULL) {
  ------------------
  |  Branch (416:20): [True: 1, False: 0]
  ------------------
  417|      1|#endif
  418|       |            /*
  419|       |             * NIST SP800-90Ar1 section 9.1 says you can combine getting
  420|       |             * the entropy and nonce in 1 call by increasing the entropy
  421|       |             * with 50% and increasing the minimum length to accommodate
  422|       |             * the length of the nonce. We do this in case a nonce is
  423|       |             * required and there is no parental nonce capability.
  424|       |             */
  425|      1|            min_entropy += drbg->strength / 2;
  426|      1|            min_entropylen += drbg->min_noncelen;
  427|      1|            max_entropylen += drbg->max_noncelen;
  428|      1|        }
  429|      0|#ifndef PROV_RAND_GET_RANDOM_NONCE
  430|      0|        else { /* parent == NULL */
  431|      0|            noncelen = prov_drbg_get_nonce(drbg, &nonce, drbg->min_noncelen,
  432|      0|                                           drbg->max_noncelen);
  433|      0|            if (noncelen < drbg->min_noncelen
  ------------------
  |  Branch (433:17): [True: 0, False: 0]
  ------------------
  434|      0|                    || noncelen > drbg->max_noncelen) {
  ------------------
  |  Branch (434:24): [True: 0, False: 0]
  ------------------
  435|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  436|      0|                goto end;
  437|      0|            }
  438|      0|        }
  439|      1|#endif
  440|      1|    }
  441|       |
  442|      2|    drbg->reseed_next_counter = tsan_load(&drbg->reseed_counter);
  ------------------
  |  |   61|      2|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  443|      2|    if (drbg->reseed_next_counter) {
  ------------------
  |  Branch (443:9): [True: 2, False: 0]
  ------------------
  444|      2|        drbg->reseed_next_counter++;
  445|      2|        if (!drbg->reseed_next_counter)
  ------------------
  |  Branch (445:13): [True: 0, False: 2]
  ------------------
  446|      0|            drbg->reseed_next_counter = 1;
  447|      2|    }
  448|       |
  449|      2|    entropylen = get_entropy(drbg, &entropy, min_entropy,
  450|      2|                             min_entropylen, max_entropylen,
  451|      2|                             prediction_resistance);
  452|      2|    if (entropylen < min_entropylen
  ------------------
  |  Branch (452:9): [True: 0, False: 2]
  ------------------
  453|      2|            || entropylen > max_entropylen) {
  ------------------
  |  Branch (453:16): [True: 0, False: 2]
  ------------------
  454|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  455|      0|        goto end;
  456|      0|    }
  457|       |
  458|      2|    if (!drbg->instantiate(drbg, entropy, entropylen, nonce, noncelen,
  ------------------
  |  Branch (458:9): [True: 0, False: 2]
  ------------------
  459|      2|                           pers, perslen)) {
  460|      0|        cleanup_entropy(drbg, entropy, entropylen);
  461|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  462|      0|        goto end;
  463|      0|    }
  464|      2|    cleanup_entropy(drbg, entropy, entropylen);
  465|       |
  466|      2|    drbg->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1298|      2|# define EVP_RAND_STATE_READY            1
  ------------------
  467|      2|    drbg->generate_counter = 1;
  468|      2|    drbg->reseed_time = time(NULL);
  469|      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)
  ------------------
  470|       |
  471|      2| end:
  472|      2|    if (nonce != NULL)
  ------------------
  |  Branch (472:9): [True: 0, False: 2]
  ------------------
  473|      0|        ossl_prov_cleanup_nonce(drbg->provctx, nonce, noncelen);
  474|      2|    if (drbg->state == EVP_RAND_STATE_READY)
  ------------------
  |  | 1298|      2|# define EVP_RAND_STATE_READY            1
  ------------------
  |  Branch (474:9): [True: 2, False: 0]
  ------------------
  475|      2|        return 1;
  476|      0|    return 0;
  477|      2|}
ossl_prov_drbg_generate:
  637|  20.5k|{
  638|  20.5k|    int fork_id;
  639|  20.5k|    int reseed_required = 0;
  640|  20.5k|    int ret = 0;
  641|       |
  642|  20.5k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (642:9): [True: 0, False: 20.5k]
  ------------------
  643|      0|        return 0;
  644|       |
  645|  20.5k|    if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  ------------------
  |  Branch (645:9): [True: 2, False: 20.5k]
  |  Branch (645:31): [True: 0, False: 2]
  ------------------
  646|      0|        return 0;
  647|       |
  648|  20.5k|    if (drbg->state != EVP_RAND_STATE_READY) {
  ------------------
  |  | 1298|  20.5k|# define EVP_RAND_STATE_READY            1
  ------------------
  |  Branch (648:9): [True: 0, False: 20.5k]
  ------------------
  649|       |        /* try to recover from previous errors */
  650|      0|        rand_drbg_restart(drbg);
  651|       |
  652|      0|        if (drbg->state == EVP_RAND_STATE_ERROR) {
  ------------------
  |  | 1299|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  |  Branch (652:13): [True: 0, False: 0]
  ------------------
  653|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  654|      0|            goto err;
  655|      0|        }
  656|      0|        if (drbg->state == EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1297|      0|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
  |  Branch (656:13): [True: 0, False: 0]
  ------------------
  657|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  658|      0|            goto err;
  659|      0|        }
  660|      0|    }
  661|  20.5k|    if (strength > drbg->strength) {
  ------------------
  |  Branch (661:9): [True: 0, False: 20.5k]
  ------------------
  662|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  663|      0|        goto err;
  664|      0|    }
  665|       |
  666|  20.5k|    if (outlen > drbg->max_request) {
  ------------------
  |  Branch (666:9): [True: 0, False: 20.5k]
  ------------------
  667|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  668|      0|        goto err;
  669|      0|    }
  670|  20.5k|    if (adinlen > drbg->max_adinlen) {
  ------------------
  |  Branch (670:9): [True: 0, False: 20.5k]
  ------------------
  671|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  672|      0|        goto err;
  673|      0|    }
  674|       |
  675|  20.5k|    fork_id = openssl_get_fork_id();
  676|       |
  677|  20.5k|    if (drbg->fork_id != fork_id) {
  ------------------
  |  Branch (677:9): [True: 0, False: 20.5k]
  ------------------
  678|      0|        drbg->fork_id = fork_id;
  679|      0|        reseed_required = 1;
  680|      0|    }
  681|       |
  682|  20.5k|    if (drbg->reseed_interval > 0) {
  ------------------
  |  Branch (682:9): [True: 20.5k, False: 0]
  ------------------
  683|  20.5k|        if (drbg->generate_counter >= drbg->reseed_interval)
  ------------------
  |  Branch (683:13): [True: 0, False: 20.5k]
  ------------------
  684|      0|            reseed_required = 1;
  685|  20.5k|    }
  686|  20.5k|    if (drbg->reseed_time_interval > 0) {
  ------------------
  |  Branch (686:9): [True: 20.5k, False: 0]
  ------------------
  687|  20.5k|        time_t now = time(NULL);
  688|  20.5k|        if (now < drbg->reseed_time
  ------------------
  |  Branch (688:13): [True: 0, False: 20.5k]
  ------------------
  689|  20.5k|            || now - drbg->reseed_time >= drbg->reseed_time_interval)
  ------------------
  |  Branch (689:16): [True: 0, False: 20.5k]
  ------------------
  690|      0|            reseed_required = 1;
  691|  20.5k|    }
  692|  20.5k|    if (drbg->parent != NULL
  ------------------
  |  Branch (692:9): [True: 20.5k, False: 0]
  ------------------
  693|  20.5k|            && get_parent_reseed_count(drbg) != drbg->parent_reseed_counter)
  ------------------
  |  Branch (693:16): [True: 1, False: 20.5k]
  ------------------
  694|      1|        reseed_required = 1;
  695|       |
  696|  20.5k|    if (reseed_required || prediction_resistance) {
  ------------------
  |  Branch (696:9): [True: 1, False: 20.5k]
  |  Branch (696:28): [True: 0, False: 20.5k]
  ------------------
  697|      1|        if (!ossl_prov_drbg_reseed_unlocked(drbg, prediction_resistance, NULL,
  ------------------
  |  Branch (697:13): [True: 0, False: 1]
  ------------------
  698|      1|                                            0, adin, adinlen)) {
  699|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  700|      0|            goto err;
  701|      0|        }
  702|      1|        adin = NULL;
  703|      1|        adinlen = 0;
  704|      1|    }
  705|       |
  706|  20.5k|    if (!drbg->generate(drbg, out, outlen, adin, adinlen)) {
  ------------------
  |  Branch (706:9): [True: 0, False: 20.5k]
  ------------------
  707|      0|        drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1299|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  708|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  709|      0|        goto err;
  710|      0|    }
  711|       |
  712|  20.5k|    drbg->generate_counter++;
  713|       |
  714|  20.5k|    ret = 1;
  715|  20.5k| err:
  716|  20.5k|    if (drbg->lock != NULL)
  ------------------
  |  Branch (716:9): [True: 2, False: 20.5k]
  ------------------
  717|      2|        CRYPTO_THREAD_unlock(drbg->lock);
  718|       |
  719|  20.5k|    return ret;
  720|  20.5k|}
ossl_drbg_enable_locking:
  767|      1|{
  768|      1|    PROV_DRBG *drbg = vctx;
  769|       |
  770|      1|    if (drbg != NULL && drbg->lock == NULL) {
  ------------------
  |  Branch (770:9): [True: 1, False: 0]
  |  Branch (770:25): [True: 1, False: 0]
  ------------------
  771|      1|        if (drbg->parent_enable_locking != NULL)
  ------------------
  |  Branch (771:13): [True: 1, False: 0]
  ------------------
  772|      1|            if (!drbg->parent_enable_locking(drbg->parent)) {
  ------------------
  |  Branch (772:17): [True: 0, False: 1]
  ------------------
  773|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  774|      0|                return 0;
  775|      0|            }
  776|      1|        drbg->lock = CRYPTO_THREAD_lock_new();
  777|      1|        if (drbg->lock == NULL) {
  ------------------
  |  Branch (777:13): [True: 0, False: 1]
  ------------------
  778|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  779|      0|            return 0;
  780|      0|        }
  781|      1|    }
  782|      1|    return 1;
  783|      1|}
ossl_rand_drbg_new:
  806|      2|{
  807|      2|    PROV_DRBG *drbg;
  808|      2|    unsigned int p_str;
  809|      2|    const OSSL_DISPATCH *pfunc;
  810|       |
  811|      2|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (811:9): [True: 0, False: 2]
  ------------------
  812|      0|        return NULL;
  813|       |
  814|      2|    drbg = OPENSSL_zalloc(sizeof(*drbg));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  815|      2|    if (drbg == NULL)
  ------------------
  |  Branch (815:9): [True: 0, False: 2]
  ------------------
  816|      0|        return NULL;
  817|       |
  818|      2|    drbg->provctx = provctx;
  819|      2|    drbg->instantiate = instantiate;
  820|      2|    drbg->uninstantiate = uninstantiate;
  821|      2|    drbg->reseed = reseed;
  822|      2|    drbg->generate = generate;
  823|      2|    drbg->fork_id = openssl_get_fork_id();
  824|       |
  825|       |    /* Extract parent's functions */
  826|      2|    drbg->parent = parent;
  827|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_ENABLE_LOCKING)) != NULL)
  ------------------
  |  |  469|      2|# define OSSL_FUNC_RAND_ENABLE_LOCKING                8
  ------------------
  |  Branch (827:9): [True: 2, False: 0]
  ------------------
  828|      2|        drbg->parent_enable_locking = OSSL_FUNC_rand_enable_locking(pfunc);
  829|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_LOCK)) != NULL)
  ------------------
  |  |  470|      2|# define OSSL_FUNC_RAND_LOCK                          9
  ------------------
  |  Branch (829:9): [True: 2, False: 0]
  ------------------
  830|      2|        drbg->parent_lock = OSSL_FUNC_rand_lock(pfunc);
  831|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_UNLOCK)) != NULL)
  ------------------
  |  |  471|      2|# define OSSL_FUNC_RAND_UNLOCK                       10
  ------------------
  |  Branch (831:9): [True: 2, False: 0]
  ------------------
  832|      2|        drbg->parent_unlock = OSSL_FUNC_rand_unlock(pfunc);
  833|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_GET_CTX_PARAMS)) != NULL)
  ------------------
  |  |  476|      2|# define OSSL_FUNC_RAND_GET_CTX_PARAMS               15
  ------------------
  |  Branch (833:9): [True: 2, False: 0]
  ------------------
  834|      2|        drbg->parent_get_ctx_params = OSSL_FUNC_rand_get_ctx_params(pfunc);
  835|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_NONCE)) != NULL)
  ------------------
  |  |  468|      2|# define OSSL_FUNC_RAND_NONCE                         7
  ------------------
  |  Branch (835:9): [True: 0, False: 2]
  ------------------
  836|      0|        drbg->parent_nonce = OSSL_FUNC_rand_nonce(pfunc);
  837|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_GET_SEED)) != NULL)
  ------------------
  |  |  479|      2|# define OSSL_FUNC_RAND_GET_SEED                     18
  ------------------
  |  Branch (837:9): [True: 2, False: 0]
  ------------------
  838|      2|        drbg->parent_get_seed = OSSL_FUNC_rand_get_seed(pfunc);
  839|      2|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_CLEAR_SEED)) != NULL)
  ------------------
  |  |  480|      2|# define OSSL_FUNC_RAND_CLEAR_SEED                   19
  ------------------
  |  Branch (839:9): [True: 2, False: 0]
  ------------------
  840|      2|        drbg->parent_clear_seed = OSSL_FUNC_rand_clear_seed(pfunc);
  841|       |
  842|       |    /* Set some default maximums up */
  843|      2|    drbg->max_entropylen = DRBG_MAX_LENGTH;
  ------------------
  |  |   51|      2|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  844|      2|    drbg->max_noncelen = DRBG_MAX_LENGTH;
  ------------------
  |  |   51|      2|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  845|      2|    drbg->max_perslen = DRBG_MAX_LENGTH;
  ------------------
  |  |   51|      2|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  846|      2|    drbg->max_adinlen = DRBG_MAX_LENGTH;
  ------------------
  |  |   51|      2|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  847|      2|    drbg->generate_counter = 1;
  848|      2|    drbg->reseed_counter = 1;
  849|      2|    drbg->reseed_interval = RESEED_INTERVAL;
  ------------------
  |  |   31|      2|# define RESEED_INTERVAL                         (1 << 8)
  ------------------
  850|      2|    drbg->reseed_time_interval = TIME_INTERVAL;
  ------------------
  |  |   32|      2|# define TIME_INTERVAL                           (60*60)   /* 1 hour */
  ------------------
  851|       |
  852|      2|    if (!dnew(drbg))
  ------------------
  |  Branch (852:9): [True: 0, False: 2]
  ------------------
  853|      0|        goto err;
  854|       |
  855|      2|    if (parent != NULL) {
  ------------------
  |  Branch (855:9): [True: 2, False: 0]
  ------------------
  856|      2|        if (!get_parent_strength(drbg, &p_str))
  ------------------
  |  Branch (856:13): [True: 0, False: 2]
  ------------------
  857|      0|            goto err;
  858|      2|        if (drbg->strength > p_str) {
  ------------------
  |  Branch (858:13): [True: 0, False: 2]
  ------------------
  859|       |            /*
  860|       |             * We currently don't support the algorithm from NIST SP 800-90C
  861|       |             * 10.1.2 to use a weaker DRBG as source
  862|       |             */
  863|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  864|      0|            goto err;
  865|      0|        }
  866|      2|    }
  867|       |#ifdef TSAN_REQUIRES_LOCKING
  868|       |    if (!ossl_drbg_enable_locking(drbg))
  869|       |        goto err;
  870|       |#endif
  871|      2|    return drbg;
  872|       |
  873|      0| err:
  874|      0|    dfree(drbg);
  875|      0|    return NULL;
  876|      2|}
ossl_rand_drbg_free:
  879|      2|{
  880|      2|    if (drbg == NULL)
  ------------------
  |  Branch (880:9): [True: 0, False: 2]
  ------------------
  881|      0|        return;
  882|       |
  883|      2|    CRYPTO_THREAD_lock_free(drbg->lock);
  884|      2|    OPENSSL_free(drbg);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  885|      2|}
ossl_drbg_get_ctx_params:
  892|      3|{
  893|      3|    OSSL_PARAM *p;
  894|       |
  895|      3|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
  ------------------
  |  |  475|      3|# define OSSL_RAND_PARAM_STATE "state"
  ------------------
  896|      3|    if (p != NULL && !OSSL_PARAM_set_int(p, drbg->state))
  ------------------
  |  Branch (896:9): [True: 0, False: 3]
  |  Branch (896:22): [True: 0, False: 0]
  ------------------
  897|      0|        return 0;
  898|       |
  899|      3|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
  ------------------
  |  |  476|      3|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
  900|      3|    if (p != NULL && !OSSL_PARAM_set_int(p, drbg->strength))
  ------------------
  |  Branch (900:9): [True: 3, False: 0]
  |  Branch (900:22): [True: 0, False: 3]
  ------------------
  901|      0|        return 0;
  902|       |
  903|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MIN_ENTROPYLEN);
  ------------------
  |  |  218|      3|# define OSSL_DRBG_PARAM_MIN_ENTROPYLEN "min_entropylen"
  ------------------
  904|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->min_entropylen))
  ------------------
  |  Branch (904:9): [True: 0, False: 3]
  |  Branch (904:22): [True: 0, False: 0]
  ------------------
  905|      0|        return 0;
  906|       |
  907|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_ENTROPYLEN);
  ------------------
  |  |  214|      3|# define OSSL_DRBG_PARAM_MAX_ENTROPYLEN "max_entropylen"
  ------------------
  908|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_entropylen))
  ------------------
  |  Branch (908:9): [True: 0, False: 3]
  |  Branch (908:22): [True: 0, False: 0]
  ------------------
  909|      0|        return 0;
  910|       |
  911|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MIN_NONCELEN);
  ------------------
  |  |  220|      3|# define OSSL_DRBG_PARAM_MIN_NONCELEN "min_noncelen"
  ------------------
  912|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->min_noncelen))
  ------------------
  |  Branch (912:9): [True: 0, False: 3]
  |  Branch (912:22): [True: 0, False: 0]
  ------------------
  913|      0|        return 0;
  914|       |
  915|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_NONCELEN);
  ------------------
  |  |  216|      3|# define OSSL_DRBG_PARAM_MAX_NONCELEN "max_noncelen"
  ------------------
  916|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_noncelen))
  ------------------
  |  Branch (916:9): [True: 0, False: 3]
  |  Branch (916:22): [True: 0, False: 0]
  ------------------
  917|      0|        return 0;
  918|       |
  919|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_PERSLEN);
  ------------------
  |  |  217|      3|# define OSSL_DRBG_PARAM_MAX_PERSLEN "max_perslen"
  ------------------
  920|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_perslen))
  ------------------
  |  Branch (920:9): [True: 0, False: 3]
  |  Branch (920:22): [True: 0, False: 0]
  ------------------
  921|      0|        return 0;
  922|       |
  923|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_ADINLEN);
  ------------------
  |  |  213|      3|# define OSSL_DRBG_PARAM_MAX_ADINLEN "max_adinlen"
  ------------------
  924|      3|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_adinlen))
  ------------------
  |  Branch (924:9): [True: 0, False: 3]
  |  Branch (924:22): [True: 0, False: 0]
  ------------------
  925|      0|        return 0;
  926|       |
  927|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_REQUESTS);
  ------------------
  |  |  225|      3|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  928|      3|    if (p != NULL && !OSSL_PARAM_set_uint(p, drbg->reseed_interval))
  ------------------
  |  Branch (928:9): [True: 0, False: 3]
  |  Branch (928:22): [True: 0, False: 0]
  ------------------
  929|      0|        return 0;
  930|       |
  931|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_TIME);
  ------------------
  |  |  226|      3|# define OSSL_DRBG_PARAM_RESEED_TIME "reseed_time"
  ------------------
  932|      3|    if (p != NULL && !OSSL_PARAM_set_time_t(p, drbg->reseed_time))
  ------------------
  |  Branch (932:9): [True: 0, False: 3]
  |  Branch (932:22): [True: 0, False: 0]
  ------------------
  933|      0|        return 0;
  934|       |
  935|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL);
  ------------------
  |  |  227|      3|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  936|      3|    if (p != NULL && !OSSL_PARAM_set_time_t(p, drbg->reseed_time_interval))
  ------------------
  |  Branch (936:9): [True: 0, False: 3]
  |  Branch (936:22): [True: 0, False: 0]
  ------------------
  937|      0|        return 0;
  938|      3|    if (!OSSL_FIPS_IND_GET_CTX_PARAM(drbg, params))
  ------------------
  |  |  141|      3|# define OSSL_FIPS_IND_GET_CTX_PARAM(ctx, params) 1
  ------------------
  |  Branch (938:9): [Folded - Ignored]
  ------------------
  939|      0|        return 0;
  940|      3|    return 1;
  941|      3|}
ossl_drbg_get_ctx_params_no_lock:
  949|  41.1k|{
  950|  41.1k|    size_t cnt = 0;
  951|  41.1k|    OSSL_PARAM *p;
  952|       |
  953|       |    /* This value never changes once set */
  954|  41.1k|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
  ------------------
  |  |  474|  41.1k|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  955|  41.1k|    if (p != NULL) {
  ------------------
  |  Branch (955:9): [True: 20.5k, False: 20.5k]
  ------------------
  956|  20.5k|        if (!OSSL_PARAM_set_size_t(p, drbg->max_request))
  ------------------
  |  Branch (956:13): [True: 0, False: 20.5k]
  ------------------
  957|      0|            return 0;
  958|  20.5k|        cnt++;
  959|  20.5k|    }
  960|       |
  961|       |    /*
  962|       |     * Can be changed by multiple threads, but we tolerate inaccuracies in this
  963|       |     * value.
  964|       |     */
  965|  41.1k|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_COUNTER);
  ------------------
  |  |  224|  41.1k|# define OSSL_DRBG_PARAM_RESEED_COUNTER "reseed_counter"
  ------------------
  966|  41.1k|    if (p != NULL) {
  ------------------
  |  Branch (966:9): [True: 20.5k, False: 20.5k]
  ------------------
  967|  20.5k|        if (!OSSL_PARAM_set_uint(p, tsan_load(&drbg->reseed_counter)))
  ------------------
  |  |   61|  20.5k|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (967:13): [True: 0, False: 20.5k]
  ------------------
  968|      0|            return 0;
  969|  20.5k|        cnt++;
  970|  20.5k|    }
  971|       |
  972|  41.1k|    if (params[cnt].key == NULL)
  ------------------
  |  Branch (972:9): [True: 41.1k, False: 3]
  ------------------
  973|  41.1k|        *complete = 1;
  974|      3|    else
  975|      3|        *complete = 0;
  976|       |
  977|  41.1k|    return 1;
  978|  41.1k|}
ossl_drbg_set_ctx_params:
  981|      2|{
  982|      2|    const OSSL_PARAM *p;
  983|       |
  984|      2|    if (params == NULL)
  ------------------
  |  Branch (984:9): [True: 0, False: 2]
  ------------------
  985|      0|        return 1;
  986|       |
  987|      2|    p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_RESEED_REQUESTS);
  ------------------
  |  |  225|      2|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  988|      2|    if (p != NULL && !OSSL_PARAM_get_uint(p, &drbg->reseed_interval))
  ------------------
  |  Branch (988:9): [True: 2, False: 0]
  |  Branch (988:22): [True: 0, False: 2]
  ------------------
  989|      0|        return 0;
  990|       |
  991|      2|    p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL);
  ------------------
  |  |  227|      2|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  992|      2|    if (p != NULL && !OSSL_PARAM_get_time_t(p, &drbg->reseed_time_interval))
  ------------------
  |  Branch (992:9): [True: 2, False: 0]
  |  Branch (992:22): [True: 0, False: 2]
  ------------------
  993|      0|        return 0;
  994|       |
  995|      2|    return 1;
  996|      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|       |        /*
  206|       |         * In normal use (i.e. OpenSSL's own uses), this is never called.
  207|       |         * Outside of the FIPS provider, OpenSSL sets its DRBGs up so that
  208|       |         * they always have a parent.  This remains purely for legacy reasons.
  209|       |         */
  210|      0|        return ossl_prov_get_entropy(drbg->provctx, pout, entropy, min_len,
  211|      0|                                     max_len);
  212|      3|#endif
  213|       |
  214|      3|    if (drbg->parent_get_seed == NULL) {
  ------------------
  |  Branch (214:9): [True: 0, False: 3]
  ------------------
  215|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  216|      0|        return 0;
  217|      0|    }
  218|      3|    if (!get_parent_strength(drbg, &p_str))
  ------------------
  |  Branch (218:9): [True: 0, False: 3]
  ------------------
  219|      0|        return 0;
  220|      3|    if (drbg->strength > p_str) {
  ------------------
  |  Branch (220:9): [True: 0, False: 3]
  ------------------
  221|       |        /*
  222|       |         * We currently don't support the algorithm from NIST SP 800-90C
  223|       |         * 10.1.2 to use a weaker DRBG as source
  224|       |         */
  225|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  226|      0|        return 0;
  227|      0|    }
  228|       |
  229|       |    /*
  230|       |     * Our lock is already held, but we need to lock our parent before
  231|       |     * generating bits from it.  Note: taking the lock will be a no-op
  232|       |     * if locking is not required (while drbg->parent->lock == NULL).
  233|       |     */
  234|      3|    if (!ossl_drbg_lock_parent(drbg))
  ------------------
  |  Branch (234:9): [True: 0, False: 3]
  ------------------
  235|      0|        return 0;
  236|       |    /*
  237|       |     * Get random data from parent.  Include our DRBG address as
  238|       |     * additional input, in order to provide a distinction between
  239|       |     * different DRBG child instances.
  240|       |     *
  241|       |     * Note: using the sizeof() operator on a pointer triggers
  242|       |     *       a warning in some static code analyzers, but it's
  243|       |     *       intentional and correct here.
  244|       |     */
  245|      3|    bytes = drbg->parent_get_seed(drbg->parent, pout, drbg->strength,
  246|      3|                                  min_len, max_len, prediction_resistance,
  247|      3|                                  (unsigned char *)&drbg, sizeof(drbg));
  248|      3|    ossl_drbg_unlock_parent(drbg);
  249|      3|    return bytes;
  250|      3|}
drbg.c:ossl_drbg_lock_parent:
   65|  20.5k|{
   66|  20.5k|    void *parent = drbg->parent;
   67|       |
   68|  20.5k|    if (parent != NULL
  ------------------
  |  Branch (68:9): [True: 20.5k, False: 0]
  ------------------
   69|  20.5k|            && drbg->parent_lock != NULL
  ------------------
  |  Branch (69:16): [True: 20.5k, False: 0]
  ------------------
   70|  20.5k|            && !drbg->parent_lock(parent)) {
  ------------------
  |  Branch (70:16): [True: 0, False: 20.5k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   72|      0|        return 0;
   73|      0|    }
   74|  20.5k|    return 1;
   75|  20.5k|}
drbg.c:ossl_drbg_unlock_parent:
   78|  20.5k|{
   79|  20.5k|    void *parent = drbg->parent;
   80|       |
   81|  20.5k|    if (parent != NULL && drbg->parent_unlock != NULL)
  ------------------
  |  Branch (81:9): [True: 20.5k, False: 0]
  |  Branch (81:27): [True: 20.5k, False: 0]
  ------------------
   82|  20.5k|        drbg->parent_unlock(parent);
   83|  20.5k|}
drbg.c:cleanup_entropy:
  253|      3|{
  254|      3|    if (drbg->parent == NULL) {
  ------------------
  |  Branch (254:9): [True: 0, False: 3]
  ------------------
  255|       |#ifdef FIPS_MODULE
  256|       |        ossl_crngt_cleanup_entropy(drbg, out, outlen);
  257|       |#else
  258|      0|        ossl_prov_cleanup_entropy(drbg->provctx, out, outlen);
  259|      0|#endif
  260|      3|    } else if (drbg->parent_clear_seed != NULL) {
  ------------------
  |  Branch (260:16): [True: 3, False: 0]
  ------------------
  261|      3|        if (!ossl_drbg_lock_parent(drbg))
  ------------------
  |  Branch (261:13): [True: 0, False: 3]
  ------------------
  262|      0|            return;
  263|      3|        drbg->parent_clear_seed(drbg->parent, out, outlen);
  264|      3|        ossl_drbg_unlock_parent(drbg);
  265|      3|    }
  266|      3|}
drbg.c:ossl_prov_drbg_reseed_unlocked:
  498|      1|{
  499|      1|    unsigned char *entropy = NULL;
  500|      1|    size_t entropylen = 0;
  501|       |
  502|      1|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (502:9): [True: 0, False: 1]
  ------------------
  503|      0|        return 0;
  504|       |
  505|      1|    if (drbg->state != EVP_RAND_STATE_READY) {
  ------------------
  |  | 1298|      1|# define EVP_RAND_STATE_READY            1
  ------------------
  |  Branch (505:9): [True: 0, False: 1]
  ------------------
  506|       |        /* try to recover from previous errors */
  507|      0|        rand_drbg_restart(drbg);
  508|       |
  509|      0|        if (drbg->state == EVP_RAND_STATE_ERROR) {
  ------------------
  |  | 1299|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  |  Branch (509:13): [True: 0, False: 0]
  ------------------
  510|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  511|      0|            return 0;
  512|      0|        }
  513|      0|        if (drbg->state == EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1297|      0|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
  |  Branch (513:13): [True: 0, False: 0]
  ------------------
  514|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  515|      0|            return 0;
  516|      0|        }
  517|      0|    }
  518|       |
  519|      1|    if (ent != NULL) {
  ------------------
  |  Branch (519:9): [True: 0, False: 1]
  ------------------
  520|      0|        if (ent_len < drbg->min_entropylen) {
  ------------------
  |  Branch (520:13): [True: 0, False: 0]
  ------------------
  521|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  522|      0|            drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1299|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  523|      0|            return 0;
  524|      0|        }
  525|      0|        if (ent_len > drbg->max_entropylen) {
  ------------------
  |  Branch (525:13): [True: 0, False: 0]
  ------------------
  526|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  527|      0|            drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1299|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  528|      0|            return 0;
  529|      0|        }
  530|      0|    }
  531|       |
  532|      1|    if (adin == NULL) {
  ------------------
  |  Branch (532:9): [True: 1, False: 0]
  ------------------
  533|      1|        adinlen = 0;
  534|      1|    } else if (adinlen > drbg->max_adinlen) {
  ------------------
  |  Branch (534:16): [True: 0, False: 0]
  ------------------
  535|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  536|      0|        return 0;
  537|      0|    }
  538|       |
  539|      1|    drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1299|      1|# define EVP_RAND_STATE_ERROR            2
  ------------------
  540|       |
  541|      1|    drbg->reseed_next_counter = tsan_load(&drbg->reseed_counter);
  ------------------
  |  |   61|      1|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  542|      1|    if (drbg->reseed_next_counter) {
  ------------------
  |  Branch (542:9): [True: 1, False: 0]
  ------------------
  543|      1|        drbg->reseed_next_counter++;
  544|      1|        if (!drbg->reseed_next_counter)
  ------------------
  |  Branch (544:13): [True: 0, False: 1]
  ------------------
  545|      0|            drbg->reseed_next_counter = 1;
  546|      1|    }
  547|       |
  548|      1|    if (ent != NULL) {
  ------------------
  |  Branch (548:9): [True: 0, False: 1]
  ------------------
  549|       |#ifdef FIPS_MODULE
  550|       |        /*
  551|       |         * NIST SP-800-90A mandates that entropy *shall not* be provided
  552|       |         * by the consuming application. Instead the data is added as additional
  553|       |         * input.
  554|       |         *
  555|       |         * (NIST SP-800-90Ar1, Sections 9.1 and 9.2)
  556|       |         */
  557|       |        if (!drbg->reseed(drbg, NULL, 0, ent, ent_len)) {
  558|       |            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_RESEED);
  559|       |            return 0;
  560|       |        }
  561|       |#else
  562|      0|        if (!drbg->reseed(drbg, ent, ent_len, adin, adinlen)) {
  ------------------
  |  Branch (562:13): [True: 0, False: 0]
  ------------------
  563|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  564|      0|            return 0;
  565|      0|        }
  566|       |        /* There isn't much point adding the same additional input twice */
  567|      0|        adin = NULL;
  568|      0|        adinlen = 0;
  569|      0|#endif
  570|      0|    }
  571|       |
  572|       |    /* Reseed using our sources in addition */
  573|      1|    entropylen = get_entropy(drbg, &entropy, drbg->strength,
  574|      1|                             drbg->min_entropylen, drbg->max_entropylen,
  575|      1|                             prediction_resistance);
  576|      1|    if (entropylen < drbg->min_entropylen
  ------------------
  |  Branch (576:9): [True: 0, False: 1]
  ------------------
  577|      1|            || entropylen > drbg->max_entropylen) {
  ------------------
  |  Branch (577:16): [True: 0, False: 1]
  ------------------
  578|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  579|      0|        goto end;
  580|      0|    }
  581|       |
  582|      1|    if (!drbg->reseed(drbg, entropy, entropylen, adin, adinlen))
  ------------------
  |  Branch (582:9): [True: 0, False: 1]
  ------------------
  583|      0|        goto end;
  584|       |
  585|      1|    drbg->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1298|      1|# define EVP_RAND_STATE_READY            1
  ------------------
  586|      1|    drbg->generate_counter = 1;
  587|      1|    drbg->reseed_time = time(NULL);
  588|      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)
  ------------------
  589|      1|    if (drbg->parent != NULL)
  ------------------
  |  Branch (589:9): [True: 1, False: 0]
  ------------------
  590|      1|        drbg->parent_reseed_counter = get_parent_reseed_count(drbg);
  591|       |
  592|      1| end:
  593|      1|    cleanup_entropy(drbg, entropy, entropylen);
  594|      1|    if (drbg->state == EVP_RAND_STATE_READY)
  ------------------
  |  | 1298|      1|# define EVP_RAND_STATE_READY            1
  ------------------
  |  Branch (594:9): [True: 1, False: 0]
  ------------------
  595|      1|        return 1;
  596|      0|    return 0;
  597|      1|}
drbg.c:get_parent_reseed_count:
  111|  20.5k|{
  112|  20.5k|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  20.5k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  20.5k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  113|  20.5k|    void *parent = drbg->parent;
  114|  20.5k|    unsigned int r = 0;
  115|       |
  116|  20.5k|    *params = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_COUNTER, &r);
  ------------------
  |  |  224|  20.5k|# define OSSL_DRBG_PARAM_RESEED_COUNTER "reseed_counter"
  ------------------
  117|  20.5k|    if (!ossl_drbg_lock_parent(drbg)) {
  ------------------
  |  Branch (117:9): [True: 0, False: 20.5k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  119|      0|        goto err;
  120|      0|    }
  121|  20.5k|    if (!drbg->parent_get_ctx_params(parent, params))
  ------------------
  |  Branch (121:9): [True: 0, False: 20.5k]
  ------------------
  122|      0|        r = 0;
  123|  20.5k|    ossl_drbg_unlock_parent(drbg);
  124|  20.5k|    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|  20.5k|}
drbg.c:find_call:
  756|     14|{
  757|     14|    if (dispatch != NULL)
  ------------------
  |  Branch (757:9): [True: 14, False: 0]
  ------------------
  758|    162|        while (dispatch->function_id != 0) {
  ------------------
  |  Branch (758:16): [True: 160, False: 2]
  ------------------
  759|    160|            if (dispatch->function_id == function)
  ------------------
  |  Branch (759:17): [True: 12, False: 148]
  ------------------
  760|     12|                return dispatch;
  761|    148|            dispatch++;
  762|    148|        }
  763|      2|    return NULL;
  764|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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);
  ------------------
  |  |  476|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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:
  634|      2|{
  635|      2|    return ossl_rand_drbg_new(provctx, parent, parent_dispatch,
  636|      2|                              &drbg_ctr_new, &drbg_ctr_free,
  637|      2|                              &drbg_ctr_instantiate, &drbg_ctr_uninstantiate,
  638|      2|                              &drbg_ctr_reseed, &drbg_ctr_generate);
  639|      2|}
drbg_ctr.c:drbg_ctr_new:
  619|      2|{
  620|      2|    PROV_DRBG_CTR *ctr;
  621|       |
  622|      2|    ctr = OPENSSL_secure_zalloc(sizeof(*ctr));
  ------------------
  |  |  125|      2|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|    OSSL_FIPS_IND_INIT(drbg)
  629|      2|    return drbg_ctr_init_lengths(drbg);
  630|      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;
  ------------------
  |  |   51|      3|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  534|      3|        drbg->min_noncelen = 0;
  535|      3|        drbg->max_noncelen = DRBG_MAX_LENGTH;
  ------------------
  |  |   51|      3|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  536|      3|        drbg->max_perslen = DRBG_MAX_LENGTH;
  ------------------
  |  |   51|      3|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  537|      3|        drbg->max_adinlen = DRBG_MAX_LENGTH;
  ------------------
  |  |   51|      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;
  ------------------
  |  |   51|      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|  61.7k|{
   62|  61.7k|    unsigned char *p = &ctr->V[0];
   63|  61.7k|    u32 n = 16, c = 1;
   64|       |
   65|   987k|    do {
   66|   987k|        --n;
   67|   987k|        c += p[n];
   68|   987k|        p[n] = (u8)c;
   69|   987k|        c >>= 8;
   70|   987k|    } while (n);
  ------------------
  |  Branch (70:14): [True: 925k, False: 61.7k]
  ------------------
   71|  61.7k|}
drbg_ctr.c:ctr_update:
  265|  20.5k|{
  266|  20.5k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  267|  20.5k|    int outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|  20.5k|# define AES_BLOCK_SIZE 16
  ------------------
  268|  20.5k|    unsigned char V_tmp[48], out[48];
  269|  20.5k|    unsigned char len;
  270|       |
  271|       |    /* correct key is already set up. */
  272|  20.5k|    memcpy(V_tmp, ctr->V, 16);
  273|  20.5k|    inc_128(ctr);
  274|  20.5k|    memcpy(V_tmp + 16, ctr->V, 16);
  275|  20.5k|    if (ctr->keylen == 16) {
  ------------------
  |  Branch (275:9): [True: 0, False: 20.5k]
  ------------------
  276|      0|        len = 32;
  277|  20.5k|    } else {
  278|  20.5k|        inc_128(ctr);
  279|  20.5k|        memcpy(V_tmp + 32, ctr->V, 16);
  280|  20.5k|        len = 48;
  281|  20.5k|    }
  282|  20.5k|    if (!EVP_CipherUpdate(ctr->ctx_ecb, out, &outlen, V_tmp, len)
  ------------------
  |  Branch (282:9): [True: 0, False: 20.5k]
  ------------------
  283|  20.5k|            || outlen != len)
  ------------------
  |  Branch (283:16): [True: 0, False: 20.5k]
  ------------------
  284|      0|        return 0;
  285|  20.5k|    memcpy(ctr->K, out, ctr->keylen);
  286|  20.5k|    memcpy(ctr->V, out + ctr->keylen, 16);
  287|       |
  288|  20.5k|    if (ctr->use_df) {
  ------------------
  |  Branch (288:9): [True: 5, False: 20.5k]
  ------------------
  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|  20.5k|    } else {
  297|  20.5k|        ctr_XOR(ctr, in1, in1len);
  298|  20.5k|        ctr_XOR(ctr, in2, in2len);
  299|  20.5k|    }
  300|       |
  301|  20.5k|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->K, NULL, -1)
  ------------------
  |  Branch (301:9): [True: 0, False: 20.5k]
  ------------------
  302|  20.5k|        || !EVP_CipherInit_ex(ctr->ctx_ctr, NULL, NULL, ctr->K, NULL, -1))
  ------------------
  |  Branch (302:12): [True: 0, False: 20.5k]
  ------------------
  303|      0|        return 0;
  304|  20.5k|    return 1;
  305|  20.5k|}
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|  41.1k|{
   75|  41.1k|    size_t i, n;
   76|       |
   77|  41.1k|    if (in == NULL || inlen == 0)
  ------------------
  |  Branch (77:9): [True: 41.1k, False: 8]
  |  Branch (77:23): [True: 0, False: 8]
  ------------------
   78|  41.1k|        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|  20.5k|{
  392|  20.5k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  393|  20.5k|    unsigned int ctr32, blocks;
  394|  20.5k|    int outl, buflen;
  395|       |
  396|  20.5k|    if (adin != NULL && adinlen != 0) {
  ------------------
  |  Branch (396:9): [True: 2, False: 20.5k]
  |  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|  20.5k|    } else {
  407|  20.5k|        adinlen = 0;
  408|  20.5k|    }
  409|       |
  410|  20.5k|    inc_128(ctr);
  411|       |
  412|  20.5k|    if (outlen == 0) {
  ------------------
  |  Branch (412:9): [True: 0, False: 20.5k]
  ------------------
  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|  20.5k|    memset(out, 0, outlen);
  421|       |
  422|  20.5k|    do {
  423|  20.5k|        if (!EVP_CipherInit_ex(ctr->ctx_ctr,
  ------------------
  |  Branch (423:13): [True: 0, False: 20.5k]
  ------------------
  424|  20.5k|                               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|  20.5k|        buflen = outlen > (1U << 30) ? (1U << 30) : outlen;
  ------------------
  |  Branch (434:18): [True: 0, False: 20.5k]
  ------------------
  435|  20.5k|        blocks = (buflen + 15) / 16;
  436|       |
  437|  20.5k|        ctr32 = GETU32(ctr->V + 12) + blocks;
  ------------------
  |  |  103|  20.5k|# define GETU32(p)       ((u32)(p)[0]<<24|(u32)(p)[1]<<16|(u32)(p)[2]<<8|(u32)(p)[3])
  ------------------
  438|  20.5k|        if (ctr32 < blocks) {
  ------------------
  |  Branch (438:13): [True: 0, False: 20.5k]
  ------------------
  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|  20.5k|        PUTU32(ctr->V + 12, ctr32);
  ------------------
  |  |  104|  20.5k|# 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|  20.5k|        if (!EVP_CipherUpdate(ctr->ctx_ctr, out, &outl, out, buflen)
  ------------------
  |  Branch (449:13): [True: 0, False: 20.5k]
  ------------------
  450|  20.5k|            || outl != buflen)
  ------------------
  |  Branch (450:16): [True: 0, False: 20.5k]
  ------------------
  451|      0|            return 0;
  452|       |
  453|  20.5k|        out += buflen;
  454|  20.5k|        outlen -= buflen;
  455|  20.5k|    } while (outlen);
  ------------------
  |  Branch (455:14): [True: 0, False: 20.5k]
  ------------------
  456|       |
  457|  20.5k|    if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (457:9): [True: 0, False: 20.5k]
  ------------------
  458|      0|        return 0;
  459|  20.5k|    return 1;
  460|  20.5k|}
drbg_ctr.c:drbg_ctr_free:
  642|      2|{
  643|      2|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  644|      2|    PROV_DRBG_CTR *ctr;
  645|       |
  646|      2|    if (drbg != NULL && (ctr = (PROV_DRBG_CTR *)drbg->data) != NULL) {
  ------------------
  |  Branch (646:9): [True: 2, False: 0]
  |  Branch (646:25): [True: 2, False: 0]
  ------------------
  647|      2|        EVP_CIPHER_CTX_free(ctr->ctx_ecb);
  648|      2|        EVP_CIPHER_CTX_free(ctr->ctx_ctr);
  649|      2|        EVP_CIPHER_CTX_free(ctr->ctx_df);
  650|      2|        EVP_CIPHER_free(ctr->cipher_ecb);
  651|      2|        EVP_CIPHER_free(ctr->cipher_ctr);
  652|       |
  653|      2|        OPENSSL_secure_clear_free(ctr, sizeof(*ctr));
  ------------------
  |  |  129|      2|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  654|      2|    }
  655|      2|    ossl_rand_drbg_free(drbg);
  656|      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:
  708|      2|{
  709|      2|    PROV_DRBG *ctx = (PROV_DRBG *)vctx;
  710|      2|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)ctx->data;
  711|      2|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
  ------------------
  |  |   29|      2|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  712|      2|    const OSSL_PARAM *p;
  713|      2|    char *ecb;
  714|      2|    const char *propquery = NULL;
  715|      2|    int i, cipher_init = 0;
  716|       |
  717|      2|    if ((p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_USE_DF)) != NULL
  ------------------
  |  |  229|      2|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  |  Branch (717:9): [True: 2, False: 0]
  ------------------
  718|      2|            && OSSL_PARAM_get_int(p, &i)) {
  ------------------
  |  Branch (718:16): [True: 2, False: 0]
  ------------------
  719|       |        /* FIPS errors out in the drbg_ctr_init() call later */
  720|      2|        ctr->use_df = i != 0;
  721|      2|        cipher_init = 1;
  722|      2|    }
  723|       |
  724|      2|    if ((p = OSSL_PARAM_locate_const(params,
  ------------------
  |  Branch (724:9): [True: 0, False: 2]
  ------------------
  725|      2|                                     OSSL_DRBG_PARAM_PROPERTIES)) != NULL) {
  ------------------
  |  |  222|      2|# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  117|      2|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  726|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (726:13): [True: 0, False: 0]
  ------------------
  727|      0|            return 0;
  728|      0|        propquery = (const char *)p->data;
  729|      0|    }
  730|       |
  731|      2|    if ((p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_CIPHER)) != NULL) {
  ------------------
  |  |  207|      2|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  112|      2|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  |  Branch (731:9): [True: 2, False: 0]
  ------------------
  732|      2|        const char *base = (const char *)p->data;
  733|      2|        size_t ctr_str_len = sizeof("CTR") - 1;
  734|      2|        size_t ecb_str_len = sizeof("ECB") - 1;
  735|       |
  736|      2|        if (p->data_type != OSSL_PARAM_UTF8_STRING
  ------------------
  |  |  117|      4|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (736:13): [True: 0, False: 2]
  ------------------
  737|      2|                || p->data_size < ctr_str_len)
  ------------------
  |  Branch (737:20): [True: 0, False: 2]
  ------------------
  738|      0|            return 0;
  739|      2|        if (OPENSSL_strcasecmp("CTR", base + p->data_size - ctr_str_len) != 0) {
  ------------------
  |  Branch (739:13): [True: 0, False: 2]
  ------------------
  740|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  741|      0|            return 0;
  742|      0|        }
  743|      2|        if ((ecb = OPENSSL_strndup(base, p->data_size)) == NULL)
  ------------------
  |  |  121|      2|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (743:13): [True: 0, False: 2]
  ------------------
  744|      0|            return 0;
  745|      2|        strcpy(ecb + p->data_size - ecb_str_len, "ECB");
  746|      2|        EVP_CIPHER_free(ctr->cipher_ecb);
  747|      2|        EVP_CIPHER_free(ctr->cipher_ctr);
  748|      2|        ctr->cipher_ctr = EVP_CIPHER_fetch(libctx, base, propquery);
  749|      2|        ctr->cipher_ecb = EVP_CIPHER_fetch(libctx, ecb, propquery);
  750|      2|        OPENSSL_free(ecb);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  751|      2|        if (ctr->cipher_ctr == NULL || ctr->cipher_ecb == NULL) {
  ------------------
  |  Branch (751:13): [True: 0, False: 2]
  |  Branch (751:40): [True: 0, False: 2]
  ------------------
  752|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  753|      0|            return 0;
  754|      0|        }
  755|      2|        cipher_init = 1;
  756|      2|    }
  757|       |
  758|      2|    if (cipher_init && !drbg_ctr_init(ctx))
  ------------------
  |  Branch (758:9): [True: 2, False: 0]
  |  Branch (758:24): [True: 0, False: 2]
  ------------------
  759|      0|        return 0;
  760|       |
  761|      2|    return ossl_drbg_set_ctx_params(ctx, params);
  762|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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|  20.5k|{
  467|  20.5k|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  468|       |
  469|  20.5k|    return ossl_prov_drbg_generate(drbg, out, outlen, strength,
  470|  20.5k|                                   prediction_resistance, adin, adin_len);
  471|  20.5k|}
drbg_ctr.c:drbg_ctr_settable_ctx_params:
  782|      2|{
  783|      2|    static const OSSL_PARAM known_settable_ctx_params[] = {
  784|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  785|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  786|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  787|      2|        OSSL_PARAM_DRBG_SETTABLE_CTX_COMMON,
  ------------------
  |  |  234|      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))
  |  |  ------------------
  |  |  235|      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))
  |  |  ------------------
  ------------------
  788|      2|        OSSL_PARAM_END
  ------------------
  |  |   25|      2|    { NULL, 0, NULL, 0, 0 }
  ------------------
  789|      2|    };
  790|      2|    return known_settable_ctx_params;
  791|      2|}
drbg_ctr.c:drbg_ctr_get_ctx_params:
  659|  41.1k|{
  660|  41.1k|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  661|  41.1k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  662|  41.1k|    OSSL_PARAM *p;
  663|  41.1k|    int ret = 0, complete = 0;
  664|       |
  665|  41.1k|    if (!ossl_drbg_get_ctx_params_no_lock(drbg, params, &complete))
  ------------------
  |  Branch (665:9): [True: 0, False: 41.1k]
  ------------------
  666|      0|        return 0;
  667|       |
  668|  41.1k|    if (complete)
  ------------------
  |  Branch (668:9): [True: 41.1k, False: 3]
  ------------------
  669|  41.1k|        return 1;
  670|       |
  671|      3|    if (drbg->lock != NULL && !CRYPTO_THREAD_read_lock(drbg->lock))
  ------------------
  |  Branch (671:9): [True: 3, False: 0]
  |  Branch (671:31): [True: 0, False: 3]
  ------------------
  672|      0|        return 0;
  673|       |
  674|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_USE_DF);
  ------------------
  |  |  229|      3|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  675|      3|    if (p != NULL && !OSSL_PARAM_set_int(p, ctr->use_df))
  ------------------
  |  Branch (675:9): [True: 0, False: 3]
  |  Branch (675:22): [True: 0, False: 0]
  ------------------
  676|      0|        goto err;
  677|       |
  678|      3|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_CIPHER);
  ------------------
  |  |  207|      3|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  112|      3|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  679|      3|    if (p != NULL) {
  ------------------
  |  Branch (679:9): [True: 0, False: 3]
  ------------------
  680|      0|        if (ctr->cipher_ctr == NULL
  ------------------
  |  Branch (680:13): [True: 0, False: 0]
  ------------------
  681|      0|            || !OSSL_PARAM_set_utf8_string(p,
  ------------------
  |  Branch (681:16): [True: 0, False: 0]
  ------------------
  682|      0|                                           EVP_CIPHER_get0_name(ctr->cipher_ctr)))
  683|      0|            goto err;
  684|      0|    }
  685|       |
  686|      3|    ret = ossl_drbg_get_ctx_params(drbg, params);
  687|      3| err:
  688|      3|    if (drbg->lock != NULL)
  ------------------
  |  Branch (688:9): [True: 3, False: 0]
  ------------------
  689|      3|        CRYPTO_THREAD_unlock(drbg->lock);
  690|       |
  691|      3|    return ret;
  692|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   52|      0|        return NULL;
   53|      0|    }
   54|       |
   55|      1|    s = OPENSSL_zalloc(sizeof(*s));
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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;
  ------------------
  |  | 1297|      1|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
   61|      1|    return s;
   62|      1|}
seed_src.c:seed_src_free:
   65|      1|{
   66|      1|    OPENSSL_free(vseed);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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;
  ------------------
  |  | 1298|      1|# define EVP_RAND_STATE_READY            1
  ------------------
   77|      1|    return 1;
   78|      1|}
seed_src.c:seed_src_enable_locking:
  215|      1|{
  216|      1|    return 1;
  217|      1|}
seed_src.c:seed_src_lock:
  220|      7|{
  221|      7|    return 1;
  222|      7|}
seed_src.c:seed_src_unlock:
  225|      7|{
  226|      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);
  ------------------
  |  |  475|      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);
  ------------------
  |  |  476|      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);
  ------------------
  |  |  474|      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 ret = 0;
  181|      1|    size_t entropy_available = 0;
  182|      1|    size_t i;
  183|      1|    RAND_POOL *pool;
  184|       |
  185|      1|    pool = ossl_rand_pool_new(entropy, 1, min_len, max_len);
  186|      1|    if (pool == NULL) {
  ------------------
  |  Branch (186:9): [True: 0, False: 1]
  ------------------
  187|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  188|      0|        return 0;
  189|      0|    }
  190|       |
  191|       |    /* Get entropy by polling system entropy sources. */
  192|      1|    entropy_available = ossl_pool_acquire_entropy(pool);
  193|       |
  194|      1|    if (entropy_available > 0) {
  ------------------
  |  Branch (194:9): [True: 1, False: 0]
  ------------------
  195|      1|        ret = ossl_rand_pool_length(pool);
  196|      1|        *pout = ossl_rand_pool_detach(pool);
  197|       |
  198|       |        /* xor the additional data into the output */
  199|      9|        for (i = 0 ; i < adin_len ; ++i)
  ------------------
  |  Branch (199:22): [True: 8, False: 1]
  ------------------
  200|      8|            (*pout)[i % ret] ^= adin[i];
  201|      1|    } else {
  202|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  203|      0|    }
  204|      1|    ossl_rand_pool_free(pool);
  205|      1|    return ret;
  206|      1|}
seed_src.c:seed_clear_seed:
  210|      1|{
  211|      1|    OPENSSL_secure_clear_free(out, outlen);
  ------------------
  |  |  129|      1|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  212|      1|}

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

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

