ASN1_BIT_STRING_set:
   17|     67|{
   18|     67|    return ASN1_STRING_set(x, d, len);
   19|     67|}
ossl_i2c_ASN1_BIT_STRING:
   22|  46.6k|{
   23|  46.6k|    int ret, j, bits, len;
   24|  46.6k|    unsigned char *p, *d;
   25|       |
   26|  46.6k|    if (a == NULL)
  ------------------
  |  Branch (26:9): [True: 0, False: 46.6k]
  ------------------
   27|      0|        return 0;
   28|       |
   29|  46.6k|    len = a->length;
   30|       |
   31|  46.6k|    if (len > 0) {
  ------------------
  |  Branch (31:9): [True: 21.0k, False: 25.6k]
  ------------------
   32|  21.0k|        if (a->flags & ASN1_STRING_FLAG_BITS_LEFT) {
  ------------------
  |  |  161|  21.0k|# define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  |  Branch (32:13): [True: 21.0k, False: 0]
  ------------------
   33|  21.0k|            bits = (int)a->flags & 0x07;
   34|  21.0k|        } 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|  21.0k|    } else
   60|  25.6k|        bits = 0;
   61|       |
   62|  46.6k|    ret = 1 + len;
   63|  46.6k|    if (pp == NULL)
  ------------------
  |  Branch (63:9): [True: 35.9k, False: 10.7k]
  ------------------
   64|  35.9k|        return ret;
   65|       |
   66|  10.7k|    p = *pp;
   67|       |
   68|  10.7k|    *(p++) = (unsigned char)bits;
   69|  10.7k|    d = a->data;
   70|  10.7k|    if (len > 0) {
  ------------------
  |  Branch (70:9): [True: 5.04k, False: 5.68k]
  ------------------
   71|  5.04k|        memcpy(p, d, len);
   72|  5.04k|        p += len;
   73|  5.04k|        p[-1] &= (0xff << bits);
   74|  5.04k|    }
   75|  10.7k|    *pp = p;
   76|  10.7k|    return ret;
   77|  46.6k|}
ossl_c2i_ASN1_BIT_STRING:
   81|  24.8k|{
   82|  24.8k|    ASN1_BIT_STRING *ret = NULL;
   83|  24.8k|    const unsigned char *p;
   84|  24.8k|    unsigned char *s;
   85|  24.8k|    int i = 0;
   86|       |
   87|  24.8k|    if (len < 1) {
  ------------------
  |  Branch (87:9): [True: 102, False: 24.7k]
  ------------------
   88|    102|        i = ASN1_R_STRING_TOO_SHORT;
  ------------------
  |  |  116|    102|# define ASN1_R_STRING_TOO_SHORT                          152
  ------------------
   89|    102|        goto err;
   90|    102|    }
   91|       |
   92|  24.7k|    if (len > INT_MAX) {
  ------------------
  |  Branch (92:9): [True: 0, False: 24.7k]
  ------------------
   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|  24.7k|    if ((a == NULL) || ((*a) == NULL)) {
  ------------------
  |  Branch (97:9): [True: 0, False: 24.7k]
  |  Branch (97:24): [True: 8.94k, False: 15.8k]
  ------------------
   98|  8.94k|        if ((ret = ASN1_BIT_STRING_new()) == NULL)
  ------------------
  |  Branch (98:13): [True: 0, False: 8.94k]
  ------------------
   99|      0|            return NULL;
  100|  8.94k|    } else
  101|  15.8k|        ret = (*a);
  102|       |
  103|  24.7k|    p = *pp;
  104|  24.7k|    i = *(p++);
  105|  24.7k|    if (i > 7) {
  ------------------
  |  Branch (105:9): [True: 383, False: 24.3k]
  ------------------
  106|    383|        i = ASN1_R_INVALID_BIT_STRING_BITS_LEFT;
  ------------------
  |  |   72|    383|# define ASN1_R_INVALID_BIT_STRING_BITS_LEFT              220
  ------------------
  107|    383|        goto err;
  108|    383|    }
  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|  24.3k|    ossl_asn1_string_set_bits_left(ret, i);
  114|       |
  115|  24.3k|    if (len-- > 1) {            /* using one because of the bits left byte */
  ------------------
  |  Branch (115:9): [True: 10.3k, False: 14.0k]
  ------------------
  116|  10.3k|        s = OPENSSL_malloc((int)len);
  ------------------
  |  |  102|  10.3k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  10.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  10.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  117|  10.3k|        if (s == NULL) {
  ------------------
  |  Branch (117:13): [True: 0, False: 10.3k]
  ------------------
  118|      0|            goto err;
  119|      0|        }
  120|  10.3k|        memcpy(s, p, (int)len);
  121|  10.3k|        s[len - 1] &= (0xff << i);
  122|  10.3k|        p += len;
  123|  10.3k|    } else
  124|  14.0k|        s = NULL;
  125|       |
  126|  24.3k|    ASN1_STRING_set0(ret, s, (int)len);
  127|  24.3k|    ret->type = V_ASN1_BIT_STRING;
  ------------------
  |  |   65|  24.3k|# define V_ASN1_BIT_STRING               3
  ------------------
  128|  24.3k|    if (a != NULL)
  ------------------
  |  Branch (128:9): [True: 24.3k, False: 0]
  ------------------
  129|  24.3k|        (*a) = ret;
  130|  24.3k|    *pp = p;
  131|  24.3k|    return ret;
  132|    485| err:
  133|    485|    if (i != 0)
  ------------------
  |  Branch (133:9): [True: 485, False: 0]
  ------------------
  134|    485|        ERR_raise(ERR_LIB_ASN1, i);
  ------------------
  |  |  401|    485|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    485|    (ERR_new(),                                                 \
  |  |  |  |  404|    485|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    485|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    485|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    485|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    485|     ERR_set_error)
  |  |  ------------------
  ------------------
  135|    485|    if ((a == NULL) || (*a != ret))
  ------------------
  |  Branch (135:9): [True: 0, False: 485]
  |  Branch (135:24): [True: 255, False: 230]
  ------------------
  136|    255|        ASN1_BIT_STRING_free(ret);
  137|    485|    return NULL;
  138|  24.3k|}
ASN1_BIT_STRING_get_bit:
  180|  15.4k|{
  181|  15.4k|    int w, v;
  182|       |
  183|  15.4k|    if (n < 0)
  ------------------
  |  Branch (183:9): [True: 0, False: 15.4k]
  ------------------
  184|      0|        return 0;
  185|       |
  186|  15.4k|    w = n / 8;
  187|  15.4k|    v = 1 << (7 - (n & 0x07));
  188|  15.4k|    if ((a == NULL) || (a->length < (w + 1)) || (a->data == NULL))
  ------------------
  |  Branch (188:9): [True: 0, False: 15.4k]
  |  Branch (188:24): [True: 3.53k, False: 11.8k]
  |  Branch (188:49): [True: 0, False: 11.8k]
  ------------------
  189|  3.53k|        return 0;
  190|  11.8k|    return ((a->data[w] & v) != 0);
  191|  15.4k|}

asn1_d2i_read_bio:
  110|   192k|{
  111|   192k|    BUF_MEM *b;
  112|   192k|    unsigned char *p;
  113|   192k|    int i;
  114|   192k|    size_t want = HEADER_SIZE;
  ------------------
  |  |  107|   192k|#define HEADER_SIZE   8
  ------------------
  115|   192k|    uint32_t eos = 0;
  116|   192k|    size_t off = 0;
  117|   192k|    size_t len = 0;
  118|   192k|    size_t diff;
  119|       |
  120|   192k|    const unsigned char *q;
  121|   192k|    long slen;
  122|   192k|    int inf, tag, xclass;
  123|       |
  124|   192k|    b = BUF_MEM_new();
  125|   192k|    if (b == NULL) {
  ------------------
  |  Branch (125:9): [True: 0, False: 192k]
  ------------------
  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|   192k|    ERR_set_mark();
  131|   146M|    for (;;) {
  132|   146M|        diff = len - off;
  133|   146M|        if (want >= diff) {
  ------------------
  |  Branch (133:13): [True: 146M, False: 19.9k]
  ------------------
  134|   146M|            want -= diff;
  135|       |
  136|   146M|            if (len + want < len || !BUF_MEM_grow_clean(b, len + want)) {
  ------------------
  |  Branch (136:17): [True: 0, False: 146M]
  |  Branch (136:37): [True: 0, False: 146M]
  ------------------
  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|   146M|            i = BIO_read(in, &(b->data[len]), want);
  141|   146M|            if (i < 0 && diff == 0) {
  ------------------
  |  Branch (141:17): [True: 0, False: 146M]
  |  Branch (141:26): [True: 0, False: 0]
  ------------------
  142|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|                goto err;
  144|      0|            }
  145|   146M|            if (i > 0) {
  ------------------
  |  Branch (145:17): [True: 146M, False: 232k]
  ------------------
  146|   146M|                if (len + i < len) {
  ------------------
  |  Branch (146:21): [True: 0, False: 146M]
  ------------------
  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|   146M|                len += i;
  151|   146M|                if ((size_t)i < want)
  ------------------
  |  Branch (151:21): [True: 85.0k, False: 146M]
  ------------------
  152|  85.0k|                    continue;
  153|       |
  154|   146M|            }
  155|   146M|        }
  156|       |        /* else data already loaded */
  157|       |
  158|   146M|        p = (unsigned char *)&(b->data[off]);
  159|   146M|        q = p;
  160|   146M|        diff = len - off;
  161|   146M|        if (diff == 0)
  ------------------
  |  Branch (161:13): [True: 16.0k, False: 146M]
  ------------------
  162|  16.0k|            goto err;
  163|   146M|        inf = ASN1_get_object(&q, &slen, &tag, &xclass, diff);
  164|   146M|        if (inf & 0x80) {
  ------------------
  |  Branch (164:13): [True: 3.71M, False: 143M]
  ------------------
  165|  3.71M|            unsigned long e;
  166|       |
  167|  3.71M|            e = ERR_GET_REASON(ERR_peek_last_error());
  168|  3.71M|            if (e != ASN1_R_TOO_LONG)
  ------------------
  |  |  120|  3.71M|# define ASN1_R_TOO_LONG                                  155
  ------------------
  |  Branch (168:17): [True: 14.6k, False: 3.69M]
  ------------------
  169|  14.6k|                goto err;
  170|  3.69M|            ERR_pop_to_mark();
  171|  3.69M|        }
  172|   146M|        i = q - p;            /* header length */
  173|   146M|        off += i;               /* end of data */
  174|       |
  175|   146M|        if (inf & 1) {
  ------------------
  |  Branch (175:13): [True: 17.6M, False: 129M]
  ------------------
  176|       |            /* no data body so go round again */
  177|  17.6M|            if (eos == UINT32_MAX) {
  ------------------
  |  Branch (177:17): [True: 0, False: 17.6M]
  ------------------
  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|  17.6M|            eos++;
  182|  17.6M|            want = HEADER_SIZE;
  ------------------
  |  |  107|  17.6M|#define HEADER_SIZE   8
  ------------------
  183|   129M|        } else if (eos && (slen == 0) && (tag == V_ASN1_EOC)) {
  ------------------
  |  |   62|   112M|# define V_ASN1_EOC                      0
  ------------------
  |  Branch (183:20): [True: 129M, False: 76.2k]
  |  Branch (183:27): [True: 112M, False: 16.7M]
  |  Branch (183:42): [True: 5.00M, False: 107M]
  ------------------
  184|       |            /* eos value, so go back and read another header */
  185|  5.00M|            eos--;
  186|  5.00M|            if (eos == 0)
  ------------------
  |  Branch (186:17): [True: 78.6k, False: 4.93M]
  ------------------
  187|  78.6k|                break;
  188|  4.93M|            else
  189|  4.93M|                want = HEADER_SIZE;
  ------------------
  |  |  107|  4.93M|#define HEADER_SIZE   8
  ------------------
  190|   124M|        } else {
  191|       |            /* suck in slen bytes of data */
  192|   124M|            want = slen;
  193|   124M|            if (want > (len - off)) {
  ------------------
  |  Branch (193:17): [True: 3.69M, False: 120M]
  ------------------
  194|  3.69M|                size_t chunk_max = ASN1_CHUNK_INITIAL_SIZE;
  ------------------
  |  |  108|  3.69M|#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024)
  ------------------
  195|       |
  196|  3.69M|                want -= (len - off);
  197|  3.69M|                if (want > INT_MAX /* BIO_read takes an int length */  ||
  ------------------
  |  Branch (197:21): [True: 855, False: 3.69M]
  ------------------
  198|  3.69M|                    len + want < len) {
  ------------------
  |  Branch (198:21): [True: 0, False: 3.69M]
  ------------------
  199|    855|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|    855|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    855|    (ERR_new(),                                                 \
  |  |  |  |  404|    855|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    855|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    855|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    855|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    855|     ERR_set_error)
  |  |  ------------------
  ------------------
  200|    855|                    goto err;
  201|    855|                }
  202|  7.41M|                while (want > 0) {
  ------------------
  |  Branch (202:24): [True: 3.72M, False: 3.68M]
  ------------------
  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|  3.72M|                    size_t chunk = want > chunk_max ? chunk_max : want;
  ------------------
  |  Branch (209:36): [True: 32.3k, False: 3.69M]
  ------------------
  210|       |
  211|  3.72M|                    if (!BUF_MEM_grow_clean(b, len + chunk)) {
  ------------------
  |  Branch (211:25): [True: 0, False: 3.72M]
  ------------------
  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|  3.72M|                    want -= chunk;
  216|  7.44M|                    while (chunk > 0) {
  ------------------
  |  Branch (216:28): [True: 3.72M, False: 3.71M]
  ------------------
  217|  3.72M|                        i = BIO_read(in, &(b->data[len]), chunk);
  218|  3.72M|                        if (i <= 0) {
  ------------------
  |  Branch (218:29): [True: 8.85k, False: 3.72M]
  ------------------
  219|  8.85k|                            ERR_raise(ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA);
  ------------------
  |  |  401|  8.85k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  8.85k|    (ERR_new(),                                                 \
  |  |  |  |  404|  8.85k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  8.85k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  8.85k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  8.85k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  8.85k|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|  8.85k|                            goto err;
  221|  8.85k|                        }
  222|       |                    /*
  223|       |                     * This can't overflow because |len+want| didn't
  224|       |                     * overflow.
  225|       |                     */
  226|  3.72M|                        len += i;
  227|  3.72M|                        chunk -= i;
  228|  3.72M|                    }
  229|  3.71M|                    if (chunk_max < INT_MAX/2)
  ------------------
  |  Branch (229:25): [True: 3.71M, False: 0]
  ------------------
  230|  3.71M|                        chunk_max *= 2;
  231|  3.71M|                }
  232|  3.69M|            }
  233|   124M|            if (off + slen < off) {
  ------------------
  |  Branch (233:17): [True: 0, False: 124M]
  ------------------
  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|   124M|            off += slen;
  238|   124M|            if (eos == 0) {
  ------------------
  |  Branch (238:17): [True: 73.2k, False: 123M]
  ------------------
  239|  73.2k|                break;
  240|  73.2k|            } else
  241|   123M|                want = HEADER_SIZE;
  ------------------
  |  |  107|   123M|#define HEADER_SIZE   8
  ------------------
  242|   124M|        }
  243|   146M|    }
  244|       |
  245|   151k|    if (off > INT_MAX) {
  ------------------
  |  Branch (245:9): [True: 0, False: 151k]
  ------------------
  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|   151k|    *pb = b;
  251|   151k|    return off;
  252|  40.3k| err:
  253|  40.3k|    ERR_clear_last_mark();
  254|  40.3k|    BUF_MEM_free(b);
  255|  40.3k|    return -1;
  256|   151k|}

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

ASN1_item_dup:
   51|  1.14k|{
   52|  1.14k|    ASN1_aux_cb *asn1_cb = NULL;
   53|  1.14k|    unsigned char *b = NULL;
   54|  1.14k|    const unsigned char *p;
   55|  1.14k|    long i;
   56|  1.14k|    ASN1_VALUE *ret;
   57|  1.14k|    OSSL_LIB_CTX *libctx = NULL;
   58|  1.14k|    const char *propq = NULL;
   59|       |
   60|  1.14k|    if (x == NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 1.14k]
  ------------------
   61|      0|        return NULL;
   62|       |
   63|  1.14k|    if (it->itype == ASN1_ITYPE_SEQUENCE || it->itype == ASN1_ITYPE_CHOICE
  ------------------
  |  |   81|  2.29k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
                  if (it->itype == ASN1_ITYPE_SEQUENCE || it->itype == ASN1_ITYPE_CHOICE
  ------------------
  |  |   82|  1.25k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (63:9): [True: 1.03k, False: 111]
  |  Branch (63:45): [True: 0, False: 111]
  ------------------
   64|  1.14k|        || it->itype == ASN1_ITYPE_NDEF_SEQUENCE) {
  ------------------
  |  |   86|    111|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (64:12): [True: 0, False: 111]
  ------------------
   65|  1.03k|        const ASN1_AUX *aux = it->funcs;
   66|       |
   67|  1.03k|        asn1_cb = aux != NULL ? aux->asn1_cb : NULL;
  ------------------
  |  Branch (67:19): [True: 0, False: 1.03k]
  ------------------
   68|  1.03k|    }
   69|       |
   70|  1.14k|    if (asn1_cb != NULL) {
  ------------------
  |  Branch (70:9): [True: 0, False: 1.14k]
  ------------------
   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.14k|    i = ASN1_item_i2d(x, &b, it);
   78|  1.14k|    if (b == NULL) {
  ------------------
  |  Branch (78:9): [True: 0, False: 1.14k]
  ------------------
   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.14k|    p = b;
   83|  1.14k|    ret = ASN1_item_d2i_ex(NULL, &p, i, it, libctx, propq);
   84|  1.14k|    OPENSSL_free(b);
  ------------------
  |  |  115|  1.14k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.14k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.14k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   85|       |
   86|  1.14k|    if (asn1_cb != NULL
  ------------------
  |  Branch (86:9): [True: 0, False: 1.14k]
  ------------------
   87|  1.14k|        && !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.14k|    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.14k|}

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

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

ossl_i2c_ASN1_INTEGER:
  208|  92.9k|{
  209|  92.9k|    return i2c_ibuf(a->data, a->length, a->type & V_ASN1_NEG, pp);
  ------------------
  |  |   97|  92.9k|# define V_ASN1_NEG                      0x100
  ------------------
  210|  92.9k|}
ossl_c2i_ASN1_INTEGER:
  288|   478k|{
  289|   478k|    ASN1_INTEGER *ret = NULL;
  290|   478k|    size_t r;
  291|   478k|    int neg;
  292|       |
  293|   478k|    r = c2i_ibuf(NULL, NULL, *pp, len);
  294|       |
  295|   478k|    if (r == 0)
  ------------------
  |  Branch (295:9): [True: 81.3k, False: 397k]
  ------------------
  296|  81.3k|        return NULL;
  297|       |
  298|   397k|    if ((a == NULL) || ((*a) == NULL)) {
  ------------------
  |  Branch (298:9): [True: 0, False: 397k]
  |  Branch (298:24): [True: 225k, False: 171k]
  ------------------
  299|   225k|        ret = ASN1_INTEGER_new();
  300|   225k|        if (ret == NULL)
  ------------------
  |  Branch (300:13): [True: 0, False: 225k]
  ------------------
  301|      0|            return NULL;
  302|   225k|        ret->type = V_ASN1_INTEGER;
  ------------------
  |  |   64|   225k|# define V_ASN1_INTEGER                  2
  ------------------
  303|   225k|    } else
  304|   171k|        ret = *a;
  305|       |
  306|   397k|    if (ASN1_STRING_set(ret, NULL, r) == 0) {
  ------------------
  |  Branch (306:9): [True: 0, False: 397k]
  ------------------
  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|   397k|    c2i_ibuf(ret->data, &neg, *pp, len);
  312|       |
  313|   397k|    if (neg != 0)
  ------------------
  |  Branch (313:9): [True: 112k, False: 284k]
  ------------------
  314|   112k|        ret->type |= V_ASN1_NEG;
  ------------------
  |  |   97|   112k|# define V_ASN1_NEG                      0x100
  ------------------
  315|   284k|    else
  316|   284k|        ret->type &= ~V_ASN1_NEG;
  ------------------
  |  |   97|   284k|# define V_ASN1_NEG                      0x100
  ------------------
  317|       |
  318|   397k|    *pp += len;
  319|   397k|    if (a != NULL)
  ------------------
  |  Branch (319:9): [True: 397k, False: 0]
  ------------------
  320|   397k|        (*a) = ret;
  321|   397k|    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|   397k|}
ASN1_INTEGER_get_int64:
  524|  1.72k|{
  525|  1.72k|    return asn1_string_get_int64(pr, a, V_ASN1_INTEGER);
  ------------------
  |  |   64|  1.72k|# define V_ASN1_INTEGER                  2
  ------------------
  526|  1.72k|}
ASN1_INTEGER_set_int64:
  529|     37|{
  530|     37|    return asn1_string_set_int64(a, r, V_ASN1_INTEGER);
  ------------------
  |  |   64|     37|# define V_ASN1_INTEGER                  2
  ------------------
  531|     37|}
ASN1_INTEGER_set:
  544|     37|{
  545|     37|    return ASN1_INTEGER_set_int64(a, v);
  546|     37|}
ASN1_INTEGER_get:
  549|  1.72k|{
  550|  1.72k|    int i;
  551|  1.72k|    int64_t r;
  552|  1.72k|    if (a == NULL)
  ------------------
  |  Branch (552:9): [True: 0, False: 1.72k]
  ------------------
  553|      0|        return 0;
  554|  1.72k|    i = ASN1_INTEGER_get_int64(&r, a);
  555|  1.72k|    if (i == 0)
  ------------------
  |  Branch (555:9): [True: 164, False: 1.56k]
  ------------------
  556|    164|        return -1;
  557|  1.56k|    if (r > LONG_MAX || r < LONG_MIN)
  ------------------
  |  Branch (557:9): [True: 0, False: 1.56k]
  |  Branch (557:25): [True: 0, False: 1.56k]
  ------------------
  558|      0|        return -1;
  559|  1.56k|    return (long)r;
  560|  1.56k|}
BN_to_ASN1_INTEGER:
  563|    748|{
  564|    748|    return bn_to_asn1_string(bn, ai, V_ASN1_INTEGER);
  ------------------
  |  |   64|    748|# define V_ASN1_INTEGER                  2
  ------------------
  565|    748|}
ASN1_INTEGER_to_BN:
  568|  18.9k|{
  569|  18.9k|    return asn1_string_to_bn(ai, bn, V_ASN1_INTEGER);
  ------------------
  |  |   64|  18.9k|# define V_ASN1_INTEGER                  2
  ------------------
  570|  18.9k|}
ASN1_ENUMERATED_get_int64:
  573|  15.3k|{
  574|  15.3k|    return asn1_string_get_int64(pr, a, V_ASN1_ENUMERATED);
  ------------------
  |  |   72|  15.3k|# define V_ASN1_ENUMERATED               10
  ------------------
  575|  15.3k|}
ASN1_ENUMERATED_get:
  588|  15.4k|{
  589|  15.4k|    int i;
  590|  15.4k|    int64_t r;
  591|  15.4k|    if (a == NULL)
  ------------------
  |  Branch (591:9): [True: 0, False: 15.4k]
  ------------------
  592|      0|        return 0;
  593|  15.4k|    if ((a->type & ~V_ASN1_NEG) != V_ASN1_ENUMERATED)
  ------------------
  |  |   97|  15.4k|# define V_ASN1_NEG                      0x100
  ------------------
                  if ((a->type & ~V_ASN1_NEG) != V_ASN1_ENUMERATED)
  ------------------
  |  |   72|  15.4k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (593:9): [True: 0, False: 15.4k]
  ------------------
  594|      0|        return -1;
  595|  15.4k|    if (a->length > (int)sizeof(long))
  ------------------
  |  Branch (595:9): [True: 69, False: 15.3k]
  ------------------
  596|     69|        return 0xffffffffL;
  597|  15.3k|    i = ASN1_ENUMERATED_get_int64(&r, a);
  598|  15.3k|    if (i == 0)
  ------------------
  |  Branch (598:9): [True: 191, False: 15.1k]
  ------------------
  599|    191|        return -1;
  600|  15.1k|    if (r > LONG_MAX || r < LONG_MIN)
  ------------------
  |  Branch (600:9): [True: 0, False: 15.1k]
  |  Branch (600:25): [True: 0, False: 15.1k]
  ------------------
  601|      0|        return -1;
  602|  15.1k|    return (long)r;
  603|  15.1k|}
ASN1_ENUMERATED_to_BN:
  611|    549|{
  612|    549|    return asn1_string_to_bn(ai, bn, V_ASN1_ENUMERATED);
  ------------------
  |  |   72|    549|# define V_ASN1_ENUMERATED               10
  ------------------
  613|    549|}
ossl_c2i_uint64_int:
  618|  71.3k|{
  619|  71.3k|    unsigned char buf[sizeof(uint64_t)];
  620|  71.3k|    size_t buflen;
  621|       |
  622|  71.3k|    buflen = c2i_ibuf(NULL, NULL, *pp, len);
  623|  71.3k|    if (buflen == 0)
  ------------------
  |  Branch (623:9): [True: 977, False: 70.3k]
  ------------------
  624|    977|        return 0;
  625|  70.3k|    if (buflen > sizeof(uint64_t)) {
  ------------------
  |  Branch (625:9): [True: 1.59k, False: 68.7k]
  ------------------
  626|  1.59k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|  1.59k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.59k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.59k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  1.59k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  1.59k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  1.59k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.59k|     ERR_set_error)
  |  |  ------------------
  ------------------
  627|  1.59k|        return 0;
  628|  1.59k|    }
  629|  68.7k|    (void)c2i_ibuf(buf, neg, *pp, len);
  630|  68.7k|    return asn1_get_uint64(ret, buf, buflen);
  631|  70.3k|}
ossl_i2c_uint64_int:
  634|  43.6k|{
  635|  43.6k|    unsigned char buf[sizeof(uint64_t)];
  636|  43.6k|    size_t off;
  637|       |
  638|  43.6k|    off = asn1_put_uint64(buf, r);
  639|  43.6k|    return i2c_ibuf(buf + off, sizeof(buf) - off, neg, &p);
  640|  43.6k|}
a_int.c:i2c_ibuf:
   99|   136k|{
  100|   136k|    unsigned int pad = 0;
  101|   136k|    size_t ret, i;
  102|   136k|    unsigned char *p, pb = 0;
  103|       |
  104|   136k|    if (b != NULL && blen) {
  ------------------
  |  Branch (104:9): [True: 136k, False: 0]
  |  Branch (104:22): [True: 136k, False: 0]
  ------------------
  105|   136k|        ret = blen;
  106|   136k|        i = b[0];
  107|   136k|        if (!neg && (i > 127)) {
  ------------------
  |  Branch (107:13): [True: 100k, False: 36.4k]
  |  Branch (107:21): [True: 8.59k, False: 91.5k]
  ------------------
  108|  8.59k|            pad = 1;
  109|  8.59k|            pb = 0;
  110|   128k|        } else if (neg) {
  ------------------
  |  Branch (110:20): [True: 36.4k, False: 91.5k]
  ------------------
  111|  36.4k|            pb = 0xFF;
  112|  36.4k|            if (i > 128) {
  ------------------
  |  Branch (112:17): [True: 3.61k, False: 32.8k]
  ------------------
  113|  3.61k|                pad = 1;
  114|  32.8k|            } else if (i == 128) {
  ------------------
  |  Branch (114:24): [True: 10.2k, False: 22.6k]
  ------------------
  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|  22.3k|                for (pad = 0, i = 1; i < blen; i++)
  ------------------
  |  Branch (119:38): [True: 12.1k, False: 10.2k]
  ------------------
  120|  12.1k|                    pad |= b[i];
  121|  10.2k|                pb = pad != 0 ? 0xffU : 0;
  ------------------
  |  Branch (121:22): [True: 1.88k, False: 8.33k]
  ------------------
  122|  10.2k|                pad = pb & 1;
  123|  10.2k|            }
  124|  36.4k|        }
  125|   136k|        ret += pad;
  126|   136k|    } else {
  127|      0|        ret = 1;
  128|      0|        blen = 0;   /* reduce '(b == NULL || blen == 0)' to '(blen == 0)' */
  129|      0|    }
  130|       |
  131|   136k|    if (pp == NULL || (p = *pp) == NULL)
  ------------------
  |  Branch (131:9): [True: 73.0k, False: 63.5k]
  |  Branch (131:23): [True: 34.6k, False: 28.8k]
  ------------------
  132|   107k|        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|  28.8k|    *p = pb;
  140|  28.8k|    p += pad;       /* yes, p[0] can be written twice, but it's little
  141|       |                     * price to pay for eliminated branches */
  142|  28.8k|    twos_complement(p, b, blen, pb);
  143|       |
  144|  28.8k|    *pp += ret;
  145|  28.8k|    return ret;
  146|   136k|}
a_int.c:twos_complement:
   78|   272k|{
   79|   272k|    unsigned int carry = pad & 1;
   80|       |
   81|       |    /* Begin at the end of the encoding */
   82|   272k|    if (len != 0) {
  ------------------
  |  Branch (82:9): [True: 272k, False: 0]
  ------------------
   83|       |        /*
   84|       |         * if len == 0 then src/dst could be NULL, and this would be undefined
   85|       |         * behaviour.
   86|       |         */
   87|   272k|        dst += len;
   88|   272k|        src += len;
   89|   272k|    }
   90|       |    /* two's complement value: ~value + 1 */
   91|  70.5M|    while (len-- != 0) {
  ------------------
  |  Branch (91:12): [True: 70.2M, False: 272k]
  ------------------
   92|  70.2M|        *(--dst) = (unsigned char)(carry += *(--src) ^ pad);
   93|  70.2M|        carry >>= 8;
   94|  70.2M|    }
   95|   272k|}
a_int.c:c2i_ibuf:
  156|  1.01M|{
  157|  1.01M|    int neg, pad;
  158|       |    /* Zero content length is illegal */
  159|  1.01M|    if (plen == 0) {
  ------------------
  |  Branch (159:9): [True: 75.9k, False: 939k]
  ------------------
  160|  75.9k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  401|  75.9k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  75.9k|    (ERR_new(),                                                 \
  |  |  |  |  404|  75.9k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  75.9k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  75.9k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  75.9k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  75.9k|     ERR_set_error)
  |  |  ------------------
  ------------------
  161|  75.9k|        return 0;
  162|  75.9k|    }
  163|   939k|    neg = p[0] & 0x80;
  164|   939k|    if (pneg)
  ------------------
  |  Branch (164:9): [True: 465k, False: 473k]
  ------------------
  165|   465k|        *pneg = neg;
  166|       |    /* Handle common case where length is 1 octet separately */
  167|   939k|    if (plen == 1) {
  ------------------
  |  Branch (167:9): [True: 443k, False: 495k]
  ------------------
  168|   443k|        if (b != NULL) {
  ------------------
  |  Branch (168:13): [True: 221k, False: 221k]
  ------------------
  169|   221k|            if (neg)
  ------------------
  |  Branch (169:17): [True: 69.5k, False: 152k]
  ------------------
  170|  69.5k|                b[0] = (p[0] ^ 0xFF) + 1;
  171|   152k|            else
  172|   152k|                b[0] = p[0];
  173|   221k|        }
  174|   443k|        return 1;
  175|   443k|    }
  176|       |
  177|   495k|    pad = 0;
  178|   495k|    if (p[0] == 0) {
  ------------------
  |  Branch (178:9): [True: 56.1k, False: 439k]
  ------------------
  179|  56.1k|        pad = 1;
  180|   439k|    } else if (p[0] == 0xFF) {
  ------------------
  |  Branch (180:16): [True: 23.6k, False: 415k]
  ------------------
  181|  23.6k|        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|  16.8M|        for (pad = 0, i = 1; i < plen; i++)
  ------------------
  |  Branch (187:30): [True: 16.7M, False: 23.6k]
  ------------------
  188|  16.7M|            pad |= p[i];
  189|  23.6k|        pad = pad != 0 ? 1 : 0;
  ------------------
  |  Branch (189:15): [True: 23.2k, False: 440]
  ------------------
  190|  23.6k|    }
  191|       |    /* reject illegal padding: first two octets MSB can't match */
  192|   495k|    if (pad && (neg == (p[1] & 0x80))) {
  ------------------
  |  Branch (192:9): [True: 79.3k, False: 416k]
  |  Branch (192:16): [True: 6.37k, False: 73.0k]
  ------------------
  193|  6.37k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING);
  ------------------
  |  |  401|  6.37k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  6.37k|    (ERR_new(),                                                 \
  |  |  |  |  404|  6.37k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  6.37k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  6.37k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  6.37k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  6.37k|     ERR_set_error)
  |  |  ------------------
  ------------------
  194|  6.37k|        return 0;
  195|  6.37k|    }
  196|       |
  197|       |    /* skip over pad */
  198|   489k|    p += pad;
  199|   489k|    plen -= pad;
  200|       |
  201|   489k|    if (b != NULL)
  ------------------
  |  Branch (201:9): [True: 243k, False: 245k]
  ------------------
  202|   243k|        twos_complement(b, p, plen, neg ? 0xffU : 0);
  ------------------
  |  Branch (202:37): [True: 62.1k, False: 181k]
  ------------------
  203|       |
  204|   489k|    return plen;
  205|   495k|}
a_int.c:asn1_string_get_int64:
  329|  17.0k|{
  330|  17.0k|    if (a == NULL) {
  ------------------
  |  Branch (330:9): [True: 0, False: 17.0k]
  ------------------
  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|  17.0k|    if ((a->type & ~V_ASN1_NEG) != itype) {
  ------------------
  |  |   97|  17.0k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (334:9): [True: 0, False: 17.0k]
  ------------------
  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|  17.0k|    return asn1_get_int64(pr, a->data, a->length, a->type & V_ASN1_NEG);
  ------------------
  |  |   97|  17.0k|# define V_ASN1_NEG                      0x100
  ------------------
  339|  17.0k|}
a_int.c:asn1_get_int64:
  257|  17.0k|{
  258|  17.0k|    uint64_t r;
  259|  17.0k|    if (asn1_get_uint64(&r, b, blen) == 0)
  ------------------
  |  Branch (259:9): [True: 21, False: 17.0k]
  ------------------
  260|     21|        return 0;
  261|  17.0k|    if (neg) {
  ------------------
  |  Branch (261:9): [True: 1.49k, False: 15.5k]
  ------------------
  262|  1.49k|        if (r <= INT64_MAX) {
  ------------------
  |  Branch (262:13): [True: 1.36k, False: 129]
  ------------------
  263|       |            /* Most significant bit is guaranteed to be clear, negation
  264|       |             * is guaranteed to be meaningful in platform-neutral sense. */
  265|  1.36k|            *pr = -(int64_t)r;
  266|  1.36k|        } else if (r == ABS_INT64_MIN) {
  ------------------
  |  |  252|    129|#define ABS_INT64_MIN ((uint64_t)INT64_MAX + (-(INT64_MIN + INT64_MAX)))
  ------------------
  |  Branch (266:20): [True: 10, False: 119]
  ------------------
  267|       |            /* This never happens if INT64_MAX == ABS_INT64_MIN, e.g.
  268|       |             * on ones'-complement system. */
  269|     10|            *pr = (int64_t)(0 - r);
  270|    119|        } else {
  271|    119|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|    119|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    119|    (ERR_new(),                                                 \
  |  |  |  |  404|    119|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    119|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    119|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    119|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    119|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|    119|            return 0;
  273|    119|        }
  274|  15.5k|    } else {
  275|  15.5k|        if (r <= INT64_MAX) {
  ------------------
  |  Branch (275:13): [True: 15.3k, False: 215]
  ------------------
  276|  15.3k|            *pr = (int64_t)r;
  277|  15.3k|        } else {
  278|    215|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|    215|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    215|    (ERR_new(),                                                 \
  |  |  |  |  404|    215|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    215|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    215|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    215|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    215|     ERR_set_error)
  |  |  ------------------
  ------------------
  279|    215|            return 0;
  280|    215|        }
  281|  15.5k|    }
  282|  16.7k|    return 1;
  283|  17.0k|}
a_int.c:asn1_string_set_int64:
  342|     37|{
  343|     37|    unsigned char tbuf[sizeof(r)];
  344|     37|    size_t off;
  345|       |
  346|     37|    a->type = itype;
  347|     37|    if (r < 0) {
  ------------------
  |  Branch (347:9): [True: 0, False: 37]
  ------------------
  348|       |        /* Most obvious '-r' triggers undefined behaviour for most
  349|       |         * common INT64_MIN. Even though below '0 - (uint64_t)r' can
  350|       |         * appear two's-complement centric, it does produce correct/
  351|       |         * expected result even on one's-complement. This is because
  352|       |         * cast to unsigned has to change bit pattern... */
  353|      0|        off = asn1_put_uint64(tbuf, 0 - (uint64_t)r);
  354|      0|        a->type |= V_ASN1_NEG;
  ------------------
  |  |   97|      0|# define V_ASN1_NEG                      0x100
  ------------------
  355|     37|    } else {
  356|     37|        off = asn1_put_uint64(tbuf, r);
  357|     37|        a->type &= ~V_ASN1_NEG;
  ------------------
  |  |   97|     37|# define V_ASN1_NEG                      0x100
  ------------------
  358|     37|    }
  359|     37|    return ASN1_STRING_set(a, tbuf + off, sizeof(tbuf) - off);
  360|     37|}
a_int.c:bn_to_asn1_string:
  461|    748|{
  462|    748|    ASN1_INTEGER *ret;
  463|    748|    int len;
  464|       |
  465|    748|    if (ai == NULL) {
  ------------------
  |  Branch (465:9): [True: 507, False: 241]
  ------------------
  466|    507|        ret = ASN1_STRING_type_new(atype);
  467|    507|    } else {
  468|    241|        ret = ai;
  469|    241|        ret->type = atype;
  470|    241|    }
  471|       |
  472|    748|    if (ret == NULL) {
  ------------------
  |  Branch (472:9): [True: 0, False: 748]
  ------------------
  473|      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)
  |  |  ------------------
  ------------------
  474|      0|        goto err;
  475|      0|    }
  476|       |
  477|    748|    if (BN_is_negative(bn) && !BN_is_zero(bn))
  ------------------
  |  Branch (477:9): [True: 12, False: 736]
  |  Branch (477:31): [True: 12, False: 0]
  ------------------
  478|     12|        ret->type |= V_ASN1_NEG_INTEGER;
  ------------------
  |  |   98|     12|# define V_ASN1_NEG_INTEGER              (2 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|     12|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  479|       |
  480|    748|    len = BN_num_bytes(bn);
  ------------------
  |  |  189|    748|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  481|       |
  482|    748|    if (len == 0)
  ------------------
  |  Branch (482:9): [True: 146, False: 602]
  ------------------
  483|    146|        len = 1;
  484|       |
  485|    748|    if (ASN1_STRING_set(ret, NULL, len) == 0) {
  ------------------
  |  Branch (485:9): [True: 0, False: 748]
  ------------------
  486|      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)
  |  |  ------------------
  ------------------
  487|      0|        goto err;
  488|      0|    }
  489|       |
  490|       |    /* Correct zero case */
  491|    748|    if (BN_is_zero(bn))
  ------------------
  |  Branch (491:9): [True: 146, False: 602]
  ------------------
  492|    146|        ret->data[0] = 0;
  493|    602|    else
  494|    602|        len = BN_bn2bin(bn, ret->data);
  495|    748|    ret->length = len;
  496|    748|    return ret;
  497|      0| err:
  498|      0|    if (ret != ai)
  ------------------
  |  Branch (498:9): [True: 0, False: 0]
  ------------------
  499|      0|        ASN1_INTEGER_free(ret);
  500|      0|    return NULL;
  501|    748|}
a_int.c:asn1_string_to_bn:
  505|  19.4k|{
  506|  19.4k|    BIGNUM *ret;
  507|       |
  508|  19.4k|    if ((ai->type & ~V_ASN1_NEG) != itype) {
  ------------------
  |  |   97|  19.4k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (508:9): [True: 63, False: 19.4k]
  ------------------
  509|     63|        ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE);
  ------------------
  |  |  401|     63|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     63|    (ERR_new(),                                                 \
  |  |  |  |  404|     63|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     63|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     63|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     63|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     63|     ERR_set_error)
  |  |  ------------------
  ------------------
  510|     63|        return NULL;
  511|     63|    }
  512|       |
  513|  19.4k|    ret = BN_bin2bn(ai->data, ai->length, bn);
  514|  19.4k|    if (ret == NULL) {
  ------------------
  |  Branch (514:9): [True: 0, False: 19.4k]
  ------------------
  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|  19.4k|    if (ai->type & V_ASN1_NEG)
  ------------------
  |  |   97|  19.4k|# define V_ASN1_NEG                      0x100
  ------------------
  |  Branch (518:9): [True: 4.95k, False: 14.4k]
  ------------------
  519|  4.95k|        BN_set_negative(ret, 1);
  520|  19.4k|    return ret;
  521|  19.4k|}
a_int.c:asn1_get_uint64:
  214|  85.8k|{
  215|  85.8k|    size_t i;
  216|  85.8k|    uint64_t r;
  217|       |
  218|  85.8k|    if (blen > sizeof(*pr)) {
  ------------------
  |  Branch (218:9): [True: 21, False: 85.7k]
  ------------------
  219|     21|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|     21|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     21|    (ERR_new(),                                                 \
  |  |  |  |  404|     21|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     21|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     21|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     21|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     21|     ERR_set_error)
  |  |  ------------------
  ------------------
  220|     21|        return 0;
  221|     21|    }
  222|  85.7k|    if (b == NULL)
  ------------------
  |  Branch (222:9): [True: 0, False: 85.7k]
  ------------------
  223|      0|        return 0;
  224|   239k|    for (r = 0, i = 0; i < blen; i++) {
  ------------------
  |  Branch (224:24): [True: 154k, False: 85.7k]
  ------------------
  225|   154k|        r <<= 8;
  226|   154k|        r |= b[i];
  227|   154k|    }
  228|  85.7k|    *pr = r;
  229|  85.7k|    return 1;
  230|  85.7k|}
a_int.c:asn1_put_uint64:
  238|  43.6k|{
  239|  43.6k|    size_t off = sizeof(uint64_t);
  240|       |
  241|  77.5k|    do {
  242|  77.5k|        b[--off] = (unsigned char)r;
  243|  77.5k|    } while (r >>= 8);
  ------------------
  |  Branch (243:14): [True: 33.8k, False: 43.6k]
  ------------------
  244|       |
  245|  43.6k|    return off;
  246|  43.6k|}

ASN1_mbstring_copy:
   38|  86.0k|{
   39|  86.0k|    return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0);
   40|  86.0k|}
ASN1_mbstring_ncopy:
   45|  86.0k|{
   46|  86.0k|    int str_type;
   47|  86.0k|    int ret;
   48|  86.0k|    char free_out;
   49|  86.0k|    int outform, outlen = 0;
   50|  86.0k|    ASN1_STRING *dest;
   51|  86.0k|    unsigned char *p;
   52|  86.0k|    int nchar;
   53|  86.0k|    int (*cpyfunc) (unsigned long, void *) = NULL;
   54|  86.0k|    if (len == -1)
  ------------------
  |  Branch (54:9): [True: 0, False: 86.0k]
  ------------------
   55|      0|        len = strlen((const char *)in);
   56|  86.0k|    if (!mask)
  ------------------
  |  Branch (56:9): [True: 0, False: 86.0k]
  ------------------
   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|  86.0k|    if (len < 0)
  ------------------
  |  Branch (58:9): [True: 0, False: 86.0k]
  ------------------
   59|      0|        return -1;
   60|       |
   61|       |    /* First do a string check and work out the number of characters */
   62|  86.0k|    switch (inform) {
   63|       |
   64|    879|    case MBSTRING_BMP:
  ------------------
  |  |  125|    879|# define MBSTRING_BMP            (MBSTRING_FLAG|2)
  |  |  ------------------
  |  |  |  |  122|    879|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (64:5): [True: 879, False: 85.2k]
  ------------------
   65|    879|        if (len & 1) {
  ------------------
  |  Branch (65:13): [True: 0, False: 879]
  ------------------
   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|    879|        nchar = len >> 1;
   70|    879|        break;
   71|       |
   72|  1.16k|    case MBSTRING_UNIV:
  ------------------
  |  |  126|  1.16k|# define MBSTRING_UNIV           (MBSTRING_FLAG|4)
  |  |  ------------------
  |  |  |  |  122|  1.16k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (72:5): [True: 1.16k, False: 84.9k]
  ------------------
   73|  1.16k|        if (len & 3) {
  ------------------
  |  Branch (73:13): [True: 0, False: 1.16k]
  ------------------
   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|  1.16k|        nchar = len >> 2;
   78|  1.16k|        break;
   79|       |
   80|  3.22k|    case MBSTRING_UTF8:
  ------------------
  |  |  123|  3.22k|# define MBSTRING_UTF8           (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  122|  3.22k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (80:5): [True: 3.22k, False: 82.8k]
  ------------------
   81|  3.22k|        nchar = 0;
   82|       |        /* This counts the characters and does utf8 syntax checking */
   83|  3.22k|        ret = traverse_string(in, len, MBSTRING_UTF8, in_utf8, &nchar);
  ------------------
  |  |  123|  3.22k|# define MBSTRING_UTF8           (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  122|  3.22k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
   84|  3.22k|        if (ret < 0) {
  ------------------
  |  Branch (84:13): [True: 120, False: 3.10k]
  ------------------
   85|    120|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING);
  ------------------
  |  |  401|    120|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    120|    (ERR_new(),                                                 \
  |  |  |  |  404|    120|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    120|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    120|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    120|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    120|     ERR_set_error)
  |  |  ------------------
  ------------------
   86|    120|            return -1;
   87|    120|        }
   88|  3.10k|        break;
   89|       |
   90|  80.8k|    case MBSTRING_ASC:
  ------------------
  |  |  124|  80.8k|# define MBSTRING_ASC            (MBSTRING_FLAG|1)
  |  |  ------------------
  |  |  |  |  122|  80.8k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (90:5): [True: 80.8k, False: 5.26k]
  ------------------
   91|  80.8k|        nchar = len;
   92|  80.8k|        break;
   93|       |
   94|      0|    default:
  ------------------
  |  Branch (94:5): [True: 0, False: 86.0k]
  ------------------
   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|  86.0k|    }
   98|       |
   99|  85.9k|    if ((minsize > 0) && (nchar < minsize)) {
  ------------------
  |  Branch (99:9): [True: 0, False: 85.9k]
  |  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|  85.9k|    if ((maxsize > 0) && (nchar > maxsize)) {
  ------------------
  |  Branch (105:9): [True: 0, False: 85.9k]
  |  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|  85.9k|    if (traverse_string(in, len, inform, type_str, &mask) < 0) {
  ------------------
  |  Branch (112:9): [True: 45, False: 85.9k]
  ------------------
  113|     45|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  114|     45|        return -1;
  115|     45|    }
  116|       |
  117|       |    /* Now work out output format and string type */
  118|  85.9k|    outform = MBSTRING_ASC;
  ------------------
  |  |  124|  85.9k|# define MBSTRING_ASC            (MBSTRING_FLAG|1)
  |  |  ------------------
  |  |  |  |  122|  85.9k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  119|  85.9k|    if (mask & B_ASN1_NUMERICSTRING)
  ------------------
  |  |  102|  85.9k|# define B_ASN1_NUMERICSTRING    0x0001
  ------------------
  |  Branch (119:9): [True: 0, False: 85.9k]
  ------------------
  120|      0|        str_type = V_ASN1_NUMERICSTRING;
  ------------------
  |  |   76|      0|# define V_ASN1_NUMERICSTRING            18 /**/
  ------------------
  121|  85.9k|    else if (mask & B_ASN1_PRINTABLESTRING)
  ------------------
  |  |  103|  85.9k|# define B_ASN1_PRINTABLESTRING  0x0002
  ------------------
  |  Branch (121:14): [True: 0, False: 85.9k]
  ------------------
  122|      0|        str_type = V_ASN1_PRINTABLESTRING;
  ------------------
  |  |   77|      0|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  123|  85.9k|    else if (mask & B_ASN1_IA5STRING)
  ------------------
  |  |  107|  85.9k|# define B_ASN1_IA5STRING        0x0010
  ------------------
  |  Branch (123:14): [True: 0, False: 85.9k]
  ------------------
  124|      0|        str_type = V_ASN1_IA5STRING;
  ------------------
  |  |   81|      0|# define V_ASN1_IA5STRING                22
  ------------------
  125|  85.9k|    else if (mask & B_ASN1_T61STRING)
  ------------------
  |  |  104|  85.9k|# define B_ASN1_T61STRING        0x0004
  ------------------
  |  Branch (125:14): [True: 0, False: 85.9k]
  ------------------
  126|      0|        str_type = V_ASN1_T61STRING;
  ------------------
  |  |   78|      0|# define V_ASN1_T61STRING                20
  ------------------
  127|  85.9k|    else if (mask & B_ASN1_BMPSTRING) {
  ------------------
  |  |  115|  85.9k|# define B_ASN1_BMPSTRING        0x0800
  ------------------
  |  Branch (127:14): [True: 0, False: 85.9k]
  ------------------
  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|  85.9k|    } else if (mask & B_ASN1_UNIVERSALSTRING) {
  ------------------
  |  |  112|  85.9k|# define B_ASN1_UNIVERSALSTRING  0x0100
  ------------------
  |  Branch (130:16): [True: 0, False: 85.9k]
  ------------------
  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|  85.9k|    } else {
  134|  85.9k|        str_type = V_ASN1_UTF8STRING;
  ------------------
  |  |   73|  85.9k|# define V_ASN1_UTF8STRING               12
  ------------------
  135|  85.9k|        outform = MBSTRING_UTF8;
  ------------------
  |  |  123|  85.9k|# define MBSTRING_UTF8           (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  122|  85.9k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  136|  85.9k|    }
  137|  85.9k|    if (!out)
  ------------------
  |  Branch (137:9): [True: 0, False: 85.9k]
  ------------------
  138|      0|        return str_type;
  139|  85.9k|    if (*out) {
  ------------------
  |  Branch (139:9): [True: 85.9k, False: 0]
  ------------------
  140|  85.9k|        free_out = 0;
  141|  85.9k|        dest = *out;
  142|  85.9k|        ASN1_STRING_set0(dest, NULL, 0);
  143|  85.9k|        dest->type = str_type;
  144|  85.9k|    } 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|  85.9k|    if (inform == outform) {
  ------------------
  |  Branch (154:9): [True: 3.10k, False: 82.8k]
  ------------------
  155|  3.10k|        if (!ASN1_STRING_set(dest, in, len)) {
  ------------------
  |  Branch (155:13): [True: 0, False: 3.10k]
  ------------------
  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|  3.10k|        return str_type;
  164|  3.10k|    }
  165|       |
  166|       |    /* Work out how much space the destination will need */
  167|  82.8k|    switch (outform) {
  ------------------
  |  Branch (167:13): [True: 0, False: 82.8k]
  ------------------
  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: 82.8k]
  ------------------
  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: 82.8k]
  ------------------
  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: 82.8k]
  ------------------
  179|      0|        outlen = nchar << 2;
  180|      0|        cpyfunc = cpy_univ;
  181|      0|        break;
  182|       |
  183|  82.8k|    case MBSTRING_UTF8:
  ------------------
  |  |  123|  82.8k|# define MBSTRING_UTF8           (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  122|  82.8k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (183:5): [True: 82.8k, False: 0]
  ------------------
  184|  82.8k|        outlen = 0;
  185|  82.8k|        traverse_string(in, len, inform, out_utf8, &outlen);
  186|  82.8k|        cpyfunc = cpy_utf8;
  187|  82.8k|        break;
  188|  82.8k|    }
  189|  82.8k|    if ((p = OPENSSL_malloc(outlen + 1)) == NULL) {
  ------------------
  |  |  102|  82.8k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  82.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  82.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (189:9): [True: 0, False: 82.8k]
  ------------------
  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|  82.8k|    dest->length = outlen;
  197|  82.8k|    dest->data = p;
  198|  82.8k|    p[outlen] = 0;
  199|  82.8k|    traverse_string(in, len, inform, cpyfunc, &p);
  200|  82.8k|    return str_type;
  201|  82.8k|}
a_mbstr.c:traverse_string:
  211|   254k|{
  212|   254k|    unsigned long value;
  213|   254k|    int ret;
  214|  42.8M|    while (len) {
  ------------------
  |  Branch (214:12): [True: 42.5M, False: 254k]
  ------------------
  215|  42.5M|        if (inform == MBSTRING_ASC) {
  ------------------
  |  |  124|  42.5M|# define MBSTRING_ASC            (MBSTRING_FLAG|1)
  |  |  ------------------
  |  |  |  |  122|  42.5M|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (215:13): [True: 42.5M, False: 13.9k]
  ------------------
  216|  42.5M|            value = *p++;
  217|  42.5M|            len--;
  218|  42.5M|        } else if (inform == MBSTRING_BMP) {
  ------------------
  |  |  125|  13.9k|# define MBSTRING_BMP            (MBSTRING_FLAG|2)
  |  |  ------------------
  |  |  |  |  122|  13.9k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (218:20): [True: 3.93k, False: 10.0k]
  ------------------
  219|  3.93k|            value = *p++ << 8;
  220|  3.93k|            value |= *p++;
  221|  3.93k|            len -= 2;
  222|  10.0k|        } else if (inform == MBSTRING_UNIV) {
  ------------------
  |  |  126|  10.0k|# define MBSTRING_UNIV           (MBSTRING_FLAG|4)
  |  |  ------------------
  |  |  |  |  122|  10.0k|# define MBSTRING_FLAG           0x1000
  |  |  ------------------
  ------------------
  |  Branch (222:20): [True: 1.22k, False: 8.83k]
  ------------------
  223|  1.22k|            value = ((unsigned long)*p++) << 24;
  224|  1.22k|            value |= ((unsigned long)*p++) << 16;
  225|  1.22k|            value |= *p++ << 8;
  226|  1.22k|            value |= *p++;
  227|  1.22k|            len -= 4;
  228|  8.83k|        } else {
  229|  8.83k|            ret = UTF8_getc(p, len, &value);
  230|  8.83k|            if (ret < 0)
  ------------------
  |  Branch (230:17): [True: 117, False: 8.71k]
  ------------------
  231|    117|                return -1;
  232|  8.71k|            len -= ret;
  233|  8.71k|            p += ret;
  234|  8.71k|        }
  235|  42.5M|        if (rfunc) {
  ------------------
  |  Branch (235:13): [True: 42.5M, False: 0]
  ------------------
  236|  42.5M|            ret = rfunc(value, arg);
  237|  42.5M|            if (ret <= 0)
  ------------------
  |  Branch (237:17): [True: 48, False: 42.5M]
  ------------------
  238|     48|                return ret;
  239|  42.5M|        }
  240|  42.5M|    }
  241|   254k|    return 1;
  242|   254k|}
a_mbstr.c:in_utf8:
  249|  4.63k|{
  250|  4.63k|    int *nchar;
  251|       |
  252|  4.63k|    if (!is_unicode_valid(value))
  ------------------
  |  Branch (252:9): [True: 3, False: 4.63k]
  ------------------
  253|      3|        return -2;
  254|  4.63k|    nchar = arg;
  255|  4.63k|    (*nchar)++;
  256|  4.63k|    return 1;
  257|  4.63k|}
a_mbstr.c:out_utf8:
  262|  14.1M|{
  263|  14.1M|    int *outlen, len;
  264|       |
  265|  14.1M|    len = UTF8_putc(NULL, -1, value);
  266|  14.1M|    if (len <= 0)
  ------------------
  |  Branch (266:9): [True: 0, False: 14.1M]
  ------------------
  267|      0|        return len;
  268|  14.1M|    outlen = arg;
  269|  14.1M|    *outlen += len;
  270|  14.1M|    return 1;
  271|  14.1M|}
a_mbstr.c:type_str:
  279|  14.1M|{
  280|  14.1M|    unsigned long types = *((unsigned long *)arg);
  281|  14.1M|    const int native = value > INT_MAX ? INT_MAX : ossl_fromascii(value);
  ------------------
  |  |   57|  28.3M|#  define ossl_fromascii(c)     (c)
  ------------------
  |  Branch (281:24): [True: 10, False: 14.1M]
  ------------------
  282|       |
  283|  14.1M|    if ((types & B_ASN1_NUMERICSTRING) && !(ossl_isdigit(native)
  ------------------
  |  |  102|  14.1M|# define B_ASN1_NUMERICSTRING    0x0001
  ------------------
  |  Branch (283:9): [True: 0, False: 14.1M]
  |  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|  14.1M|    if ((types & B_ASN1_PRINTABLESTRING) && !ossl_isasn1print(native))
  ------------------
  |  |  103|  14.1M|# 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: 14.1M]
  |  Branch (286:45): [True: 0, False: 0]
  ------------------
  287|      0|        types &= ~B_ASN1_PRINTABLESTRING;
  ------------------
  |  |  103|      0|# define B_ASN1_PRINTABLESTRING  0x0002
  ------------------
  288|  14.1M|    if ((types & B_ASN1_IA5STRING) && !ossl_isascii(native))
  ------------------
  |  |  107|  14.1M|# 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: 14.1M]
  |  Branch (288:39): [True: 0, False: 0]
  ------------------
  289|      0|        types &= ~B_ASN1_IA5STRING;
  ------------------
  |  |  107|      0|# define B_ASN1_IA5STRING        0x0010
  ------------------
  290|  14.1M|    if ((types & B_ASN1_T61STRING) && (value > 0xff))
  ------------------
  |  |  104|  14.1M|# define B_ASN1_T61STRING        0x0004
  ------------------
  |  Branch (290:9): [True: 0, False: 14.1M]
  |  Branch (290:39): [True: 0, False: 0]
  ------------------
  291|      0|        types &= ~B_ASN1_T61STRING;
  ------------------
  |  |  104|      0|# define B_ASN1_T61STRING        0x0004
  ------------------
  292|  14.1M|    if ((types & B_ASN1_BMPSTRING) && (value > 0xffff))
  ------------------
  |  |  115|  14.1M|# define B_ASN1_BMPSTRING        0x0800
  ------------------
  |  Branch (292:9): [True: 0, False: 14.1M]
  |  Branch (292:39): [True: 0, False: 0]
  ------------------
  293|      0|        types &= ~B_ASN1_BMPSTRING;
  ------------------
  |  |  115|      0|# define B_ASN1_BMPSTRING        0x0800
  ------------------
  294|  14.1M|    if ((types & B_ASN1_UTF8STRING) && !is_unicode_valid(value))
  ------------------
  |  |  117|  14.1M|# define B_ASN1_UTF8STRING       0x2000
  ------------------
  |  Branch (294:9): [True: 14.1M, False: 0]
  |  Branch (294:40): [True: 45, False: 14.1M]
  ------------------
  295|     45|        types &= ~B_ASN1_UTF8STRING;
  ------------------
  |  |  117|     45|# define B_ASN1_UTF8STRING       0x2000
  ------------------
  296|  14.1M|    if (!types)
  ------------------
  |  Branch (296:9): [True: 45, False: 14.1M]
  ------------------
  297|     45|        return -1;
  298|  14.1M|    *((unsigned long *)arg) = types;
  299|  14.1M|    return 1;
  300|  14.1M|}
a_mbstr.c:cpy_utf8:
  345|  14.1M|{
  346|  14.1M|    unsigned char **p;
  347|  14.1M|    int ret;
  348|  14.1M|    p = arg;
  349|       |    /* We already know there is enough room so pass 0xff as the length */
  350|  14.1M|    ret = UTF8_putc(*p, 0xff, value);
  351|  14.1M|    *p += ret;
  352|  14.1M|    return 1;
  353|  14.1M|}

i2t_ASN1_OBJECT:
  178|   258k|{
  179|   258k|    return OBJ_obj2txt(buf, buf_len, a, 0);
  180|   258k|}
i2a_ASN1_OBJECT:
  183|   254k|{
  184|   254k|    char buf[80], *p = buf;
  185|   254k|    int i;
  186|       |
  187|   254k|    if ((a == NULL) || (a->data == NULL))
  ------------------
  |  Branch (187:9): [True: 0, False: 254k]
  |  Branch (187:24): [True: 0, False: 254k]
  ------------------
  188|      0|        return BIO_write(bp, "NULL", 4);
  189|   254k|    i = i2t_ASN1_OBJECT(buf, sizeof(buf), a);
  190|   254k|    if (i > (int)(sizeof(buf) - 1)) {
  ------------------
  |  Branch (190:9): [True: 1.27k, False: 253k]
  ------------------
  191|  1.27k|        if (i > INT_MAX - 1) {  /* catch an integer overflow */
  ------------------
  |  Branch (191:13): [True: 0, False: 1.27k]
  ------------------
  192|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_LENGTH_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  193|      0|            return -1;
  194|      0|        }
  195|  1.27k|        if ((p = OPENSSL_malloc(i + 1)) == NULL)
  ------------------
  |  |  102|  1.27k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.27k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.27k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (195:13): [True: 0, False: 1.27k]
  ------------------
  196|      0|            return -1;
  197|  1.27k|        i2t_ASN1_OBJECT(p, i + 1, a);
  198|  1.27k|    }
  199|   254k|    if (i <= 0) {
  ------------------
  |  Branch (199:9): [True: 89, False: 254k]
  ------------------
  200|     89|        i = BIO_write(bp, "<INVALID>", 9);
  201|     89|        if (i > 0)
  ------------------
  |  Branch (201:13): [True: 89, False: 0]
  ------------------
  202|     89|            i += BIO_dump(bp, (const char *)a->data, a->length);
  203|     89|        return i;
  204|     89|    }
  205|   254k|    BIO_write(bp, p, i);
  206|   254k|    if (p != buf)
  ------------------
  |  Branch (206:9): [True: 1.27k, False: 253k]
  ------------------
  207|  1.27k|        OPENSSL_free(p);
  ------------------
  |  |  115|  1.27k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.27k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.27k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  208|   254k|    return i;
  209|   254k|}
d2i_ASN1_OBJECT:
  213|   207k|{
  214|   207k|    const unsigned char *p;
  215|   207k|    long len;
  216|   207k|    int tag, xclass;
  217|   207k|    int inf, i;
  218|   207k|    ASN1_OBJECT *ret = NULL;
  219|   207k|    p = *pp;
  220|   207k|    inf = ASN1_get_object(&p, &len, &tag, &xclass, length);
  221|   207k|    if (inf & 0x80) {
  ------------------
  |  Branch (221:9): [True: 207, False: 207k]
  ------------------
  222|    207|        i = ASN1_R_BAD_OBJECT_HEADER;
  ------------------
  |  |   28|    207|# define ASN1_R_BAD_OBJECT_HEADER                         102
  ------------------
  223|    207|        goto err;
  224|    207|    }
  225|       |
  226|   207k|    if (tag != V_ASN1_OBJECT) {
  ------------------
  |  |   68|   207k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (226:9): [True: 0, False: 207k]
  ------------------
  227|      0|        i = ASN1_R_EXPECTING_AN_OBJECT;
  ------------------
  |  |   45|      0|# define ASN1_R_EXPECTING_AN_OBJECT                       116
  ------------------
  228|      0|        goto err;
  229|      0|    }
  230|   207k|    ret = ossl_c2i_ASN1_OBJECT(a, &p, len);
  231|   207k|    if (ret)
  ------------------
  |  Branch (231:9): [True: 201k, False: 5.24k]
  ------------------
  232|   201k|        *pp = p;
  233|   207k|    return ret;
  234|    207| err:
  235|    207|    ERR_raise(ERR_LIB_ASN1, i);
  ------------------
  |  |  401|    207|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    207|    (ERR_new(),                                                 \
  |  |  |  |  404|    207|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    207|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    207|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    207|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    207|     ERR_set_error)
  |  |  ------------------
  ------------------
  236|    207|    return NULL;
  237|   207k|}
ossl_c2i_ASN1_OBJECT:
  241|   661k|{
  242|   661k|    ASN1_OBJECT *ret = NULL, tobj;
  243|   661k|    const unsigned char *p;
  244|   661k|    unsigned char *data;
  245|   661k|    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|   661k|    if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL ||
  ------------------
  |  Branch (252:9): [True: 1.30k, False: 660k]
  |  Branch (252:21): [True: 0, False: 660k]
  |  Branch (252:38): [True: 0, False: 660k]
  |  Branch (252:52): [True: 0, False: 660k]
  ------------------
  253|   661k|        p[len - 1] & 0x80) {
  ------------------
  |  Branch (253:9): [True: 3.58k, False: 656k]
  ------------------
  254|  4.88k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING);
  ------------------
  |  |  401|  4.88k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  4.88k|    (ERR_new(),                                                 \
  |  |  |  |  404|  4.88k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  4.88k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  4.88k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  4.88k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  4.88k|     ERR_set_error)
  |  |  ------------------
  ------------------
  255|  4.88k|        return NULL;
  256|  4.88k|    }
  257|       |    /* Now 0 < len <= INT_MAX, so the cast is safe. */
  258|   656k|    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|   656k|    tobj.nid = NID_undef;
  ------------------
  |  |   18|   656k|#define NID_undef                       0
  ------------------
  264|   656k|    tobj.data = p;
  265|   656k|    tobj.length = length;
  266|   656k|    tobj.flags = 0;
  267|   656k|    i = OBJ_obj2nid(&tobj);
  268|   656k|    if (i != NID_undef) {
  ------------------
  |  |   18|   656k|#define NID_undef                       0
  ------------------
  |  Branch (268:9): [True: 321k, False: 334k]
  ------------------
  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|   321k|        ret = OBJ_nid2obj(i);
  275|   321k|        if (a) {
  ------------------
  |  Branch (275:13): [True: 321k, False: 0]
  ------------------
  276|   321k|            ASN1_OBJECT_free(*a);
  277|   321k|            *a = ret;
  278|   321k|        }
  279|   321k|        *pp += len;
  280|   321k|        return ret;
  281|   321k|    }
  282|  5.00M|    for (i = 0; i < length; i++, p++) {
  ------------------
  |  Branch (282:17): [True: 4.67M, False: 333k]
  ------------------
  283|  4.67M|        if (*p == 0x80 && (!i || !(p[-1] & 0x80))) {
  ------------------
  |  Branch (283:13): [True: 15.9k, False: 4.65M]
  |  Branch (283:28): [True: 221, False: 15.7k]
  |  Branch (283:34): [True: 650, False: 15.0k]
  ------------------
  284|    871|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING);
  ------------------
  |  |  401|    871|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    871|    (ERR_new(),                                                 \
  |  |  |  |  404|    871|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    871|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    871|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    871|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    871|     ERR_set_error)
  |  |  ------------------
  ------------------
  285|    871|            return NULL;
  286|    871|        }
  287|  4.67M|    }
  288|       |
  289|   333k|    if ((a == NULL) || ((*a) == NULL) ||
  ------------------
  |  Branch (289:9): [True: 0, False: 333k]
  |  Branch (289:24): [True: 82.4k, False: 251k]
  ------------------
  290|   333k|        !((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC)) {
  ------------------
  |  |  110|   251k|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  |  Branch (290:9): [True: 248k, False: 2.67k]
  ------------------
  291|   331k|        if ((ret = ASN1_OBJECT_new()) == NULL)
  ------------------
  |  Branch (291:13): [True: 0, False: 331k]
  ------------------
  292|      0|            return NULL;
  293|   331k|    } else {
  294|  2.67k|        ret = (*a);
  295|  2.67k|    }
  296|       |
  297|   333k|    p = *pp;
  298|       |    /* detach data from object */
  299|   333k|    data = (unsigned char *)ret->data;
  300|   333k|    ret->data = NULL;
  301|       |    /* once detached we can change it */
  302|   333k|    if ((data == NULL) || (ret->length < length)) {
  ------------------
  |  Branch (302:9): [True: 331k, False: 2.67k]
  |  Branch (302:27): [True: 230, False: 2.44k]
  ------------------
  303|   331k|        ret->length = 0;
  304|   331k|        OPENSSL_free(data);
  ------------------
  |  |  115|   331k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   331k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   331k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  305|   331k|        data = OPENSSL_malloc(length);
  ------------------
  |  |  102|   331k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   331k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   331k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  306|   331k|        if (data == NULL)
  ------------------
  |  Branch (306:13): [True: 0, False: 331k]
  ------------------
  307|      0|            goto err;
  308|   331k|        ret->flags |= ASN1_OBJECT_FLAG_DYNAMIC_DATA;
  ------------------
  |  |  113|   331k|# define ASN1_OBJECT_FLAG_DYNAMIC_DATA    0x08/* internal use */
  ------------------
  309|   331k|    }
  310|   333k|    memcpy(data, p, length);
  311|       |    /* If there are dynamic strings, free them here, and clear the flag */
  312|   333k|    if ((ret->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) != 0) {
  ------------------
  |  |  112|   333k|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
  |  Branch (312:9): [True: 0, False: 333k]
  ------------------
  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|   333k|    ret->data = data;
  319|   333k|    ret->length = length;
  320|   333k|    ret->sn = NULL;
  321|   333k|    ret->ln = NULL;
  322|       |    /* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */
  323|   333k|    p += length;
  324|       |
  325|   333k|    if (a != NULL)
  ------------------
  |  Branch (325:9): [True: 333k, False: 0]
  ------------------
  326|   333k|        (*a) = ret;
  327|   333k|    *pp = p;
  328|   333k|    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|   333k|}
ASN1_OBJECT_new:
  337|   438k|{
  338|   438k|    ASN1_OBJECT *ret;
  339|       |
  340|   438k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|   438k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   438k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   438k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  341|   438k|    if (ret == NULL)
  ------------------
  |  Branch (341:9): [True: 0, False: 438k]
  ------------------
  342|      0|        return NULL;
  343|   438k|    ret->flags = ASN1_OBJECT_FLAG_DYNAMIC;
  ------------------
  |  |  110|   438k|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  344|   438k|    return ret;
  345|   438k|}
ASN1_OBJECT_free:
  348|  1.92M|{
  349|  1.92M|    if (a == NULL)
  ------------------
  |  Branch (349:9): [True: 390k, False: 1.53M]
  ------------------
  350|   390k|        return;
  351|  1.53M|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) {
  ------------------
  |  |  112|  1.53M|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
  |  Branch (351:9): [True: 107k, False: 1.42M]
  ------------------
  352|   107k|#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|   107k|        OPENSSL_free((void*)a->sn);
  ------------------
  |  |  115|   107k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   107k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   107k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  358|   107k|        OPENSSL_free((void*)a->ln);
  ------------------
  |  |  115|   107k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   107k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   107k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  359|   107k|#endif
  360|   107k|        a->sn = a->ln = NULL;
  361|   107k|    }
  362|  1.53M|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) {
  ------------------
  |  |  113|  1.53M|# define ASN1_OBJECT_FLAG_DYNAMIC_DATA    0x08/* internal use */
  ------------------
  |  Branch (362:9): [True: 438k, False: 1.09M]
  ------------------
  363|   438k|        OPENSSL_free((void*)a->data);
  ------------------
  |  |  115|   438k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   438k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   438k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  364|   438k|        a->data = NULL;
  365|   438k|        a->length = 0;
  366|   438k|    }
  367|  1.53M|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC)
  ------------------
  |  |  110|  1.53M|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  |  Branch (367:9): [True: 438k, False: 1.09M]
  ------------------
  368|   438k|        OPENSSL_free(a);
  ------------------
  |  |  115|   438k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   438k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   438k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  369|  1.53M|}

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

ASN1_STRING_print:
   70|  40.1k|{
   71|  40.1k|    int i, n;
   72|  40.1k|    char buf[80];
   73|  40.1k|    const char *p;
   74|       |
   75|  40.1k|    if (v == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 40.1k]
  ------------------
   76|      0|        return 0;
   77|  40.1k|    n = 0;
   78|  40.1k|    p = (const char *)v->data;
   79|   664k|    for (i = 0; i < v->length; i++) {
  ------------------
  |  Branch (79:17): [True: 624k, False: 40.1k]
  ------------------
   80|   624k|        if ((p[i] > '~') || ((p[i] < ' ') &&
  ------------------
  |  Branch (80:13): [True: 1.26k, False: 622k]
  |  Branch (80:30): [True: 315k, False: 307k]
  ------------------
   81|   622k|                             (p[i] != '\n') && (p[i] != '\r')))
  ------------------
  |  Branch (81:30): [True: 314k, False: 435]
  |  Branch (81:48): [True: 313k, False: 1.93k]
  ------------------
   82|   314k|            buf[n] = '.';
   83|   309k|        else
   84|   309k|            buf[n] = p[i];
   85|   624k|        n++;
   86|   624k|        if (n >= 80) {
  ------------------
  |  Branch (86:13): [True: 297, False: 623k]
  ------------------
   87|    297|            if (BIO_write(bp, buf, n) <= 0)
  ------------------
  |  Branch (87:17): [True: 0, False: 297]
  ------------------
   88|      0|                return 0;
   89|    297|            n = 0;
   90|    297|        }
   91|   624k|    }
   92|  40.1k|    if (n > 0)
  ------------------
  |  Branch (92:9): [True: 27.3k, False: 12.8k]
  ------------------
   93|  27.3k|        if (BIO_write(bp, buf, n) <= 0)
  ------------------
  |  Branch (93:13): [True: 0, False: 27.3k]
  ------------------
   94|      0|            return 0;
   95|  40.1k|    return 1;
   96|  40.1k|}

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

ossl_asn1_time_to_tm:
   77|  18.8k|{
   78|  18.8k|    static const int min[9] = { 0, 0, 1, 1, 0, 0, 0, 0, 0 };
   79|  18.8k|    static const int max[9] = { 99, 99, 12, 31, 23, 59, 59, 12, 59 };
   80|  18.8k|    static const int mdays[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
   81|  18.8k|    char *a;
   82|  18.8k|    int n, i, i2, l, o, min_l, strict = 0, end = 6, btz = 5, md;
   83|  18.8k|    struct tm tmp;
   84|       |#if defined(CHARSET_EBCDIC)
   85|       |    const char upper_z = 0x5A, num_zero = 0x30, period = 0x2E, minus = 0x2D, plus = 0x2B;
   86|       |#else
   87|  18.8k|    const char upper_z = 'Z', num_zero = '0', period = '.', minus = '-', plus = '+';
   88|  18.8k|#endif
   89|       |    /*
   90|       |     * ASN1_STRING_FLAG_X509_TIME is used to enforce RFC 5280
   91|       |     * time string format, in which:
   92|       |     *
   93|       |     * 1. "seconds" is a 'MUST'
   94|       |     * 2. "Zulu" timezone is a 'MUST'
   95|       |     * 3. "+|-" is not allowed to indicate a timezone
   96|       |     */
   97|  18.8k|    if (d->type == V_ASN1_UTCTIME) {
  ------------------
  |  |   82|  18.8k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (97:9): [True: 1.14k, False: 17.6k]
  ------------------
   98|  1.14k|        min_l = 13;
   99|  1.14k|        if (d->flags & ASN1_STRING_FLAG_X509_TIME) {
  ------------------
  |  |  184|  1.14k|# define ASN1_STRING_FLAG_X509_TIME 0x100
  ------------------
  |  Branch (99:13): [True: 0, False: 1.14k]
  ------------------
  100|      0|            strict = 1;
  101|      0|        }
  102|  17.6k|    } else if (d->type == V_ASN1_GENERALIZEDTIME) {
  ------------------
  |  |   83|  17.6k|# define V_ASN1_GENERALIZEDTIME          24 /**/
  ------------------
  |  Branch (102:16): [True: 17.6k, False: 0]
  ------------------
  103|  17.6k|        end = 7;
  104|  17.6k|        btz = 6;
  105|  17.6k|        min_l = 15;
  106|  17.6k|        if (d->flags & ASN1_STRING_FLAG_X509_TIME) {
  ------------------
  |  |  184|  17.6k|# define ASN1_STRING_FLAG_X509_TIME 0x100
  ------------------
  |  Branch (106:13): [True: 0, False: 17.6k]
  ------------------
  107|      0|            strict = 1;
  108|      0|        }
  109|  17.6k|    } else {
  110|      0|        return 0;
  111|      0|    }
  112|       |
  113|  18.8k|    l = d->length;
  114|  18.8k|    a = (char *)d->data;
  115|  18.8k|    o = 0;
  116|  18.8k|    memset(&tmp, 0, sizeof(tmp));
  117|       |
  118|       |    /*
  119|       |     * GENERALIZEDTIME is similar to UTCTIME except the year is represented
  120|       |     * as YYYY. This stuff treats everything as a two digit field so make
  121|       |     * first two fields 00 to 99
  122|       |     */
  123|       |
  124|  18.8k|    if (l < min_l)
  ------------------
  |  Branch (124:9): [True: 0, False: 18.8k]
  ------------------
  125|      0|        goto err;
  126|  95.0k|    for (i = 0; i < end; i++) {
  ------------------
  |  Branch (126:17): [True: 91.5k, False: 3.50k]
  ------------------
  127|  91.5k|        if (!strict && (i == btz) && ((a[o] == upper_z) || (a[o] == plus) || (a[o] == minus))) {
  ------------------
  |  Branch (127:13): [True: 91.5k, False: 0]
  |  Branch (127:24): [True: 9.35k, False: 82.1k]
  |  Branch (127:39): [True: 11, False: 9.34k]
  |  Branch (127:60): [True: 650, False: 8.69k]
  |  Branch (127:78): [True: 4.94k, False: 3.74k]
  ------------------
  128|  5.60k|            i++;
  129|  5.60k|            break;
  130|  5.60k|        }
  131|  85.9k|        if (!ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (131:13): [True: 2.22k, False: 83.6k]
  ------------------
  132|  2.22k|            goto err;
  133|  83.6k|        n = a[o] - num_zero;
  134|       |        /* incomplete 2-digital number */
  135|  83.6k|        if (++o == l)
  ------------------
  |  Branch (135:13): [True: 0, False: 83.6k]
  ------------------
  136|      0|            goto err;
  137|       |
  138|  83.6k|        if (!ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (138:13): [True: 6.23k, False: 77.4k]
  ------------------
  139|  6.23k|            goto err;
  140|  77.4k|        n = (n * 10) + a[o] - num_zero;
  141|       |        /* no more bytes to read, but we haven't seen time-zone yet */
  142|  77.4k|        if (++o == l)
  ------------------
  |  Branch (142:13): [True: 0, False: 77.4k]
  ------------------
  143|      0|            goto err;
  144|       |
  145|  77.4k|        i2 = (d->type == V_ASN1_UTCTIME) ? i + 1 : i;
  ------------------
  |  |   82|  77.4k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (145:14): [True: 6.03k, False: 71.4k]
  ------------------
  146|       |
  147|  77.4k|        if ((n < min[i2]) || (n > max[i2]))
  ------------------
  |  Branch (147:13): [True: 25, False: 77.4k]
  |  Branch (147:30): [True: 1.16k, False: 76.2k]
  ------------------
  148|  1.18k|            goto err;
  149|  76.2k|        switch (i2) {
  ------------------
  |  Branch (149:17): [True: 0, False: 76.2k]
  ------------------
  150|  16.6k|        case 0:
  ------------------
  |  Branch (150:9): [True: 16.6k, False: 59.5k]
  ------------------
  151|       |            /* UTC will never be here */
  152|  16.6k|            tmp.tm_year = n * 100 - 1900;
  153|  16.6k|            break;
  154|  16.5k|        case 1:
  ------------------
  |  Branch (154:9): [True: 16.5k, False: 59.7k]
  ------------------
  155|  16.5k|            if (d->type == V_ASN1_UTCTIME)
  ------------------
  |  |   82|  16.5k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (155:17): [True: 1.12k, False: 15.4k]
  ------------------
  156|  1.12k|                tmp.tm_year = n < 50 ? n + 100 : n;
  ------------------
  |  Branch (156:31): [True: 880, False: 241]
  ------------------
  157|  15.4k|            else
  158|  15.4k|                tmp.tm_year += n;
  159|  16.5k|            break;
  160|  11.2k|        case 2:
  ------------------
  |  Branch (160:9): [True: 11.2k, False: 65.0k]
  ------------------
  161|  11.2k|            tmp.tm_mon = n - 1;
  162|  11.2k|            break;
  163|  9.56k|        case 3:
  ------------------
  |  Branch (163:9): [True: 9.56k, False: 66.7k]
  ------------------
  164|       |            /* check if tm_mday is valid in tm_mon */
  165|  9.56k|            if (tmp.tm_mon == 1) {
  ------------------
  |  Branch (165:17): [True: 862, False: 8.70k]
  ------------------
  166|       |                /* it's February */
  167|    862|                md = mdays[1] + leap_year(tmp.tm_year + 1900);
  168|  8.70k|            } else {
  169|  8.70k|                md = mdays[tmp.tm_mon];
  170|  8.70k|            }
  171|  9.56k|            if (n > md)
  ------------------
  |  Branch (171:17): [True: 77, False: 9.48k]
  ------------------
  172|     77|                goto err;
  173|  9.48k|            tmp.tm_mday = n;
  174|  9.48k|            determine_days(&tmp);
  175|  9.48k|            break;
  176|  9.38k|        case 4:
  ------------------
  |  Branch (176:9): [True: 9.38k, False: 66.8k]
  ------------------
  177|  9.38k|            tmp.tm_hour = n;
  178|  9.38k|            break;
  179|  9.35k|        case 5:
  ------------------
  |  Branch (179:9): [True: 9.35k, False: 66.9k]
  ------------------
  180|  9.35k|            tmp.tm_min = n;
  181|  9.35k|            break;
  182|  3.50k|        case 6:
  ------------------
  |  Branch (182:9): [True: 3.50k, False: 72.7k]
  ------------------
  183|  3.50k|            tmp.tm_sec = n;
  184|  3.50k|            break;
  185|  76.2k|        }
  186|  76.2k|    }
  187|       |
  188|       |    /*
  189|       |     * Optional fractional seconds: decimal point followed by one or more
  190|       |     * digits.
  191|       |     */
  192|  9.10k|    if (d->type == V_ASN1_GENERALIZEDTIME && a[o] == period) {
  ------------------
  |  |   83|  18.2k|# define V_ASN1_GENERALIZEDTIME          24 /**/
  ------------------
  |  Branch (192:9): [True: 8.11k, False: 992]
  |  Branch (192:46): [True: 1.12k, False: 6.99k]
  ------------------
  193|  1.12k|        if (strict)
  ------------------
  |  Branch (193:13): [True: 0, False: 1.12k]
  ------------------
  194|       |            /* RFC 5280 forbids fractional seconds */
  195|      0|            goto err;
  196|  1.12k|        if (++o == l)
  ------------------
  |  Branch (196:13): [True: 11, False: 1.11k]
  ------------------
  197|     11|            goto err;
  198|  1.11k|        i = o;
  199|  13.5k|        while ((o < l) && ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (199:16): [True: 13.5k, False: 20]
  |  Branch (199:27): [True: 12.4k, False: 1.09k]
  ------------------
  200|  12.4k|            o++;
  201|       |        /* Must have at least one digit after decimal point */
  202|  1.11k|        if (i == o)
  ------------------
  |  Branch (202:13): [True: 14, False: 1.09k]
  ------------------
  203|     14|            goto err;
  204|       |        /* no more bytes to read, but we haven't seen time-zone yet */
  205|  1.09k|        if (o == l)
  ------------------
  |  Branch (205:13): [True: 20, False: 1.07k]
  ------------------
  206|     20|            goto err;
  207|  1.09k|    }
  208|       |
  209|       |    /*
  210|       |     * 'o' will never point to '\0' at this point, the only chance
  211|       |     * 'o' can point to '\0' is either the subsequent if or the first
  212|       |     * else if is true.
  213|       |     */
  214|  9.06k|    if (a[o] == upper_z) {
  ------------------
  |  Branch (214:9): [True: 983, False: 8.08k]
  ------------------
  215|    983|        o++;
  216|  8.08k|    } else if (!strict && ((a[o] == plus) || (a[o] == minus))) {
  ------------------
  |  Branch (216:16): [True: 8.08k, False: 0]
  |  Branch (216:28): [True: 1.67k, False: 6.40k]
  |  Branch (216:46): [True: 4.95k, False: 1.45k]
  ------------------
  217|  6.62k|        int offsign = a[o] == minus ? 1 : -1;
  ------------------
  |  Branch (217:23): [True: 4.95k, False: 1.67k]
  ------------------
  218|  6.62k|        int offset = 0;
  219|       |
  220|  6.62k|        o++;
  221|       |        /*
  222|       |         * if not equal, no need to do subsequent checks
  223|       |         * since the following for-loop will add 'o' by 4
  224|       |         * and the final return statement will check if 'l'
  225|       |         * and 'o' are equal.
  226|       |         */
  227|  6.62k|        if (o + 4 != l)
  ------------------
  |  Branch (227:13): [True: 38, False: 6.58k]
  ------------------
  228|     38|            goto err;
  229|  12.7k|        for (i = end; i < end + 2; i++) {
  ------------------
  |  Branch (229:23): [True: 10.8k, False: 1.86k]
  ------------------
  230|  10.8k|            if (!ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (230:17): [True: 1.33k, False: 9.51k]
  ------------------
  231|  1.33k|                goto err;
  232|  9.51k|            n = a[o] - num_zero;
  233|  9.51k|            o++;
  234|  9.51k|            if (!ossl_ascii_isdigit(a[o]))
  ------------------
  |  Branch (234:17): [True: 2.49k, False: 7.01k]
  ------------------
  235|  2.49k|                goto err;
  236|  7.01k|            n = (n * 10) + a[o] - num_zero;
  237|  7.01k|            i2 = (d->type == V_ASN1_UTCTIME) ? i + 1 : i;
  ------------------
  |  |   82|  7.01k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (237:18): [True: 550, False: 6.46k]
  ------------------
  238|  7.01k|            if ((n < min[i2]) || (n > max[i2]))
  ------------------
  |  Branch (238:17): [True: 0, False: 7.01k]
  |  Branch (238:34): [True: 890, False: 6.12k]
  ------------------
  239|    890|                goto err;
  240|       |            /* if tm is NULL, no need to adjust */
  241|  6.12k|            if (tm != NULL) {
  ------------------
  |  Branch (241:17): [True: 6.12k, False: 0]
  ------------------
  242|  6.12k|                if (i == end)
  ------------------
  |  Branch (242:21): [True: 4.26k, False: 1.86k]
  ------------------
  243|  4.26k|                    offset = n * 3600;
  244|  1.86k|                else if (i == end + 1)
  ------------------
  |  Branch (244:26): [True: 1.86k, False: 0]
  ------------------
  245|  1.86k|                    offset += n * 60;
  246|  6.12k|            }
  247|  6.12k|            o++;
  248|  6.12k|        }
  249|  1.86k|        if (offset && !OPENSSL_gmtime_adj(&tmp, 0, offset * offsign))
  ------------------
  |  Branch (249:13): [True: 1.79k, False: 68]
  |  Branch (249:23): [True: 228, False: 1.57k]
  ------------------
  250|    228|            goto err;
  251|  1.86k|    } else {
  252|       |        /* not Z, or not +/- in non-strict mode */
  253|  1.45k|        goto err;
  254|  1.45k|    }
  255|  2.62k|    if (o == l) {
  ------------------
  |  Branch (255:9): [True: 2.59k, False: 24]
  ------------------
  256|       |        /* success, check if tm should be filled */
  257|  2.59k|        if (tm != NULL)
  ------------------
  |  Branch (257:13): [True: 2.59k, False: 0]
  ------------------
  258|  2.59k|            *tm = tmp;
  259|  2.59k|        return 1;
  260|  2.59k|    }
  261|  16.2k| err:
  262|  16.2k|    return 0;
  263|  2.62k|}
ASN1_TIME_print:
  477|  18.8k|{
  478|  18.8k|    return ASN1_TIME_print_ex(bp, tm, ASN1_DTFLGS_RFC822);
  ------------------
  |  |  446|  18.8k|# define ASN1_DTFLGS_RFC822       0x00UL
  ------------------
  479|  18.8k|}
ASN1_TIME_print_ex:
  483|  18.8k|{
  484|  18.8k|    return ossl_asn1_time_print_ex(bp, tm, flags) > 0;
  485|  18.8k|}
ossl_asn1_time_print_ex:
  491|  18.8k|{
  492|  18.8k|    char *v;
  493|  18.8k|    int gmt = 0, l;
  494|  18.8k|    struct tm stm;
  495|  18.8k|    const char upper_z = 0x5A, period = 0x2E;
  496|       |
  497|       |    /* ossl_asn1_time_to_tm will check the time type */
  498|  18.8k|    if (!ossl_asn1_time_to_tm(&stm, tm))
  ------------------
  |  Branch (498:9): [True: 16.2k, False: 2.59k]
  ------------------
  499|  16.2k|        return BIO_write(bp, "Bad time value", 14) ? -1 : 0;
  ------------------
  |  Branch (499:16): [True: 16.2k, False: 0]
  ------------------
  500|       |
  501|  2.59k|    l = tm->length;
  502|  2.59k|    v = (char *)tm->data;
  503|  2.59k|    if (v[l - 1] == upper_z)
  ------------------
  |  Branch (503:9): [True: 959, False: 1.63k]
  ------------------
  504|    959|        gmt = 1;
  505|       |
  506|  2.59k|    if (tm->type == V_ASN1_GENERALIZEDTIME) {
  ------------------
  |  |   83|  2.59k|# define V_ASN1_GENERALIZEDTIME          24 /**/
  ------------------
  |  Branch (506:9): [True: 1.69k, False: 900]
  ------------------
  507|  1.69k|        char *f = NULL;
  508|  1.69k|        int f_len = 0;
  509|       |
  510|       |        /*
  511|       |         * Try to parse fractional seconds. '14' is the place of
  512|       |         * 'fraction point' in a GeneralizedTime string.
  513|       |         */
  514|  1.69k|        if (tm->length > 15 && v[14] == period) {
  ------------------
  |  Branch (514:13): [True: 1.42k, False: 276]
  |  Branch (514:32): [True: 1.00k, False: 422]
  ------------------
  515|  1.00k|            f = &v[14];
  516|  1.00k|            f_len = 1;
  517|  12.4k|            while (14 + f_len < l && ossl_ascii_isdigit(f[f_len]))
  ------------------
  |  Branch (517:20): [True: 12.4k, False: 0]
  |  Branch (517:38): [True: 11.4k, False: 1.00k]
  ------------------
  518|  11.4k|                ++f_len;
  519|  1.00k|        }
  520|       |
  521|  1.69k|        if ((flags & ASN1_DTFLGS_TYPE_MASK) == ASN1_DTFLGS_ISO8601) {
  ------------------
  |  |  445|  1.69k|# define ASN1_DTFLGS_TYPE_MASK    0x0FUL
  ------------------
                      if ((flags & ASN1_DTFLGS_TYPE_MASK) == ASN1_DTFLGS_ISO8601) {
  ------------------
  |  |  447|  1.69k|# define ASN1_DTFLGS_ISO8601      0x01UL
  ------------------
  |  Branch (521:13): [True: 0, False: 1.69k]
  ------------------
  522|      0|            return BIO_printf(bp, "%4d-%02d-%02d %02d:%02d:%02d%.*s%s",
  523|      0|                          stm.tm_year + 1900, stm.tm_mon + 1,
  524|      0|                          stm.tm_mday, stm.tm_hour,
  525|      0|                          stm.tm_min, stm.tm_sec, f_len, f,
  526|      0|                          (gmt ? "Z" : "")) > 0;
  ------------------
  |  Branch (526:28): [True: 0, False: 0]
  ------------------
  527|      0|        }
  528|  1.69k|        else {
  529|  1.69k|            return BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s",
  530|  1.69k|                          _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour,
  531|  1.69k|                          stm.tm_min, stm.tm_sec, f_len, f, stm.tm_year + 1900,
  532|  1.69k|                          (gmt ? " GMT" : "")) > 0;
  ------------------
  |  Branch (532:28): [True: 319, False: 1.37k]
  ------------------
  533|  1.69k|        }
  534|  1.69k|    } else {
  535|    900|        if ((flags & ASN1_DTFLGS_TYPE_MASK) == ASN1_DTFLGS_ISO8601) {
  ------------------
  |  |  445|    900|# define ASN1_DTFLGS_TYPE_MASK    0x0FUL
  ------------------
                      if ((flags & ASN1_DTFLGS_TYPE_MASK) == ASN1_DTFLGS_ISO8601) {
  ------------------
  |  |  447|    900|# define ASN1_DTFLGS_ISO8601      0x01UL
  ------------------
  |  Branch (535:13): [True: 0, False: 900]
  ------------------
  536|      0|            return BIO_printf(bp, "%4d-%02d-%02d %02d:%02d:%02d%s",
  537|      0|                          stm.tm_year + 1900, stm.tm_mon + 1,
  538|      0|                          stm.tm_mday, stm.tm_hour,
  539|      0|                          stm.tm_min, stm.tm_sec,
  540|      0|                          (gmt ? "Z" : "")) > 0;
  ------------------
  |  Branch (540:28): [True: 0, False: 0]
  ------------------
  541|      0|        }
  542|    900|        else {
  543|    900|            return BIO_printf(bp, "%s %2d %02d:%02d:%02d %d%s",
  544|    900|                          _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour,
  545|    900|                          stm.tm_min, stm.tm_sec, stm.tm_year + 1900,
  546|    900|                          (gmt ? " GMT" : "")) > 0;
  ------------------
  |  Branch (546:28): [True: 640, False: 260]
  ------------------
  547|    900|        }
  548|    900|    }
  549|  2.59k|}
a_time.c:leap_year:
   38|  9.23k|{
   39|  9.23k|    if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0))
  ------------------
  |  Branch (39:9): [True: 566, False: 8.66k]
  |  Branch (39:29): [True: 7.95k, False: 717]
  |  Branch (39:48): [True: 210, False: 7.74k]
  ------------------
   40|    776|        return 1;
   41|  8.45k|    return 0;
   42|  9.23k|}
a_time.c:determine_days:
   51|  9.48k|{
   52|  9.48k|    static const int ydays[12] = {
   53|  9.48k|        0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
   54|  9.48k|    };
   55|  9.48k|    int y = tm->tm_year + 1900;
   56|  9.48k|    int m = tm->tm_mon;
   57|  9.48k|    int d = tm->tm_mday;
   58|  9.48k|    int c;
   59|       |
   60|  9.48k|    tm->tm_yday = ydays[m] + d - 1;
   61|  9.48k|    if (m >= 2) {
  ------------------
  |  Branch (61:9): [True: 8.37k, False: 1.11k]
  ------------------
   62|       |        /* March and onwards can be one day further into the year */
   63|  8.37k|        tm->tm_yday += leap_year(y);
   64|  8.37k|        m += 2;
   65|  8.37k|    } else {
   66|       |        /* Treat January and February as part of the previous year */
   67|  1.11k|        m += 14;
   68|  1.11k|        y--;
   69|  1.11k|    }
   70|  9.48k|    c = y / 100;
   71|  9.48k|    y %= 100;
   72|       |    /* Zeller's congruence */
   73|  9.48k|    tm->tm_wday = (d + (13 * m) / 5 + y + y / 4 + c / 4 + 5 * c + 6) % 7;
   74|  9.48k|}

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

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

UTF8_getc:
   29|  21.5k|{
   30|  21.5k|    const unsigned char *p;
   31|  21.5k|    unsigned long value;
   32|  21.5k|    int ret;
   33|  21.5k|    if (len <= 0)
  ------------------
  |  Branch (33:9): [True: 0, False: 21.5k]
  ------------------
   34|      0|        return 0;
   35|  21.5k|    p = str;
   36|       |
   37|       |    /* Check syntax and work out the encoded value (if correct) */
   38|  21.5k|    if ((*p & 0x80) == 0) {
  ------------------
  |  Branch (38:9): [True: 14.7k, False: 6.76k]
  ------------------
   39|  14.7k|        value = *p++ & 0x7f;
   40|  14.7k|        ret = 1;
   41|  14.7k|    } else if ((*p & 0xe0) == 0xc0) {
  ------------------
  |  Branch (41:16): [True: 943, False: 5.82k]
  ------------------
   42|    943|        if (len < 2)
  ------------------
  |  Branch (42:13): [True: 113, False: 830]
  ------------------
   43|    113|            return -1;
   44|    830|        if ((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (44:13): [True: 146, False: 684]
  ------------------
   45|    146|            return -3;
   46|    684|        value = (*p++ & 0x1f) << 6;
   47|    684|        value |= *p++ & 0x3f;
   48|    684|        if (value < 0x80)
  ------------------
  |  Branch (48:13): [True: 207, False: 477]
  ------------------
   49|    207|            return -4;
   50|    477|        ret = 2;
   51|  5.82k|    } else if ((*p & 0xf0) == 0xe0) {
  ------------------
  |  Branch (51:16): [True: 4.05k, False: 1.76k]
  ------------------
   52|  4.05k|        if (len < 3)
  ------------------
  |  Branch (52:13): [True: 74, False: 3.98k]
  ------------------
   53|     74|            return -1;
   54|  3.98k|        if (((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (54:13): [True: 563, False: 3.42k]
  ------------------
   55|  3.98k|            || ((p[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (55:16): [True: 368, False: 3.05k]
  ------------------
   56|    931|            return -3;
   57|  3.05k|        value = (*p++ & 0xf) << 12;
   58|  3.05k|        value |= (*p++ & 0x3f) << 6;
   59|  3.05k|        value |= *p++ & 0x3f;
   60|  3.05k|        if (value < 0x800)
  ------------------
  |  Branch (60:13): [True: 196, False: 2.85k]
  ------------------
   61|    196|            return -4;
   62|  2.85k|        if (is_unicode_surrogate(value))
  ------------------
  |  Branch (62:13): [True: 307, False: 2.55k]
  ------------------
   63|    307|            return -2;
   64|  2.55k|        ret = 3;
   65|  2.55k|    } else if ((*p & 0xf8) == 0xf0) {
  ------------------
  |  Branch (65:16): [True: 1.19k, False: 571]
  ------------------
   66|  1.19k|        if (len < 4)
  ------------------
  |  Branch (66:13): [True: 132, False: 1.05k]
  ------------------
   67|    132|            return -1;
   68|  1.05k|        if (((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (68:13): [True: 219, False: 840]
  ------------------
   69|  1.05k|            || ((p[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (69:16): [True: 71, False: 769]
  ------------------
   70|  1.05k|            || ((p[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (70:16): [True: 71, False: 698]
  ------------------
   71|    361|            return -3;
   72|    698|        value = ((unsigned long)(*p++ & 0x7)) << 18;
   73|    698|        value |= (*p++ & 0x3f) << 12;
   74|    698|        value |= (*p++ & 0x3f) << 6;
   75|    698|        value |= *p++ & 0x3f;
   76|    698|        if (value < 0x10000)
  ------------------
  |  Branch (76:13): [True: 270, False: 428]
  ------------------
   77|    270|            return -4;
   78|    428|        ret = 4;
   79|    428|    } else
   80|    571|        return -2;
   81|  18.1k|    *val = value;
   82|  18.1k|    return ret;
   83|  21.5k|}
UTF8_putc:
   94|  28.4M|{
   95|  28.4M|    if (!str)
  ------------------
  |  Branch (95:9): [True: 14.1M, False: 14.2M]
  ------------------
   96|  14.1M|        len = 4;                /* Maximum we will need */
   97|  14.2M|    else if (len <= 0)
  ------------------
  |  Branch (97:14): [True: 0, False: 14.2M]
  ------------------
   98|      0|        return -1;
   99|  28.4M|    if (value < 0x80) {
  ------------------
  |  Branch (99:9): [True: 1.50M, False: 26.9M]
  ------------------
  100|  1.50M|        if (str)
  ------------------
  |  Branch (100:13): [True: 752k, False: 749k]
  ------------------
  101|   752k|            *str = (unsigned char)value;
  102|  1.50M|        return 1;
  103|  1.50M|    }
  104|  26.9M|    if (value < 0x800) {
  ------------------
  |  Branch (104:9): [True: 26.8M, False: 64.5k]
  ------------------
  105|  26.8M|        if (len < 2)
  ------------------
  |  Branch (105:13): [True: 0, False: 26.8M]
  ------------------
  106|      0|            return -1;
  107|  26.8M|        if (str) {
  ------------------
  |  Branch (107:13): [True: 13.4M, False: 13.4M]
  ------------------
  108|  13.4M|            *str++ = (unsigned char)(((value >> 6) & 0x1f) | 0xc0);
  109|  13.4M|            *str = (unsigned char)((value & 0x3f) | 0x80);
  110|  13.4M|        }
  111|  26.8M|        return 2;
  112|  26.8M|    }
  113|  64.5k|    if (value < 0x10000) {
  ------------------
  |  Branch (113:9): [True: 63.9k, False: 628]
  ------------------
  114|  63.9k|        if (is_unicode_surrogate(value))
  ------------------
  |  Branch (114:13): [True: 34, False: 63.9k]
  ------------------
  115|     34|            return -2;
  116|  63.9k|        if (len < 3)
  ------------------
  |  Branch (116:13): [True: 0, False: 63.9k]
  ------------------
  117|      0|            return -1;
  118|  63.9k|        if (str) {
  ------------------
  |  Branch (118:13): [True: 62.7k, False: 1.12k]
  ------------------
  119|  62.7k|            *str++ = (unsigned char)(((value >> 12) & 0xf) | 0xe0);
  120|  62.7k|            *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
  121|  62.7k|            *str = (unsigned char)((value & 0x3f) | 0x80);
  122|  62.7k|        }
  123|  63.9k|        return 3;
  124|  63.9k|    }
  125|    628|    if (value < UNICODE_LIMIT) {
  ------------------
  |  Branch (125:9): [True: 386, False: 242]
  ------------------
  126|    386|        if (len < 4)
  ------------------
  |  Branch (126:13): [True: 0, False: 386]
  ------------------
  127|      0|            return -1;
  128|    386|        if (str) {
  ------------------
  |  Branch (128:13): [True: 194, False: 192]
  ------------------
  129|    194|            *str++ = (unsigned char)(((value >> 18) & 0x7) | 0xf0);
  130|    194|            *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80);
  131|    194|            *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
  132|    194|            *str = (unsigned char)((value & 0x3f) | 0x80);
  133|    194|        }
  134|    386|        return 4;
  135|    386|    }
  136|    242|    return -2;
  137|    628|}

EVP_PKEY_asn1_get_count:
   39|  9.81k|{
   40|  9.81k|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|  9.81k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   41|  9.81k|    if (app_methods)
  ------------------
  |  Branch (41:9): [True: 0, False: 9.81k]
  ------------------
   42|      0|        num += sk_EVP_PKEY_ASN1_METHOD_num(app_methods);
   43|  9.81k|    return num;
   44|  9.81k|}
EVP_PKEY_asn1_get0:
   47|   127k|{
   48|   127k|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|   127k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   49|   127k|    if (idx < 0)
  ------------------
  |  Branch (49:9): [True: 0, False: 127k]
  ------------------
   50|      0|        return NULL;
   51|   127k|    if (idx < num)
  ------------------
  |  Branch (51:9): [True: 127k, False: 0]
  ------------------
   52|   127k|        return standard_methods[idx];
   53|      0|    idx -= num;
   54|      0|    return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
   55|   127k|}
EVP_PKEY_asn1_find:
   82|  10.3k|{
   83|  10.3k|    const EVP_PKEY_ASN1_METHOD *t;
   84|       |
   85|  10.3k|    for (;;) {
   86|  10.3k|        t = pkey_asn1_find(type);
   87|  10.3k|        if (!t || !(t->pkey_flags & ASN1_PKEY_ALIAS))
  ------------------
  |  | 1554|  10.3k|# define ASN1_PKEY_ALIAS         0x1
  ------------------
  |  Branch (87:13): [True: 35, False: 10.3k]
  |  Branch (87:19): [True: 10.2k, False: 12]
  ------------------
   88|  10.3k|            break;
   89|     12|        type = t->pkey_base_id;
   90|     12|    }
   91|  10.3k|    if (pe) {
  ------------------
  |  Branch (91:9): [True: 10.3k, False: 0]
  ------------------
   92|  10.3k|#ifndef OPENSSL_NO_ENGINE
   93|  10.3k|        ENGINE *e;
   94|       |        /* type will contain the final unaliased type */
   95|  10.3k|        e = ENGINE_get_pkey_asn1_meth_engine(type);
   96|  10.3k|        if (e) {
  ------------------
  |  Branch (96:13): [True: 0, False: 10.3k]
  ------------------
   97|      0|            *pe = e;
   98|      0|            return ENGINE_get_pkey_asn1_meth(e, type);
   99|      0|        }
  100|  10.3k|#endif
  101|  10.3k|        *pe = NULL;
  102|  10.3k|    }
  103|  10.3k|    return t;
  104|  10.3k|}
EVP_PKEY_asn1_find_str:
  108|  9.81k|{
  109|  9.81k|    int i;
  110|  9.81k|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
  111|       |
  112|  9.81k|    if (len == -1)
  ------------------
  |  Branch (112:9): [True: 0, False: 9.81k]
  ------------------
  113|      0|        len = strlen(str);
  114|  9.81k|    if (pe) {
  ------------------
  |  Branch (114:9): [True: 9.81k, False: 0]
  ------------------
  115|  9.81k|#ifndef OPENSSL_NO_ENGINE
  116|  9.81k|        ENGINE *e;
  117|  9.81k|        ameth = ENGINE_pkey_asn1_find_str(&e, str, len);
  118|  9.81k|        if (ameth) {
  ------------------
  |  Branch (118:13): [True: 0, False: 9.81k]
  ------------------
  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|  9.81k|#endif
  129|  9.81k|        *pe = NULL;
  130|  9.81k|    }
  131|   133k|    for (i = EVP_PKEY_asn1_get_count(); i-- > 0; ) {
  ------------------
  |  Branch (131:41): [True: 127k, False: 6.01k]
  ------------------
  132|   127k|        ameth = EVP_PKEY_asn1_get0(i);
  133|   127k|        if (ameth->pkey_flags & ASN1_PKEY_ALIAS)
  ------------------
  |  | 1554|   127k|# define ASN1_PKEY_ALIAS         0x1
  ------------------
  |  Branch (133:13): [True: 37.2k, False: 90.2k]
  ------------------
  134|  37.2k|            continue;
  135|  90.2k|        if ((int)strlen(ameth->pem_str) == len
  ------------------
  |  Branch (135:13): [True: 5.96k, False: 84.3k]
  ------------------
  136|  90.2k|            && OPENSSL_strncasecmp(ameth->pem_str, str, len) == 0)
  ------------------
  |  Branch (136:16): [True: 3.79k, False: 2.17k]
  ------------------
  137|  3.79k|            return ameth;
  138|  90.2k|    }
  139|  6.01k|    return NULL;
  140|  9.81k|}
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|  10.3k|{
   59|  10.3k|    EVP_PKEY_ASN1_METHOD tmp;
   60|  10.3k|    const EVP_PKEY_ASN1_METHOD *t = &tmp, **ret;
   61|       |
   62|  10.3k|    tmp.pkey_id = type;
   63|  10.3k|    if (app_methods) {
  ------------------
  |  Branch (63:9): [True: 0, False: 10.3k]
  ------------------
   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|  10.3k|    ret = OBJ_bsearch_ameth(&t, standard_methods, OSSL_NELEM(standard_methods));
  ------------------
  |  |   14|  10.3k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   70|  10.3k|    if (ret == NULL || *ret == NULL)
  ------------------
  |  Branch (70:9): [True: 35, False: 10.3k]
  |  Branch (70:24): [True: 0, False: 10.3k]
  ------------------
   71|     35|        return NULL;
   72|  10.3k|    return *ret;
   73|  10.3k|}
ameth_lib.c:ameth_cmp:
   31|  37.1k|{
   32|  37.1k|    return ((*a)->pkey_id - (*b)->pkey_id);
   33|  37.1k|}

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

ASN1_get_object:
   48|   202M|{
   49|   202M|    int i, ret;
   50|   202M|    long len;
   51|   202M|    const unsigned char *p = *pp;
   52|   202M|    int tag, xclass, inf;
   53|   202M|    long max = omax;
   54|       |
   55|   202M|    if (omax <= 0) {
  ------------------
  |  Branch (55:9): [True: 0, False: 202M]
  ------------------
   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|   202M|    ret = (*p & V_ASN1_CONSTRUCTED);
  ------------------
  |  |   52|   202M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
   60|   202M|    xclass = (*p & V_ASN1_PRIVATE);
  ------------------
  |  |   50|   202M|# define V_ASN1_PRIVATE                  0xc0
  ------------------
   61|   202M|    i = *p & V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   53|   202M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
   62|   202M|    if (i == V_ASN1_PRIMITIVE_TAG) { /* high-tag */
  ------------------
  |  |   53|   202M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  |  Branch (62:9): [True: 338k, False: 201M]
  ------------------
   63|   338k|        p++;
   64|   338k|        if (--max == 0)
  ------------------
  |  Branch (64:13): [True: 906, False: 337k]
  ------------------
   65|    906|            goto err;
   66|   337k|        len = 0;
   67|   718k|        while (*p & 0x80) {
  ------------------
  |  Branch (67:16): [True: 384k, False: 334k]
  ------------------
   68|   384k|            len <<= 7L;
   69|   384k|            len |= *(p++) & 0x7f;
   70|   384k|            if (--max == 0)
  ------------------
  |  Branch (70:17): [True: 1.72k, False: 382k]
  ------------------
   71|  1.72k|                goto err;
   72|   382k|            if (len > (INT_MAX >> 7L))
  ------------------
  |  Branch (72:17): [True: 1.00k, False: 381k]
  ------------------
   73|  1.00k|                goto err;
   74|   382k|        }
   75|   334k|        len <<= 7L;
   76|   334k|        len |= *(p++) & 0x7f;
   77|   334k|        tag = (int)len;
   78|   334k|        if (--max == 0)
  ------------------
  |  Branch (78:13): [True: 1.35k, False: 333k]
  ------------------
   79|  1.35k|            goto err;
   80|   201M|    } else {
   81|   201M|        tag = i;
   82|   201M|        p++;
   83|   201M|        if (--max == 0)
  ------------------
  |  Branch (83:13): [True: 14.9k, False: 201M]
  ------------------
   84|  14.9k|            goto err;
   85|   201M|    }
   86|   202M|    *ptag = tag;
   87|   202M|    *pclass = xclass;
   88|   202M|    if (!asn1_get_length(&p, &inf, plength, max))
  ------------------
  |  Branch (88:9): [True: 23.3k, False: 202M]
  ------------------
   89|  23.3k|        goto err;
   90|       |
   91|   202M|    if (inf && !(ret & V_ASN1_CONSTRUCTED))
  ------------------
  |  |   52|  24.5M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (91:9): [True: 24.5M, False: 177M]
  |  Branch (91:16): [True: 1.09k, False: 24.5M]
  ------------------
   92|  1.09k|        goto err;
   93|       |
   94|   202M|    if (*plength > (omax - (p - *pp))) {
  ------------------
  |  Branch (94:9): [True: 3.74M, False: 198M]
  ------------------
   95|  3.74M|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  401|  3.74M|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  3.74M|    (ERR_new(),                                                 \
  |  |  |  |  404|  3.74M|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  3.74M|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  3.74M|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  3.74M|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  3.74M|     ERR_set_error)
  |  |  ------------------
  ------------------
   96|       |        /*
   97|       |         * Set this so that even if things are not long enough the values are
   98|       |         * set correctly
   99|       |         */
  100|  3.74M|        ret |= 0x80;
  101|  3.74M|    }
  102|   202M|    *pp = p;
  103|   202M|    return ret | inf;
  104|  44.3k| err:
  105|  44.3k|    ERR_raise(ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG);
  ------------------
  |  |  401|  44.3k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  44.3k|    (ERR_new(),                                                 \
  |  |  |  |  404|  44.3k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  44.3k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  44.3k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  44.3k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  44.3k|     ERR_set_error)
  |  |  ------------------
  ------------------
  106|  44.3k|    return 0x80;
  107|   202M|}
ASN1_put_object:
  162|  1.03M|{
  163|  1.03M|    unsigned char *p = *pp;
  164|  1.03M|    int i, ttag;
  165|       |
  166|  1.03M|    i = (constructed) ? V_ASN1_CONSTRUCTED : 0;
  ------------------
  |  |   52|   372k|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (166:9): [True: 372k, False: 658k]
  ------------------
  167|  1.03M|    i |= (xclass & V_ASN1_PRIVATE);
  ------------------
  |  |   50|  1.03M|# define V_ASN1_PRIVATE                  0xc0
  ------------------
  168|  1.03M|    if (tag < 31) {
  ------------------
  |  Branch (168:9): [True: 1.02M, False: 1.44k]
  ------------------
  169|  1.02M|        *(p++) = i | (tag & V_ASN1_PRIMITIVE_TAG);
  ------------------
  |  |   53|  1.02M|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  170|  1.02M|    } else {
  171|  1.44k|        *(p++) = i | V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   53|  1.44k|# define V_ASN1_PRIMITIVE_TAG            0x1f
  ------------------
  172|  4.66k|        for (i = 0, ttag = tag; ttag > 0; i++)
  ------------------
  |  Branch (172:33): [True: 3.22k, False: 1.44k]
  ------------------
  173|  3.22k|            ttag >>= 7;
  174|  1.44k|        ttag = i;
  175|  4.66k|        while (i-- > 0) {
  ------------------
  |  Branch (175:16): [True: 3.22k, False: 1.44k]
  ------------------
  176|  3.22k|            p[i] = tag & 0x7f;
  177|  3.22k|            if (i != (ttag - 1))
  ------------------
  |  Branch (177:17): [True: 1.77k, False: 1.44k]
  ------------------
  178|  1.77k|                p[i] |= 0x80;
  179|  3.22k|            tag >>= 7;
  180|  3.22k|        }
  181|  1.44k|        p += ttag;
  182|  1.44k|    }
  183|  1.03M|    if (constructed == 2)
  ------------------
  |  Branch (183:9): [True: 0, False: 1.03M]
  ------------------
  184|      0|        *(p++) = 0x80;
  185|  1.03M|    else
  186|  1.03M|        asn1_put_length(&p, length);
  187|  1.03M|    *pp = p;
  188|  1.03M|}
ASN1_object_size:
  223|  4.13M|{
  224|  4.13M|    int ret = 1;
  225|       |
  226|  4.13M|    if (length < 0)
  ------------------
  |  Branch (226:9): [True: 0, False: 4.13M]
  ------------------
  227|      0|        return -1;
  228|  4.13M|    if (tag >= 31) {
  ------------------
  |  Branch (228:9): [True: 5.05k, False: 4.13M]
  ------------------
  229|  16.7k|        while (tag > 0) {
  ------------------
  |  Branch (229:16): [True: 11.7k, False: 5.05k]
  ------------------
  230|  11.7k|            tag >>= 7;
  231|  11.7k|            ret++;
  232|  11.7k|        }
  233|  5.05k|    }
  234|  4.13M|    if (constructed == 2) {
  ------------------
  |  Branch (234:9): [True: 0, False: 4.13M]
  ------------------
  235|      0|        ret += 3;
  236|  4.13M|    } else {
  237|  4.13M|        ret++;
  238|  4.13M|        if (length > 127) {
  ------------------
  |  Branch (238:13): [True: 97.7k, False: 4.04M]
  ------------------
  239|  97.7k|            int tmplen = length;
  240|   262k|            while (tmplen > 0) {
  ------------------
  |  Branch (240:20): [True: 165k, False: 97.7k]
  ------------------
  241|   165k|                tmplen >>= 8;
  242|   165k|                ret++;
  243|   165k|            }
  244|  97.7k|        }
  245|  4.13M|    }
  246|  4.13M|    if (ret >= INT_MAX - length)
  ------------------
  |  Branch (246:9): [True: 0, False: 4.13M]
  ------------------
  247|      0|        return -1;
  248|  4.13M|    return ret + length;
  249|  4.13M|}
ossl_asn1_string_set_bits_left:
  252|  24.7k|{
  253|  24.7k|    str->flags &= ~0x07;
  254|  24.7k|    str->flags |= ASN1_STRING_FLAG_BITS_LEFT | (num & 0x07);
  ------------------
  |  |  161|  24.7k|# define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  255|  24.7k|}
ASN1_STRING_copy:
  258|  38.0k|{
  259|  38.0k|    if (str == NULL)
  ------------------
  |  Branch (259:9): [True: 0, False: 38.0k]
  ------------------
  260|      0|        return 0;
  261|  38.0k|    dst->type = str->type;
  262|  38.0k|    if (!ASN1_STRING_set(dst, str->data, str->length))
  ------------------
  |  Branch (262:9): [True: 0, False: 38.0k]
  ------------------
  263|      0|        return 0;
  264|       |    /* Copy flags but preserve embed value */
  265|  38.0k|    dst->flags &= ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|  38.0k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  266|  38.0k|    dst->flags |= str->flags & ~ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|  38.0k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  267|  38.0k|    return 1;
  268|  38.0k|}
ASN1_STRING_set:
  287|  4.99M|{
  288|  4.99M|    unsigned char *c;
  289|  4.99M|    const char *data = _data;
  290|  4.99M|    size_t len;
  291|       |
  292|  4.99M|    if (len_in < 0) {
  ------------------
  |  Branch (292:9): [True: 0, False: 4.99M]
  ------------------
  293|      0|        if (data == NULL)
  ------------------
  |  Branch (293:13): [True: 0, False: 0]
  ------------------
  294|      0|            return 0;
  295|      0|        len = strlen(data);
  296|  4.99M|    } else {
  297|  4.99M|        len = (size_t)len_in;
  298|  4.99M|    }
  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|  4.99M|    if (len > INT_MAX - 1) {
  ------------------
  |  Branch (304:9): [True: 0, False: 4.99M]
  ------------------
  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|  4.99M|    if ((size_t)str->length <= len || str->data == NULL) {
  ------------------
  |  Branch (308:9): [True: 4.99M, False: 0]
  |  Branch (308:39): [True: 0, False: 0]
  ------------------
  309|  4.99M|        c = str->data;
  310|  4.99M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  311|       |        /* No NUL terminator in fuzzing builds */
  312|  4.99M|        str->data = OPENSSL_realloc(c, len != 0 ? len : 1);
  ------------------
  |  |  109|  9.99M|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.99M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.99M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (109:30): [True: 4.74M, False: 254k]
  |  |  ------------------
  ------------------
  313|       |#else
  314|       |        str->data = OPENSSL_realloc(c, len + 1);
  315|       |#endif
  316|  4.99M|        if (str->data == NULL) {
  ------------------
  |  Branch (316:13): [True: 0, False: 4.99M]
  ------------------
  317|      0|            str->data = c;
  318|      0|            return 0;
  319|      0|        }
  320|  4.99M|    }
  321|  4.99M|    str->length = len;
  322|  4.99M|    if (data != NULL) {
  ------------------
  |  Branch (322:9): [True: 4.59M, False: 398k]
  ------------------
  323|  4.59M|        memcpy(str->data, data, len);
  324|  4.59M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  325|       |        /* Set the unused byte to something non NUL and printable. */
  326|  4.59M|        if (len == 0)
  ------------------
  |  Branch (326:13): [True: 253k, False: 4.34M]
  ------------------
  327|   253k|            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|  4.59M|    }
  336|  4.99M|    return 1;
  337|  4.99M|}
ASN1_STRING_set0:
  340|   156k|{
  341|   156k|    OPENSSL_free(str->data);
  ------------------
  |  |  115|   156k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   156k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   156k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  342|   156k|    str->data = data;
  343|   156k|    str->length = len;
  344|   156k|}
ASN1_STRING_new:
  347|     72|{
  348|     72|    return ASN1_STRING_type_new(V_ASN1_OCTET_STRING);
  ------------------
  |  |   66|     72|# define V_ASN1_OCTET_STRING             4
  ------------------
  349|     72|}
ASN1_STRING_type_new:
  352|  5.93M|{
  353|  5.93M|    ASN1_STRING *ret;
  354|       |
  355|  5.93M|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  5.93M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.93M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.93M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  356|  5.93M|    if (ret == NULL)
  ------------------
  |  Branch (356:9): [True: 0, False: 5.93M]
  ------------------
  357|      0|        return NULL;
  358|  5.93M|    ret->type = type;
  359|  5.93M|    return ret;
  360|  5.93M|}
ossl_asn1_string_embed_free:
  363|  6.23M|{
  364|  6.23M|    if (a == NULL)
  ------------------
  |  Branch (364:9): [True: 0, False: 6.23M]
  ------------------
  365|      0|        return;
  366|  6.23M|    if (!(a->flags & ASN1_STRING_FLAG_NDEF))
  ------------------
  |  |  167|  6.23M|# define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (366:9): [True: 6.23M, False: 0]
  ------------------
  367|  6.23M|        OPENSSL_free(a->data);
  ------------------
  |  |  115|  6.23M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  6.23M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  6.23M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  368|  6.23M|    if (embed == 0)
  ------------------
  |  Branch (368:9): [True: 5.93M, False: 303k]
  ------------------
  369|  5.93M|        OPENSSL_free(a);
  ------------------
  |  |  115|  5.93M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.93M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.93M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  370|  6.23M|}
ASN1_STRING_free:
  373|  1.87M|{
  374|  1.87M|    if (a == NULL)
  ------------------
  |  Branch (374:9): [True: 1.51M, False: 353k]
  ------------------
  375|  1.51M|        return;
  376|   353k|    ossl_asn1_string_embed_free(a, a->flags & ASN1_STRING_FLAG_EMBED);
  ------------------
  |  |  182|   353k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  377|   353k|}
ASN1_STRING_clear_free:
  380|    637|{
  381|    637|    if (a == NULL)
  ------------------
  |  Branch (381:9): [True: 15, False: 622]
  ------------------
  382|     15|        return;
  383|    622|    if (a->data && !(a->flags & ASN1_STRING_FLAG_NDEF))
  ------------------
  |  |  167|    622|# define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (383:9): [True: 622, False: 0]
  |  Branch (383:20): [True: 622, False: 0]
  ------------------
  384|    622|        OPENSSL_cleanse(a->data, a->length);
  385|    622|    ASN1_STRING_free(a);
  386|    622|}
ASN1_STRING_length:
  406|  83.6k|{
  407|  83.6k|    return x->length;
  408|  83.6k|}
ASN1_STRING_get0_data:
  423|  83.6k|{
  424|  83.6k|    return x->data;
  425|  83.6k|}
asn1_lib.c:asn1_get_length:
  118|   202M|{
  119|   202M|    const unsigned char *p = *pp;
  120|   202M|    unsigned long ret = 0;
  121|   202M|    int i;
  122|       |
  123|   202M|    if (max-- < 1)
  ------------------
  |  Branch (123:9): [True: 0, False: 202M]
  ------------------
  124|      0|        return 0;
  125|   202M|    if (*p == 0x80) {
  ------------------
  |  Branch (125:9): [True: 24.5M, False: 177M]
  ------------------
  126|  24.5M|        *inf = 1;
  127|  24.5M|        p++;
  128|   177M|    } else {
  129|   177M|        *inf = 0;
  130|   177M|        i = *p & 0x7f;
  131|   177M|        if (*p++ & 0x80) {
  ------------------
  |  Branch (131:13): [True: 2.11M, False: 175M]
  ------------------
  132|  2.11M|            if (max < i + 1)
  ------------------
  |  Branch (132:17): [True: 21.5k, False: 2.09M]
  ------------------
  133|  21.5k|                return 0;
  134|       |            /* Skip leading zeroes */
  135|  2.23M|            while (i > 0 && *p == 0) {
  ------------------
  |  Branch (135:20): [True: 2.19M, False: 43.7k]
  |  Branch (135:29): [True: 143k, False: 2.05M]
  ------------------
  136|   143k|                p++;
  137|   143k|                i--;
  138|   143k|            }
  139|  2.09M|            if (i > (int)sizeof(long))
  ------------------
  |  Branch (139:17): [True: 1.25k, False: 2.09M]
  ------------------
  140|  1.25k|                return 0;
  141|  4.49M|            while (i > 0) {
  ------------------
  |  Branch (141:20): [True: 2.40M, False: 2.09M]
  ------------------
  142|  2.40M|                ret <<= 8;
  143|  2.40M|                ret |= *p++;
  144|  2.40M|                i--;
  145|  2.40M|            }
  146|  2.09M|            if (ret > LONG_MAX)
  ------------------
  |  Branch (146:17): [True: 519, False: 2.09M]
  ------------------
  147|    519|                return 0;
  148|   175M|        } else {
  149|   175M|            ret = i;
  150|   175M|        }
  151|   177M|    }
  152|   202M|    *pp = p;
  153|   202M|    *rl = (long)ret;
  154|   202M|    return 1;
  155|   202M|}
asn1_lib.c:asn1_put_length:
  201|  1.03M|{
  202|  1.03M|    unsigned char *p = *pp;
  203|  1.03M|    int i, len;
  204|       |
  205|  1.03M|    if (length <= 127) {
  ------------------
  |  Branch (205:9): [True: 1.00M, False: 29.5k]
  ------------------
  206|  1.00M|        *(p++) = (unsigned char)length;
  207|  1.00M|    } else {
  208|  29.5k|        len = length;
  209|  79.4k|        for (i = 0; len > 0; i++)
  ------------------
  |  Branch (209:21): [True: 49.8k, False: 29.5k]
  ------------------
  210|  49.8k|            len >>= 8;
  211|  29.5k|        *(p++) = i | 0x80;
  212|  29.5k|        len = i;
  213|  79.4k|        while (i-- > 0) {
  ------------------
  |  Branch (213:16): [True: 49.8k, False: 29.5k]
  ------------------
  214|  49.8k|            p[i] = length & 0xff;
  215|  49.8k|            length >>= 8;
  216|  49.8k|        }
  217|  29.5k|        p += len;
  218|  29.5k|    }
  219|  1.03M|    *pp = p;
  220|  1.03M|}

ASN1_parse_dump:
   90|  58.4k|{
   91|  58.4k|    return asn1_parse2(bp, &pp, len, 0, 0, indent, dump);
   92|  58.4k|}
ASN1_tag2str:
  361|  1.35M|{
  362|  1.35M|    static const char *const tag2str[] = {
  363|       |        /* 0-4 */
  364|  1.35M|        "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING",
  365|       |        /* 5-9 */
  366|  1.35M|        "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL",
  367|       |        /* 10-13 */
  368|  1.35M|        "ENUMERATED", "<ASN1 11>", "UTF8STRING", "<ASN1 13>",
  369|       |        /* 15-17 */
  370|  1.35M|        "<ASN1 14>", "<ASN1 15>", "SEQUENCE", "SET",
  371|       |        /* 18-20 */
  372|  1.35M|        "NUMERICSTRING", "PRINTABLESTRING", "T61STRING",
  373|       |        /* 21-24 */
  374|  1.35M|        "VIDEOTEXSTRING", "IA5STRING", "UTCTIME", "GENERALIZEDTIME",
  375|       |        /* 25-27 */
  376|  1.35M|        "GRAPHICSTRING", "VISIBLESTRING", "GENERALSTRING",
  377|       |        /* 28-30 */
  378|  1.35M|        "UNIVERSALSTRING", "<ASN1 29>", "BMPSTRING"
  379|  1.35M|    };
  380|       |
  381|  1.35M|    if ((tag == V_ASN1_NEG_INTEGER) || (tag == V_ASN1_NEG_ENUMERATED))
  ------------------
  |  |   98|  1.35M|# define V_ASN1_NEG_INTEGER              (2 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|  1.35M|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
                  if ((tag == V_ASN1_NEG_INTEGER) || (tag == V_ASN1_NEG_ENUMERATED))
  ------------------
  |  |   99|  1.35M|# define V_ASN1_NEG_ENUMERATED           (10 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|  1.35M|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  |  Branch (381:9): [True: 604, False: 1.35M]
  |  Branch (381:40): [True: 78, False: 1.35M]
  ------------------
  382|    682|        tag &= ~0x100;
  383|       |
  384|  1.35M|    if (tag < 0 || tag > 30)
  ------------------
  |  Branch (384:9): [True: 11.0k, False: 1.34M]
  |  Branch (384:20): [True: 1.78k, False: 1.34M]
  ------------------
  385|  12.8k|        return "(unknown)";
  386|  1.34M|    return tag2str[tag];
  387|  1.35M|}
asn1_parse.c:asn1_parse2:
   96|   446k|{
   97|   446k|    const unsigned char *p, *ep, *tot, *op, *opp;
   98|   446k|    long len;
   99|   446k|    int tag, xclass, ret = 0;
  100|   446k|    int nl, hl, j, r;
  101|   446k|    ASN1_OBJECT *o = NULL;
  102|   446k|    ASN1_OCTET_STRING *os = NULL;
  103|   446k|    ASN1_INTEGER *ai = NULL;
  104|   446k|    ASN1_ENUMERATED *ae = NULL;
  105|       |    /* ASN1_BMPSTRING *bmp=NULL; */
  106|   446k|    int dump_indent, dump_cont = 0;
  107|       |
  108|   446k|    if (depth > ASN1_PARSE_MAXDEPTH) {
  ------------------
  |  |   17|   446k|#define ASN1_PARSE_MAXDEPTH 128
  ------------------
  |  Branch (108:9): [True: 26, False: 446k]
  ------------------
  109|     26|        BIO_puts(bp, "BAD RECURSION DEPTH\n");
  110|     26|        return 0;
  111|     26|    }
  112|       |
  113|   446k|    dump_indent = 6;            /* Because we know BIO_dump_indent() */
  114|   446k|    p = *pp;
  115|   446k|    tot = p + length;
  116|  1.57M|    while (length > 0) {
  ------------------
  |  Branch (116:12): [True: 1.36M, False: 213k]
  ------------------
  117|  1.36M|        op = p;
  118|  1.36M|        j = ASN1_get_object(&p, &len, &tag, &xclass, length);
  119|  1.36M|        if (j & 0x80) {
  ------------------
  |  Branch (119:13): [True: 2.03k, False: 1.36M]
  ------------------
  120|  2.03k|            BIO_puts(bp, "Error in encoding\n");
  121|  2.03k|            goto end;
  122|  2.03k|        }
  123|  1.36M|        hl = (p - op);
  124|  1.36M|        length -= hl;
  125|       |        /*
  126|       |         * if j == 0x21 it is a constructed indefinite length object
  127|       |         */
  128|  1.36M|        if (!asn1_print_info(bp, (long)offset + (long)(op - *pp), depth,
  ------------------
  |  Branch (128:13): [True: 0, False: 1.36M]
  ------------------
  129|  1.36M|                             hl, len, tag, xclass, j, (indent) ? depth : 0))
  ------------------
  |  Branch (129:55): [True: 1.36M, False: 0]
  ------------------
  130|      0|            goto end;
  131|  1.36M|        if (j & V_ASN1_CONSTRUCTED) {
  ------------------
  |  |   52|  1.36M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (131:13): [True: 493k, False: 870k]
  ------------------
  132|   493k|            const unsigned char *sp = p;
  133|       |
  134|   493k|            ep = p + len;
  135|   493k|            if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (135:17): [True: 0, False: 493k]
  ------------------
  136|      0|                goto end;
  137|   493k|            if (len > length) {
  ------------------
  |  Branch (137:17): [True: 0, False: 493k]
  ------------------
  138|      0|                BIO_printf(bp, "length is greater than %ld\n", length);
  139|      0|                goto end;
  140|      0|            }
  141|   493k|            if ((j == 0x21) && (len == 0)) {
  ------------------
  |  Branch (141:17): [True: 225k, False: 267k]
  |  Branch (141:32): [True: 225k, False: 0]
  ------------------
  142|   225k|                for (;;) {
  143|   225k|                    r = asn1_parse2(bp, &p, (long)(tot - p),
  144|   225k|                                    offset + (p - *pp), depth + 1,
  145|   225k|                                    indent, dump);
  146|   225k|                    if (r == 0)
  ------------------
  |  Branch (146:25): [True: 13.4k, False: 212k]
  ------------------
  147|  13.4k|                        goto end;
  148|   212k|                    if ((r == 2) || (p >= tot)) {
  ------------------
  |  Branch (148:25): [True: 210k, False: 1.90k]
  |  Branch (148:37): [True: 1.90k, False: 0]
  ------------------
  149|   212k|                        len = p - sp;
  150|   212k|                        break;
  151|   212k|                    }
  152|   212k|                }
  153|   267k|            } else {
  154|   267k|                long tmp = len;
  155|       |
  156|   425k|                while (p < ep) {
  ------------------
  |  Branch (156:24): [True: 161k, False: 264k]
  ------------------
  157|   161k|                    sp = p;
  158|   161k|                    r = asn1_parse2(bp, &p, tmp,
  159|   161k|                                    offset + (p - *pp), depth + 1,
  160|   161k|                                    indent, dump);
  161|   161k|                    if (r == 0)
  ------------------
  |  Branch (161:25): [True: 2.85k, False: 158k]
  ------------------
  162|  2.85k|                        goto end;
  163|   158k|                    tmp -= p - sp;
  164|   158k|                }
  165|   267k|            }
  166|   870k|        } else if (xclass != 0) {
  ------------------
  |  Branch (166:20): [True: 24.6k, False: 846k]
  ------------------
  167|  24.6k|            p += len;
  168|  24.6k|            if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (168:17): [True: 0, False: 24.6k]
  ------------------
  169|      0|                goto end;
  170|   846k|        } else {
  171|   846k|            nl = 0;
  172|   846k|            if ((tag == V_ASN1_PRINTABLESTRING) ||
  ------------------
  |  |   77|   846k|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  |  Branch (172:17): [True: 4.30k, False: 841k]
  ------------------
  173|   846k|                (tag == V_ASN1_T61STRING) ||
  ------------------
  |  |   78|   841k|# define V_ASN1_T61STRING                20
  ------------------
  |  Branch (173:17): [True: 433, False: 841k]
  ------------------
  174|   846k|                (tag == V_ASN1_IA5STRING) ||
  ------------------
  |  |   81|   841k|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (174:17): [True: 1.18k, False: 840k]
  ------------------
  175|   846k|                (tag == V_ASN1_VISIBLESTRING) ||
  ------------------
  |  |   86|   840k|# define V_ASN1_VISIBLESTRING            26/* alias */
  ------------------
  |  Branch (175:17): [True: 416, False: 839k]
  ------------------
  176|   846k|                (tag == V_ASN1_NUMERICSTRING) ||
  ------------------
  |  |   76|   839k|# define V_ASN1_NUMERICSTRING            18 /**/
  ------------------
  |  Branch (176:17): [True: 353, False: 839k]
  ------------------
  177|   846k|                (tag == V_ASN1_UTF8STRING) ||
  ------------------
  |  |   73|   839k|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (177:17): [True: 22.2k, False: 817k]
  ------------------
  178|   846k|                (tag == V_ASN1_UTCTIME) || (tag == V_ASN1_GENERALIZEDTIME)) {
  ------------------
  |  |   82|   817k|# define V_ASN1_UTCTIME                  23
  ------------------
                              (tag == V_ASN1_UTCTIME) || (tag == V_ASN1_GENERALIZEDTIME)) {
  ------------------
  |  |   83|   813k|# define V_ASN1_GENERALIZEDTIME          24 /**/
  ------------------
  |  Branch (178:17): [True: 4.24k, False: 813k]
  |  Branch (178:44): [True: 5.53k, False: 807k]
  ------------------
  179|  38.6k|                if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (179:21): [True: 0, False: 38.6k]
  ------------------
  180|      0|                    goto end;
  181|  38.6k|                if ((len > 0) && BIO_write(bp, (const char *)p, (int)len)
  ------------------
  |  Branch (181:21): [True: 30.4k, False: 8.27k]
  |  Branch (181:34): [True: 0, False: 30.4k]
  ------------------
  182|  30.4k|                    != (int)len)
  183|      0|                    goto end;
  184|   807k|            } else if (tag == V_ASN1_OBJECT) {
  ------------------
  |  |   68|   807k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (184:24): [True: 207k, False: 600k]
  ------------------
  185|   207k|                opp = op;
  186|   207k|                if (d2i_ASN1_OBJECT(&o, &opp, len + hl) != NULL) {
  ------------------
  |  Branch (186:21): [True: 201k, False: 5.45k]
  ------------------
  187|   201k|                    if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (187:25): [True: 0, False: 201k]
  ------------------
  188|      0|                        goto end;
  189|   201k|                    i2a_ASN1_OBJECT(bp, o);
  190|   201k|                } else {
  191|  5.45k|                    if (BIO_puts(bp, ":BAD OBJECT") <= 0)
  ------------------
  |  Branch (191:25): [True: 0, False: 5.45k]
  ------------------
  192|      0|                        goto end;
  193|  5.45k|                    dump_cont = 1;
  194|  5.45k|                }
  195|   600k|            } else if (tag == V_ASN1_BOOLEAN) {
  ------------------
  |  |   63|   600k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (195:24): [True: 8.47k, False: 591k]
  ------------------
  196|  8.47k|                if (len != 1) {
  ------------------
  |  Branch (196:21): [True: 1.03k, False: 7.44k]
  ------------------
  197|  1.03k|                    if (BIO_puts(bp, ":BAD BOOLEAN") <= 0)
  ------------------
  |  Branch (197:25): [True: 0, False: 1.03k]
  ------------------
  198|      0|                        goto end;
  199|  1.03k|                    dump_cont = 1;
  200|  1.03k|                }
  201|  8.47k|                if (len > 0)
  ------------------
  |  Branch (201:21): [True: 7.92k, False: 551]
  ------------------
  202|  7.92k|                    BIO_printf(bp, ":%u", p[0]);
  203|   591k|            } else if (tag == V_ASN1_BMPSTRING) {
  ------------------
  |  |   89|   591k|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (203:24): [True: 875, False: 590k]
  ------------------
  204|       |                /* do the BMP thang */
  205|   590k|            } else if (tag == V_ASN1_OCTET_STRING) {
  ------------------
  |  |   66|   590k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (205:24): [True: 146k, False: 444k]
  ------------------
  206|   146k|                int i, printable = 1;
  207|       |
  208|   146k|                opp = op;
  209|   146k|                os = d2i_ASN1_OCTET_STRING(NULL, &opp, len + hl);
  210|   146k|                if (os != NULL && os->length > 0) {
  ------------------
  |  Branch (210:21): [True: 144k, False: 1.71k]
  |  Branch (210:35): [True: 103k, False: 41.6k]
  ------------------
  211|   103k|                    opp = os->data;
  212|       |                    /*
  213|       |                     * testing whether the octet string is printable
  214|       |                     */
  215|   179k|                    for (i = 0; i < os->length; i++) {
  ------------------
  |  Branch (215:33): [True: 177k, False: 2.47k]
  ------------------
  216|   177k|                        if (((opp[i] < ' ') &&
  ------------------
  |  Branch (216:30): [True: 57.4k, False: 119k]
  ------------------
  217|   177k|                             (opp[i] != '\n') &&
  ------------------
  |  Branch (217:30): [True: 50.4k, False: 7.04k]
  ------------------
  218|   177k|                             (opp[i] != '\r') &&
  ------------------
  |  Branch (218:30): [True: 49.6k, False: 810]
  ------------------
  219|   177k|                             (opp[i] != '\t')) || (opp[i] > '~')) {
  ------------------
  |  Branch (219:30): [True: 49.4k, False: 173]
  |  Branch (219:51): [True: 51.2k, False: 76.5k]
  ------------------
  220|   100k|                            printable = 0;
  221|   100k|                            break;
  222|   100k|                        }
  223|   177k|                    }
  224|   103k|                    if (printable)
  ------------------
  |  Branch (224:25): [True: 2.47k, False: 100k]
  ------------------
  225|       |                        /* printable string */
  226|  2.47k|                    {
  227|  2.47k|                        if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (227:29): [True: 0, False: 2.47k]
  ------------------
  228|      0|                            goto end;
  229|  2.47k|                        if (BIO_write(bp, (const char *)opp, os->length) <= 0)
  ------------------
  |  Branch (229:29): [True: 0, False: 2.47k]
  ------------------
  230|      0|                            goto end;
  231|   100k|                    } else if (!dump)
  ------------------
  |  Branch (231:32): [True: 100k, False: 0]
  ------------------
  232|       |                        /*
  233|       |                         * not printable => print octet string as hex dump
  234|       |                         */
  235|   100k|                    {
  236|   100k|                        if (BIO_write(bp, "[HEX DUMP]:", 11) <= 0)
  ------------------
  |  Branch (236:29): [True: 0, False: 100k]
  ------------------
  237|      0|                            goto end;
  238|  1.65M|                        for (i = 0; i < os->length; i++) {
  ------------------
  |  Branch (238:37): [True: 1.55M, False: 100k]
  ------------------
  239|  1.55M|                            if (BIO_printf(bp, "%02X", opp[i]) <= 0)
  ------------------
  |  Branch (239:33): [True: 0, False: 1.55M]
  ------------------
  240|      0|                                goto end;
  241|  1.55M|                        }
  242|   100k|                    } else
  243|       |                        /* print the normal dump */
  244|      0|                    {
  245|      0|                        if (!nl) {
  ------------------
  |  Branch (245:29): [True: 0, False: 0]
  ------------------
  246|      0|                            if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (246:33): [True: 0, False: 0]
  ------------------
  247|      0|                                goto end;
  248|      0|                        }
  249|      0|                        if (BIO_dump_indent(bp,
  ------------------
  |  Branch (249:29): [True: 0, False: 0]
  ------------------
  250|      0|                                            (const char *)opp,
  251|      0|                                            ((dump == -1 || dump >
  ------------------
  |  Branch (251:47): [True: 0, False: 0]
  |  Branch (251:61): [True: 0, False: 0]
  ------------------
  252|      0|                                              os->
  253|      0|                                              length) ? os->length : dump),
  254|      0|                                            dump_indent) <= 0)
  255|      0|                            goto end;
  256|      0|                        nl = 1;
  257|      0|                    }
  258|   103k|                }
  259|   146k|                ASN1_OCTET_STRING_free(os);
  260|   146k|                os = NULL;
  261|   444k|            } else if (tag == V_ASN1_INTEGER) {
  ------------------
  |  |   64|   444k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (261:24): [True: 187k, False: 256k]
  ------------------
  262|   187k|                int i;
  263|       |
  264|   187k|                opp = op;
  265|   187k|                ai = d2i_ASN1_INTEGER(NULL, &opp, len + hl);
  266|   187k|                if (ai != NULL) {
  ------------------
  |  Branch (266:21): [True: 135k, False: 52.6k]
  ------------------
  267|   135k|                    if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (267:25): [True: 0, False: 135k]
  ------------------
  268|      0|                        goto end;
  269|   135k|                    if (ai->type == V_ASN1_NEG_INTEGER)
  ------------------
  |  |   98|   135k|# define V_ASN1_NEG_INTEGER              (2 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|   135k|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  |  Branch (269:25): [True: 63.0k, False: 72.2k]
  ------------------
  270|  63.0k|                        if (BIO_write(bp, "-", 1) <= 0)
  ------------------
  |  Branch (270:29): [True: 0, False: 63.0k]
  ------------------
  271|      0|                            goto end;
  272|  1.55M|                    for (i = 0; i < ai->length; i++) {
  ------------------
  |  Branch (272:33): [True: 1.41M, False: 135k]
  ------------------
  273|  1.41M|                        if (BIO_printf(bp, "%02X", ai->data[i]) <= 0)
  ------------------
  |  Branch (273:29): [True: 0, False: 1.41M]
  ------------------
  274|      0|                            goto end;
  275|  1.41M|                    }
  276|   135k|                    if (ai->length == 0) {
  ------------------
  |  Branch (276:25): [True: 0, False: 135k]
  ------------------
  277|      0|                        if (BIO_write(bp, "00", 2) <= 0)
  ------------------
  |  Branch (277:29): [True: 0, False: 0]
  ------------------
  278|      0|                            goto end;
  279|      0|                    }
  280|   135k|                } else {
  281|  52.6k|                    if (BIO_puts(bp, ":BAD INTEGER") <= 0)
  ------------------
  |  Branch (281:25): [True: 0, False: 52.6k]
  ------------------
  282|      0|                        goto end;
  283|  52.6k|                    dump_cont = 1;
  284|  52.6k|                }
  285|   187k|                ASN1_INTEGER_free(ai);
  286|   187k|                ai = NULL;
  287|   256k|            } else if (tag == V_ASN1_ENUMERATED) {
  ------------------
  |  |   72|   256k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (287:24): [True: 9.35k, False: 246k]
  ------------------
  288|  9.35k|                int i;
  289|       |
  290|  9.35k|                opp = op;
  291|  9.35k|                ae = d2i_ASN1_ENUMERATED(NULL, &opp, len + hl);
  292|  9.35k|                if (ae != NULL) {
  ------------------
  |  Branch (292:21): [True: 8.51k, False: 840]
  ------------------
  293|  8.51k|                    if (BIO_write(bp, ":", 1) <= 0)
  ------------------
  |  Branch (293:25): [True: 0, False: 8.51k]
  ------------------
  294|      0|                        goto end;
  295|  8.51k|                    if (ae->type == V_ASN1_NEG_ENUMERATED)
  ------------------
  |  |   99|  8.51k|# define V_ASN1_NEG_ENUMERATED           (10 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   97|  8.51k|# define V_ASN1_NEG                      0x100
  |  |  ------------------
  ------------------
  |  Branch (295:25): [True: 2.19k, False: 6.32k]
  ------------------
  296|  2.19k|                        if (BIO_write(bp, "-", 1) <= 0)
  ------------------
  |  Branch (296:29): [True: 0, False: 2.19k]
  ------------------
  297|      0|                            goto end;
  298|  19.4k|                    for (i = 0; i < ae->length; i++) {
  ------------------
  |  Branch (298:33): [True: 10.9k, False: 8.51k]
  ------------------
  299|  10.9k|                        if (BIO_printf(bp, "%02X", ae->data[i]) <= 0)
  ------------------
  |  Branch (299:29): [True: 0, False: 10.9k]
  ------------------
  300|      0|                            goto end;
  301|  10.9k|                    }
  302|  8.51k|                    if (ae->length == 0) {
  ------------------
  |  Branch (302:25): [True: 0, False: 8.51k]
  ------------------
  303|      0|                        if (BIO_write(bp, "00", 2) <= 0)
  ------------------
  |  Branch (303:29): [True: 0, False: 0]
  ------------------
  304|      0|                            goto end;
  305|      0|                    }
  306|  8.51k|                } else {
  307|    840|                    if (BIO_puts(bp, ":BAD ENUMERATED") <= 0)
  ------------------
  |  Branch (307:25): [True: 0, False: 840]
  ------------------
  308|      0|                        goto end;
  309|    840|                    dump_cont = 1;
  310|    840|                }
  311|  9.35k|                ASN1_ENUMERATED_free(ae);
  312|  9.35k|                ae = NULL;
  313|   246k|            } else if (len > 0 && dump) {
  ------------------
  |  Branch (313:24): [True: 22.4k, False: 224k]
  |  Branch (313:35): [True: 0, False: 22.4k]
  ------------------
  314|      0|                if (!nl) {
  ------------------
  |  Branch (314:21): [True: 0, False: 0]
  ------------------
  315|      0|                    if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (315:25): [True: 0, False: 0]
  ------------------
  316|      0|                        goto end;
  317|      0|                }
  318|      0|                if (BIO_dump_indent(bp, (const char *)p,
  ------------------
  |  Branch (318:21): [True: 0, False: 0]
  ------------------
  319|      0|                                    ((dump == -1 || dump > len) ? len : dump),
  ------------------
  |  Branch (319:39): [True: 0, False: 0]
  |  Branch (319:53): [True: 0, False: 0]
  ------------------
  320|      0|                                    dump_indent) <= 0)
  321|      0|                    goto end;
  322|      0|                nl = 1;
  323|      0|            }
  324|   846k|            if (dump_cont) {
  ------------------
  |  Branch (324:17): [True: 59.9k, False: 786k]
  ------------------
  325|  59.9k|                int i;
  326|  59.9k|                const unsigned char *tmp = op + hl;
  327|  59.9k|                if (BIO_puts(bp, ":[") <= 0)
  ------------------
  |  Branch (327:21): [True: 0, False: 59.9k]
  ------------------
  328|      0|                    goto end;
  329|   563k|                for (i = 0; i < len; i++) {
  ------------------
  |  Branch (329:29): [True: 503k, False: 59.9k]
  ------------------
  330|   503k|                    if (BIO_printf(bp, "%02X", tmp[i]) <= 0)
  ------------------
  |  Branch (330:25): [True: 0, False: 503k]
  ------------------
  331|      0|                        goto end;
  332|   503k|                }
  333|  59.9k|                if (BIO_puts(bp, "]") <= 0)
  ------------------
  |  Branch (333:21): [True: 0, False: 59.9k]
  ------------------
  334|      0|                    goto end;
  335|  59.9k|                dump_cont = 0;
  336|  59.9k|            }
  337|       |
  338|   846k|            if (!nl) {
  ------------------
  |  Branch (338:17): [True: 846k, False: 0]
  ------------------
  339|   846k|                if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (339:21): [True: 0, False: 846k]
  ------------------
  340|      0|                    goto end;
  341|   846k|            }
  342|   846k|            p += len;
  343|   846k|            if ((tag == V_ASN1_EOC) && (xclass == 0)) {
  ------------------
  |  |   62|   846k|# define V_ASN1_EOC                      0
  ------------------
  |  Branch (343:17): [True: 214k, False: 631k]
  |  Branch (343:40): [True: 214k, False: 0]
  ------------------
  344|   214k|                ret = 2;        /* End of sequence */
  345|   214k|                goto end;
  346|   214k|            }
  347|   846k|        }
  348|  1.13M|        length -= len;
  349|  1.13M|    }
  350|   213k|    ret = 1;
  351|   446k| end:
  352|   446k|    ASN1_OBJECT_free(o);
  353|   446k|    ASN1_OCTET_STRING_free(os);
  354|   446k|    ASN1_INTEGER_free(ai);
  355|   446k|    ASN1_ENUMERATED_free(ae);
  356|   446k|    *pp = p;
  357|   446k|    return ret;
  358|   213k|}
asn1_parse.c:asn1_print_info:
   24|  1.36M|{
   25|  1.36M|    char str[128];
   26|  1.36M|    const char *p;
   27|  1.36M|    int pop_f_prefix = 0;
   28|  1.36M|    long saved_indent = -1;
   29|  1.36M|    int i = 0;
   30|  1.36M|    BIO *bio = NULL;
   31|       |
   32|  1.36M|    if (constructed & V_ASN1_CONSTRUCTED)
  ------------------
  |  |   52|  1.36M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (32:9): [True: 493k, False: 870k]
  ------------------
   33|   493k|        p = "cons: ";
   34|   870k|    else
   35|   870k|        p = "prim: ";
   36|  1.36M|    if (constructed != (V_ASN1_CONSTRUCTED | 1)) {
  ------------------
  |  |   52|  1.36M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
  |  Branch (36:9): [True: 1.13M, False: 225k]
  ------------------
   37|  1.13M|        if (BIO_snprintf(str, sizeof(str), "%5ld:d=%-2d hl=%ld l=%4ld %s",
  ------------------
  |  Branch (37:13): [True: 0, False: 1.13M]
  ------------------
   38|  1.13M|                         offset, depth, (long)hl, len, p) <= 0)
   39|      0|            goto err;
   40|  1.13M|    } else {
   41|   225k|        if (BIO_snprintf(str, sizeof(str), "%5ld:d=%-2d hl=%ld l=inf  %s",
  ------------------
  |  Branch (41:13): [True: 0, False: 225k]
  ------------------
   42|   225k|                         offset, depth, (long)hl, p) <= 0)
   43|      0|            goto err;
   44|   225k|    }
   45|  1.36M|    if (bp != NULL) {
  ------------------
  |  Branch (45:9): [True: 1.36M, False: 0]
  ------------------
   46|  1.36M|        if (BIO_set_prefix(bp, str) <= 0) {
  ------------------
  |  |  698|  1.36M|# define BIO_set_prefix(b,p) BIO_ctrl((b), BIO_CTRL_SET_PREFIX, 0, (void *)(p))
  |  |  ------------------
  |  |  |  |  175|  1.36M|# define BIO_CTRL_SET_PREFIX                    79
  |  |  ------------------
  ------------------
  |  Branch (46:13): [True: 1.36M, False: 0]
  ------------------
   47|  1.36M|            if ((bio = BIO_new(BIO_f_prefix())) == NULL
  ------------------
  |  Branch (47:17): [True: 0, False: 1.36M]
  ------------------
   48|  1.36M|                    || (bp = BIO_push(bio, bp)) == NULL)
  ------------------
  |  Branch (48:24): [True: 0, False: 1.36M]
  ------------------
   49|      0|                goto err;
   50|  1.36M|            pop_f_prefix = 1;
   51|  1.36M|        }
   52|  1.36M|        saved_indent = BIO_get_indent(bp);
  ------------------
  |  |  700|  1.36M|# define BIO_get_indent(b) BIO_ctrl((b), BIO_CTRL_GET_INDENT, 0, NULL)
  |  |  ------------------
  |  |  |  |  177|  1.36M|# define BIO_CTRL_GET_INDENT                    81
  |  |  ------------------
  ------------------
   53|  1.36M|        if (BIO_set_prefix(bp, str) <= 0 || BIO_set_indent(bp, indent) <= 0)
  ------------------
  |  |  698|  1.36M|# define BIO_set_prefix(b,p) BIO_ctrl((b), BIO_CTRL_SET_PREFIX, 0, (void *)(p))
  |  |  ------------------
  |  |  |  |  175|  1.36M|# define BIO_CTRL_SET_PREFIX                    79
  |  |  ------------------
  ------------------
                      if (BIO_set_prefix(bp, str) <= 0 || BIO_set_indent(bp, indent) <= 0)
  ------------------
  |  |  699|  1.36M|# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
  |  |  ------------------
  |  |  |  |  176|  1.36M|# define BIO_CTRL_SET_INDENT                    80
  |  |  ------------------
  ------------------
  |  Branch (53:13): [True: 0, False: 1.36M]
  |  Branch (53:45): [True: 0, False: 1.36M]
  ------------------
   54|      0|            goto err;
   55|  1.36M|    }
   56|       |
   57|       |    /*
   58|       |     * BIO_set_prefix made a copy of |str|, so we can safely use it for
   59|       |     * something else, ASN.1 tag printout.
   60|       |     */
   61|  1.36M|    p = str;
   62|  1.36M|    if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
  ------------------
  |  |   50|  1.36M|# define V_ASN1_PRIVATE                  0xc0
  ------------------
                  if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
  ------------------
  |  |   50|  1.36M|# define V_ASN1_PRIVATE                  0xc0
  ------------------
  |  Branch (62:9): [True: 1.23k, False: 1.36M]
  ------------------
   63|  1.23k|        BIO_snprintf(str, sizeof(str), "priv [ %d ] ", tag);
   64|  1.36M|    else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
  ------------------
  |  |   49|  1.36M|# define V_ASN1_CONTEXT_SPECIFIC         0x80
  ------------------
                  else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
  ------------------
  |  |   49|  1.36M|# define V_ASN1_CONTEXT_SPECIFIC         0x80
  ------------------
  |  Branch (64:14): [True: 123k, False: 1.23M]
  ------------------
   65|   123k|        BIO_snprintf(str, sizeof(str), "cont [ %d ]", tag);
   66|  1.23M|    else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
  ------------------
  |  |   48|  1.23M|# define V_ASN1_APPLICATION              0x40
  ------------------
                  else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
  ------------------
  |  |   48|  1.23M|# define V_ASN1_APPLICATION              0x40
  ------------------
  |  Branch (66:14): [True: 4.98k, False: 1.23M]
  ------------------
   67|  4.98k|        BIO_snprintf(str, sizeof(str), "appl [ %d ]", tag);
   68|  1.23M|    else if (tag > 30)
  ------------------
  |  Branch (68:14): [True: 6.28k, False: 1.22M]
  ------------------
   69|  6.28k|        BIO_snprintf(str, sizeof(str), "<ASN1 %d>", tag);
   70|  1.22M|    else
   71|  1.22M|        p = ASN1_tag2str(tag);
   72|       |
   73|  1.36M|    i = (BIO_printf(bp, "%-18s", p) > 0);
   74|  1.36M| err:
   75|  1.36M|    if (saved_indent >= 0)
  ------------------
  |  Branch (75:9): [True: 1.36M, False: 0]
  ------------------
   76|  1.36M|        BIO_set_indent(bp, saved_indent);
  ------------------
  |  |  699|  1.36M|# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
  |  |  ------------------
  |  |  |  |  176|  1.36M|# define BIO_CTRL_SET_INDENT                    80
  |  |  ------------------
  ------------------
   77|  1.36M|    if (pop_f_prefix)
  ------------------
  |  Branch (77:9): [True: 1.36M, False: 0]
  ------------------
   78|  1.36M|        BIO_pop(bp);
   79|  1.36M|    BIO_free(bio);
   80|  1.36M|    return i;
   81|  1.36M|}

ASN1_item_unpack:
   53|      3|{
   54|      3|    const unsigned char *p;
   55|      3|    void *ret;
   56|       |
   57|      3|    p = oct->data;
   58|      3|    if ((ret = ASN1_item_d2i(NULL, &p, oct->length, it)) == NULL)
  ------------------
  |  Branch (58:9): [True: 1, False: 2]
  ------------------
   59|      3|        ERR_raise(ERR_LIB_ASN1, ASN1_R_DECODE_ERROR);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  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)
  |  |  ------------------
  ------------------
   60|      3|    return ret;
   61|      3|}

ossl_d2i_PrivateKey_legacy:
   93|  9.01k|{
   94|  9.01k|    EVP_PKEY *ret;
   95|  9.01k|    const unsigned char *p = *pp;
   96|       |
   97|  9.01k|    if (a == NULL || *a == NULL) {
  ------------------
  |  Branch (97:9): [True: 9.01k, False: 0]
  |  Branch (97:22): [True: 0, False: 0]
  ------------------
   98|  9.01k|        if ((ret = EVP_PKEY_new()) == NULL) {
  ------------------
  |  Branch (98:13): [True: 0, False: 9.01k]
  ------------------
   99|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|            return NULL;
  101|      0|        }
  102|  9.01k|    } else {
  103|      0|        ret = *a;
  104|      0|#ifndef OPENSSL_NO_ENGINE
  105|      0|        ENGINE_finish(ret->engine);
  106|      0|        ret->engine = NULL;
  107|      0|#endif
  108|      0|    }
  109|       |
  110|  9.01k|    if (!EVP_PKEY_set_type(ret, keytype)) {
  ------------------
  |  Branch (110:9): [True: 0, False: 9.01k]
  ------------------
  111|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|       |
  115|  9.01k|    ERR_set_mark();
  116|  9.01k|    if (!ret->ameth->old_priv_decode ||
  ------------------
  |  Branch (116:9): [True: 0, False: 9.01k]
  ------------------
  117|  9.01k|        !ret->ameth->old_priv_decode(ret, &p, length)) {
  ------------------
  |  Branch (117:9): [True: 8.96k, False: 57]
  ------------------
  118|  8.96k|        if (ret->ameth->priv_decode != NULL
  ------------------
  |  Branch (118:13): [True: 8.52k, False: 433]
  ------------------
  119|  8.96k|                || ret->ameth->priv_decode_ex != NULL) {
  ------------------
  |  Branch (119:20): [True: 433, False: 0]
  ------------------
  120|  8.96k|            EVP_PKEY *tmp;
  121|  8.96k|            PKCS8_PRIV_KEY_INFO *p8 = NULL;
  122|  8.96k|            p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
  123|  8.96k|            if (p8 == NULL) {
  ------------------
  |  Branch (123:17): [True: 8.95k, False: 4]
  ------------------
  124|  8.95k|                ERR_clear_last_mark();
  125|  8.95k|                goto err;
  126|  8.95k|            }
  127|      4|            tmp = evp_pkcs82pkey_legacy(p8, libctx, propq);
  128|      4|            PKCS8_PRIV_KEY_INFO_free(p8);
  129|      4|            if (tmp == NULL) {
  ------------------
  |  Branch (129:17): [True: 2, False: 2]
  ------------------
  130|      2|                ERR_clear_last_mark();
  131|      2|                goto err;
  132|      2|            }
  133|      2|            EVP_PKEY_free(ret);
  134|      2|            ret = tmp;
  135|      2|            ERR_pop_to_mark();
  136|      2|            if (EVP_PKEY_type(keytype) != EVP_PKEY_get_base_id(ret))
  ------------------
  |  Branch (136:17): [True: 1, False: 1]
  ------------------
  137|      1|                goto err;
  138|      2|        } else {
  139|      0|            ERR_clear_last_mark();
  140|      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)
  |  |  ------------------
  ------------------
  141|      0|            goto err;
  142|      0|        }
  143|  8.96k|    } else {
  144|     57|      ERR_clear_last_mark();
  145|     57|    }
  146|     58|    *pp = p;
  147|     58|    if (a != NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 58]
  ------------------
  148|      0|        *a = ret;
  149|     58|    return ret;
  150|  8.96k| err:
  151|  8.96k|    if (a == NULL || *a != ret)
  ------------------
  |  Branch (151:9): [True: 8.96k, False: 0]
  |  Branch (151:22): [True: 0, False: 0]
  ------------------
  152|  8.96k|        EVP_PKEY_free(ret);
  153|  8.96k|    return NULL;
  154|  9.01k|}
d2i_AutoPrivateKey_ex:
  234|  11.5k|{
  235|  11.5k|    EVP_PKEY *ret;
  236|       |
  237|  11.5k|    ret = d2i_PrivateKey_decoder(EVP_PKEY_NONE, a, pp, length, libctx, propq);
  ------------------
  |  |   59|  11.5k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  11.5k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  238|       |    /* try the legacy path if the decoder failed */
  239|  11.5k|    if (ret == NULL)
  ------------------
  |  Branch (239:9): [True: 9.90k, False: 1.62k]
  ------------------
  240|  9.90k|        ret = d2i_AutoPrivateKey_legacy(a, pp, length, libctx, propq);
  241|  11.5k|    return ret;
  242|  11.5k|}
d2i_AutoPrivateKey:
  246|  11.5k|{
  247|  11.5k|    return d2i_AutoPrivateKey_ex(a, pp, length, NULL, NULL);
  248|  11.5k|}
d2i_pr.c:d2i_PrivateKey_decoder:
   30|  11.5k|{
   31|  11.5k|    OSSL_DECODER_CTX *dctx = NULL;
   32|  11.5k|    size_t len = length;
   33|  11.5k|    EVP_PKEY *pkey = NULL, *bak_a = NULL;
   34|  11.5k|    EVP_PKEY **ppkey = &pkey;
   35|  11.5k|    const char *key_name = NULL;
   36|  11.5k|    char keytypebuf[OSSL_MAX_NAME_SIZE];
   37|  11.5k|    int ret;
   38|  11.5k|    const unsigned char *p = *pp;
   39|  11.5k|    const char *structure;
   40|  11.5k|    PKCS8_PRIV_KEY_INFO *p8info;
   41|  11.5k|    const ASN1_OBJECT *algoid;
   42|       |
   43|  11.5k|    if (keytype != EVP_PKEY_NONE) {
  ------------------
  |  |   59|  11.5k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  11.5k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (43:9): [True: 0, False: 11.5k]
  ------------------
   44|      0|        key_name = evp_pkey_type2name(keytype);
   45|      0|        if (key_name == NULL)
  ------------------
  |  Branch (45:13): [True: 0, False: 0]
  ------------------
   46|      0|            return NULL;
   47|      0|    }
   48|       |
   49|       |    /* This is just a probe. It might fail, so we ignore errors */
   50|  11.5k|    ERR_set_mark();
   51|  11.5k|    p8info = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, len);
   52|  11.5k|    ERR_pop_to_mark();
   53|  11.5k|    if (p8info != NULL) {
  ------------------
  |  Branch (53:9): [True: 674, False: 10.8k]
  ------------------
   54|    674|        if (key_name == NULL
  ------------------
  |  Branch (54:13): [True: 674, False: 0]
  ------------------
   55|    674|                && PKCS8_pkey_get0(&algoid, NULL, NULL, NULL, p8info)
  ------------------
  |  Branch (55:20): [True: 674, False: 0]
  ------------------
   56|    674|                && OBJ_obj2txt(keytypebuf, sizeof(keytypebuf), algoid, 0))
  ------------------
  |  Branch (56:20): [True: 674, False: 0]
  ------------------
   57|    674|            key_name = keytypebuf;
   58|    674|        structure = "PrivateKeyInfo";
   59|    674|        PKCS8_PRIV_KEY_INFO_free(p8info);
   60|  10.8k|    } else {
   61|  10.8k|        structure = "type-specific";
   62|  10.8k|    }
   63|  11.5k|    *pp = p;
   64|       |
   65|  11.5k|    if (a != NULL && (bak_a = *a) != NULL)
  ------------------
  |  Branch (65:9): [True: 0, False: 11.5k]
  |  Branch (65:22): [True: 0, False: 0]
  ------------------
   66|      0|        ppkey = a;
   67|  11.5k|    dctx = OSSL_DECODER_CTX_new_for_pkey(ppkey, "DER", structure, key_name,
   68|  11.5k|                                         EVP_PKEY_KEYPAIR, libctx, propq);
  ------------------
  |  |   94|  11.5k|    ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |   92|  11.5k|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|  11.5k|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  574|  11.5k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  569|  11.5k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  575|  11.5k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  570|  11.5k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  568|  11.5k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  567|  11.5k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  ------------------
   69|  11.5k|    if (a != NULL)
  ------------------
  |  Branch (69:9): [True: 0, False: 11.5k]
  ------------------
   70|      0|        *a = bak_a;
   71|  11.5k|    if (dctx == NULL)
  ------------------
  |  Branch (71:9): [True: 0, False: 11.5k]
  ------------------
   72|      0|        goto err;
   73|       |
   74|  11.5k|    ret = OSSL_DECODER_from_data(dctx, pp, &len);
   75|  11.5k|    OSSL_DECODER_CTX_free(dctx);
   76|  11.5k|    if (ret
  ------------------
  |  Branch (76:9): [True: 1.62k, False: 9.90k]
  ------------------
   77|  11.5k|        && *ppkey != NULL
  ------------------
  |  Branch (77:12): [True: 1.62k, False: 0]
  ------------------
   78|  11.5k|        && evp_keymgmt_util_has(*ppkey, OSSL_KEYMGMT_SELECT_PRIVATE_KEY)) {
  ------------------
  |  |  567|  1.62k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (78:12): [True: 1.62k, False: 0]
  ------------------
   79|  1.62k|        if (a != NULL)
  ------------------
  |  Branch (79:13): [True: 0, False: 1.62k]
  ------------------
   80|      0|            *a = *ppkey;
   81|  1.62k|        return *ppkey;
   82|  1.62k|    }
   83|       |
   84|  9.90k| err:
   85|  9.90k|    if (ppkey != a)
  ------------------
  |  Branch (85:9): [True: 9.90k, False: 0]
  ------------------
   86|  9.90k|        EVP_PKEY_free(*ppkey);
   87|  9.90k|    return NULL;
   88|  11.5k|}
d2i_pr.c:d2i_AutoPrivateKey_legacy:
  180|  9.90k|{
  181|  9.90k|    STACK_OF(ASN1_TYPE) *inkey;
  ------------------
  |  |   31|  9.90k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  182|  9.90k|    const unsigned char *p;
  183|  9.90k|    int keytype;
  184|       |
  185|  9.90k|    p = *pp;
  186|       |    /*
  187|       |     * Dirty trick: read in the ASN1 data into a STACK_OF(ASN1_TYPE): by
  188|       |     * analyzing it we can determine the passed structure: this assumes the
  189|       |     * input is surrounded by an ASN1 SEQUENCE.
  190|       |     */
  191|  9.90k|    inkey = d2i_ASN1_SEQUENCE_ANY(NULL, &p, length);
  192|  9.90k|    p = *pp;
  193|       |    /*
  194|       |     * Since we only need to discern "traditional format" RSA and DSA keys we
  195|       |     * can just count the elements.
  196|       |     */
  197|  9.90k|    if (sk_ASN1_TYPE_num(inkey) == 6) {
  ------------------
  |  |  555|  9.90k|#define sk_ASN1_TYPE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_TYPE_sk_type(sk))
  ------------------
  |  Branch (197:9): [True: 225, False: 9.67k]
  ------------------
  198|    225|        keytype = EVP_PKEY_DSA;
  ------------------
  |  |   63|    225|# define EVP_PKEY_DSA    NID_dsa
  |  |  ------------------
  |  |  |  |  136|    225|#define NID_dsa         116
  |  |  ------------------
  ------------------
  199|  9.67k|    } else if (sk_ASN1_TYPE_num(inkey) == 4) {
  ------------------
  |  |  555|  9.67k|#define sk_ASN1_TYPE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_TYPE_sk_type(sk))
  ------------------
  |  Branch (199:16): [True: 438, False: 9.24k]
  ------------------
  200|    438|        keytype = EVP_PKEY_EC;
  ------------------
  |  |   70|    438|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|    438|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  201|  9.24k|    } else if (sk_ASN1_TYPE_num(inkey) == 3) { /* This seems to be PKCS8, not
  ------------------
  |  |  555|  9.24k|#define sk_ASN1_TYPE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_TYPE_sk_type(sk))
  ------------------
  |  Branch (201:16): [True: 884, False: 8.35k]
  ------------------
  202|       |                                              * traditional format */
  203|    884|        PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
  204|    884|        EVP_PKEY *ret;
  205|       |
  206|    884|        sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
  ------------------
  |  |  569|    884|#define sk_ASN1_TYPE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_TYPE_sk_type(sk),ossl_check_ASN1_TYPE_freefunc_type(freefunc))
  ------------------
  207|    884|        if (p8 == NULL) {
  ------------------
  |  Branch (207:13): [True: 813, False: 71]
  ------------------
  208|    813|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
  ------------------
  |  |  401|    813|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    813|    (ERR_new(),                                                 \
  |  |  |  |  404|    813|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    813|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    813|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    813|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    813|     ERR_set_error)
  |  |  ------------------
  ------------------
  209|    813|            return NULL;
  210|    813|        }
  211|     71|        ret = evp_pkcs82pkey_legacy(p8, libctx, propq);
  212|     71|        PKCS8_PRIV_KEY_INFO_free(p8);
  213|     71|        if (ret == NULL)
  ------------------
  |  Branch (213:13): [True: 67, False: 4]
  ------------------
  214|     67|            return NULL;
  215|      4|        *pp = p;
  216|      4|        if (a != NULL) {
  ------------------
  |  Branch (216:13): [True: 0, False: 4]
  ------------------
  217|      0|            *a = ret;
  218|      0|        }
  219|      4|        return ret;
  220|  8.35k|    } else {
  221|  8.35k|        keytype = EVP_PKEY_RSA;
  ------------------
  |  |   60|  8.35k|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|  8.35k|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  222|  8.35k|    }
  223|  9.01k|    sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
  ------------------
  |  |  569|  9.01k|#define sk_ASN1_TYPE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_TYPE_sk_type(sk),ossl_check_ASN1_TYPE_freefunc_type(freefunc))
  ------------------
  224|  9.01k|    return ossl_d2i_PrivateKey_legacy(keytype, a, pp, length, libctx, propq);
  225|  9.90k|}

i2a_ASN1_STRING:
   17|     12|{
   18|     12|    int i, n = 0;
   19|     12|    static const char *h = "0123456789ABCDEF";
   20|     12|    char buf[2];
   21|       |
   22|     12|    if (a == NULL)
  ------------------
  |  Branch (22:9): [True: 0, False: 12]
  ------------------
   23|      0|        return 0;
   24|       |
   25|     12|    if (a->length == 0) {
  ------------------
  |  Branch (25:9): [True: 1, False: 11]
  ------------------
   26|      1|        if (BIO_write(bp, "0", 1) != 1)
  ------------------
  |  Branch (26:13): [True: 0, False: 1]
  ------------------
   27|      0|            goto err;
   28|      1|        n = 1;
   29|     11|    } else {
   30|    319|        for (i = 0; i < a->length; i++) {
  ------------------
  |  Branch (30:21): [True: 308, False: 11]
  ------------------
   31|    308|            if ((i != 0) && (i % 35 == 0)) {
  ------------------
  |  Branch (31:17): [True: 297, False: 11]
  |  Branch (31:29): [True: 6, False: 291]
  ------------------
   32|      6|                if (BIO_write(bp, "\\\n", 2) != 2)
  ------------------
  |  Branch (32:21): [True: 0, False: 6]
  ------------------
   33|      0|                    goto err;
   34|      6|                n += 2;
   35|      6|            }
   36|    308|            buf[0] = h[((unsigned char)a->data[i] >> 4) & 0x0f];
   37|    308|            buf[1] = h[((unsigned char)a->data[i]) & 0x0f];
   38|    308|            if (BIO_write(bp, buf, 2) != 2)
  ------------------
  |  Branch (38:17): [True: 0, False: 308]
  ------------------
   39|      0|                goto err;
   40|    308|            n += 2;
   41|    308|        }
   42|     11|    }
   43|     12|    return n;
   44|      0| err:
   45|      0|    return -1;
   46|     12|}

i2d_PrivateKey:
   95|  1.68k|{
   96|  1.68k|    if (evp_pkey_is_provided(a)) {
  ------------------
  |  |  641|  1.68k|    ((pk)->keymgmt != NULL)
  |  |  ------------------
  |  |  |  Branch (641:5): [True: 1.62k, False: 62]
  |  |  ------------------
  ------------------
   97|  1.62k|        static const struct type_and_structure_st output_info[] = {
   98|  1.62k|            { "DER", "type-specific" },
   99|  1.62k|            { "DER", "PrivateKeyInfo" },
  100|  1.62k|            { NULL, }
  101|  1.62k|        };
  102|       |
  103|  1.62k|        return i2d_provided(a, EVP_PKEY_KEYPAIR, output_info, pp);
  ------------------
  |  |   94|  1.62k|    ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |   92|  1.62k|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|  1.62k|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  574|  1.62k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  569|  1.62k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  575|  1.62k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  570|  1.62k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  568|  1.62k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  567|  1.62k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  ------------------
  104|  1.62k|    }
  105|     62|    if (a->ameth != NULL && a->ameth->old_priv_encode != NULL) {
  ------------------
  |  Branch (105:9): [True: 62, False: 0]
  |  Branch (105:29): [True: 58, False: 4]
  ------------------
  106|     58|        return a->ameth->old_priv_encode(a, pp);
  107|     58|    }
  108|      4|    if (a->ameth != NULL && a->ameth->priv_encode != NULL) {
  ------------------
  |  Branch (108:9): [True: 4, False: 0]
  |  Branch (108:29): [True: 4, False: 0]
  ------------------
  109|      4|        PKCS8_PRIV_KEY_INFO *p8 = EVP_PKEY2PKCS8(a);
  110|      4|        int ret = 0;
  111|       |
  112|      4|        if (p8 != NULL) {
  ------------------
  |  Branch (112:13): [True: 4, False: 0]
  ------------------
  113|      4|            ret = i2d_PKCS8_PRIV_KEY_INFO(p8, pp);
  114|      4|            PKCS8_PRIV_KEY_INFO_free(p8);
  115|      4|        }
  116|      4|        return ret;
  117|      4|    }
  118|      4|    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|    return -1;
  120|      4|}
i2d_evp.c:i2d_provided:
   36|  1.62k|{
   37|  1.62k|    int ret;
   38|       |
   39|  1.62k|    for (ret = -1;
   40|  3.39k|         ret == -1 && output_info->output_type != NULL;
  ------------------
  |  Branch (40:10): [True: 1.88k, False: 1.50k]
  |  Branch (40:23): [True: 1.77k, False: 118]
  ------------------
   41|  1.77k|         output_info++) {
   42|       |        /*
   43|       |         * The i2d_ calls don't take a boundary length for *pp.  However,
   44|       |         * OSSL_ENCODER_to_data() needs one, so we make one up.  Because
   45|       |         * OSSL_ENCODER_to_data() decrements this number by the amount of
   46|       |         * bytes written, we need to calculate the length written further
   47|       |         * down, when pp != NULL.
   48|       |         */
   49|  1.77k|        size_t len = INT_MAX;
   50|  1.77k|        int pp_was_NULL = (pp == NULL || *pp == NULL);
  ------------------
  |  Branch (50:28): [True: 0, False: 1.77k]
  |  Branch (50:42): [True: 1.77k, False: 0]
  ------------------
   51|  1.77k|        OSSL_ENCODER_CTX *ctx;
   52|       |
   53|  1.77k|        ctx = OSSL_ENCODER_CTX_new_for_pkey(a, selection,
   54|  1.77k|                                            output_info->output_type,
   55|  1.77k|                                            output_info->output_structure,
   56|  1.77k|                                            NULL);
   57|  1.77k|        if (ctx == NULL)
  ------------------
  |  Branch (57:13): [True: 0, False: 1.77k]
  ------------------
   58|      0|            return -1;
   59|  1.77k|        if (OSSL_ENCODER_to_data(ctx, pp, &len)) {
  ------------------
  |  Branch (59:13): [True: 1.50k, False: 269]
  ------------------
   60|  1.50k|            if (pp_was_NULL)
  ------------------
  |  Branch (60:17): [True: 1.50k, False: 0]
  ------------------
   61|  1.50k|                ret = (int)len;
   62|      0|            else
   63|      0|                ret = INT_MAX - (int)len;
   64|  1.50k|        }
   65|  1.77k|        OSSL_ENCODER_CTX_free(ctx);
   66|  1.77k|    }
   67|       |
   68|  1.62k|    if (ret == -1)
  ------------------
  |  Branch (68:9): [True: 118, False: 1.50k]
  ------------------
   69|  1.62k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_TYPE);
  ------------------
  |  |  401|    118|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    118|    (ERR_new(),                                                 \
  |  |  |  |  404|    118|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    118|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    118|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    118|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    118|     ERR_set_error)
  |  |  ------------------
  ------------------
   70|  1.62k|    return ret;
   71|  1.62k|}

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

PKCS8_pkey_set0:
   41|     37|{
   42|     37|    if (version >= 0) {
  ------------------
  |  Branch (42:9): [True: 37, False: 0]
  ------------------
   43|     37|        if (!ASN1_INTEGER_set(priv->version, version))
  ------------------
  |  Branch (43:13): [True: 0, False: 37]
  ------------------
   44|      0|            return 0;
   45|     37|    }
   46|     37|    if (!X509_ALGOR_set0(priv->pkeyalg, aobj, ptype, pval))
  ------------------
  |  Branch (46:9): [True: 0, False: 37]
  ------------------
   47|      0|        return 0;
   48|     37|    if (penc)
  ------------------
  |  Branch (48:9): [True: 37, False: 0]
  ------------------
   49|     37|        ASN1_STRING_set0(priv->pkey, penc, penclen);
   50|     37|    return 1;
   51|     37|}
PKCS8_pkey_get0:
   56|  2.45k|{
   57|  2.45k|    if (ppkalg)
  ------------------
  |  Branch (57:9): [True: 749, False: 1.70k]
  ------------------
   58|    749|        *ppkalg = p8->pkeyalg->algorithm;
   59|  2.45k|    if (pk) {
  ------------------
  |  Branch (59:9): [True: 725, False: 1.73k]
  ------------------
   60|    725|        *pk = ASN1_STRING_get0_data(p8->pkey);
   61|    725|        *ppklen = ASN1_STRING_length(p8->pkey);
   62|    725|    }
   63|  2.45k|    if (pa)
  ------------------
  |  Branch (63:9): [True: 1.70k, False: 749]
  ------------------
   64|  1.70k|        *pa = p8->pkeyalg;
   65|  2.45k|    return 1;
   66|  2.45k|}
p8_pkey.c:pkey_cb:
   19|   443k|{
   20|       |    /* Since the structure must still be valid use ASN1_OP_FREE_PRE */
   21|   443k|    if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|   443k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (21:9): [True: 87.5k, False: 355k]
  ------------------
   22|  87.5k|        PKCS8_PRIV_KEY_INFO *key = (PKCS8_PRIV_KEY_INFO *)*pval;
   23|  87.5k|        if (key->pkey)
  ------------------
  |  Branch (23:13): [True: 87.5k, False: 0]
  ------------------
   24|  87.5k|            OPENSSL_cleanse(key->pkey->data, key->pkey->length);
   25|  87.5k|    }
   26|   443k|    return 1;
   27|   443k|}

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

ASN1_tag2bit:
   88|   461k|{
   89|   461k|    if ((tag < 0) || (tag > 30))
  ------------------
  |  Branch (89:9): [True: 0, False: 461k]
  |  Branch (89:22): [True: 556, False: 460k]
  ------------------
   90|    556|        return 0;
   91|   460k|    return tag2bit[tag];
   92|   461k|}
ASN1_item_ex_d2i:
  128|  90.0k|{
  129|  90.0k|    return asn1_item_ex_d2i_intern(pval, in, len, it, tag, aclass, opt, ctx,
  130|  90.0k|                                   NULL, NULL);
  131|  90.0k|}
ASN1_item_d2i_ex:
  137|  2.50M|{
  138|  2.50M|    ASN1_TLC c;
  139|  2.50M|    ASN1_VALUE *ptmpval = NULL;
  140|       |
  141|  2.50M|    if (pval == NULL)
  ------------------
  |  Branch (141:9): [True: 2.49M, False: 10.6k]
  ------------------
  142|  2.49M|        pval = &ptmpval;
  143|  2.50M|    asn1_tlc_clear_nc(&c);
  ------------------
  |  |   98|  2.50M|#define asn1_tlc_clear_nc(c)    do {(c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (98:62): [Folded - Ignored]
  |  |  ------------------
  ------------------
  144|  2.50M|    if (asn1_item_ex_d2i_intern(pval, in, len, it, -1, 0, 0, &c, libctx,
  ------------------
  |  Branch (144:9): [True: 400k, False: 2.10M]
  ------------------
  145|  2.50M|                                propq) > 0)
  146|   400k|        return *pval;
  147|  2.10M|    return NULL;
  148|  2.50M|}
ASN1_item_d2i:
  153|  2.49M|{
  154|  2.49M|    return ASN1_item_d2i_ex(pval, in, len, it, NULL, NULL);
  155|  2.49M|}
tasn_dec.c:asn1_item_ex_d2i_intern:
  111|  2.59M|{
  112|  2.59M|    int rv;
  113|       |
  114|  2.59M|    if (pval == NULL || it == NULL) {
  ------------------
  |  Branch (114:9): [True: 0, False: 2.59M]
  |  Branch (114:25): [True: 0, False: 2.59M]
  ------------------
  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|  2.59M|    rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0,
  119|  2.59M|                             libctx, propq);
  120|  2.59M|    if (rv <= 0)
  ------------------
  |  Branch (120:9): [True: 2.16M, False: 428k]
  ------------------
  121|  2.16M|        ASN1_item_ex_free(pval, it);
  122|  2.59M|    return rv;
  123|  2.59M|}
tasn_dec.c:asn1_item_embed_d2i:
  167|  17.0M|{
  168|  17.0M|    const ASN1_TEMPLATE *tt, *errtt = NULL;
  169|  17.0M|    const ASN1_EXTERN_FUNCS *ef;
  170|  17.0M|    const ASN1_AUX *aux;
  171|  17.0M|    ASN1_aux_cb *asn1_cb;
  172|  17.0M|    const unsigned char *p = NULL, *q;
  173|  17.0M|    unsigned char oclass;
  174|  17.0M|    char seq_eoc, seq_nolen, cst, isopt;
  175|  17.0M|    long tmplen;
  176|  17.0M|    int i;
  177|  17.0M|    int otag;
  178|  17.0M|    int ret = 0;
  179|  17.0M|    ASN1_VALUE **pchptr;
  180|       |
  181|  17.0M|    if (pval == NULL || it == NULL) {
  ------------------
  |  Branch (181:9): [True: 0, False: 17.0M]
  |  Branch (181:25): [True: 0, False: 17.0M]
  ------------------
  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|  17.0M|    if (len <= 0) {
  ------------------
  |  Branch (185:9): [True: 632, False: 17.0M]
  ------------------
  186|    632|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|    632|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    632|    (ERR_new(),                                                 \
  |  |  |  |  404|    632|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    632|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    632|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    632|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    632|     ERR_set_error)
  |  |  ------------------
  ------------------
  187|    632|        return 0;
  188|    632|    }
  189|  17.0M|    aux = it->funcs;
  190|  17.0M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (190:9): [True: 2.06M, False: 14.9M]
  |  Branch (190:16): [True: 1.94M, False: 113k]
  ------------------
  191|  1.94M|        asn1_cb = aux->asn1_cb;
  192|  15.0M|    else
  193|  15.0M|        asn1_cb = 0;
  194|       |
  195|  17.0M|    if (++depth > ASN1_MAX_CONSTRUCTED_NEST) {
  ------------------
  |  |   26|  17.0M|#define ASN1_MAX_CONSTRUCTED_NEST 30
  ------------------
  |  Branch (195:9): [True: 1, False: 17.0M]
  ------------------
  196|      1|        ERR_raise(ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  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)
  |  |  ------------------
  ------------------
  197|      1|        goto err;
  198|      1|    }
  199|       |
  200|  17.0M|    switch (it->itype) {
  201|  12.1M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  12.1M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (201:5): [True: 12.1M, False: 4.85M]
  ------------------
  202|  12.1M|        if (it->templates) {
  ------------------
  |  Branch (202:13): [True: 3.25M, False: 8.93M]
  ------------------
  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.25M|            if ((tag != -1) || opt) {
  ------------------
  |  Branch (209:17): [True: 0, False: 3.25M]
  |  Branch (209:32): [True: 0, False: 3.25M]
  ------------------
  210|      0|                ERR_raise(ERR_LIB_ASN1,
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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.25M|            return asn1_template_ex_d2i(pval, in, len, it->templates, opt, ctx,
  215|  3.25M|                                        depth, libctx, propq);
  216|  3.25M|        }
  217|  8.93M|        return asn1_d2i_ex_primitive(pval, in, len, it,
  218|  8.93M|                                     tag, aclass, opt, ctx);
  219|       |
  220|   345k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   345k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (220:5): [True: 345k, False: 16.6M]
  ------------------
  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|   345k|        if (tag != -1) {
  ------------------
  |  Branch (225:13): [True: 0, False: 345k]
  ------------------
  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|   345k|        p = *in;
  231|       |        /* Just read in tag and class */
  232|   345k|        ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL,
  233|   345k|                              &p, len, -1, 0, 1, ctx);
  234|   345k|        if (!ret) {
  ------------------
  |  Branch (234:13): [True: 1.34k, False: 344k]
  ------------------
  235|  1.34k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  1.34k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.34k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.34k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  1.34k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  1.34k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  1.34k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.34k|     ERR_set_error)
  |  |  ------------------
  ------------------
  236|  1.34k|            goto err;
  237|  1.34k|        }
  238|       |
  239|       |        /* Must be UNIVERSAL class */
  240|   344k|        if (oclass != V_ASN1_UNIVERSAL) {
  ------------------
  |  |   47|   344k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (240:13): [True: 6.82k, False: 337k]
  ------------------
  241|       |            /* If OPTIONAL, assume this is OK */
  242|  6.82k|            if (opt)
  ------------------
  |  Branch (242:17): [True: 580, False: 6.24k]
  ------------------
  243|    580|                return -1;
  244|  6.82k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL);
  ------------------
  |  |  401|  6.24k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  6.24k|    (ERR_new(),                                                 \
  |  |  |  |  404|  6.24k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  6.24k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  6.24k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  6.24k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  6.24k|     ERR_set_error)
  |  |  ------------------
  ------------------
  245|  6.24k|            goto err;
  246|  6.82k|        }
  247|       |
  248|       |        /* Check tag matches bit map */
  249|   337k|        if (!(ASN1_tag2bit(otag) & it->utype)) {
  ------------------
  |  Branch (249:13): [True: 61.7k, False: 275k]
  ------------------
  250|       |            /* If OPTIONAL, assume this is OK */
  251|  61.7k|            if (opt)
  ------------------
  |  Branch (251:17): [True: 195, False: 61.5k]
  ------------------
  252|    195|                return -1;
  253|  61.7k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG);
  ------------------
  |  |  401|  61.5k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  61.5k|    (ERR_new(),                                                 \
  |  |  |  |  404|  61.5k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  61.5k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  61.5k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  61.5k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  61.5k|     ERR_set_error)
  |  |  ------------------
  ------------------
  254|  61.5k|            goto err;
  255|  61.7k|        }
  256|   275k|        return asn1_d2i_ex_primitive(pval, in, len, it, otag, 0, 0, ctx);
  257|       |
  258|  90.0k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|  90.0k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (258:5): [True: 90.0k, False: 16.9M]
  ------------------
  259|       |        /* Use new style d2i */
  260|  90.0k|        ef = it->funcs;
  261|  90.0k|        if (ef->asn1_ex_d2i_ex != NULL)
  ------------------
  |  Branch (261:13): [True: 26.3k, False: 63.7k]
  ------------------
  262|  26.3k|            return ef->asn1_ex_d2i_ex(pval, in, len, it, tag, aclass, opt, ctx,
  263|  26.3k|                                      libctx, propq);
  264|  63.7k|        return ef->asn1_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx);
  265|       |
  266|  1.07M|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|  1.07M|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (266:5): [True: 1.07M, False: 15.9M]
  ------------------
  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|  1.07M|        if (tag != -1) {
  ------------------
  |  Branch (271:13): [True: 0, False: 1.07M]
  ------------------
  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|  1.07M|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
  ------------------
  |  |  746|  28.2k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (276:13): [True: 28.2k, False: 1.04M]
  |  Branch (276:24): [True: 0, False: 28.2k]
  ------------------
  277|      0|            goto auxerr;
  278|  1.07M|        if (*pval) {
  ------------------
  |  Branch (278:13): [True: 29.0k, False: 1.04M]
  ------------------
  279|       |            /* Free up and zero CHOICE value if initialised */
  280|  29.0k|            i = ossl_asn1_get_choice_selector(pval, it);
  281|  29.0k|            if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (281:17): [True: 0, False: 29.0k]
  |  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|  1.04M|        } else if (!ossl_asn1_item_ex_new_intern(pval, it, libctx, propq)) {
  ------------------
  |  Branch (287:20): [True: 0, False: 1.04M]
  ------------------
  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|  1.07M|        p = *in;
  293|  4.22M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (293:41): [True: 4.12M, False: 100k]
  ------------------
  294|  4.12M|            pchptr = ossl_asn1_get_field_ptr(pval, tt);
  295|       |            /*
  296|       |             * We mark field as OPTIONAL so its absence can be recognised.
  297|       |             */
  298|  4.12M|            ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx, depth,
  299|  4.12M|                                       libctx, propq);
  300|       |            /* If field not present, try the next one */
  301|  4.12M|            if (ret == -1)
  ------------------
  |  Branch (301:17): [True: 3.14M, False: 975k]
  ------------------
  302|  3.14M|                continue;
  303|       |            /* If positive return, read OK, break loop */
  304|   975k|            if (ret > 0)
  ------------------
  |  Branch (304:17): [True: 893k, False: 81.2k]
  ------------------
  305|   893k|                break;
  306|       |            /*
  307|       |             * Must be an ASN1 parsing error.
  308|       |             * Free up any partial choice value
  309|       |             */
  310|  81.2k|            ossl_asn1_template_free(pchptr, tt);
  311|  81.2k|            errtt = tt;
  312|  81.2k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  81.2k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  81.2k|    (ERR_new(),                                                 \
  |  |  |  |  404|  81.2k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  81.2k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  81.2k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  81.2k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  81.2k|     ERR_set_error)
  |  |  ------------------
  ------------------
  313|  81.2k|            goto err;
  314|   975k|        }
  315|       |
  316|       |        /* Did we fall off the end without reading anything? */
  317|   994k|        if (i == it->tcount) {
  ------------------
  |  Branch (317:13): [True: 100k, False: 893k]
  ------------------
  318|       |            /* If OPTIONAL, this is OK */
  319|   100k|            if (opt) {
  ------------------
  |  Branch (319:17): [True: 30, False: 100k]
  ------------------
  320|       |                /* Free and zero it */
  321|     30|                ASN1_item_ex_free(pval, it);
  322|     30|                return -1;
  323|     30|            }
  324|   100k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE);
  ------------------
  |  |  401|   100k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|   100k|    (ERR_new(),                                                 \
  |  |  |  |  404|   100k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|   100k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|   100k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|   100k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|   100k|     ERR_set_error)
  |  |  ------------------
  ------------------
  325|   100k|            goto err;
  326|   100k|        }
  327|       |
  328|   893k|        ossl_asn1_set_choice_selector(pval, i, it);
  329|       |
  330|   893k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
  ------------------
  |  |  747|  14.8k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (330:13): [True: 14.8k, False: 879k]
  |  Branch (330:24): [True: 0, False: 14.8k]
  ------------------
  331|      0|            goto auxerr;
  332|   893k|        *in = p;
  333|   893k|        return 1;
  334|       |
  335|   118k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|   118k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (335:5): [True: 118k, False: 16.9M]
  ------------------
  336|  3.34M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  3.34M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (336:5): [True: 3.22M, False: 13.8M]
  ------------------
  337|  3.34M|        p = *in;
  338|  3.34M|        tmplen = len;
  339|       |
  340|       |        /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */
  341|  3.34M|        if (tag == -1) {
  ------------------
  |  Branch (341:13): [True: 3.20M, False: 141k]
  ------------------
  342|  3.20M|            tag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  3.20M|# define V_ASN1_SEQUENCE                 16
  ------------------
  343|  3.20M|            aclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  3.20M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  344|  3.20M|        }
  345|       |        /* Get SEQUENCE length and update len, p */
  346|  3.34M|        ret = asn1_check_tlen(&len, NULL, NULL, &seq_eoc, &cst,
  347|  3.34M|                              &p, len, tag, aclass, opt, ctx);
  348|  3.34M|        if (!ret) {
  ------------------
  |  Branch (348:13): [True: 553k, False: 2.78M]
  ------------------
  349|   553k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|   553k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|   553k|    (ERR_new(),                                                 \
  |  |  |  |  404|   553k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|   553k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|   553k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|   553k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|   553k|     ERR_set_error)
  |  |  ------------------
  ------------------
  350|   553k|            goto err;
  351|  2.78M|        } else if (ret == -1)
  ------------------
  |  Branch (351:20): [True: 1.00M, False: 1.78M]
  ------------------
  352|  1.00M|            return -1;
  353|  1.78M|        if (aux && (aux->flags & ASN1_AFLG_BROKEN)) {
  ------------------
  |  |  736|   359k|# define ASN1_AFLG_BROKEN        4
  ------------------
  |  Branch (353:13): [True: 359k, False: 1.42M]
  |  Branch (353:20): [True: 0, False: 359k]
  ------------------
  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.78M|        else
  359|  1.78M|            seq_nolen = seq_eoc;
  360|  1.78M|        if (!cst) {
  ------------------
  |  Branch (360:13): [True: 20.0k, False: 1.76M]
  ------------------
  361|  20.0k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED);
  ------------------
  |  |  401|  20.0k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  20.0k|    (ERR_new(),                                                 \
  |  |  |  |  404|  20.0k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  20.0k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  20.0k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  20.0k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  20.0k|     ERR_set_error)
  |  |  ------------------
  ------------------
  362|  20.0k|            goto err;
  363|  20.0k|        }
  364|       |
  365|  1.76M|        if (*pval == NULL
  ------------------
  |  Branch (365:13): [True: 1.59M, False: 162k]
  ------------------
  366|  1.76M|                && !ossl_asn1_item_ex_new_intern(pval, it, libctx, propq)) {
  ------------------
  |  Branch (366:20): [True: 0, False: 1.59M]
  ------------------
  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.76M|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
  ------------------
  |  |  746|   338k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (371:13): [True: 338k, False: 1.42M]
  |  Branch (371:24): [True: 0, False: 338k]
  ------------------
  372|      0|            goto auxerr;
  373|       |
  374|       |        /* Free up and zero any ADB found */
  375|  7.47M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (375:41): [True: 5.71M, False: 1.76M]
  ------------------
  376|  5.71M|            if (tt->flags & ASN1_TFLG_ADB_MASK) {
  ------------------
  |  |  583|  5.71M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
  |  Branch (376:17): [True: 67.4k, False: 5.64M]
  ------------------
  377|  67.4k|                const ASN1_TEMPLATE *seqtt;
  378|  67.4k|                ASN1_VALUE **pseqval;
  379|  67.4k|                seqtt = ossl_asn1_do_adb(*pval, tt, 0);
  380|  67.4k|                if (seqtt == NULL)
  ------------------
  |  Branch (380:21): [True: 47.3k, False: 20.0k]
  ------------------
  381|  47.3k|                    continue;
  382|  20.0k|                pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  383|  20.0k|                ossl_asn1_template_free(pseqval, seqtt);
  384|  20.0k|            }
  385|  5.71M|        }
  386|       |
  387|       |        /* Get each field entry */
  388|  3.85M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (388:41): [True: 3.32M, False: 529k]
  ------------------
  389|  3.32M|            const ASN1_TEMPLATE *seqtt;
  390|  3.32M|            ASN1_VALUE **pseqval;
  391|  3.32M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  392|  3.32M|            if (seqtt == NULL)
  ------------------
  |  Branch (392:17): [True: 0, False: 3.32M]
  ------------------
  393|      0|                goto err;
  394|  3.32M|            pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  395|       |            /* Have we ran out of data? */
  396|  3.32M|            if (!len)
  ------------------
  |  Branch (396:17): [True: 83.3k, False: 3.24M]
  ------------------
  397|  83.3k|                break;
  398|  3.24M|            q = p;
  399|  3.24M|            if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (399:17): [True: 42.3k, False: 3.20M]
  ------------------
  400|  42.3k|                if (!seq_eoc) {
  ------------------
  |  Branch (400:21): [True: 785, False: 41.5k]
  ------------------
  401|    785|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|    785|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    785|    (ERR_new(),                                                 \
  |  |  |  |  404|    785|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    785|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    785|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    785|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    785|     ERR_set_error)
  |  |  ------------------
  ------------------
  402|    785|                    goto err;
  403|    785|                }
  404|  41.5k|                len -= p - q;
  405|  41.5k|                seq_eoc = 0;
  406|  41.5k|                break;
  407|  42.3k|            }
  408|       |            /*
  409|       |             * This determines the OPTIONAL flag value. The field cannot be
  410|       |             * omitted if it is the last of a SEQUENCE and there is still
  411|       |             * data to be read. This isn't strictly necessary but it
  412|       |             * increases efficiency in some cases.
  413|       |             */
  414|  3.20M|            if (i == (it->tcount - 1))
  ------------------
  |  Branch (414:17): [True: 711k, False: 2.49M]
  ------------------
  415|   711k|                isopt = 0;
  416|  2.49M|            else
  417|  2.49M|                isopt = (char)(seqtt->flags & ASN1_TFLG_OPTIONAL);
  ------------------
  |  |  523|  2.49M|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  418|       |            /*
  419|       |             * attempt to read in field, allowing each to be OPTIONAL
  420|       |             */
  421|       |
  422|  3.20M|            ret = asn1_template_ex_d2i(pseqval, &p, len, seqtt, isopt, ctx,
  423|  3.20M|                                       depth, libctx, propq);
  424|  3.20M|            if (!ret) {
  ------------------
  |  Branch (424:17): [True: 1.10M, False: 2.09M]
  ------------------
  425|  1.10M|                errtt = seqtt;
  426|  1.10M|                goto err;
  427|  2.09M|            } else if (ret == -1) {
  ------------------
  |  Branch (427:24): [True: 461k, False: 1.63M]
  ------------------
  428|       |                /*
  429|       |                 * OPTIONAL component absent. Free and zero the field.
  430|       |                 */
  431|   461k|                ossl_asn1_template_free(pseqval, seqtt);
  432|   461k|                continue;
  433|   461k|            }
  434|       |            /* Update length */
  435|  1.63M|            len -= p - q;
  436|  1.63M|        }
  437|       |
  438|       |        /* Check for EOC if expecting one */
  439|   654k|        if (seq_eoc && !asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (439:13): [True: 169k, False: 484k]
  |  Branch (439:24): [True: 12.2k, False: 157k]
  ------------------
  440|  12.2k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|  12.2k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  12.2k|    (ERR_new(),                                                 \
  |  |  |  |  404|  12.2k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  12.2k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  12.2k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  12.2k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  12.2k|     ERR_set_error)
  |  |  ------------------
  ------------------
  441|  12.2k|            goto err;
  442|  12.2k|        }
  443|       |        /* Check all data read */
  444|   641k|        if (!seq_nolen && len) {
  ------------------
  |  Branch (444:13): [True: 442k, False: 198k]
  |  Branch (444:27): [True: 5.49k, False: 437k]
  ------------------
  445|  5.49k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH);
  ------------------
  |  |  401|  5.49k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  5.49k|    (ERR_new(),                                                 \
  |  |  |  |  404|  5.49k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  5.49k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  5.49k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  5.49k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  5.49k|     ERR_set_error)
  |  |  ------------------
  ------------------
  446|  5.49k|            goto err;
  447|  5.49k|        }
  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|   804k|        for (; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (454:16): [True: 193k, False: 610k]
  ------------------
  455|   193k|            const ASN1_TEMPLATE *seqtt;
  456|   193k|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  457|   193k|            if (seqtt == NULL)
  ------------------
  |  Branch (457:17): [True: 0, False: 193k]
  ------------------
  458|      0|                goto err;
  459|   193k|            if (seqtt->flags & ASN1_TFLG_OPTIONAL) {
  ------------------
  |  |  523|   193k|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (459:17): [True: 168k, False: 25.7k]
  ------------------
  460|   168k|                ASN1_VALUE **pseqval;
  461|   168k|                pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  462|   168k|                ossl_asn1_template_free(pseqval, seqtt);
  463|   168k|            } else {
  464|  25.7k|                errtt = seqtt;
  465|  25.7k|                ERR_raise(ERR_LIB_ASN1, ASN1_R_FIELD_MISSING);
  ------------------
  |  |  401|  25.7k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  25.7k|    (ERR_new(),                                                 \
  |  |  |  |  404|  25.7k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  25.7k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  25.7k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  25.7k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  25.7k|     ERR_set_error)
  |  |  ------------------
  ------------------
  466|  25.7k|                goto err;
  467|  25.7k|            }
  468|   193k|        }
  469|       |        /* Save encoding */
  470|   610k|        if (!ossl_asn1_enc_save(pval, *in, p - *in, it))
  ------------------
  |  Branch (470:13): [True: 0, False: 610k]
  ------------------
  471|      0|            goto auxerr;
  472|   610k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
  ------------------
  |  |  747|  34.1k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (472:13): [True: 34.1k, False: 576k]
  |  Branch (472:24): [True: 110, False: 34.0k]
  ------------------
  473|    110|            goto auxerr;
  474|   610k|        *in = p;
  475|   610k|        return 1;
  476|       |
  477|      0|    default:
  ------------------
  |  Branch (477:5): [True: 0, False: 17.0M]
  ------------------
  478|      0|        return 0;
  479|  17.0M|    }
  480|    110| auxerr:
  481|    110|    ERR_raise(ERR_LIB_ASN1, ASN1_R_AUX_ERROR);
  ------------------
  |  |  401|    110|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    110|    (ERR_new(),                                                 \
  |  |  |  |  404|    110|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    110|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    110|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    110|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    110|     ERR_set_error)
  |  |  ------------------
  ------------------
  482|  1.97M| err:
  483|  1.97M|    if (errtt)
  ------------------
  |  Branch (483:9): [True: 1.21M, False: 762k]
  ------------------
  484|  1.21M|        ERR_add_error_data(4, "Field=", errtt->field_name,
  485|  1.21M|                           ", Type=", it->sname);
  486|   762k|    else
  487|   762k|        ERR_add_error_data(2, "Type=", it->sname);
  488|  1.97M|    return 0;
  489|    110|}
tasn_dec.c:asn1_template_ex_d2i:
  501|  10.5M|{
  502|  10.5M|    int flags, aclass;
  503|  10.5M|    int ret;
  504|  10.5M|    long len;
  505|  10.5M|    const unsigned char *p, *q;
  506|  10.5M|    char exp_eoc;
  507|  10.5M|    if (!val)
  ------------------
  |  Branch (507:9): [True: 0, False: 10.5M]
  ------------------
  508|      0|        return 0;
  509|  10.5M|    flags = tt->flags;
  510|  10.5M|    aclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  10.5M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  511|       |
  512|  10.5M|    p = *in;
  513|       |
  514|       |    /* Check if EXPLICIT tag expected */
  515|  10.5M|    if (flags & ASN1_TFLG_EXPTAG) {
  ------------------
  |  |  550|  10.5M|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (515:9): [True: 321k, False: 10.2M]
  ------------------
  516|   321k|        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|   321k|        ret = asn1_check_tlen(&len, NULL, NULL, &exp_eoc, &cst,
  522|   321k|                              &p, inlen, tt->tag, aclass, opt, ctx);
  523|   321k|        q = p;
  524|   321k|        if (!ret) {
  ------------------
  |  Branch (524:13): [True: 46.8k, False: 274k]
  ------------------
  525|  46.8k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  46.8k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  46.8k|    (ERR_new(),                                                 \
  |  |  |  |  404|  46.8k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  46.8k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  46.8k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  46.8k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  46.8k|     ERR_set_error)
  |  |  ------------------
  ------------------
  526|  46.8k|            return 0;
  527|   274k|        } else if (ret == -1)
  ------------------
  |  Branch (527:20): [True: 239k, False: 34.5k]
  ------------------
  528|   239k|            return -1;
  529|  34.5k|        if (!cst) {
  ------------------
  |  Branch (529:13): [True: 297, False: 34.2k]
  ------------------
  530|    297|            ERR_raise(ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED);
  ------------------
  |  |  401|    297|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    297|    (ERR_new(),                                                 \
  |  |  |  |  404|    297|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    297|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    297|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    297|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    297|     ERR_set_error)
  |  |  ------------------
  ------------------
  531|    297|            return 0;
  532|    297|        }
  533|       |        /* We've found the field so it can't be OPTIONAL now */
  534|  34.2k|        ret = asn1_template_noexp_d2i(val, &p, len, tt, 0, ctx, depth, libctx,
  535|  34.2k|                                      propq);
  536|  34.2k|        if (!ret) {
  ------------------
  |  Branch (536:13): [True: 8.92k, False: 25.3k]
  ------------------
  537|  8.92k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  8.92k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  8.92k|    (ERR_new(),                                                 \
  |  |  |  |  404|  8.92k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  8.92k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  8.92k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  8.92k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  8.92k|     ERR_set_error)
  |  |  ------------------
  ------------------
  538|  8.92k|            return 0;
  539|  8.92k|        }
  540|       |        /* We read the field in OK so update length */
  541|  25.3k|        len -= p - q;
  542|  25.3k|        if (exp_eoc) {
  ------------------
  |  Branch (542:13): [True: 11.5k, False: 13.8k]
  ------------------
  543|       |            /* If NDEF we must have an EOC here */
  544|  11.5k|            if (!asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (544:17): [True: 334, False: 11.1k]
  ------------------
  545|    334|                ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|    334|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    334|    (ERR_new(),                                                 \
  |  |  |  |  404|    334|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    334|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    334|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    334|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    334|     ERR_set_error)
  |  |  ------------------
  ------------------
  546|    334|                goto err;
  547|    334|            }
  548|  13.8k|        } else {
  549|       |            /*
  550|       |             * Otherwise we must hit the EXPLICIT tag end or its an error
  551|       |             */
  552|  13.8k|            if (len) {
  ------------------
  |  Branch (552:17): [True: 17, False: 13.7k]
  ------------------
  553|     17|                ERR_raise(ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  554|     17|                goto err;
  555|     17|            }
  556|  13.8k|        }
  557|  25.3k|    } else
  558|  10.2M|        return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx, depth,
  559|  10.2M|                                       libctx, propq);
  560|       |
  561|  24.9k|    *in = p;
  562|  24.9k|    return 1;
  563|       |
  564|    351| err:
  565|    351|    return 0;
  566|  10.5M|}
tasn_dec.c:asn1_template_noexp_d2i:
  573|  10.2M|{
  574|  10.2M|    int flags, aclass;
  575|  10.2M|    int ret;
  576|  10.2M|    ASN1_VALUE *tval;
  577|  10.2M|    const unsigned char *p, *q;
  578|  10.2M|    if (!val)
  ------------------
  |  Branch (578:9): [True: 0, False: 10.2M]
  ------------------
  579|      0|        return 0;
  580|  10.2M|    flags = tt->flags;
  581|  10.2M|    aclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  10.2M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  582|       |
  583|  10.2M|    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|  10.2M|    if (tt->flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  597|  10.2M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  |  Branch (589:9): [True: 442k, False: 9.85M]
  ------------------
  590|   442k|        tval = (ASN1_VALUE *)val;
  591|   442k|        val = &tval;
  592|   442k|    }
  593|       |
  594|  10.2M|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  10.2M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (594:9): [True: 3.50M, False: 6.79M]
  ------------------
  595|       |        /* SET OF, SEQUENCE OF */
  596|  3.50M|        int sktag, skaclass;
  597|  3.50M|        char sk_eoc;
  598|       |        /* First work out expected inner tag value */
  599|  3.50M|        if (flags & ASN1_TFLG_IMPTAG) {
  ------------------
  |  |  547|  3.50M|# define ASN1_TFLG_IMPTAG        (0x1 << 3)
  ------------------
  |  Branch (599:13): [True: 109k, False: 3.39M]
  ------------------
  600|   109k|            sktag = tt->tag;
  601|   109k|            skaclass = aclass;
  602|  3.39M|        } else {
  603|  3.39M|            skaclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  3.39M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  604|  3.39M|            if (flags & ASN1_TFLG_SET_OF)
  ------------------
  |  |  526|  3.39M|# define ASN1_TFLG_SET_OF        (0x1 << 1)
  ------------------
  |  Branch (604:17): [True: 3.02M, False: 372k]
  ------------------
  605|  3.02M|                sktag = V_ASN1_SET;
  ------------------
  |  |   75|  3.02M|# define V_ASN1_SET                      17
  ------------------
  606|   372k|            else
  607|   372k|                sktag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|   372k|# define V_ASN1_SEQUENCE                 16
  ------------------
  608|  3.39M|        }
  609|       |        /* Get the tag */
  610|  3.50M|        ret = asn1_check_tlen(&len, NULL, NULL, &sk_eoc, NULL,
  611|  3.50M|                              &p, len, sktag, skaclass, opt, ctx);
  612|  3.50M|        if (!ret) {
  ------------------
  |  Branch (612:13): [True: 185k, False: 3.31M]
  ------------------
  613|   185k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|   185k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|   185k|    (ERR_new(),                                                 \
  |  |  |  |  404|   185k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|   185k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|   185k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|   185k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|   185k|     ERR_set_error)
  |  |  ------------------
  ------------------
  614|   185k|            return 0;
  615|  3.31M|        } else if (ret == -1)
  ------------------
  |  Branch (615:20): [True: 72.6k, False: 3.24M]
  ------------------
  616|  72.6k|            return -1;
  617|  3.24M|        if (*val == NULL)
  ------------------
  |  Branch (617:13): [True: 3.23M, False: 13.5k]
  ------------------
  618|  3.23M|            *val = (ASN1_VALUE *)sk_ASN1_VALUE_new_null();
  ------------------
  |  |  901|  3.23M|#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  619|  13.5k|        else {
  620|       |            /*
  621|       |             * We've got a valid STACK: free up any items present
  622|       |             */
  623|  13.5k|            STACK_OF(ASN1_VALUE) *sktmp = (STACK_OF(ASN1_VALUE) *)*val;
  ------------------
  |  |   31|  13.5k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  624|  13.5k|            ASN1_VALUE *vtmp;
  625|  13.5k|            while (sk_ASN1_VALUE_num(sktmp) > 0) {
  ------------------
  |  |  898|  13.5k|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (625:20): [True: 0, False: 13.5k]
  ------------------
  626|      0|                vtmp = sk_ASN1_VALUE_pop(sktmp);
  ------------------
  |  |  910|      0|#define sk_ASN1_VALUE_pop(sk) ((ASN1_VALUE *)OPENSSL_sk_pop(ossl_check_ASN1_VALUE_sk_type(sk)))
  ------------------
  627|      0|                ASN1_item_ex_free(&vtmp, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  421|      0|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  628|      0|            }
  629|  13.5k|        }
  630|       |
  631|  3.24M|        if (*val == NULL) {
  ------------------
  |  Branch (631:13): [True: 0, False: 3.24M]
  ------------------
  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|  10.7M|        while (len > 0) {
  ------------------
  |  Branch (637:16): [True: 7.78M, False: 2.95M]
  ------------------
  638|  7.78M|            ASN1_VALUE *skfield;
  639|  7.78M|            q = p;
  640|       |            /* See if EOC found */
  641|  7.78M|            if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (641:17): [True: 129k, False: 7.65M]
  ------------------
  642|   129k|                if (!sk_eoc) {
  ------------------
  |  Branch (642:21): [True: 143, False: 129k]
  ------------------
  643|    143|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|    143|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    143|    (ERR_new(),                                                 \
  |  |  |  |  404|    143|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    143|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    143|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    143|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    143|     ERR_set_error)
  |  |  ------------------
  ------------------
  644|    143|                    goto err;
  645|    143|                }
  646|   129k|                len -= p - q;
  647|   129k|                sk_eoc = 0;
  648|   129k|                break;
  649|   129k|            }
  650|  7.65M|            skfield = NULL;
  651|  7.65M|            if (asn1_item_embed_d2i(&skfield, &p, len,
  ------------------
  |  Branch (651:17): [True: 161k, False: 7.49M]
  ------------------
  652|  7.65M|                                     ASN1_ITEM_ptr(tt->item), -1, 0, 0, ctx,
  ------------------
  |  |  421|  7.65M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  653|  7.65M|                                     depth, libctx, propq) <= 0) {
  654|   161k|                ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|   161k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|   161k|    (ERR_new(),                                                 \
  |  |  |  |  404|   161k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|   161k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|   161k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|   161k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|   161k|     ERR_set_error)
  |  |  ------------------
  ------------------
  655|       |                /* |skfield| may be partially allocated despite failure. */
  656|   161k|                ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  421|   161k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  657|   161k|                goto err;
  658|   161k|            }
  659|  7.49M|            len -= p - q;
  660|  7.49M|            if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val, skfield)) {
  ------------------
  |  |  908|  7.49M|#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: 7.49M]
  ------------------
  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|  7.49M|        }
  666|  3.08M|        if (sk_eoc) {
  ------------------
  |  Branch (666:13): [True: 1.04k, False: 3.08M]
  ------------------
  667|  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)
  |  |  ------------------
  ------------------
  668|  1.04k|            goto err;
  669|  1.04k|        }
  670|  6.79M|    } else if (flags & ASN1_TFLG_IMPTAG) {
  ------------------
  |  |  547|  6.79M|# define ASN1_TFLG_IMPTAG        (0x1 << 3)
  ------------------
  |  Branch (670:16): [True: 3.08M, False: 3.71M]
  ------------------
  671|       |        /* IMPLICIT tagging */
  672|  3.08M|        ret = asn1_item_embed_d2i(val, &p, len,
  673|  3.08M|                                  ASN1_ITEM_ptr(tt->item), tt->tag, aclass, opt,
  ------------------
  |  |  421|  3.08M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  674|  3.08M|                                  ctx, depth, libctx, propq);
  675|  3.08M|        if (!ret) {
  ------------------
  |  Branch (675:13): [True: 49.0k, False: 3.03M]
  ------------------
  676|  49.0k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  49.0k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  49.0k|    (ERR_new(),                                                 \
  |  |  |  |  404|  49.0k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  49.0k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  49.0k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  49.0k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  49.0k|     ERR_set_error)
  |  |  ------------------
  ------------------
  677|  49.0k|            goto err;
  678|  3.03M|        } else if (ret == -1)
  ------------------
  |  Branch (678:20): [True: 2.16M, False: 868k]
  ------------------
  679|  2.16M|            return -1;
  680|  3.71M|    } else {
  681|       |        /* Nothing special */
  682|  3.71M|        ret = asn1_item_embed_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  421|  3.71M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  683|  3.71M|                                  -1, 0, opt, ctx, depth, libctx, propq);
  684|  3.71M|        if (!ret) {
  ------------------
  |  Branch (684:13): [True: 983k, False: 2.72M]
  ------------------
  685|   983k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|   983k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|   983k|    (ERR_new(),                                                 \
  |  |  |  |  404|   983k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|   983k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|   983k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|   983k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|   983k|     ERR_set_error)
  |  |  ------------------
  ------------------
  686|   983k|            goto err;
  687|  2.72M|        } else if (ret == -1)
  ------------------
  |  Branch (687:20): [True: 1.13M, False: 1.59M]
  ------------------
  688|  1.13M|            return -1;
  689|  3.71M|    }
  690|       |
  691|  5.54M|    *in = p;
  692|  5.54M|    return 1;
  693|       |
  694|  1.19M| err:
  695|  1.19M|    return 0;
  696|  10.2M|}
tasn_dec.c:asn1_d2i_ex_primitive:
  702|  9.20M|{
  703|  9.20M|    int ret = 0, utype;
  704|  9.20M|    long plen;
  705|  9.20M|    char cst, inf, free_cont = 0;
  706|  9.20M|    const unsigned char *p;
  707|  9.20M|    BUF_MEM buf = { 0, NULL, 0, 0 };
  708|  9.20M|    const unsigned char *cont = NULL;
  709|  9.20M|    long len;
  710|       |
  711|  9.20M|    if (pval == NULL) {
  ------------------
  |  Branch (711:9): [True: 0, False: 9.20M]
  ------------------
  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|  9.20M|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  9.20M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (716:9): [True: 275k, False: 8.93M]
  ------------------
  717|   275k|        utype = tag;
  718|   275k|        tag = -1;
  719|   275k|    } else
  720|  8.93M|        utype = it->utype;
  721|       |
  722|  9.20M|    if (utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  9.20M|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (722:9): [True: 3.22M, False: 5.98M]
  ------------------
  723|       |        /* If type is ANY need to figure out type from tag */
  724|  3.22M|        unsigned char oclass;
  725|  3.22M|        if (tag >= 0) {
  ------------------
  |  Branch (725:13): [True: 0, False: 3.22M]
  ------------------
  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|  3.22M|        if (opt) {
  ------------------
  |  Branch (729:13): [True: 0, False: 3.22M]
  ------------------
  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|  3.22M|        p = *in;
  734|  3.22M|        ret = asn1_check_tlen(NULL, &utype, &oclass, NULL, NULL,
  735|  3.22M|                              &p, inlen, -1, 0, 0, ctx);
  736|  3.22M|        if (!ret) {
  ------------------
  |  Branch (736:13): [True: 1.05k, False: 3.22M]
  ------------------
  737|  1.05k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  1.05k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.05k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.05k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  1.05k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  1.05k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  1.05k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.05k|     ERR_set_error)
  |  |  ------------------
  ------------------
  738|  1.05k|            return 0;
  739|  1.05k|        }
  740|  3.22M|        if (oclass != V_ASN1_UNIVERSAL)
  ------------------
  |  |   47|  3.22M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (740:13): [True: 74.2k, False: 3.14M]
  ------------------
  741|  74.2k|            utype = V_ASN1_OTHER;
  ------------------
  |  |   57|  74.2k|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  742|  3.22M|    }
  743|  9.20M|    if (tag == -1) {
  ------------------
  |  Branch (743:9): [True: 6.26M, False: 2.93M]
  ------------------
  744|  6.26M|        tag = utype;
  745|  6.26M|        aclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  6.26M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  746|  6.26M|    }
  747|  9.20M|    p = *in;
  748|       |    /* Check header */
  749|  9.20M|    ret = asn1_check_tlen(&plen, NULL, NULL, &inf, &cst,
  750|  9.20M|                          &p, inlen, tag, aclass, opt, ctx);
  751|  9.20M|    if (!ret) {
  ------------------
  |  Branch (751:9): [True: 974k, False: 8.23M]
  ------------------
  752|   974k|        ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|   974k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|   974k|    (ERR_new(),                                                 \
  |  |  |  |  404|   974k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|   974k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|   974k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|   974k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|   974k|     ERR_set_error)
  |  |  ------------------
  ------------------
  753|   974k|        return 0;
  754|  8.23M|    } else if (ret == -1)
  ------------------
  |  Branch (754:16): [True: 2.28M, False: 5.94M]
  ------------------
  755|  2.28M|        return -1;
  756|  5.94M|    ret = 0;
  757|       |    /* SEQUENCE, SET and "OTHER" are left in encoded form */
  758|  5.94M|    if ((utype == V_ASN1_SEQUENCE)
  ------------------
  |  |   74|  5.94M|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (758:9): [True: 937k, False: 5.00M]
  ------------------
  759|  5.94M|        || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {
  ------------------
  |  |   75|  5.00M|# define V_ASN1_SET                      17
  ------------------
                      || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {
  ------------------
  |  |   57|  2.00M|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  |  Branch (759:12): [True: 2.99M, False: 2.00M]
  |  Branch (759:37): [True: 74.2k, False: 1.93M]
  ------------------
  760|       |        /*
  761|       |         * Clear context cache for type OTHER because the auto clear when we
  762|       |         * have a exact match won't work
  763|       |         */
  764|  4.01M|        if (utype == V_ASN1_OTHER) {
  ------------------
  |  |   57|  4.01M|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  |  Branch (764:13): [True: 74.2k, False: 3.93M]
  ------------------
  765|  74.2k|            asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  74.2k|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 74.2k, False: 0]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
  766|  74.2k|        }
  767|       |        /* SEQUENCE and SET must be constructed */
  768|  3.93M|        else if (!cst) {
  ------------------
  |  Branch (768:18): [True: 850, False: 3.93M]
  ------------------
  769|    850|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED);
  ------------------
  |  |  401|    850|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    850|    (ERR_new(),                                                 \
  |  |  |  |  404|    850|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    850|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    850|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    850|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    850|     ERR_set_error)
  |  |  ------------------
  ------------------
  770|    850|            return 0;
  771|    850|        }
  772|       |
  773|  4.01M|        cont = *in;
  774|       |        /* If indefinite length constructed find the real end */
  775|  4.01M|        if (inf) {
  ------------------
  |  Branch (775:13): [True: 46.3k, False: 3.96M]
  ------------------
  776|  46.3k|            if (!asn1_find_end(&p, plen, inf))
  ------------------
  |  Branch (776:17): [True: 9.77k, False: 36.5k]
  ------------------
  777|  9.77k|                goto err;
  778|  36.5k|            len = p - cont;
  779|  3.96M|        } else {
  780|  3.96M|            len = p - cont + plen;
  781|  3.96M|            p += plen;
  782|  3.96M|        }
  783|  4.01M|    } else if (cst) {
  ------------------
  |  Branch (783:16): [True: 48.3k, False: 1.88M]
  ------------------
  784|  48.3k|        if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN
  ------------------
  |  |   67|  96.6k|# define V_ASN1_NULL                     5
  ------------------
                      if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN
  ------------------
  |  |   63|  96.5k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (784:13): [True: 91, False: 48.2k]
  |  Branch (784:37): [True: 350, False: 47.8k]
  ------------------
  785|  48.3k|            || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER
  ------------------
  |  |   68|  96.2k|# define V_ASN1_OBJECT                   6
  ------------------
                          || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER
  ------------------
  |  |   64|  96.1k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (785:16): [True: 57, False: 47.8k]
  |  Branch (785:42): [True: 614, False: 47.2k]
  ------------------
  786|  48.3k|            || utype == V_ASN1_ENUMERATED) {
  ------------------
  |  |   72|  47.2k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (786:16): [True: 357, False: 46.8k]
  ------------------
  787|  1.46k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE);
  ------------------
  |  |  401|  1.46k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  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)
  |  |  ------------------
  ------------------
  788|  1.46k|            return 0;
  789|  1.46k|        }
  790|       |
  791|       |        /* Free any returned 'buf' content */
  792|  46.8k|        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|  46.8k|        if (!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL, 0)) {
  ------------------
  |  |   47|  46.8k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (799:13): [True: 1.50k, False: 45.3k]
  ------------------
  800|  1.50k|            goto err;
  801|  1.50k|        }
  802|  45.3k|        len = buf.length;
  803|       |        /* Append a final null to string */
  804|  45.3k|        if (!BUF_MEM_grow_clean(&buf, len + 1)) {
  ------------------
  |  Branch (804:13): [True: 0, False: 45.3k]
  ------------------
  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|  45.3k|        buf.data[len] = 0;
  809|  45.3k|        cont = (const unsigned char *)buf.data;
  810|  1.88M|    } else {
  811|  1.88M|        cont = p;
  812|  1.88M|        len = plen;
  813|  1.88M|        p += plen;
  814|  1.88M|    }
  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|  5.93M|    if (!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it))
  ------------------
  |  Branch (818:9): [True: 92.6k, False: 5.83M]
  ------------------
  819|  92.6k|        goto err;
  820|       |
  821|  5.83M|    *in = p;
  822|  5.83M|    ret = 1;
  823|  5.94M| err:
  824|  5.94M|    if (free_cont)
  ------------------
  |  Branch (824:9): [True: 2.35k, False: 5.94M]
  ------------------
  825|  2.35k|        OPENSSL_free(buf.data);
  ------------------
  |  |  115|  2.35k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.35k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.35k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  826|  5.94M|    return ret;
  827|  5.83M|}
tasn_dec.c:asn1_find_end:
  980|  46.3k|{
  981|  46.3k|    uint32_t expected_eoc;
  982|  46.3k|    long plen;
  983|  46.3k|    const unsigned char *p = *in, *q;
  984|       |    /* If not indefinite length constructed just add length */
  985|  46.3k|    if (inf == 0) {
  ------------------
  |  Branch (985:9): [True: 0, False: 46.3k]
  ------------------
  986|      0|        *in += len;
  987|      0|        return 1;
  988|      0|    }
  989|  46.3k|    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|  43.0M|    while (len > 0) {
  ------------------
  |  Branch (996:12): [True: 43.0M, False: 4.27k]
  ------------------
  997|  43.0M|        if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (997:13): [True: 2.22M, False: 40.7M]
  ------------------
  998|  2.22M|            expected_eoc--;
  999|  2.22M|            if (expected_eoc == 0)
  ------------------
  |  Branch (999:17): [True: 36.5k, False: 2.18M]
  ------------------
 1000|  36.5k|                break;
 1001|  2.18M|            len -= 2;
 1002|  2.18M|            continue;
 1003|  2.22M|        }
 1004|  40.7M|        q = p;
 1005|       |        /* Just read in a header: only care about the length */
 1006|  40.7M|        if (!asn1_check_tlen(&plen, NULL, NULL, &inf, NULL, &p, len,
  ------------------
  |  Branch (1006:13): [True: 5.49k, False: 40.7M]
  ------------------
 1007|  40.7M|                             -1, 0, 0, NULL)) {
 1008|  5.49k|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|  5.49k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  5.49k|    (ERR_new(),                                                 \
  |  |  |  |  404|  5.49k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  5.49k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  5.49k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  5.49k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  5.49k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1009|  5.49k|            return 0;
 1010|  5.49k|        }
 1011|  40.7M|        if (inf) {
  ------------------
  |  Branch (1011:13): [True: 4.87M, False: 35.8M]
  ------------------
 1012|  4.87M|            if (expected_eoc == UINT32_MAX) {
  ------------------
  |  Branch (1012:17): [True: 0, False: 4.87M]
  ------------------
 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|  4.87M|            expected_eoc++;
 1017|  35.8M|        } else {
 1018|  35.8M|            p += plen;
 1019|  35.8M|        }
 1020|  40.7M|        len -= p - q;
 1021|  40.7M|    }
 1022|  40.8k|    if (expected_eoc) {
  ------------------
  |  Branch (1022:9): [True: 4.27k, False: 36.5k]
  ------------------
 1023|  4.27k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|  4.27k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  4.27k|    (ERR_new(),                                                 \
  |  |  |  |  404|  4.27k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  4.27k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  4.27k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  4.27k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  4.27k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1024|  4.27k|        return 0;
 1025|  4.27k|    }
 1026|  36.5k|    *in = p;
 1027|  36.5k|    return 1;
 1028|  40.8k|}
tasn_dec.c:asn1_collect:
 1048|  86.5k|{
 1049|  86.5k|    const unsigned char *p, *q;
 1050|  86.5k|    long plen;
 1051|  86.5k|    char cst, ininf;
 1052|  86.5k|    p = *in;
 1053|  86.5k|    inf &= 1;
 1054|       |    /*
 1055|       |     * If no buffer and not indefinite length constructed just pass over the
 1056|       |     * encoded data
 1057|       |     */
 1058|  86.5k|    if (!buf && !inf) {
  ------------------
  |  Branch (1058:9): [True: 0, False: 86.5k]
  |  Branch (1058:17): [True: 0, False: 0]
  ------------------
 1059|      0|        *in += len;
 1060|      0|        return 1;
 1061|      0|    }
 1062|   307k|    while (len > 0) {
  ------------------
  |  Branch (1062:12): [True: 247k, False: 59.6k]
  ------------------
 1063|   247k|        q = p;
 1064|       |        /* Check for EOC */
 1065|   247k|        if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (1065:13): [True: 23.8k, False: 223k]
  ------------------
 1066|       |            /*
 1067|       |             * EOC is illegal outside indefinite length constructed form
 1068|       |             */
 1069|  23.8k|            if (!inf) {
  ------------------
  |  Branch (1069:17): [True: 64, False: 23.8k]
  ------------------
 1070|     64|                ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  401|     64|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     64|    (ERR_new(),                                                 \
  |  |  |  |  404|     64|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     64|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     64|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     64|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     64|     ERR_set_error)
  |  |  ------------------
  ------------------
 1071|     64|                return 0;
 1072|     64|            }
 1073|  23.8k|            inf = 0;
 1074|  23.8k|            break;
 1075|  23.8k|        }
 1076|       |
 1077|   223k|        if (!asn1_check_tlen(&plen, NULL, NULL, &ininf, &cst, &p,
  ------------------
  |  Branch (1077:13): [True: 915, False: 222k]
  ------------------
 1078|   223k|                             len, tag, aclass, 0, NULL)) {
 1079|    915|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|    915|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    915|    (ERR_new(),                                                 \
  |  |  |  |  404|    915|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    915|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    915|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    915|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    915|     ERR_set_error)
  |  |  ------------------
  ------------------
 1080|    915|            return 0;
 1081|    915|        }
 1082|       |
 1083|       |        /* If indefinite length constructed update max length */
 1084|   222k|        if (cst) {
  ------------------
  |  Branch (1084:13): [True: 39.8k, False: 183k]
  ------------------
 1085|  39.8k|            if (depth >= ASN1_MAX_STRING_NEST) {
  ------------------
  |  | 1043|  39.8k|# define ASN1_MAX_STRING_NEST 5
  ------------------
  |  Branch (1085:17): [True: 92, False: 39.7k]
  ------------------
 1086|     92|                ERR_raise(ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING);
  ------------------
  |  |  401|     92|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     92|    (ERR_new(),                                                 \
  |  |  |  |  404|     92|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     92|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     92|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     92|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     92|     ERR_set_error)
  |  |  ------------------
  ------------------
 1087|     92|                return 0;
 1088|     92|            }
 1089|  39.7k|            if (!asn1_collect(buf, &p, plen, ininf, tag, aclass, depth + 1))
  ------------------
  |  Branch (1089:17): [True: 2.07k, False: 37.6k]
  ------------------
 1090|  2.07k|                return 0;
 1091|   183k|        } else if (plen && !collect_data(buf, &p, plen))
  ------------------
  |  Branch (1091:20): [True: 171k, False: 11.4k]
  |  Branch (1091:28): [True: 0, False: 171k]
  ------------------
 1092|      0|            return 0;
 1093|   220k|        len -= p - q;
 1094|   220k|    }
 1095|  83.4k|    if (inf) {
  ------------------
  |  Branch (1095:9): [True: 438, False: 83.0k]
  ------------------
 1096|    438|        ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  401|    438|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    438|    (ERR_new(),                                                 \
  |  |  |  |  404|    438|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    438|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    438|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    438|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    438|     ERR_set_error)
  |  |  ------------------
  ------------------
 1097|    438|        return 0;
 1098|    438|    }
 1099|  83.0k|    *in = p;
 1100|  83.0k|    return 1;
 1101|  83.4k|}
tasn_dec.c:collect_data:
 1104|   171k|{
 1105|   171k|    int len;
 1106|   171k|    if (buf) {
  ------------------
  |  Branch (1106:9): [True: 171k, False: 0]
  ------------------
 1107|   171k|        len = buf->length;
 1108|   171k|        if (!BUF_MEM_grow_clean(buf, len + plen)) {
  ------------------
  |  Branch (1108:13): [True: 0, False: 171k]
  ------------------
 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|   171k|        memcpy(buf->data + len, *p, plen);
 1113|   171k|    }
 1114|   171k|    *p += plen;
 1115|   171k|    return 1;
 1116|   171k|}
tasn_dec.c:asn1_ex_c2i:
  833|  5.93M|{
  834|  5.93M|    ASN1_VALUE **opval = NULL;
  835|  5.93M|    ASN1_STRING *stmp;
  836|  5.93M|    ASN1_TYPE *typ = NULL;
  837|  5.93M|    int ret = 0;
  838|  5.93M|    const ASN1_PRIMITIVE_FUNCS *pf;
  839|  5.93M|    ASN1_INTEGER **tint;
  840|  5.93M|    pf = it->funcs;
  841|       |
  842|  5.93M|    if (pf && pf->prim_c2i)
  ------------------
  |  Branch (842:9): [True: 359k, False: 5.57M]
  |  Branch (842:15): [True: 359k, False: 0]
  ------------------
  843|   359k|        return pf->prim_c2i(pval, cont, len, utype, free_cont, it);
  844|       |    /* If ANY type clear type and set pointer to internal value */
  845|  5.57M|    if (it->utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  5.57M|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (845:9): [True: 3.21M, False: 2.35M]
  ------------------
  846|  3.21M|        if (*pval == NULL) {
  ------------------
  |  Branch (846:13): [True: 3.20M, False: 9.00k]
  ------------------
  847|  3.20M|            typ = ASN1_TYPE_new();
  848|  3.20M|            if (typ == NULL)
  ------------------
  |  Branch (848:17): [True: 0, False: 3.20M]
  ------------------
  849|      0|                goto err;
  850|  3.20M|            *pval = (ASN1_VALUE *)typ;
  851|  3.20M|        } else
  852|  9.00k|            typ = (ASN1_TYPE *)*pval;
  853|       |
  854|  3.21M|        if (utype != typ->type)
  ------------------
  |  Branch (854:13): [True: 3.21M, False: 0]
  ------------------
  855|  3.21M|            ASN1_TYPE_set(typ, utype, NULL);
  856|  3.21M|        opval = pval;
  857|  3.21M|        pval = &typ->value.asn1_value;
  858|  3.21M|    }
  859|  5.57M|    switch (utype) {
  860|   454k|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|   454k|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (860:5): [True: 454k, False: 5.11M]
  ------------------
  861|   454k|        if (!ossl_c2i_ASN1_OBJECT((ASN1_OBJECT **)pval, &cont, len))
  ------------------
  |  Branch (861:13): [True: 510, False: 453k]
  ------------------
  862|    510|            goto err;
  863|   453k|        break;
  864|       |
  865|   453k|    case V_ASN1_NULL:
  ------------------
  |  |   67|  4.95k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (865:5): [True: 4.95k, False: 5.56M]
  ------------------
  866|  4.95k|        if (len) {
  ------------------
  |  Branch (866:13): [True: 65, False: 4.89k]
  ------------------
  867|     65|            ERR_raise(ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH);
  ------------------
  |  |  401|     65|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     65|    (ERR_new(),                                                 \
  |  |  |  |  404|     65|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     65|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     65|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     65|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     65|     ERR_set_error)
  |  |  ------------------
  ------------------
  868|     65|            goto err;
  869|     65|        }
  870|  4.89k|        *pval = (ASN1_VALUE *)1;
  871|  4.89k|        break;
  872|       |
  873|  8.62k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|  8.62k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (873:5): [True: 8.62k, False: 5.56M]
  ------------------
  874|  8.62k|        if (len != 1) {
  ------------------
  |  Branch (874:13): [True: 320, False: 8.30k]
  ------------------
  875|    320|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH);
  ------------------
  |  |  401|    320|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    320|    (ERR_new(),                                                 \
  |  |  |  |  404|    320|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    320|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    320|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    320|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    320|     ERR_set_error)
  |  |  ------------------
  ------------------
  876|    320|            goto err;
  877|  8.30k|        } else {
  878|  8.30k|            ASN1_BOOLEAN *tbool;
  879|  8.30k|            tbool = (ASN1_BOOLEAN *)pval;
  880|  8.30k|            *tbool = *cont;
  881|  8.30k|        }
  882|  8.30k|        break;
  883|       |
  884|  24.8k|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   65|  24.8k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (884:5): [True: 24.8k, False: 5.54M]
  ------------------
  885|  24.8k|        if (!ossl_c2i_ASN1_BIT_STRING((ASN1_BIT_STRING **)pval, &cont, len))
  ------------------
  |  Branch (885:13): [True: 485, False: 24.3k]
  ------------------
  886|    485|            goto err;
  887|  24.3k|        break;
  888|       |
  889|   452k|    case V_ASN1_INTEGER:
  ------------------
  |  |   64|   452k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (889:5): [True: 452k, False: 5.12M]
  ------------------
  890|   478k|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   72|   478k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (890:5): [True: 26.0k, False: 5.54M]
  ------------------
  891|   478k|        tint = (ASN1_INTEGER **)pval;
  892|   478k|        if (!ossl_c2i_ASN1_INTEGER(tint, &cont, len))
  ------------------
  |  Branch (892:13): [True: 81.3k, False: 397k]
  ------------------
  893|  81.3k|            goto err;
  894|       |        /* Fixup type to match the expected form */
  895|   397k|        (*tint)->type = utype | ((*tint)->type & V_ASN1_NEG);
  ------------------
  |  |   97|   397k|# define V_ASN1_NEG                      0x100
  ------------------
  896|   397k|        break;
  897|       |
  898|   302k|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   66|   302k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (898:5): [True: 302k, False: 5.27M]
  ------------------
  899|   302k|    case V_ASN1_NUMERICSTRING:
  ------------------
  |  |   76|   302k|# define V_ASN1_NUMERICSTRING            18 /**/
  ------------------
  |  Branch (899:5): [True: 270, False: 5.57M]
  ------------------
  900|   380k|    case V_ASN1_PRINTABLESTRING:
  ------------------
  |  |   77|   380k|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  |  Branch (900:5): [True: 78.1k, False: 5.49M]
  ------------------
  901|   382k|    case V_ASN1_T61STRING:
  ------------------
  |  |   78|   382k|# define V_ASN1_T61STRING                20
  ------------------
  |  Branch (901:5): [True: 2.13k, False: 5.57M]
  ------------------
  902|   382k|    case V_ASN1_VIDEOTEXSTRING:
  ------------------
  |  |   80|   382k|# define V_ASN1_VIDEOTEXSTRING           21 /**/
  ------------------
  |  Branch (902:5): [True: 26, False: 5.57M]
  ------------------
  903|   392k|    case V_ASN1_IA5STRING:
  ------------------
  |  |   81|   392k|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (903:5): [True: 9.53k, False: 5.56M]
  ------------------
  904|   451k|    case V_ASN1_UTCTIME:
  ------------------
  |  |   82|   451k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (904:5): [True: 59.6k, False: 5.51M]
  ------------------
  905|   472k|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   83|   472k|# define V_ASN1_GENERALIZEDTIME          24 /**/
  ------------------
  |  Branch (905:5): [True: 20.4k, False: 5.55M]
  ------------------
  906|   472k|    case V_ASN1_GRAPHICSTRING:
  ------------------
  |  |   84|   472k|# define V_ASN1_GRAPHICSTRING            25 /**/
  ------------------
  |  Branch (906:5): [True: 7, False: 5.57M]
  ------------------
  907|   473k|    case V_ASN1_VISIBLESTRING:
  ------------------
  |  |   86|   473k|# define V_ASN1_VISIBLESTRING            26/* alias */
  ------------------
  |  Branch (907:5): [True: 915, False: 5.57M]
  ------------------
  908|   473k|    case V_ASN1_GENERALSTRING:
  ------------------
  |  |   87|   473k|# define V_ASN1_GENERALSTRING            27 /**/
  ------------------
  |  Branch (908:5): [True: 7, False: 5.57M]
  ------------------
  909|   477k|    case V_ASN1_UNIVERSALSTRING:
  ------------------
  |  |   88|   477k|# define V_ASN1_UNIVERSALSTRING          28 /**/
  ------------------
  |  Branch (909:5): [True: 4.15k, False: 5.56M]
  ------------------
  910|   484k|    case V_ASN1_BMPSTRING:
  ------------------
  |  |   89|   484k|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (910:5): [True: 6.93k, False: 5.56M]
  ------------------
  911|   495k|    case V_ASN1_UTF8STRING:
  ------------------
  |  |   73|   495k|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (911:5): [True: 11.1k, False: 5.56M]
  ------------------
  912|   566k|    case V_ASN1_OTHER:
  ------------------
  |  |   57|   566k|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  |  Branch (912:5): [True: 71.5k, False: 5.50M]
  ------------------
  913|  3.56M|    case V_ASN1_SET:
  ------------------
  |  |   75|  3.56M|# define V_ASN1_SET                      17
  ------------------
  |  Branch (913:5): [True: 2.99M, False: 2.57M]
  ------------------
  914|  4.49M|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|  4.49M|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (914:5): [True: 930k, False: 4.64M]
  ------------------
  915|  4.60M|    default:
  ------------------
  |  Branch (915:5): [True: 105k, False: 5.46M]
  ------------------
  916|  4.60M|        if (utype == V_ASN1_BMPSTRING && (len & 1)) {
  ------------------
  |  |   89|  9.20M|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (916:13): [True: 6.93k, False: 4.59M]
  |  Branch (916:42): [True: 42, False: 6.88k]
  ------------------
  917|     42|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  918|     42|            goto err;
  919|     42|        }
  920|  4.60M|        if (utype == V_ASN1_UNIVERSALSTRING && (len & 3)) {
  ------------------
  |  |   88|  9.20M|# define V_ASN1_UNIVERSALSTRING          28 /**/
  ------------------
  |  Branch (920:13): [True: 4.15k, False: 4.59M]
  |  Branch (920:48): [True: 40, False: 4.11k]
  ------------------
  921|     40|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH);
  ------------------
  |  |  401|     40|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     40|    (ERR_new(),                                                 \
  |  |  |  |  404|     40|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     40|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     40|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     40|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     40|     ERR_set_error)
  |  |  ------------------
  ------------------
  922|     40|            goto err;
  923|     40|        }
  924|  4.60M|        if (utype == V_ASN1_GENERALIZEDTIME && (len < 15)) {
  ------------------
  |  |   83|  9.20M|# define V_ASN1_GENERALIZEDTIME          24 /**/
  ------------------
  |  Branch (924:13): [True: 20.4k, False: 4.58M]
  |  Branch (924:48): [True: 722, False: 19.7k]
  ------------------
  925|    722|            ERR_raise(ERR_LIB_ASN1, ASN1_R_GENERALIZEDTIME_IS_TOO_SHORT);
  ------------------
  |  |  401|    722|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    722|    (ERR_new(),                                                 \
  |  |  |  |  404|    722|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    722|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    722|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    722|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    722|     ERR_set_error)
  |  |  ------------------
  ------------------
  926|    722|            goto err;
  927|    722|        }
  928|  4.60M|        if (utype == V_ASN1_UTCTIME && (len < 13)) {
  ------------------
  |  |   82|  9.20M|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (928:13): [True: 59.6k, False: 4.54M]
  |  Branch (928:40): [True: 96, False: 59.5k]
  ------------------
  929|     96|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UTCTIME_IS_TOO_SHORT);
  ------------------
  |  |  401|     96|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     96|    (ERR_new(),                                                 \
  |  |  |  |  404|     96|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     96|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     96|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     96|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     96|     ERR_set_error)
  |  |  ------------------
  ------------------
  930|     96|            goto err;
  931|     96|        }
  932|       |        /* All based on ASN1_STRING and handled the same */
  933|  4.60M|        if (*pval == NULL) {
  ------------------
  |  Branch (933:13): [True: 4.20M, False: 399k]
  ------------------
  934|  4.20M|            stmp = ASN1_STRING_type_new(utype);
  935|  4.20M|            if (stmp == NULL) {
  ------------------
  |  Branch (935:17): [True: 0, False: 4.20M]
  ------------------
  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|  4.20M|            *pval = (ASN1_VALUE *)stmp;
  940|  4.20M|        } else {
  941|   399k|            stmp = (ASN1_STRING *)*pval;
  942|   399k|            stmp->type = utype;
  943|   399k|        }
  944|       |        /* If we've already allocated a buffer use it */
  945|  4.60M|        if (*free_cont) {
  ------------------
  |  Branch (945:13): [True: 44.5k, False: 4.55M]
  ------------------
  946|  44.5k|            ASN1_STRING_set0(stmp, (unsigned char *)cont /* UGLY CAST! */, len);
  947|  44.5k|            *free_cont = 0;
  948|  4.55M|        } else {
  949|  4.55M|            if (!ASN1_STRING_set(stmp, cont, len)) {
  ------------------
  |  Branch (949:17): [True: 0, False: 4.55M]
  ------------------
  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|  4.55M|        }
  956|  4.60M|        break;
  957|  5.57M|    }
  958|       |    /* If ASN1_ANY and NULL type fix up value */
  959|  5.48M|    if (typ && (utype == V_ASN1_NULL))
  ------------------
  |  |   67|  3.20M|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (959:9): [True: 3.20M, False: 2.27M]
  |  Branch (959:16): [True: 4.86k, False: 3.20M]
  ------------------
  960|  4.86k|        typ->value.ptr = NULL;
  961|       |
  962|  5.48M|    ret = 1;
  963|  5.57M| err:
  964|  5.57M|    if (!ret) {
  ------------------
  |  Branch (964:9): [True: 83.6k, False: 5.48M]
  ------------------
  965|  83.6k|        ASN1_TYPE_free(typ);
  966|  83.6k|        if (opval)
  ------------------
  |  Branch (966:13): [True: 3.03k, False: 80.6k]
  ------------------
  967|  3.03k|            *opval = NULL;
  968|  83.6k|    }
  969|  5.57M|    return ret;
  970|  5.48M|}
tasn_dec.c:asn1_check_tlen:
 1145|  60.9M|{
 1146|  60.9M|    int i;
 1147|  60.9M|    int ptag, pclass;
 1148|  60.9M|    long plen;
 1149|  60.9M|    const unsigned char *p, *q;
 1150|  60.9M|    p = *in;
 1151|  60.9M|    q = p;
 1152|       |
 1153|  60.9M|    if (len <= 0) {
  ------------------
  |  Branch (1153:9): [True: 17, False: 60.9M]
  ------------------
 1154|     17|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|     17|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     17|    (ERR_new(),                                                 \
  |  |  |  |  404|     17|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  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)
  |  |  ------------------
  ------------------
 1155|     17|        goto err;
 1156|     17|    }
 1157|  60.9M|    if (ctx != NULL && ctx->valid) {
  ------------------
  |  Branch (1157:9): [True: 19.9M, False: 41.0M]
  |  Branch (1157:24): [True: 7.00M, False: 12.9M]
  ------------------
 1158|  7.00M|        i = ctx->ret;
 1159|  7.00M|        plen = ctx->plen;
 1160|  7.00M|        pclass = ctx->pclass;
 1161|  7.00M|        ptag = ctx->ptag;
 1162|  7.00M|        p += ctx->hdrlen;
 1163|  53.9M|    } else {
 1164|  53.9M|        i = ASN1_get_object(&p, &plen, &ptag, &pclass, len);
 1165|  53.9M|        if (ctx != NULL) {
  ------------------
  |  Branch (1165:13): [True: 12.9M, False: 41.0M]
  ------------------
 1166|  12.9M|            ctx->ret = i;
 1167|  12.9M|            ctx->plen = plen;
 1168|  12.9M|            ctx->pclass = pclass;
 1169|  12.9M|            ctx->ptag = ptag;
 1170|  12.9M|            ctx->hdrlen = p - q;
 1171|  12.9M|            ctx->valid = 1;
 1172|       |            /*
 1173|       |             * If definite length, and no error, length + header can't exceed
 1174|       |             * total amount of data available.
 1175|       |             */
 1176|  12.9M|            if ((i & 0x81) == 0 && (plen + ctx->hdrlen) > len) {
  ------------------
  |  Branch (1176:17): [True: 11.0M, False: 1.86M]
  |  Branch (1176:36): [True: 0, False: 11.0M]
  ------------------
 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|  12.9M|        }
 1181|  53.9M|    }
 1182|       |
 1183|  60.9M|    if ((i & 0x80) != 0) {
  ------------------
  |  Branch (1183:9): [True: 74.9k, False: 60.8M]
  ------------------
 1184|  74.9k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER);
  ------------------
  |  |  401|  74.9k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  74.9k|    (ERR_new(),                                                 \
  |  |  |  |  404|  74.9k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  74.9k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  74.9k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  74.9k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  74.9k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1185|  74.9k|        goto err;
 1186|  74.9k|    }
 1187|  60.8M|    if (exptag >= 0) {
  ------------------
  |  Branch (1187:9): [True: 16.2M, False: 44.6M]
  ------------------
 1188|  16.2M|        if (exptag != ptag || expclass != pclass) {
  ------------------
  |  Branch (1188:13): [True: 5.24M, False: 10.9M]
  |  Branch (1188:31): [True: 55.8k, False: 10.9M]
  ------------------
 1189|       |            /*
 1190|       |             * If type is OPTIONAL, not an error: indicate missing type.
 1191|       |             */
 1192|  5.30M|            if (opt != 0)
  ------------------
  |  Branch (1192:17): [True: 3.60M, False: 1.69M]
  ------------------
 1193|  3.60M|                return -1;
 1194|  5.30M|            ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_TAG);
  ------------------
  |  |  401|  1.69M|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.69M|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.69M|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  1.69M|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  1.69M|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  1.69M|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.69M|     ERR_set_error)
  |  |  ------------------
  ------------------
 1195|  1.69M|            goto err;
 1196|  5.30M|        }
 1197|       |        /*
 1198|       |         * We have a tag and class match: assume we are going to do something
 1199|       |         * with it
 1200|       |         */
 1201|  10.9M|        asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  10.9M|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 10.9M, False: 0]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1202|  10.9M|    }
 1203|       |
 1204|  55.5M|    if ((i & 1) != 0)
  ------------------
  |  Branch (1204:9): [True: 6.21M, False: 49.3M]
  ------------------
 1205|  6.21M|        plen = len - (p - q);
 1206|       |
 1207|  55.5M|    if (inf != NULL)
  ------------------
  |  Branch (1207:9): [True: 52.0M, False: 3.56M]
  ------------------
 1208|  52.0M|        *inf = i & 1;
 1209|       |
 1210|  55.5M|    if (cst != NULL)
  ------------------
  |  Branch (1210:9): [True: 7.98M, False: 47.5M]
  ------------------
 1211|  7.98M|        *cst = i & V_ASN1_CONSTRUCTED;
  ------------------
  |  |   52|  7.98M|# define V_ASN1_CONSTRUCTED              0x20
  ------------------
 1212|       |
 1213|  55.5M|    if (olen != NULL)
  ------------------
  |  Branch (1213:9): [True: 52.0M, False: 3.56M]
  ------------------
 1214|  52.0M|        *olen = plen;
 1215|       |
 1216|  55.5M|    if (oclass != NULL)
  ------------------
  |  Branch (1216:9): [True: 3.56M, False: 52.0M]
  ------------------
 1217|  3.56M|        *oclass = pclass;
 1218|       |
 1219|  55.5M|    if (otag != NULL)
  ------------------
  |  Branch (1219:9): [True: 3.56M, False: 52.0M]
  ------------------
 1220|  3.56M|        *otag = ptag;
 1221|       |
 1222|  55.5M|    *in = p;
 1223|  55.5M|    return 1;
 1224|       |
 1225|  1.76M| err:
 1226|  1.76M|    asn1_tlc_clear(ctx);
  ------------------
  |  |   96|  1.76M|#define asn1_tlc_clear(c)       do { if ((c) != NULL) (c)->valid = 0; } while (0)
  |  |  ------------------
  |  |  |  Branch (96:42): [True: 1.76M, False: 6.41k]
  |  |  |  Branch (96:80): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1227|  1.76M|    return 0;
 1228|  60.8M|}
tasn_dec.c:asn1_check_eoc:
 1121|  54.4M|{
 1122|  54.4M|    const unsigned char *p;
 1123|       |
 1124|  54.4M|    if (len < 2)
  ------------------
  |  Branch (1124:9): [True: 6.81k, False: 54.4M]
  ------------------
 1125|  6.81k|        return 0;
 1126|  54.4M|    p = *in;
 1127|  54.4M|    if (p[0] == '\0' && p[1] == '\0') {
  ------------------
  |  Branch (1127:9): [True: 2.62M, False: 51.8M]
  |  Branch (1127:25): [True: 2.58M, False: 43.8k]
  ------------------
 1128|  2.58M|        *in += 2;
 1129|  2.58M|        return 1;
 1130|  2.58M|    }
 1131|  51.8M|    return 0;
 1132|  54.4M|}

ASN1_item_i2d:
   44|  60.8k|{
   45|  60.8k|    return asn1_item_flags_i2d(val, out, it, 0);
   46|  60.8k|}
ASN1_item_ex_i2d:
   83|  13.4M|{
   84|  13.4M|    const ASN1_TEMPLATE *tt = NULL;
   85|  13.4M|    int i, seqcontlen, seqlen, ndef = 1;
   86|  13.4M|    const ASN1_EXTERN_FUNCS *ef;
   87|  13.4M|    const ASN1_AUX *aux = it->funcs;
   88|  13.4M|    ASN1_aux_const_cb *asn1_cb = NULL;
   89|       |
   90|  13.4M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
  ------------------
  |  |   80|  13.4M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (90:9): [True: 3.82M, False: 9.61M]
  |  Branch (90:48): [True: 23.3k, False: 3.80M]
  ------------------
   91|  23.3k|        return 0;
   92|       |
   93|  13.4M|    if (aux != NULL) {
  ------------------
  |  Branch (93:9): [True: 1.11M, False: 12.3M]
  ------------------
   94|  1.11M|        asn1_cb = ((aux->flags & ASN1_AFLG_CONST_CB) != 0) ? aux->asn1_const_cb
  ------------------
  |  |  738|  1.11M|# define ASN1_AFLG_CONST_CB      8
  ------------------
  |  Branch (94:19): [True: 0, False: 1.11M]
  ------------------
   95|  1.11M|            : (ASN1_aux_const_cb *)aux->asn1_cb; /* backward compatibility */
   96|  1.11M|    }
   97|       |
   98|  13.4M|    switch (it->itype) {
   99|       |
  100|  9.61M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  9.61M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (100:5): [True: 9.61M, False: 3.80M]
  ------------------
  101|  9.61M|        if (it->templates)
  ------------------
  |  Branch (101:13): [True: 132k, False: 9.48M]
  ------------------
  102|   132k|            return asn1_template_ex_i2d(pval, out, it->templates,
  103|   132k|                                        tag, aclass);
  104|  9.48M|        return asn1_i2d_ex_primitive(pval, out, it, tag, aclass);
  105|       |
  106|   520k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   520k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (106:5): [True: 520k, False: 12.9M]
  ------------------
  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|   520k|        if (tag != -1) {
  ------------------
  |  Branch (111:13): [True: 0, False: 520k]
  ------------------
  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|   520k|        return asn1_i2d_ex_primitive(pval, out, it, -1, aclass);
  116|       |
  117|  2.23M|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|  2.23M|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (117:5): [True: 2.23M, False: 11.1M]
  ------------------
  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|  2.23M|        if (tag != -1) {
  ------------------
  |  Branch (122:13): [True: 0, False: 2.23M]
  ------------------
  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|  2.23M|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
  ------------------
  |  |  748|  12.8k|# define ASN1_OP_I2D_PRE         6
  ------------------
  |  Branch (126:13): [True: 12.8k, False: 2.22M]
  |  Branch (126:24): [True: 0, False: 12.8k]
  ------------------
  127|      0|            return 0;
  128|  2.23M|        i = ossl_asn1_get_choice_selector_const(pval, it);
  129|  2.23M|        if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (129:13): [True: 2.23M, False: 0]
  |  Branch (129:25): [True: 2.23M, False: 0]
  ------------------
  130|  2.23M|            const ASN1_VALUE **pchval;
  131|  2.23M|            const ASN1_TEMPLATE *chtt;
  132|  2.23M|            chtt = it->templates + i;
  133|  2.23M|            pchval = ossl_asn1_get_const_field_ptr(pval, chtt);
  134|  2.23M|            return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass);
  135|  2.23M|        }
  136|       |        /* Fixme: error condition if selector out of range */
  137|      0|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL))
  ------------------
  |  |  749|      0|# define ASN1_OP_I2D_POST        7
  ------------------
  |  Branch (137:13): [True: 0, False: 0]
  |  Branch (137:24): [True: 0, False: 0]
  ------------------
  138|      0|            return 0;
  139|      0|        break;
  140|       |
  141|  13.6k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|  13.6k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (141:5): [True: 13.6k, False: 13.4M]
  ------------------
  142|       |        /* If new style i2d it does all the work */
  143|  13.6k|        ef = it->funcs;
  144|  13.6k|        return ef->asn1_ex_i2d(pval, out, it, tag, aclass);
  145|       |
  146|  13.0k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|  13.0k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (146:5): [True: 13.0k, False: 13.4M]
  ------------------
  147|       |        /* Use indefinite length constructed if requested */
  148|  13.0k|        if (aclass & ASN1_TFLG_NDEF)
  ------------------
  |  |  594|  13.0k|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (148:13): [True: 0, False: 13.0k]
  ------------------
  149|      0|            ndef = 2;
  150|       |        /* fall through */
  151|       |
  152|  1.03M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  1.03M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (152:5): [True: 1.02M, False: 12.4M]
  ------------------
  153|  1.03M|        i = ossl_asn1_enc_restore(&seqcontlen, out, pval, it);
  154|       |        /* An error occurred */
  155|  1.03M|        if (i < 0)
  ------------------
  |  Branch (155:13): [True: 0, False: 1.03M]
  ------------------
  156|      0|            return 0;
  157|       |        /* We have a valid cached encoding... */
  158|  1.03M|        if (i > 0)
  ------------------
  |  Branch (158:13): [True: 20.6k, False: 1.01M]
  ------------------
  159|  20.6k|            return seqcontlen;
  160|       |        /* Otherwise carry on */
  161|  1.01M|        seqcontlen = 0;
  162|       |        /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */
  163|  1.01M|        if (tag == -1) {
  ------------------
  |  Branch (163:13): [True: 1.00M, False: 10.2k]
  ------------------
  164|  1.00M|            tag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  1.00M|# define V_ASN1_SEQUENCE                 16
  ------------------
  165|       |            /* Retain any other flags in aclass */
  166|  1.00M|            aclass = (aclass & ~ASN1_TFLG_TAG_CLASS)
  ------------------
  |  |  575|  1.00M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  167|  1.00M|                | V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|  1.00M|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  168|  1.00M|        }
  169|  1.01M|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
  ------------------
  |  |  748|  36.4k|# define ASN1_OP_I2D_PRE         6
  ------------------
  |  Branch (169:13): [True: 36.4k, False: 982k]
  |  Branch (169:24): [True: 0, False: 36.4k]
  ------------------
  170|      0|            return 0;
  171|       |        /* First work out sequence content length */
  172|  3.66M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (172:41): [True: 2.64M, False: 1.01M]
  ------------------
  173|  2.64M|            const ASN1_TEMPLATE *seqtt;
  174|  2.64M|            const ASN1_VALUE **pseqval;
  175|  2.64M|            int tmplen;
  176|  2.64M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  177|  2.64M|            if (!seqtt)
  ------------------
  |  Branch (177:17): [True: 0, False: 2.64M]
  ------------------
  178|      0|                return 0;
  179|  2.64M|            pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
  180|  2.64M|            tmplen = asn1_template_ex_i2d(pseqval, NULL, seqtt, -1, aclass);
  181|  2.64M|            if (tmplen == -1 || (tmplen > INT_MAX - seqcontlen))
  ------------------
  |  Branch (181:17): [True: 0, False: 2.64M]
  |  Branch (181:33): [True: 0, False: 2.64M]
  ------------------
  182|      0|                return -1;
  183|  2.64M|            seqcontlen += tmplen;
  184|  2.64M|        }
  185|       |
  186|  1.01M|        seqlen = ASN1_object_size(ndef, seqcontlen, tag);
  187|  1.01M|        if (!out || seqlen == -1)
  ------------------
  |  Branch (187:13): [True: 723k, False: 295k]
  |  Branch (187:21): [True: 0, False: 295k]
  ------------------
  188|   723k|            return seqlen;
  189|       |        /* Output SEQUENCE header */
  190|   295k|        ASN1_put_object(out, ndef, seqcontlen, tag, aclass);
  191|  1.05M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (191:41): [True: 757k, False: 295k]
  ------------------
  192|   757k|            const ASN1_TEMPLATE *seqtt;
  193|   757k|            const ASN1_VALUE **pseqval;
  194|   757k|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  195|   757k|            if (!seqtt)
  ------------------
  |  Branch (195:17): [True: 0, False: 757k]
  ------------------
  196|      0|                return 0;
  197|   757k|            pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
  198|       |            /* FIXME: check for errors in enhanced version */
  199|   757k|            asn1_template_ex_i2d(pseqval, out, seqtt, -1, aclass);
  200|   757k|        }
  201|   295k|        if (ndef == 2)
  ------------------
  |  Branch (201:13): [True: 0, False: 295k]
  ------------------
  202|      0|            ASN1_put_eoc(out);
  203|   295k|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL))
  ------------------
  |  |  749|  13.8k|# define ASN1_OP_I2D_POST        7
  ------------------
  |  Branch (203:13): [True: 13.8k, False: 281k]
  |  Branch (203:24): [True: 0, False: 13.8k]
  ------------------
  204|      0|            return 0;
  205|   295k|        return seqlen;
  206|       |
  207|      0|    default:
  ------------------
  |  Branch (207:5): [True: 0, False: 13.4M]
  ------------------
  208|      0|        return 0;
  209|       |
  210|  13.4M|    }
  211|      0|    return 0;
  212|  13.4M|}
tasn_enc.c:asn1_item_flags_i2d:
   57|  60.8k|{
   58|  60.8k|    if (out != NULL && *out == NULL) {
  ------------------
  |  Branch (58:9): [True: 59.0k, False: 1.82k]
  |  Branch (58:24): [True: 57.3k, False: 1.71k]
  ------------------
   59|  57.3k|        unsigned char *p, *buf;
   60|  57.3k|        int len;
   61|       |
   62|  57.3k|        len = ASN1_item_ex_i2d(&val, NULL, it, -1, flags);
   63|  57.3k|        if (len <= 0)
  ------------------
  |  Branch (63:13): [True: 20, False: 57.2k]
  ------------------
   64|     20|            return len;
   65|  57.2k|        if ((buf = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  102|  57.2k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  57.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  57.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (65:13): [True: 0, False: 57.2k]
  ------------------
   66|      0|            return -1;
   67|  57.2k|        p = buf;
   68|  57.2k|        ASN1_item_ex_i2d(&val, &p, it, -1, flags);
   69|  57.2k|        *out = buf;
   70|  57.2k|        return len;
   71|  57.2k|    }
   72|       |
   73|  3.54k|    return ASN1_item_ex_i2d(&val, out, it, -1, flags);
   74|  60.8k|}
tasn_enc.c:asn1_template_ex_i2d:
  216|  5.76M|{
  217|  5.76M|    const int flags = tt->flags;
  218|  5.76M|    int i, ret, ttag, tclass, ndef, len;
  219|  5.76M|    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|  5.76M|    if (flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  597|  5.76M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  |  Branch (225:9): [True: 368k, False: 5.40M]
  ------------------
  226|   368k|        tval = (ASN1_VALUE *)pval;
  227|   368k|        pval = &tval;
  228|   368k|    }
  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|  5.76M|    if (flags & ASN1_TFLG_TAG_MASK) {
  ------------------
  |  |  552|  5.76M|# define ASN1_TFLG_TAG_MASK      (0x3 << 3)
  ------------------
  |  Branch (236:9): [True: 2.35M, False: 3.41M]
  ------------------
  237|       |        /* Error if argument and template tagging */
  238|  2.35M|        if (tag != -1)
  ------------------
  |  Branch (238:13): [True: 0, False: 2.35M]
  ------------------
  239|       |            /* FIXME: error code here */
  240|      0|            return -1;
  241|       |        /* Get tagging from template */
  242|  2.35M|        ttag = tt->tag;
  243|  2.35M|        tclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  2.35M|# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
  ------------------
  244|  3.41M|    } else if (tag != -1) {
  ------------------
  |  Branch (244:16): [True: 0, False: 3.41M]
  ------------------
  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|  3.41M|    } else {
  249|  3.41M|        ttag = -1;
  250|  3.41M|        tclass = 0;
  251|  3.41M|    }
  252|       |    /*
  253|       |     * Remove any class mask from iflag.
  254|       |     */
  255|  5.76M|    iclass &= ~ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  575|  5.76M|# 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|  5.76M|    if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF))
  ------------------
  |  |  594|  5.76M|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
                  if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF))
  ------------------
  |  |  594|  1.75k|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (263:9): [True: 1.75k, False: 5.76M]
  |  Branch (263:37): [True: 0, False: 1.75k]
  ------------------
  264|      0|        ndef = 2;
  265|  5.76M|    else
  266|  5.76M|        ndef = 1;
  267|       |
  268|  5.76M|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  5.76M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (268:9): [True: 212k, False: 5.55M]
  ------------------
  269|       |        /* SET OF, SEQUENCE OF */
  270|   212k|        STACK_OF(const_ASN1_VALUE) *sk = (STACK_OF(const_ASN1_VALUE) *)*pval;
  ------------------
  |  |   31|   212k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  271|   212k|        int isset, sktag, skaclass;
  272|   212k|        int skcontlen, sklen;
  273|   212k|        const ASN1_VALUE *skitem;
  274|       |
  275|   212k|        if (*pval == NULL)
  ------------------
  |  Branch (275:13): [True: 52.8k, False: 159k]
  ------------------
  276|  52.8k|            return 0;
  277|       |
  278|   159k|        if (flags & ASN1_TFLG_SET_OF) {
  ------------------
  |  |  526|   159k|# define ASN1_TFLG_SET_OF        (0x1 << 1)
  ------------------
  |  Branch (278:13): [True: 114k, False: 45.2k]
  ------------------
  279|   114k|            isset = 1;
  280|       |            /* 2 means we reorder */
  281|   114k|            if (flags & ASN1_TFLG_SEQUENCE_OF)
  ------------------
  |  |  529|   114k|# define ASN1_TFLG_SEQUENCE_OF   (0x2 << 1)
  ------------------
  |  Branch (281:17): [True: 200, False: 114k]
  ------------------
  282|    200|                isset = 2;
  283|   114k|        } else
  284|  45.2k|            isset = 0;
  285|       |
  286|       |        /*
  287|       |         * Work out inner tag value: if EXPLICIT or no tagging use underlying
  288|       |         * type.
  289|       |         */
  290|   159k|        if ((ttag != -1) && !(flags & ASN1_TFLG_EXPTAG)) {
  ------------------
  |  |  550|  16.2k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (290:13): [True: 16.2k, False: 143k]
  |  Branch (290:29): [True: 6.59k, False: 9.63k]
  ------------------
  291|  6.59k|            sktag = ttag;
  292|  6.59k|            skaclass = tclass;
  293|   153k|        } else {
  294|   153k|            skaclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   47|   153k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  295|   153k|            if (isset)
  ------------------
  |  Branch (295:17): [True: 113k, False: 39.2k]
  ------------------
  296|   113k|                sktag = V_ASN1_SET;
  ------------------
  |  |   75|   113k|# define V_ASN1_SET                      17
  ------------------
  297|  39.2k|            else
  298|  39.2k|                sktag = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|  39.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  299|   153k|        }
  300|       |
  301|       |        /* Determine total length of items */
  302|   159k|        skcontlen = 0;
  303|  5.68M|        for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  Branch (303:21): [True: 5.52M, False: 159k]
  ------------------
  304|  5.52M|            skitem = sk_const_ASN1_VALUE_value(sk, i);
  305|  5.52M|            len = ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  421|  5.52M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  306|  5.52M|                                   -1, iclass);
  307|  5.52M|            if (len == -1 || (skcontlen > INT_MAX - len))
  ------------------
  |  Branch (307:17): [True: 0, False: 5.52M]
  |  Branch (307:30): [True: 0, False: 5.52M]
  ------------------
  308|      0|                return -1;
  309|  5.52M|            if (len == 0 && (tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|      0|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (309:17): [True: 0, False: 5.52M]
  |  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|  5.52M|            skcontlen += len;
  314|  5.52M|        }
  315|   159k|        sklen = ASN1_object_size(ndef, skcontlen, sktag);
  316|   159k|        if (sklen == -1)
  ------------------
  |  Branch (316:13): [True: 0, False: 159k]
  ------------------
  317|      0|            return -1;
  318|       |        /* If EXPLICIT need length of surrounding tag */
  319|   159k|        if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  550|   159k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (319:13): [True: 9.63k, False: 150k]
  ------------------
  320|  9.63k|            ret = ASN1_object_size(ndef, sklen, ttag);
  321|   150k|        else
  322|   150k|            ret = sklen;
  323|       |
  324|   159k|        if (!out || ret == -1)
  ------------------
  |  Branch (324:13): [True: 90.5k, False: 69.3k]
  |  Branch (324:21): [True: 0, False: 69.3k]
  ------------------
  325|  90.5k|            return ret;
  326|       |
  327|       |        /* Now encode this lot... */
  328|       |        /* EXPLICIT tag */
  329|  69.3k|        if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  550|  69.3k|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (329:13): [True: 608, False: 68.6k]
  ------------------
  330|    608|            ASN1_put_object(out, ndef, sklen, ttag, tclass);
  331|       |        /* SET or SEQUENCE and IMPLICIT tag */
  332|  69.3k|        ASN1_put_object(out, ndef, skcontlen, sktag, skaclass);
  333|       |        /* And the stuff itself */
  334|  69.3k|        asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  421|  69.3k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  335|  69.3k|                         isset, iclass);
  336|  69.3k|        if (ndef == 2) {
  ------------------
  |  Branch (336:13): [True: 0, False: 69.3k]
  ------------------
  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|  69.3k|        return ret;
  343|   159k|    }
  344|       |
  345|  5.55M|    if (flags & ASN1_TFLG_EXPTAG) {
  ------------------
  |  |  550|  5.55M|# define ASN1_TFLG_EXPTAG        (0x2 << 3)
  ------------------
  |  Branch (345:9): [True: 78.6k, False: 5.47M]
  ------------------
  346|       |        /* EXPLICIT tagging */
  347|       |        /* Find length of tagged item */
  348|  78.6k|        i = ASN1_item_ex_i2d(pval, NULL, ASN1_ITEM_ptr(tt->item), -1, iclass);
  ------------------
  |  |  421|  78.6k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  349|  78.6k|        if (i == 0) {
  ------------------
  |  Branch (349:13): [True: 48.2k, False: 30.3k]
  ------------------
  350|  48.2k|            if ((tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|  48.2k|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (350:17): [True: 0, False: 48.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|  48.2k|            return 0;
  355|  48.2k|        }
  356|       |        /* Find length of EXPLICIT tag */
  357|  30.3k|        ret = ASN1_object_size(ndef, i, ttag);
  358|  30.3k|        if (out && ret != -1) {
  ------------------
  |  Branch (358:13): [True: 7.87k, False: 22.5k]
  |  Branch (358:20): [True: 7.87k, False: 0]
  ------------------
  359|       |            /* Output tag and item */
  360|  7.87k|            ASN1_put_object(out, ndef, i, ttag, tclass);
  361|  7.87k|            ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, iclass);
  ------------------
  |  |  421|  7.87k|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  362|  7.87k|            if (ndef == 2)
  ------------------
  |  Branch (362:17): [True: 0, False: 7.87k]
  ------------------
  363|      0|                ASN1_put_eoc(out);
  364|  7.87k|        }
  365|  30.3k|        return ret;
  366|  78.6k|    }
  367|       |
  368|       |    /* Either normal or IMPLICIT tagging: combine class and flags */
  369|  5.47M|    len = ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  421|  5.47M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  370|  5.47M|                              ttag, tclass | iclass);
  371|  5.47M|    if (len == 0 && (tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  523|   351k|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (371:9): [True: 351k, False: 5.12M]
  |  Branch (371:21): [True: 0, False: 351k]
  ------------------
  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|  5.47M|    return len;
  376|  5.47M|}
tasn_enc.c:asn1_set_seq_out:
  403|  69.3k|{
  404|  69.3k|    int i, ret = 0;
  405|  69.3k|    const ASN1_VALUE *skitem;
  406|  69.3k|    unsigned char *tmpdat = NULL, *p = NULL;
  407|  69.3k|    DER_ENC *derlst = NULL, *tder;
  408|       |
  409|  69.3k|    if (do_sort) {
  ------------------
  |  Branch (409:9): [True: 55.2k, False: 14.0k]
  ------------------
  410|       |        /* Don't need to sort less than 2 items */
  411|  55.2k|        if (sk_const_ASN1_VALUE_num(sk) < 2)
  ------------------
  |  Branch (411:13): [True: 54.2k, False: 983]
  ------------------
  412|  54.2k|            do_sort = 0;
  413|    983|        else {
  414|    983|            derlst = OPENSSL_malloc(sk_const_ASN1_VALUE_num(sk)
  ------------------
  |  |  102|    983|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    983|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    983|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  415|    983|                                    * sizeof(*derlst));
  416|    983|            if (derlst == NULL)
  ------------------
  |  Branch (416:17): [True: 0, False: 983]
  ------------------
  417|      0|                return 0;
  418|    983|            tmpdat = OPENSSL_malloc(skcontlen);
  ------------------
  |  |  102|    983|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    983|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    983|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  419|    983|            if (tmpdat == NULL)
  ------------------
  |  Branch (419:17): [True: 0, False: 983]
  ------------------
  420|      0|                goto err;
  421|    983|        }
  422|  55.2k|    }
  423|       |    /* If not sorting just output each item */
  424|  69.3k|    if (!do_sort) {
  ------------------
  |  Branch (424:9): [True: 68.3k, False: 983]
  ------------------
  425|  1.74M|        for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  Branch (425:21): [True: 1.67M, False: 68.3k]
  ------------------
  426|  1.67M|            skitem = sk_const_ASN1_VALUE_value(sk, i);
  427|  1.67M|            ASN1_item_ex_i2d(&skitem, out, item, -1, iclass);
  428|  1.67M|        }
  429|  68.3k|        return 1;
  430|  68.3k|    }
  431|    983|    p = tmpdat;
  432|       |
  433|       |    /* Doing sort: build up a list of each member's DER encoding */
  434|   463k|    for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++) {
  ------------------
  |  Branch (434:32): [True: 462k, False: 983]
  ------------------
  435|   462k|        skitem = sk_const_ASN1_VALUE_value(sk, i);
  436|   462k|        tder->data = p;
  437|   462k|        tder->length = ASN1_item_ex_i2d(&skitem, &p, item, -1, iclass);
  438|   462k|        tder->field = skitem;
  439|   462k|    }
  440|       |
  441|       |    /* Now sort them */
  442|    983|    qsort(derlst, sk_const_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp);
  443|       |    /* Output sorted DER encoding */
  444|    983|    p = *out;
  445|   463k|    for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++) {
  ------------------
  |  Branch (445:32): [True: 462k, False: 983]
  ------------------
  446|   462k|        memcpy(p, tder->data, tder->length);
  447|   462k|        p += tder->length;
  448|   462k|    }
  449|    983|    *out = p;
  450|       |    /* If do_sort is 2 then reorder the STACK */
  451|    983|    if (do_sort == 2) {
  ------------------
  |  Branch (451:9): [True: 16, False: 967]
  ------------------
  452|    345|        for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++)
  ------------------
  |  Branch (452:36): [True: 329, False: 16]
  ------------------
  453|    329|            (void)sk_const_ASN1_VALUE_set(sk, i, tder->field);
  454|     16|    }
  455|    983|    ret = 1;
  456|    983|err:
  457|    983|    OPENSSL_free(derlst);
  ------------------
  |  |  115|    983|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    983|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    983|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  458|    983|    OPENSSL_free(tmpdat);
  ------------------
  |  |  115|    983|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    983|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    983|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  459|    983|    return ret;
  460|    983|}
tasn_enc.c:der_cmp:
  387|  5.03M|{
  388|  5.03M|    const DER_ENC *d1 = a, *d2 = b;
  389|  5.03M|    int cmplen, i;
  390|  5.03M|    cmplen = (d1->length < d2->length) ? d1->length : d2->length;
  ------------------
  |  Branch (390:14): [True: 6.20k, False: 5.02M]
  ------------------
  391|  5.03M|    i = memcmp(d1->data, d2->data, cmplen);
  392|  5.03M|    if (i)
  ------------------
  |  Branch (392:9): [True: 1.58M, False: 3.44M]
  ------------------
  393|  1.58M|        return i;
  394|  3.44M|    return d1->length - d2->length;
  395|  5.03M|}
tasn_enc.c:asn1_i2d_ex_primitive:
  464|  10.0M|{
  465|  10.0M|    int len;
  466|  10.0M|    int utype;
  467|  10.0M|    int usetag;
  468|  10.0M|    int ndef = 0;
  469|       |
  470|  10.0M|    utype = it->utype;
  471|       |
  472|       |    /*
  473|       |     * Get length of content octets and maybe find out the underlying type.
  474|       |     */
  475|       |
  476|  10.0M|    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|  10.0M|    if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) ||
  ------------------
  |  |   74|  10.0M|# define V_ASN1_SEQUENCE                 16
  ------------------
                  if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) ||
  ------------------
  |  |   75|  7.69M|# define V_ASN1_SET                      17
  ------------------
  |  Branch (483:9): [True: 2.31M, False: 7.69M]
  |  Branch (483:39): [True: 4.29M, False: 3.40M]
  ------------------
  484|  10.0M|        (utype == V_ASN1_OTHER))
  ------------------
  |  |   57|  3.40M|# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */
  ------------------
  |  Branch (484:9): [True: 105k, False: 3.29M]
  ------------------
  485|  6.71M|        usetag = 0;
  486|  3.29M|    else
  487|  3.29M|        usetag = 1;
  488|       |
  489|       |    /* -1 means omit type */
  490|       |
  491|  10.0M|    if (len == -1)
  ------------------
  |  Branch (491:9): [True: 376k, False: 9.63M]
  ------------------
  492|   376k|        return 0;
  493|       |
  494|       |    /* -2 return is special meaning use ndef */
  495|  9.63M|    if (len == -2) {
  ------------------
  |  Branch (495:9): [True: 0, False: 9.63M]
  ------------------
  496|      0|        ndef = 2;
  497|      0|        len = 0;
  498|      0|    }
  499|       |
  500|       |    /* If not implicitly tagged get tag from underlying type */
  501|  9.63M|    if (tag == -1)
  ------------------
  |  Branch (501:9): [True: 7.43M, False: 2.19M]
  ------------------
  502|  7.43M|        tag = utype;
  503|       |
  504|       |    /* Output tag+length followed by content octets */
  505|  9.63M|    if (out) {
  ------------------
  |  Branch (505:9): [True: 2.53M, False: 7.09M]
  ------------------
  506|  2.53M|        if (usetag)
  ------------------
  |  Branch (506:13): [True: 658k, False: 1.87M]
  ------------------
  507|   658k|            ASN1_put_object(out, ndef, len, tag, aclass);
  508|  2.53M|        asn1_ex_i2c(pval, *out, &utype, it);
  509|  2.53M|        if (ndef)
  ------------------
  |  Branch (509:13): [True: 0, False: 2.53M]
  ------------------
  510|      0|            ASN1_put_eoc(out);
  511|  2.53M|        else
  512|  2.53M|            *out += len;
  513|  2.53M|    }
  514|       |
  515|  9.63M|    if (usetag)
  ------------------
  |  Branch (515:9): [True: 2.92M, False: 6.71M]
  ------------------
  516|  2.92M|        return ASN1_object_size(ndef, len, tag);
  517|  6.71M|    return len;
  518|  9.63M|}
tasn_enc.c:asn1_ex_i2c:
  524|  12.5M|{
  525|  12.5M|    ASN1_BOOLEAN *tbool = NULL;
  526|  12.5M|    ASN1_STRING *strtmp;
  527|  12.5M|    ASN1_OBJECT *otmp;
  528|  12.5M|    int utype;
  529|  12.5M|    const unsigned char *cont;
  530|  12.5M|    unsigned char c;
  531|  12.5M|    int len;
  532|  12.5M|    const ASN1_PRIMITIVE_FUNCS *pf;
  533|  12.5M|    pf = it->funcs;
  534|  12.5M|    if (pf && pf->prim_i2c)
  ------------------
  |  Branch (534:9): [True: 1.24M, False: 11.2M]
  |  Branch (534:15): [True: 1.24M, False: 0]
  ------------------
  535|  1.24M|        return pf->prim_i2c(pval, cout, putype, it);
  536|       |
  537|       |    /* Should type be omitted? */
  538|  11.2M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE)
  ------------------
  |  |   80|  11.2M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (538:9): [True: 654k, False: 10.6M]
  ------------------
  539|  11.2M|        || (it->utype != V_ASN1_BOOLEAN)) {
  ------------------
  |  |   63|  10.6M|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (539:12): [True: 10.3M, False: 273k]
  ------------------
  540|  11.0M|        if (*pval == NULL)
  ------------------
  |  Branch (540:13): [True: 102k, False: 10.9M]
  ------------------
  541|   102k|            return -1;
  542|  11.0M|    }
  543|       |
  544|  11.1M|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  11.1M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (544:9): [True: 654k, False: 10.5M]
  ------------------
  545|       |        /* If MSTRING type set the underlying type */
  546|   654k|        strtmp = (ASN1_STRING *)*pval;
  547|   654k|        utype = strtmp->type;
  548|   654k|        *putype = utype;
  549|  10.5M|    } else if (it->utype == V_ASN1_ANY) {
  ------------------
  |  |   58|  10.5M|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (549:16): [True: 6.08M, False: 4.45M]
  ------------------
  550|       |        /* If ANY set type and pointer to value */
  551|  6.08M|        ASN1_TYPE *typ;
  552|  6.08M|        typ = (ASN1_TYPE *)*pval;
  553|  6.08M|        utype = typ->type;
  554|  6.08M|        *putype = utype;
  555|  6.08M|        pval = (const ASN1_VALUE **)&typ->value.asn1_value; /* actually is const */
  556|  6.08M|    } else
  557|  4.45M|        utype = *putype;
  558|       |
  559|  11.1M|    switch (utype) {
  560|  1.13M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  1.13M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (560:5): [True: 1.13M, False: 10.0M]
  ------------------
  561|  1.13M|        otmp = (ASN1_OBJECT *)*pval;
  562|  1.13M|        cont = otmp->data;
  563|  1.13M|        len = otmp->length;
  564|  1.13M|        if (cont == NULL || len == 0)
  ------------------
  |  Branch (564:13): [True: 0, False: 1.13M]
  |  Branch (564:29): [True: 0, False: 1.13M]
  ------------------
  565|      0|            return -1;
  566|  1.13M|        break;
  567|       |
  568|  1.13M|    case V_ASN1_NULL:
  ------------------
  |  |   67|  14.5k|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (568:5): [True: 14.5k, False: 11.1M]
  ------------------
  569|  14.5k|        cont = NULL;
  570|  14.5k|        len = 0;
  571|  14.5k|        break;
  572|       |
  573|   276k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|   276k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (573:5): [True: 276k, False: 10.9M]
  ------------------
  574|   276k|        tbool = (ASN1_BOOLEAN *)pval;
  575|   276k|        if (*tbool == -1)
  ------------------
  |  Branch (575:13): [True: 0, False: 276k]
  ------------------
  576|      0|            return -1;
  577|   276k|        if (it->utype != V_ASN1_ANY) {
  ------------------
  |  |   58|   276k|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (577:13): [True: 273k, False: 3.21k]
  ------------------
  578|       |            /*
  579|       |             * Default handling if value == size field then omit
  580|       |             */
  581|   273k|            if (*tbool && (it->size > 0))
  ------------------
  |  Branch (581:17): [True: 7.30k, False: 266k]
  |  Branch (581:27): [True: 8, False: 7.30k]
  ------------------
  582|      8|                return -1;
  583|   273k|            if (!*tbool && !it->size)
  ------------------
  |  Branch (583:17): [True: 266k, False: 7.30k]
  |  Branch (583:28): [True: 266k, False: 0]
  ------------------
  584|   266k|                return -1;
  585|   273k|        }
  586|  10.5k|        c = (unsigned char)*tbool;
  587|  10.5k|        cont = &c;
  588|  10.5k|        len = 1;
  589|  10.5k|        break;
  590|       |
  591|  46.6k|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   65|  46.6k|# define V_ASN1_BIT_STRING               3
  ------------------
  |  Branch (591:5): [True: 46.6k, False: 11.1M]
  ------------------
  592|  46.6k|        return ossl_i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval,
  593|  46.6k|                                        cout ? &cout : NULL);
  ------------------
  |  Branch (593:41): [True: 10.7k, False: 35.9k]
  ------------------
  594|       |
  595|  87.5k|    case V_ASN1_INTEGER:
  ------------------
  |  |   64|  87.5k|# define V_ASN1_INTEGER                  2
  ------------------
  |  Branch (595:5): [True: 87.5k, False: 11.1M]
  ------------------
  596|  92.9k|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   72|  92.9k|# define V_ASN1_ENUMERATED               10
  ------------------
  |  Branch (596:5): [True: 5.40k, False: 11.1M]
  ------------------
  597|       |        /*
  598|       |         * These are all have the same content format as ASN1_INTEGER
  599|       |         */
  600|  92.9k|        return ossl_i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : NULL);
  ------------------
  |  Branch (600:61): [True: 19.8k, False: 73.0k]
  ------------------
  601|       |
  602|   389k|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   66|   389k|# define V_ASN1_OCTET_STRING             4
  ------------------
  |  Branch (602:5): [True: 389k, False: 10.8M]
  ------------------
  603|   390k|    case V_ASN1_NUMERICSTRING:
  ------------------
  |  |   76|   390k|# define V_ASN1_NUMERICSTRING            18 /**/
  ------------------
  |  Branch (603:5): [True: 1.08k, False: 11.1M]
  ------------------
  604|   390k|    case V_ASN1_PRINTABLESTRING:
  ------------------
  |  |   77|   390k|# define V_ASN1_PRINTABLESTRING          19
  ------------------
  |  Branch (604:5): [True: 169, False: 11.1M]
  ------------------
  605|   390k|    case V_ASN1_T61STRING:
  ------------------
  |  |   78|   390k|# define V_ASN1_T61STRING                20
  ------------------
  |  Branch (605:5): [True: 40, False: 11.1M]
  ------------------
  606|   390k|    case V_ASN1_VIDEOTEXSTRING:
  ------------------
  |  |   80|   390k|# define V_ASN1_VIDEOTEXSTRING           21 /**/
  ------------------
  |  Branch (606:5): [True: 61, False: 11.1M]
  ------------------
  607|   401k|    case V_ASN1_IA5STRING:
  ------------------
  |  |   81|   401k|# define V_ASN1_IA5STRING                22
  ------------------
  |  Branch (607:5): [True: 10.4k, False: 11.1M]
  ------------------
  608|   404k|    case V_ASN1_UTCTIME:
  ------------------
  |  |   82|   404k|# define V_ASN1_UTCTIME                  23
  ------------------
  |  Branch (608:5): [True: 3.41k, False: 11.1M]
  ------------------
  609|   415k|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   83|   415k|# define V_ASN1_GENERALIZEDTIME          24 /**/
  ------------------
  |  Branch (609:5): [True: 10.8k, False: 11.1M]
  ------------------
  610|   415k|    case V_ASN1_GRAPHICSTRING:
  ------------------
  |  |   84|   415k|# define V_ASN1_GRAPHICSTRING            25 /**/
  ------------------
  |  Branch (610:5): [True: 30, False: 11.1M]
  ------------------
  611|   416k|    case V_ASN1_VISIBLESTRING:
  ------------------
  |  |   86|   416k|# define V_ASN1_VISIBLESTRING            26/* alias */
  ------------------
  |  Branch (611:5): [True: 313, False: 11.1M]
  ------------------
  612|   416k|    case V_ASN1_GENERALSTRING:
  ------------------
  |  |   87|   416k|# define V_ASN1_GENERALSTRING            27 /**/
  ------------------
  |  Branch (612:5): [True: 16, False: 11.1M]
  ------------------
  613|   420k|    case V_ASN1_UNIVERSALSTRING:
  ------------------
  |  |   88|   420k|# define V_ASN1_UNIVERSALSTRING          28 /**/
  ------------------
  |  Branch (613:5): [True: 4.50k, False: 11.1M]
  ------------------
  614|   424k|    case V_ASN1_BMPSTRING:
  ------------------
  |  |   89|   424k|# define V_ASN1_BMPSTRING                30
  ------------------
  |  Branch (614:5): [True: 3.86k, False: 11.1M]
  ------------------
  615|   890k|    case V_ASN1_UTF8STRING:
  ------------------
  |  |   73|   890k|# define V_ASN1_UTF8STRING               12
  ------------------
  |  Branch (615:5): [True: 466k, False: 10.7M]
  ------------------
  616|  3.61M|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|  3.61M|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (616:5): [True: 2.72M, False: 8.47M]
  ------------------
  617|  9.33M|    case V_ASN1_SET:
  ------------------
  |  |   75|  9.33M|# define V_ASN1_SET                      17
  ------------------
  |  Branch (617:5): [True: 5.72M, False: 5.47M]
  ------------------
  618|  9.63M|    default:
  ------------------
  |  Branch (618:5): [True: 295k, False: 10.9M]
  ------------------
  619|       |        /* All based on ASN1_STRING and handled the same */
  620|  9.63M|        strtmp = (ASN1_STRING *)*pval;
  621|       |        /* Special handling for NDEF */
  622|  9.63M|        if ((it->size == ASN1_TFLG_NDEF)
  ------------------
  |  |  594|  9.63M|# define ASN1_TFLG_NDEF          (0x1<<11)
  ------------------
  |  Branch (622:13): [True: 74, False: 9.63M]
  ------------------
  623|  9.63M|            && (strtmp->flags & ASN1_STRING_FLAG_NDEF)) {
  ------------------
  |  |  167|     74|# define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (623:16): [True: 0, False: 74]
  ------------------
  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|  9.63M|        cont = strtmp->data;
  632|  9.63M|        len = strtmp->length;
  633|       |
  634|  9.63M|        break;
  635|       |
  636|  11.1M|    }
  637|  10.7M|    if (cout && len)
  ------------------
  |  Branch (637:9): [True: 2.29M, False: 8.49M]
  |  Branch (637:17): [True: 2.16M, False: 124k]
  ------------------
  638|  2.16M|        memcpy(cout, cont, len);
  639|  10.7M|    return len;
  640|  11.1M|}

ASN1_item_free:
   19|  2.54M|{
   20|  2.54M|    ossl_asn1_item_embed_free(&val, it, 0);
   21|  2.54M|}
ASN1_item_ex_free:
   24|  2.16M|{
   25|  2.16M|    ossl_asn1_item_embed_free(pval, it, 0);
   26|  2.16M|}
ossl_asn1_item_embed_free:
   29|  16.2M|{
   30|  16.2M|    const ASN1_TEMPLATE *tt = NULL, *seqtt;
   31|  16.2M|    const ASN1_EXTERN_FUNCS *ef;
   32|  16.2M|    const ASN1_AUX *aux = it->funcs;
   33|  16.2M|    ASN1_aux_cb *asn1_cb;
   34|  16.2M|    int i;
   35|       |
   36|  16.2M|    if (pval == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 16.2M]
  ------------------
   37|      0|        return;
   38|  16.2M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
  ------------------
  |  |   80|  16.2M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (38:9): [True: 5.51M, False: 10.7M]
  |  Branch (38:48): [True: 1.28M, False: 4.22M]
  ------------------
   39|  1.28M|        return;
   40|  15.0M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (40:9): [True: 952k, False: 14.0M]
  |  Branch (40:16): [True: 754k, False: 198k]
  ------------------
   41|   754k|        asn1_cb = aux->asn1_cb;
   42|  14.2M|    else
   43|  14.2M|        asn1_cb = 0;
   44|       |
   45|  15.0M|    switch (it->itype) {
  ------------------
  |  Branch (45:13): [True: 0, False: 15.0M]
  ------------------
   46|       |
   47|  10.7M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  10.7M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (47:5): [True: 10.7M, False: 4.22M]
  ------------------
   48|  10.7M|        if (it->templates)
  ------------------
  |  Branch (48:13): [True: 1.58M, False: 9.20M]
  ------------------
   49|  1.58M|            ossl_asn1_template_free(pval, it->templates);
   50|  9.20M|        else
   51|  9.20M|            ossl_asn1_primitive_free(pval, it, embed);
   52|  10.7M|        break;
   53|       |
   54|   508k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   508k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (54:5): [True: 508k, False: 14.5M]
  ------------------
   55|   508k|        ossl_asn1_primitive_free(pval, it, embed);
   56|   508k|        break;
   57|       |
   58|  1.11M|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|  1.11M|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (58:5): [True: 1.11M, False: 13.8M]
  ------------------
   59|  1.11M|        if (asn1_cb) {
  ------------------
  |  Branch (59:13): [True: 28.2k, False: 1.09M]
  ------------------
   60|  28.2k|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  744|  28.2k|# define ASN1_OP_FREE_PRE        2
  ------------------
   61|  28.2k|            if (i == 2)
  ------------------
  |  Branch (61:17): [True: 0, False: 28.2k]
  ------------------
   62|      0|                return;
   63|  28.2k|        }
   64|  1.11M|        i = ossl_asn1_get_choice_selector(pval, it);
   65|  1.11M|        if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (65:13): [True: 895k, False: 224k]
  |  Branch (65:25): [True: 895k, False: 0]
  ------------------
   66|   895k|            ASN1_VALUE **pchval;
   67|       |
   68|   895k|            tt = it->templates + i;
   69|   895k|            pchval = ossl_asn1_get_field_ptr(pval, tt);
   70|   895k|            ossl_asn1_template_free(pchval, tt);
   71|   895k|        }
   72|  1.11M|        if (asn1_cb)
  ------------------
  |  Branch (72:13): [True: 28.2k, False: 1.09M]
  ------------------
   73|  28.2k|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  745|  28.2k|# define ASN1_OP_FREE_POST       3
  ------------------
   74|  1.11M|        if (embed == 0) {
  ------------------
  |  Branch (74:13): [True: 1.10M, False: 17.7k]
  ------------------
   75|  1.10M|            OPENSSL_free(*pval);
  ------------------
  |  |  115|  1.10M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.10M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.10M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|  1.10M|            *pval = NULL;
   77|  1.10M|        }
   78|  1.11M|        break;
   79|       |
   80|   176k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   176k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (80:5): [True: 176k, False: 14.8M]
  ------------------
   81|   176k|        ef = it->funcs;
   82|   176k|        if (ef && ef->asn1_ex_free)
  ------------------
  |  Branch (82:13): [True: 176k, False: 0]
  |  Branch (82:19): [True: 176k, False: 0]
  ------------------
   83|   176k|            ef->asn1_ex_free(pval, it);
   84|   176k|        break;
   85|       |
   86|   134k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|   134k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (86:5): [True: 134k, False: 14.8M]
  ------------------
   87|  2.41M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  2.41M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (87:5): [True: 2.28M, False: 12.7M]
  ------------------
   88|  2.41M|        if (ossl_asn1_do_lock(pval, -1, it) != 0) /* if error or ref-counter > 0 */
  ------------------
  |  Branch (88:13): [True: 0, False: 2.41M]
  ------------------
   89|      0|            return;
   90|  2.41M|        if (asn1_cb) {
  ------------------
  |  Branch (90:13): [True: 376k, False: 2.04M]
  ------------------
   91|   376k|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  744|   376k|# define ASN1_OP_FREE_PRE        2
  ------------------
   92|   376k|            if (i == 2)
  ------------------
  |  Branch (92:17): [True: 97.9k, False: 278k]
  ------------------
   93|  97.9k|                return;
   94|   376k|        }
   95|  2.32M|        ossl_asn1_enc_free(pval, it);
   96|       |        /*
   97|       |         * If we free up as normal we will invalidate any ANY DEFINED BY
   98|       |         * field and we won't be able to determine the type of the field it
   99|       |         * defines. So free up in reverse order.
  100|       |         */
  101|  2.32M|        tt = it->templates + it->tcount;
  102|  8.99M|        for (i = 0; i < it->tcount; i++) {
  ------------------
  |  Branch (102:21): [True: 6.67M, False: 2.32M]
  ------------------
  103|  6.67M|            ASN1_VALUE **pseqval;
  104|       |
  105|  6.67M|            tt--;
  106|  6.67M|            seqtt = ossl_asn1_do_adb(*pval, tt, 0);
  107|  6.67M|            if (!seqtt)
  ------------------
  |  Branch (107:17): [True: 63.8k, False: 6.61M]
  ------------------
  108|  63.8k|                continue;
  109|  6.61M|            pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  110|  6.61M|            ossl_asn1_template_free(pseqval, seqtt);
  111|  6.61M|        }
  112|  2.32M|        if (asn1_cb)
  ------------------
  |  Branch (112:13): [True: 278k, False: 2.04M]
  ------------------
  113|   278k|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  745|   278k|# define ASN1_OP_FREE_POST       3
  ------------------
  114|  2.32M|        if (embed == 0) {
  ------------------
  |  Branch (114:13): [True: 2.11M, False: 209k]
  ------------------
  115|  2.11M|            OPENSSL_free(*pval);
  ------------------
  |  |  115|  2.11M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.11M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.11M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  116|  2.11M|            *pval = NULL;
  117|  2.11M|        }
  118|  2.32M|        break;
  119|  15.0M|    }
  120|  15.0M|}
ossl_asn1_template_free:
  123|  9.82M|{
  124|  9.82M|    int embed = tt->flags & ASN1_TFLG_EMBED;
  ------------------
  |  |  597|  9.82M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  125|  9.82M|    ASN1_VALUE *tval;
  126|  9.82M|    if (embed) {
  ------------------
  |  Branch (126:9): [True: 706k, False: 9.11M]
  ------------------
  127|   706k|        tval = (ASN1_VALUE *)pval;
  128|   706k|        pval = &tval;
  129|   706k|    }
  130|  9.82M|    if (tt->flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  9.82M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (130:9): [True: 2.38M, False: 7.44M]
  ------------------
  131|  2.38M|        STACK_OF(ASN1_VALUE) *sk = (STACK_OF(ASN1_VALUE) *)*pval;
  ------------------
  |  |   31|  2.38M|# define STACK_OF(type) struct stack_st_##type
  ------------------
  132|  2.38M|        int i;
  133|       |
  134|  6.52M|        for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  |  898|  6.52M|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (134:21): [True: 4.14M, False: 2.38M]
  ------------------
  135|  4.14M|            ASN1_VALUE *vtmp = sk_ASN1_VALUE_value(sk, i);
  ------------------
  |  |  899|  4.14M|#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
  ------------------
  136|       |
  137|  4.14M|            ossl_asn1_item_embed_free(&vtmp, ASN1_ITEM_ptr(tt->item), embed);
  ------------------
  |  |  421|  4.14M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  138|  4.14M|        }
  139|  2.38M|        sk_ASN1_VALUE_free(sk);
  ------------------
  |  |  904|  2.38M|#define sk_ASN1_VALUE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_VALUE_sk_type(sk))
  ------------------
  140|  2.38M|        *pval = NULL;
  141|  7.44M|    } else {
  142|  7.44M|        ossl_asn1_item_embed_free(pval, ASN1_ITEM_ptr(tt->item), embed);
  ------------------
  |  |  421|  7.44M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  143|  7.44M|    }
  144|  9.82M|}
ossl_asn1_primitive_free:
  147|  12.9M|{
  148|  12.9M|    int utype;
  149|       |
  150|       |    /* Special case: if 'it' is a primitive with a free_func, use that. */
  151|  12.9M|    if (it) {
  ------------------
  |  Branch (151:9): [True: 9.71M, False: 3.22M]
  ------------------
  152|  9.71M|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  153|       |
  154|  9.71M|        if (embed) {
  ------------------
  |  Branch (154:13): [True: 479k, False: 9.23M]
  ------------------
  155|   479k|            if (pf && pf->prim_clear) {
  ------------------
  |  Branch (155:17): [True: 175k, False: 303k]
  |  Branch (155:23): [True: 175k, False: 0]
  ------------------
  156|   175k|                pf->prim_clear(pval, it);
  157|   175k|                return;
  158|   175k|            }
  159|  9.23M|        } else if (pf && pf->prim_free) {
  ------------------
  |  Branch (159:20): [True: 174k, False: 9.05M]
  |  Branch (159:26): [True: 174k, False: 0]
  ------------------
  160|   174k|            pf->prim_free(pval, it);
  161|   174k|            return;
  162|   174k|        }
  163|  9.71M|    }
  164|       |
  165|       |    /* Special case: if 'it' is NULL, free contents of ASN1_TYPE */
  166|  12.5M|    if (!it) {
  ------------------
  |  Branch (166:9): [True: 3.22M, False: 9.36M]
  ------------------
  167|  3.22M|        ASN1_TYPE *typ = (ASN1_TYPE *)*pval;
  168|       |
  169|  3.22M|        utype = typ->type;
  170|  3.22M|        pval = &typ->value.asn1_value;
  171|  3.22M|        if (*pval == NULL)
  ------------------
  |  Branch (171:13): [True: 18.2k, False: 3.20M]
  ------------------
  172|  18.2k|            return;
  173|  9.36M|    } else if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   85|  9.36M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (173:16): [True: 508k, False: 8.85M]
  ------------------
  174|   508k|        utype = -1;
  175|   508k|        if (*pval == NULL)
  ------------------
  |  Branch (175:13): [True: 0, False: 508k]
  ------------------
  176|      0|            return;
  177|  8.85M|    } else {
  178|  8.85M|        utype = it->utype;
  179|  8.85M|        if ((utype != V_ASN1_BOOLEAN) && *pval == NULL)
  ------------------
  |  |   63|  8.85M|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (179:13): [True: 8.39M, False: 462k]
  |  Branch (179:42): [True: 1.84M, False: 6.54M]
  ------------------
  180|  1.84M|            return;
  181|  8.85M|    }
  182|       |
  183|  10.7M|    switch (utype) {
  184|  1.15M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  1.15M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (184:5): [True: 1.15M, False: 9.57M]
  ------------------
  185|  1.15M|        ASN1_OBJECT_free((ASN1_OBJECT *)*pval);
  186|  1.15M|        break;
  187|       |
  188|   462k|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|   462k|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (188:5): [True: 462k, False: 10.2M]
  ------------------
  189|   462k|        if (it)
  ------------------
  |  Branch (189:13): [True: 462k, False: 823]
  ------------------
  190|   462k|            *(ASN1_BOOLEAN *)pval = it->size;
  191|    823|        else
  192|    823|            *(ASN1_BOOLEAN *)pval = -1;
  193|   462k|        return;
  194|       |
  195|     22|    case V_ASN1_NULL:
  ------------------
  |  |   67|     22|# define V_ASN1_NULL                     5
  ------------------
  |  Branch (195:5): [True: 22, False: 10.7M]
  ------------------
  196|     22|        break;
  197|       |
  198|  3.22M|    case V_ASN1_ANY:
  ------------------
  |  |   58|  3.22M|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (198:5): [True: 3.22M, False: 7.50M]
  ------------------
  199|  3.22M|        ossl_asn1_primitive_free(pval, NULL, 0);
  200|  3.22M|        OPENSSL_free(*pval);
  ------------------
  |  |  115|  3.22M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.22M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.22M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  201|  3.22M|        break;
  202|       |
  203|  5.88M|    default:
  ------------------
  |  Branch (203:5): [True: 5.88M, False: 4.83M]
  ------------------
  204|  5.88M|        ossl_asn1_string_embed_free((ASN1_STRING *)*pval, embed);
  205|  5.88M|        break;
  206|  10.7M|    }
  207|  10.2M|    *pval = NULL;
  208|  10.2M|}

ASN1_item_new:
   30|  3.40M|{
   31|  3.40M|    ASN1_VALUE *ret = NULL;
   32|  3.40M|    if (ASN1_item_ex_new(&ret, it) > 0)
  ------------------
  |  Branch (32:9): [True: 3.40M, False: 0]
  ------------------
   33|  3.40M|        return ret;
   34|      0|    return NULL;
   35|  3.40M|}
ossl_asn1_item_ex_new_intern:
   51|  2.64M|{
   52|  2.64M|    return asn1_item_embed_new(pval, it, 0, libctx, propq);
   53|  2.64M|}
ASN1_item_ex_new:
   56|  3.40M|{
   57|  3.40M|    return asn1_item_embed_new(pval, it, 0, NULL, NULL);
   58|  3.40M|}
tasn_new.c:asn1_item_embed_new:
   62|  10.2M|{
   63|  10.2M|    const ASN1_TEMPLATE *tt = NULL;
   64|  10.2M|    const ASN1_EXTERN_FUNCS *ef;
   65|  10.2M|    const ASN1_AUX *aux = it->funcs;
   66|  10.2M|    ASN1_aux_cb *asn1_cb;
   67|  10.2M|    ASN1_VALUE **pseqval;
   68|  10.2M|    int i;
   69|  10.2M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (69:9): [True: 933k, False: 9.30M]
  |  Branch (69:16): [True: 731k, False: 202k]
  ------------------
   70|   731k|        asn1_cb = aux->asn1_cb;
   71|  9.50M|    else
   72|  9.50M|        asn1_cb = 0;
   73|       |
   74|  10.2M|    switch (it->itype) {
  ------------------
  |  Branch (74:13): [True: 0, False: 10.2M]
  ------------------
   75|       |
   76|   180k|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|   180k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (76:5): [True: 180k, False: 10.0M]
  ------------------
   77|   180k|        ef = it->funcs;
   78|   180k|        if (ef != NULL) {
  ------------------
  |  Branch (78:13): [True: 180k, False: 0]
  ------------------
   79|   180k|            if (ef->asn1_ex_new_ex != NULL) {
  ------------------
  |  Branch (79:17): [True: 56.8k, False: 123k]
  ------------------
   80|  56.8k|                if (!ef->asn1_ex_new_ex(pval, it, libctx, propq))
  ------------------
  |  Branch (80:21): [True: 0, False: 56.8k]
  ------------------
   81|      0|                    goto asn1err;
   82|   123k|            } else if (ef->asn1_ex_new != NULL) {
  ------------------
  |  Branch (82:24): [True: 123k, False: 0]
  ------------------
   83|   123k|                if (!ef->asn1_ex_new(pval, it))
  ------------------
  |  Branch (83:21): [True: 0, False: 123k]
  ------------------
   84|      0|                    goto asn1err;
   85|   123k|            }
   86|   180k|        }
   87|   180k|        break;
   88|       |
   89|  5.98M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  5.98M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (89:5): [True: 5.98M, False: 4.25M]
  ------------------
   90|  5.98M|        if (it->templates) {
  ------------------
  |  Branch (90:13): [True: 0, False: 5.98M]
  ------------------
   91|      0|            if (!asn1_template_new(pval, it->templates, libctx, propq))
  ------------------
  |  Branch (91:17): [True: 0, False: 0]
  ------------------
   92|      0|                goto asn1err;
   93|  5.98M|        } else if (!asn1_primitive_new(pval, it, embed))
  ------------------
  |  Branch (93:20): [True: 0, False: 5.98M]
  ------------------
   94|      0|            goto asn1err;
   95|  5.98M|        break;
   96|       |
   97|  5.98M|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|   496k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (97:5): [True: 496k, False: 9.74M]
  ------------------
   98|   496k|        if (!asn1_primitive_new(pval, it, embed))
  ------------------
  |  Branch (98:13): [True: 0, False: 496k]
  ------------------
   99|      0|            goto asn1err;
  100|   496k|        break;
  101|       |
  102|  1.11M|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|  1.11M|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (102:5): [True: 1.11M, False: 9.12M]
  ------------------
  103|  1.11M|        if (asn1_cb) {
  ------------------
  |  Branch (103:13): [True: 28.2k, False: 1.09M]
  ------------------
  104|  28.2k|            i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
  ------------------
  |  |  742|  28.2k|# define ASN1_OP_NEW_PRE         0
  ------------------
  105|  28.2k|            if (!i)
  ------------------
  |  Branch (105:17): [True: 0, False: 28.2k]
  ------------------
  106|      0|                goto auxerr;
  107|  28.2k|            if (i == 2) {
  ------------------
  |  Branch (107:17): [True: 0, False: 28.2k]
  ------------------
  108|      0|                return 1;
  109|      0|            }
  110|  28.2k|        }
  111|  1.11M|        if (embed) {
  ------------------
  |  Branch (111:13): [True: 17.7k, False: 1.10M]
  ------------------
  112|  17.7k|            memset(*pval, 0, it->size);
  113|  1.10M|        } else {
  114|  1.10M|            *pval = OPENSSL_zalloc(it->size);
  ------------------
  |  |  104|  1.10M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.10M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.10M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|  1.10M|            if (*pval == NULL)
  ------------------
  |  Branch (115:17): [True: 0, False: 1.10M]
  ------------------
  116|      0|                return 0;
  117|  1.10M|        }
  118|  1.11M|        ossl_asn1_set_choice_selector(pval, -1, it);
  119|  1.11M|        if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
  ------------------
  |  |  743|  28.2k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (119:13): [True: 28.2k, False: 1.09M]
  |  Branch (119:24): [True: 0, False: 28.2k]
  ------------------
  120|      0|            goto auxerr2;
  121|  1.11M|        break;
  122|       |
  123|  1.11M|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|   134k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (123:5): [True: 134k, False: 10.1M]
  ------------------
  124|  2.45M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|  2.45M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (124:5): [True: 2.32M, False: 7.91M]
  ------------------
  125|  2.45M|        if (asn1_cb) {
  ------------------
  |  Branch (125:13): [True: 377k, False: 2.08M]
  ------------------
  126|   377k|            i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
  ------------------
  |  |  742|   377k|# define ASN1_OP_NEW_PRE         0
  ------------------
  127|   377k|            if (!i)
  ------------------
  |  Branch (127:17): [True: 0, False: 377k]
  ------------------
  128|      0|                goto auxerr;
  129|   377k|            if (i == 2) {
  ------------------
  |  Branch (129:17): [True: 99.3k, False: 278k]
  ------------------
  130|  99.3k|                return 1;
  131|  99.3k|            }
  132|   377k|        }
  133|  2.35M|        if (embed) {
  ------------------
  |  Branch (133:13): [True: 209k, False: 2.14M]
  ------------------
  134|   209k|            memset(*pval, 0, it->size);
  135|  2.14M|        } else {
  136|  2.14M|            *pval = OPENSSL_zalloc(it->size);
  ------------------
  |  |  104|  2.14M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.14M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.14M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|  2.14M|            if (*pval == NULL)
  ------------------
  |  Branch (137:17): [True: 0, False: 2.14M]
  ------------------
  138|      0|                return 0;
  139|  2.14M|        }
  140|       |        /* 0 : init. lock */
  141|  2.35M|        if (ossl_asn1_do_lock(pval, 0, it) < 0) {
  ------------------
  |  Branch (141:13): [True: 0, False: 2.35M]
  ------------------
  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|  2.35M|        ossl_asn1_enc_init(pval, it);
  149|  9.17M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (149:41): [True: 6.82M, False: 2.35M]
  ------------------
  150|  6.82M|            pseqval = ossl_asn1_get_field_ptr(pval, tt);
  151|  6.82M|            if (!asn1_template_new(pseqval, tt, libctx, propq))
  ------------------
  |  Branch (151:17): [True: 0, False: 6.82M]
  ------------------
  152|      0|                goto asn1err2;
  153|  6.82M|        }
  154|  2.35M|        if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
  ------------------
  |  |  743|   278k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (154:13): [True: 278k, False: 2.08M]
  |  Branch (154:24): [True: 0, False: 278k]
  ------------------
  155|      0|            goto auxerr2;
  156|  2.35M|        break;
  157|  10.2M|    }
  158|  10.1M|    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|  6.82M|{
  210|  6.82M|    const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item);
  ------------------
  |  |  421|  6.82M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  211|  6.82M|    int embed = tt->flags & ASN1_TFLG_EMBED;
  ------------------
  |  |  597|  6.82M|# define ASN1_TFLG_EMBED         (0x1 << 12)
  ------------------
  212|  6.82M|    ASN1_VALUE *tval;
  213|  6.82M|    int ret;
  214|  6.82M|    if (embed) {
  ------------------
  |  Branch (214:9): [True: 702k, False: 6.11M]
  ------------------
  215|   702k|        tval = (ASN1_VALUE *)pval;
  216|   702k|        pval = &tval;
  217|   702k|    }
  218|  6.82M|    if (tt->flags & ASN1_TFLG_OPTIONAL) {
  ------------------
  |  |  523|  6.82M|# define ASN1_TFLG_OPTIONAL      (0x1)
  ------------------
  |  Branch (218:9): [True: 2.34M, False: 4.47M]
  ------------------
  219|  2.34M|        asn1_template_clear(pval, tt);
  220|  2.34M|        return 1;
  221|  2.34M|    }
  222|       |    /* If ANY DEFINED BY nothing to do */
  223|       |
  224|  4.47M|    if (tt->flags & ASN1_TFLG_ADB_MASK) {
  ------------------
  |  |  583|  4.47M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
  |  Branch (224:9): [True: 119k, False: 4.35M]
  ------------------
  225|   119k|        *pval = NULL;
  226|   119k|        return 1;
  227|   119k|    }
  228|       |    /* If SET OF or SEQUENCE OF, its a STACK */
  229|  4.35M|    if (tt->flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  539|  4.35M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (229:9): [True: 157k, False: 4.19M]
  ------------------
  230|   157k|        STACK_OF(ASN1_VALUE) *skval;
  ------------------
  |  |   31|   157k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  231|   157k|        skval = sk_ASN1_VALUE_new_null();
  ------------------
  |  |  901|   157k|#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  232|   157k|        if (!skval) {
  ------------------
  |  Branch (232:13): [True: 0, False: 157k]
  ------------------
  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|   157k|        *pval = (ASN1_VALUE *)skval;
  238|   157k|        ret = 1;
  239|   157k|        goto done;
  240|   157k|    }
  241|       |    /* Otherwise pass it back to the item routine */
  242|  4.19M|    ret = asn1_item_embed_new(pval, it, embed, libctx, propq);
  243|  4.35M| done:
  244|  4.35M|    return ret;
  245|  4.19M|}
tasn_new.c:asn1_template_clear:
  248|  2.34M|{
  249|       |    /* If ADB or STACK just NULL the field */
  250|  2.34M|    if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK))
  ------------------
  |  |  583|  2.34M|# define ASN1_TFLG_ADB_MASK      (0x3<<8)
  ------------------
                  if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK))
  ------------------
  |  |  539|  2.34M|# define ASN1_TFLG_SK_MASK       (0x3 << 1)
  ------------------
  |  Branch (250:9): [True: 539k, False: 1.80M]
  ------------------
  251|   539k|        *pval = NULL;
  252|  1.80M|    else
  253|  1.80M|        asn1_item_clear(pval, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  421|  1.80M|# define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  254|  2.34M|}
tasn_new.c:asn1_item_clear:
  175|  1.80M|{
  176|  1.80M|    const ASN1_EXTERN_FUNCS *ef;
  177|       |
  178|  1.80M|    switch (it->itype) {
  ------------------
  |  Branch (178:13): [True: 0, False: 1.80M]
  ------------------
  179|       |
  180|      0|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   84|      0|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  |  Branch (180:5): [True: 0, False: 1.80M]
  ------------------
  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|  1.48M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   80|  1.48M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  |  Branch (188:5): [True: 1.48M, False: 320k]
  ------------------
  189|  1.48M|        if (it->templates)
  ------------------
  |  Branch (189:13): [True: 0, False: 1.48M]
  ------------------
  190|      0|            asn1_template_clear(pval, it->templates);
  191|  1.48M|        else
  192|  1.48M|            asn1_primitive_clear(pval, it);
  193|  1.48M|        break;
  194|       |
  195|  42.5k|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   85|  42.5k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (195:5): [True: 42.5k, False: 1.76M]
  ------------------
  196|  42.5k|        asn1_primitive_clear(pval, it);
  197|  42.5k|        break;
  198|       |
  199|   117k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   82|   117k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  |  Branch (199:5): [True: 117k, False: 1.69M]
  ------------------
  200|   269k|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   81|   269k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (200:5): [True: 151k, False: 1.65M]
  ------------------
  201|   277k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   86|   277k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (201:5): [True: 8.87k, False: 1.80M]
  ------------------
  202|   277k|        *pval = NULL;
  203|   277k|        break;
  204|  1.80M|    }
  205|  1.80M|}
tasn_new.c:asn1_primitive_clear:
  328|  1.53M|{
  329|  1.53M|    int utype;
  330|  1.53M|    if (it && it->funcs) {
  ------------------
  |  Branch (330:9): [True: 1.53M, False: 0]
  |  Branch (330:15): [True: 88.7k, False: 1.44M]
  ------------------
  331|  88.7k|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  332|  88.7k|        if (pf->prim_clear)
  ------------------
  |  Branch (332:13): [True: 79.8k, False: 8.91k]
  ------------------
  333|  79.8k|            pf->prim_clear(pval, it);
  334|  8.91k|        else
  335|  8.91k|            *pval = NULL;
  336|  88.7k|        return;
  337|  88.7k|    }
  338|  1.44M|    if (!it || (it->itype == ASN1_ITYPE_MSTRING))
  ------------------
  |  |   85|  1.44M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (338:9): [True: 0, False: 1.44M]
  |  Branch (338:16): [True: 42.5k, False: 1.40M]
  ------------------
  339|  42.5k|        utype = -1;
  340|  1.40M|    else
  341|  1.40M|        utype = it->utype;
  342|  1.44M|    if (utype == V_ASN1_BOOLEAN)
  ------------------
  |  |   63|  1.44M|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (342:9): [True: 239k, False: 1.20M]
  ------------------
  343|   239k|        *(ASN1_BOOLEAN *)pval = it->size;
  344|  1.20M|    else
  345|  1.20M|        *pval = NULL;
  346|  1.44M|}
tasn_new.c:asn1_primitive_new:
  263|  6.48M|{
  264|  6.48M|    ASN1_TYPE *typ;
  265|  6.48M|    ASN1_STRING *str;
  266|  6.48M|    int utype;
  267|       |
  268|  6.48M|    if (!it)
  ------------------
  |  Branch (268:9): [True: 0, False: 6.48M]
  ------------------
  269|      0|        return 0;
  270|       |
  271|  6.48M|    if (it->funcs) {
  ------------------
  |  Branch (271:9): [True: 325k, False: 6.15M]
  ------------------
  272|   325k|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  273|   325k|        if (embed) {
  ------------------
  |  Branch (273:13): [True: 92.2k, False: 233k]
  ------------------
  274|  92.2k|            if (pf->prim_clear) {
  ------------------
  |  Branch (274:17): [True: 92.2k, False: 0]
  ------------------
  275|  92.2k|                pf->prim_clear(pval, it);
  276|  92.2k|                return 1;
  277|  92.2k|            }
  278|   233k|        } else if (pf->prim_new) {
  ------------------
  |  Branch (278:20): [True: 233k, False: 0]
  ------------------
  279|   233k|            return pf->prim_new(pval, it);
  280|   233k|        }
  281|   325k|    }
  282|       |
  283|  6.15M|    if (it->itype == ASN1_ITYPE_MSTRING)
  ------------------
  |  |   85|  6.15M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (283:9): [True: 496k, False: 5.65M]
  ------------------
  284|   496k|        utype = -1;
  285|  5.65M|    else
  286|  5.65M|        utype = it->utype;
  287|  6.15M|    switch (utype) {
  288|  1.19M|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|  1.19M|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (288:5): [True: 1.19M, False: 4.95M]
  ------------------
  289|  1.19M|        *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef);
  ------------------
  |  |   18|  1.19M|#define NID_undef                       0
  ------------------
  290|  1.19M|        return 1;
  291|       |
  292|      0|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   63|      0|# define V_ASN1_BOOLEAN                  1 /**/
  ------------------
  |  Branch (292:5): [True: 0, False: 6.15M]
  ------------------
  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: 6.15M]
  ------------------
  297|      0|        *pval = (ASN1_VALUE *)1;
  298|      0|        return 1;
  299|       |
  300|  3.22M|    case V_ASN1_ANY:
  ------------------
  |  |   58|  3.22M|# define V_ASN1_ANY                      -4/* used in ASN1 template code */
  ------------------
  |  Branch (300:5): [True: 3.22M, False: 2.93M]
  ------------------
  301|  3.22M|        if ((typ = OPENSSL_malloc(sizeof(*typ))) == NULL)
  ------------------
  |  |  102|  3.22M|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.22M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.22M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (301:13): [True: 0, False: 3.22M]
  ------------------
  302|      0|            return 0;
  303|  3.22M|        typ->value.ptr = NULL;
  304|  3.22M|        typ->type = -1;
  305|  3.22M|        *pval = (ASN1_VALUE *)typ;
  306|  3.22M|        break;
  307|       |
  308|  1.73M|    default:
  ------------------
  |  Branch (308:5): [True: 1.73M, False: 4.42M]
  ------------------
  309|  1.73M|        if (embed) {
  ------------------
  |  Branch (309:13): [True: 303k, False: 1.43M]
  ------------------
  310|   303k|            str = *(ASN1_STRING **)pval;
  311|   303k|            memset(str, 0, sizeof(*str));
  312|   303k|            str->type = utype;
  313|   303k|            str->flags = ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  182|   303k|# define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  314|  1.43M|        } else {
  315|  1.43M|            str = ASN1_STRING_type_new(utype);
  316|  1.43M|            *pval = (ASN1_VALUE *)str;
  317|  1.43M|        }
  318|  1.73M|        if (it->itype == ASN1_ITYPE_MSTRING && str)
  ------------------
  |  |   85|  3.46M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  |  Branch (318:13): [True: 496k, False: 1.23M]
  |  Branch (318:48): [True: 496k, False: 0]
  ------------------
  319|   496k|            str->flags |= ASN1_STRING_FLAG_MSTRING;
  ------------------
  |  |  180|   496k|# define ASN1_STRING_FLAG_MSTRING 0x040
  ------------------
  320|  1.73M|        break;
  321|  6.15M|    }
  322|  4.95M|    if (*pval)
  ------------------
  |  Branch (322:9): [True: 4.95M, False: 0]
  ------------------
  323|  4.95M|        return 1;
  324|      0|    return 0;
  325|  4.95M|}

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

ASN1_OCTET_STRING_new:
   19|     12|sname *sname##_new(void) \
   20|     12|{ \
   21|     12|    return ASN1_STRING_type_new(V_##sname); \
   22|     12|} \
ASN1_OCTET_STRING_free:
   23|   660k|void sname##_free(sname *x) \
   24|   660k|{ \
   25|   660k|    ASN1_STRING_free(x); \
   26|   660k|}
ASN1_INTEGER_new:
   19|   225k|sname *sname##_new(void) \
   20|   225k|{ \
   21|   225k|    return ASN1_STRING_type_new(V_##sname); \
   22|   225k|} \
ASN1_INTEGER_free:
   23|   692k|void sname##_free(sname *x) \
   24|   692k|{ \
   25|   692k|    ASN1_STRING_free(x); \
   26|   692k|}
ASN1_ENUMERATED_free:
   23|   470k|void sname##_free(sname *x) \
   24|   470k|{ \
   25|   470k|    ASN1_STRING_free(x); \
   26|   470k|}
ASN1_BIT_STRING_new:
   19|  78.3k|sname *sname##_new(void) \
   20|  78.3k|{ \
   21|  78.3k|    return ASN1_STRING_type_new(V_##sname); \
   22|  78.3k|} \
ASN1_BIT_STRING_free:
   23|  48.0k|void sname##_free(sname *x) \
   24|  48.0k|{ \
   25|  48.0k|    ASN1_STRING_free(x); \
   26|  48.0k|}

ossl_asn1_get_choice_selector:
   30|  1.14M|{
   31|  1.14M|    int *sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|  1.14M|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   32|       |
   33|  1.14M|    return *sel;
   34|  1.14M|}
ossl_asn1_get_choice_selector_const:
   38|  2.24M|{
   39|  2.24M|    int *sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|  2.24M|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   40|       |
   41|  2.24M|    return *sel;
   42|  2.24M|}
ossl_asn1_set_choice_selector:
   50|  2.01M|{
   51|  2.01M|    int *sel, ret;
   52|       |
   53|  2.01M|    sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|  2.01M|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   54|  2.01M|    ret = *sel;
   55|  2.01M|    *sel = value;
   56|  2.01M|    return ret;
   57|  2.01M|}
ossl_asn1_do_lock:
   69|  4.77M|{
   70|  4.77M|    const ASN1_AUX *aux;
   71|  4.77M|    CRYPTO_RWLOCK **lock;
   72|  4.77M|    CRYPTO_REF_COUNT *refcnt;
   73|  4.77M|    int ret = -1;
   74|       |
   75|  4.77M|    if ((it->itype != ASN1_ITYPE_SEQUENCE)
  ------------------
  |  |   81|  4.77M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  |  Branch (75:9): [True: 269k, False: 4.50M]
  ------------------
   76|  4.77M|        && (it->itype != ASN1_ITYPE_NDEF_SEQUENCE))
  ------------------
  |  |   86|   269k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  |  Branch (76:12): [True: 0, False: 269k]
  ------------------
   77|      0|        return 0;
   78|  4.77M|    aux = it->funcs;
   79|  4.77M|    if (aux == NULL || (aux->flags & ASN1_AFLG_REFCOUNT) == 0)
  ------------------
  |  |  732|   697k|# define ASN1_AFLG_REFCOUNT      1
  ------------------
  |  Branch (79:9): [True: 4.08M, False: 697k]
  |  Branch (79:24): [True: 625k, False: 72.1k]
  ------------------
   80|  4.70M|        return 0;
   81|  72.1k|    lock = offset2ptr(*pval, aux->ref_lock);
  ------------------
  |  |   23|  72.1k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   82|  72.1k|    refcnt = offset2ptr(*pval, aux->ref_offset);
  ------------------
  |  |   23|  72.1k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
   83|       |
   84|  72.1k|    switch (op) {
  ------------------
  |  Branch (84:13): [True: 0, False: 72.1k]
  ------------------
   85|  36.0k|    case 0:
  ------------------
  |  Branch (85:5): [True: 36.0k, False: 36.0k]
  ------------------
   86|  36.0k|        if (!CRYPTO_NEW_REF(refcnt, 1))
  ------------------
  |  Branch (86:13): [True: 0, False: 36.0k]
  ------------------
   87|      0|            return -1;
   88|  36.0k|        *lock = CRYPTO_THREAD_lock_new();
   89|  36.0k|        if (*lock == NULL) {
  ------------------
  |  Branch (89:13): [True: 0, False: 36.0k]
  ------------------
   90|      0|            CRYPTO_FREE_REF(refcnt);
   91|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|  36.0k|        ret = 1;
   95|  36.0k|        break;
   96|      0|    case 1:
  ------------------
  |  Branch (96:5): [True: 0, False: 72.1k]
  ------------------
   97|      0|        if (!CRYPTO_UP_REF(refcnt, &ret))
  ------------------
  |  Branch (97:13): [True: 0, False: 0]
  ------------------
   98|      0|            return -1;
   99|      0|        break;
  100|  36.0k|    case -1:
  ------------------
  |  Branch (100:5): [True: 36.0k, False: 36.0k]
  ------------------
  101|  36.0k|        if (!CRYPTO_DOWN_REF(refcnt, &ret))
  ------------------
  |  Branch (101:13): [True: 0, False: 36.0k]
  ------------------
  102|      0|            return -1;  /* failed */
  103|  36.0k|        REF_PRINT_EX(it->sname, ret, (void *)it);
  ------------------
  |  |  287|  36.0k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  ------------------
  |  |  |  |  294|  36.0k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  ------------------
  |  |  |  |  |  |  282|  36.0k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  104|  36.0k|        REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  281|  36.0k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 36.0k]
  |  |  ------------------
  ------------------
  105|  36.0k|        if (ret == 0) {
  ------------------
  |  Branch (105:13): [True: 36.0k, False: 0]
  ------------------
  106|  36.0k|            CRYPTO_THREAD_lock_free(*lock);
  107|  36.0k|            *lock = NULL;
  108|  36.0k|            CRYPTO_FREE_REF(refcnt);
  109|  36.0k|        }
  110|  36.0k|        break;
  111|  72.1k|    }
  112|       |
  113|  72.1k|    return ret;
  114|  72.1k|}
ossl_asn1_enc_init:
  142|  2.35M|{
  143|  2.35M|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  144|       |
  145|  2.35M|    if (enc != NULL) {
  ------------------
  |  Branch (145:9): [True: 62.6k, False: 2.29M]
  ------------------
  146|  62.6k|        enc->enc = NULL;
  147|  62.6k|        enc->len = 0;
  148|  62.6k|        enc->modified = 1;
  149|  62.6k|    }
  150|  2.35M|}
ossl_asn1_enc_free:
  153|  2.32M|{
  154|  2.32M|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  155|       |
  156|  2.32M|    if (enc != NULL) {
  ------------------
  |  Branch (156:9): [True: 62.6k, False: 2.25M]
  ------------------
  157|  62.6k|        OPENSSL_free(enc->enc);
  ------------------
  |  |  115|  62.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  62.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  62.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  158|  62.6k|        enc->enc = NULL;
  159|  62.6k|        enc->len = 0;
  160|  62.6k|        enc->modified = 1;
  161|  62.6k|    }
  162|  2.32M|}
ossl_asn1_enc_save:
  166|   610k|{
  167|   610k|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  168|       |
  169|   610k|    if (enc == NULL)
  ------------------
  |  Branch (169:9): [True: 601k, False: 9.25k]
  ------------------
  170|   601k|        return 1;
  171|       |
  172|  9.25k|    OPENSSL_free(enc->enc);
  ------------------
  |  |  115|  9.25k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  9.25k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  9.25k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  173|  9.25k|    if (inlen <= 0)
  ------------------
  |  Branch (173:9): [True: 0, False: 9.25k]
  ------------------
  174|      0|        return 0;
  175|  9.25k|    if ((enc->enc = OPENSSL_malloc(inlen)) == NULL)
  ------------------
  |  |  102|  9.25k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  9.25k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  9.25k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (175:9): [True: 0, False: 9.25k]
  ------------------
  176|      0|        return 0;
  177|  9.25k|    memcpy(enc->enc, in, inlen);
  178|  9.25k|    enc->len = inlen;
  179|  9.25k|    enc->modified = 0;
  180|       |
  181|  9.25k|    return 1;
  182|  9.25k|}
ossl_asn1_enc_restore:
  186|  1.03M|{
  187|  1.03M|    const ASN1_ENCODING *enc = asn1_get_const_enc_ptr(pval, it);
  188|       |
  189|  1.03M|    if (enc == NULL || enc->modified)
  ------------------
  |  Branch (189:9): [True: 1.01M, False: 20.6k]
  |  Branch (189:24): [True: 0, False: 20.6k]
  ------------------
  190|  1.01M|        return 0;
  191|  20.6k|    if (out) {
  ------------------
  |  Branch (191:9): [True: 6.25k, False: 14.3k]
  ------------------
  192|  6.25k|        memcpy(*out, enc->enc, enc->len);
  193|  6.25k|        *out += enc->len;
  194|  6.25k|    }
  195|  20.6k|    if (len != NULL)
  ------------------
  |  Branch (195:9): [True: 20.6k, False: 0]
  ------------------
  196|  20.6k|        *len = enc->len;
  197|  20.6k|    return 1;
  198|  1.03M|}
ossl_asn1_get_field_ptr:
  202|  21.9M|{
  203|  21.9M|    ASN1_VALUE **pvaltmp = offset2ptr(*pval, tt->offset);
  ------------------
  |  |   23|  21.9M|#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|  21.9M|    return pvaltmp;
  210|  21.9M|}
ossl_asn1_get_const_field_ptr:
  215|  5.75M|{
  216|  5.75M|    return offset2ptr(*pval, tt->offset);
  ------------------
  |  |   23|  5.75M|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  217|  5.75M|}
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.5M, False: 258k]
  ------------------
  235|  13.5M|        return tt;
  236|       |
  237|       |    /* Else ANY DEFINED BY ... get the table */
  238|   258k|    adb = ASN1_ADB_ptr(tt->item);
  ------------------
  |  |   89|   258k|# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
  ------------------
  239|       |
  240|       |    /* Get the selector field */
  241|   258k|    sfld = offset2ptr(val, adb->offset);
  ------------------
  |  |   23|   258k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  242|       |
  243|       |    /* Check if NULL */
  244|   258k|    if (*sfld == NULL) {
  ------------------
  |  Branch (244:9): [True: 111k, False: 146k]
  ------------------
  245|   111k|        if (adb->null_tt == NULL)
  ------------------
  |  Branch (245:13): [True: 111k, False: 0]
  ------------------
  246|   111k|            goto err;
  247|      0|        return adb->null_tt;
  248|   111k|    }
  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|   146k|    if ((tt->flags & ASN1_TFLG_ADB_OID) != 0)
  ------------------
  |  |  585|   146k|# define ASN1_TFLG_ADB_OID       (0x1<<8)
  ------------------
  |  Branch (254:9): [True: 146k, False: 0]
  ------------------
  255|   146k|        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|   146k|    if (adb->adb_cb != NULL && adb->adb_cb(&selector) == 0) {
  ------------------
  |  Branch (260:9): [True: 0, False: 146k]
  |  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|   870k|    for (atbl = adb->tbl, i = 0; i < adb->tblcount; i++, atbl++)
  ------------------
  |  Branch (272:34): [True: 745k, False: 124k]
  ------------------
  273|   745k|        if (atbl->value == selector)
  ------------------
  |  Branch (273:13): [True: 22.3k, False: 723k]
  ------------------
  274|  22.3k|            return &atbl->tt;
  275|       |
  276|       |    /* FIXME: need to search application table too */
  277|       |
  278|       |    /* No match, return default type */
  279|   124k|    if (!adb->default_tt)
  ------------------
  |  Branch (279:9): [True: 0, False: 124k]
  ------------------
  280|      0|        goto err;
  281|   124k|    return adb->default_tt;
  282|       |
  283|   111k| err:
  284|       |    /* FIXME: should log the value or OID of unsupported type */
  285|   111k|    if (nullerr)
  ------------------
  |  Branch (285:9): [True: 0, False: 111k]
  ------------------
  286|   111k|        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|   111k|    return NULL;
  288|   124k|}
tasn_utl.c:asn1_get_enc_ptr:
  117|  5.29M|{
  118|  5.29M|    const ASN1_AUX *aux;
  119|       |
  120|  5.29M|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 5.29M]
  |  Branch (120:25): [True: 0, False: 5.29M]
  ------------------
  121|      0|        return NULL;
  122|  5.29M|    aux = it->funcs;
  123|  5.29M|    if (aux == NULL || (aux->flags & ASN1_AFLG_ENCODING) == 0)
  ------------------
  |  |  734|   636k|# define ASN1_AFLG_ENCODING      2
  ------------------
  |  Branch (123:9): [True: 4.65M, False: 636k]
  |  Branch (123:24): [True: 502k, False: 134k]
  ------------------
  124|  5.15M|        return NULL;
  125|   134k|    return offset2ptr(*pval, aux->enc_offset);
  ------------------
  |  |   23|   134k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  126|  5.29M|}
tasn_utl.c:asn1_get_const_enc_ptr:
  130|  1.03M|{
  131|  1.03M|    const ASN1_AUX *aux;
  132|       |
  133|  1.03M|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 1.03M]
  |  Branch (133:25): [True: 0, False: 1.03M]
  ------------------
  134|      0|        return NULL;
  135|  1.03M|    aux = it->funcs;
  136|  1.03M|    if (aux == NULL || (aux->flags & ASN1_AFLG_ENCODING) == 0)
  ------------------
  |  |  734|  57.1k|# define ASN1_AFLG_ENCODING      2
  ------------------
  |  Branch (136:9): [True: 982k, False: 57.1k]
  |  Branch (136:24): [True: 36.4k, False: 20.6k]
  ------------------
  137|  1.01M|        return NULL;
  138|  20.6k|    return offset2ptr(*pval, aux->enc_offset);
  ------------------
  |  |   23|  20.6k|#define offset2ptr(addr, offset) (void *)(((char *) addr) + offset)
  ------------------
  139|  1.03M|}

X509_ALGOR_set0:
   32|     37|{
   33|     37|    if (alg == NULL)
  ------------------
  |  Branch (33:9): [True: 0, False: 37]
  ------------------
   34|      0|        return 0;
   35|       |
   36|     37|    if (ptype != V_ASN1_UNDEF && alg->parameter == NULL
  ------------------
  |  |   60|     74|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (36:9): [True: 26, False: 11]
  |  Branch (36:34): [True: 26, False: 0]
  ------------------
   37|     37|            && (alg->parameter = ASN1_TYPE_new()) == NULL)
  ------------------
  |  Branch (37:16): [True: 0, False: 26]
  ------------------
   38|      0|        return 0;
   39|       |
   40|     37|    ASN1_OBJECT_free(alg->algorithm);
   41|     37|    alg->algorithm = aobj;
   42|       |
   43|     37|    if (ptype == V_ASN1_EOC)
  ------------------
  |  |   62|     37|# define V_ASN1_EOC                      0
  ------------------
  |  Branch (43:9): [True: 0, False: 37]
  ------------------
   44|      0|        return 1;
   45|     37|    if (ptype == V_ASN1_UNDEF) {
  ------------------
  |  |   60|     37|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (45:9): [True: 11, False: 26]
  ------------------
   46|     11|        ASN1_TYPE_free(alg->parameter);
   47|     11|        alg->parameter = NULL;
   48|     11|    } else
   49|     26|        ASN1_TYPE_set(alg->parameter, ptype, pval);
   50|     37|    return 1;
   51|     37|}
X509_ALGOR_get0:
   74|  3.60k|{
   75|  3.60k|    if (paobj)
  ------------------
  |  Branch (75:9): [True: 1.30k, False: 2.30k]
  ------------------
   76|  1.30k|        *paobj = algor->algorithm;
   77|  3.60k|    if (pptype) {
  ------------------
  |  Branch (77:9): [True: 2.32k, False: 1.27k]
  ------------------
   78|  2.32k|        if (algor->parameter == NULL) {
  ------------------
  |  Branch (78:13): [True: 52, False: 2.27k]
  ------------------
   79|     52|            *pptype = V_ASN1_UNDEF;
  ------------------
  |  |   60|     52|# define V_ASN1_UNDEF                    -1
  ------------------
   80|     52|            return;
   81|     52|        } else
   82|  2.27k|            *pptype = algor->parameter->type;
   83|  2.27k|        if (ppval)
  ------------------
  |  Branch (83:13): [True: 2.26k, False: 6]
  ------------------
   84|  2.26k|            *ppval = algor->parameter->value.ptr;
   85|  2.27k|    }
   86|  3.60k|}
ossl_x509_algor_get_md:
  158|      4|{
  159|      4|    const EVP_MD *md;
  160|       |
  161|      4|    if (alg == NULL)
  ------------------
  |  Branch (161:9): [True: 4, False: 0]
  ------------------
  162|      4|        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|      4|}

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

INT32_it:
  250|   329k|ASN1_ITEM_start(INT32)
  ------------------
  |  |   95|   329k|        { \
  |  |   96|   329k|                static const ASN1_ITEM local_it = {
  ------------------
  251|   329k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   80|   329k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   64|   329k|# define V_ASN1_INTEGER                  2
  ------------------
  252|   329k|    INTxx_FLAG_SIGNED, "INT32"
  ------------------
  |  |   27|   329k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  253|   329k|ASN1_ITEM_end(INT32)
  ------------------
  |  |  102|   329k|                }; \
  |  |  103|   329k|        return &local_it; \
  |  |  104|   329k|        }
  ------------------
UINT32_it:
  255|  67.9k|ASN1_ITEM_start(UINT32)
  ------------------
  |  |   95|  67.9k|        { \
  |  |   96|  67.9k|                static const ASN1_ITEM local_it = {
  ------------------
  256|  67.9k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf, 0, "UINT32"
  ------------------
  |  |   80|  67.9k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf, 0, "UINT32"
  ------------------
  |  |   64|  67.9k|# define V_ASN1_INTEGER                  2
  ------------------
  257|  67.9k|ASN1_ITEM_end(UINT32)
  ------------------
  |  |  102|  67.9k|                }; \
  |  |  103|  67.9k|        return &local_it; \
  |  |  104|  67.9k|        }
  ------------------
INT64_it:
  259|  11.5k|ASN1_ITEM_start(INT64)
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  260|  11.5k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf,
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf,
  ------------------
  |  |   64|  11.5k|# define V_ASN1_INTEGER                  2
  ------------------
  261|  11.5k|    INTxx_FLAG_SIGNED, "INT64"
  ------------------
  |  |   27|  11.5k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  262|  11.5k|ASN1_ITEM_end(INT64)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
UINT64_it:
  264|  11.5k|ASN1_ITEM_start(UINT64)
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  265|  11.5k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf, 0, "UINT64"
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf, 0, "UINT64"
  ------------------
  |  |   64|  11.5k|# define V_ASN1_INTEGER                  2
  ------------------
  266|  11.5k|ASN1_ITEM_end(UINT64)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
ZINT32_it:
  268|  42.8k|ASN1_ITEM_start(ZINT32)
  ------------------
  |  |   95|  42.8k|        { \
  |  |   96|  42.8k|                static const ASN1_ITEM local_it = {
  ------------------
  269|  42.8k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   80|  42.8k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   64|  42.8k|# define V_ASN1_INTEGER                  2
  ------------------
  270|  42.8k|    INTxx_FLAG_ZERO_DEFAULT|INTxx_FLAG_SIGNED, "ZINT32"
  ------------------
  |  |   26|  42.8k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
                  INTxx_FLAG_ZERO_DEFAULT|INTxx_FLAG_SIGNED, "ZINT32"
  ------------------
  |  |   27|  42.8k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  271|  42.8k|ASN1_ITEM_end(ZINT32)
  ------------------
  |  |  102|  42.8k|                }; \
  |  |  103|  42.8k|        return &local_it; \
  |  |  104|  42.8k|        }
  ------------------
ZUINT32_it:
  273|  96.3k|ASN1_ITEM_start(ZUINT32)
  ------------------
  |  |   95|  96.3k|        { \
  |  |   96|  96.3k|                static const ASN1_ITEM local_it = {
  ------------------
  274|  96.3k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   80|  96.3k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint32_pf,
  ------------------
  |  |   64|  96.3k|# define V_ASN1_INTEGER                  2
  ------------------
  275|  96.3k|    INTxx_FLAG_ZERO_DEFAULT, "ZUINT32"
  ------------------
  |  |   26|  96.3k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
  276|  96.3k|ASN1_ITEM_end(ZUINT32)
  ------------------
  |  |  102|  96.3k|                }; \
  |  |  103|  96.3k|        return &local_it; \
  |  |  104|  96.3k|        }
  ------------------
ZINT64_it:
  278|  68.8k|ASN1_ITEM_start(ZINT64)
  ------------------
  |  |   95|  68.8k|        { \
  |  |   96|  68.8k|                static const ASN1_ITEM local_it = {
  ------------------
  279|  68.8k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf,
  ------------------
  |  |   80|  68.8k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf,
  ------------------
  |  |   64|  68.8k|# define V_ASN1_INTEGER                  2
  ------------------
  280|  68.8k|    INTxx_FLAG_ZERO_DEFAULT|INTxx_FLAG_SIGNED, "ZINT64"
  ------------------
  |  |   26|  68.8k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
                  INTxx_FLAG_ZERO_DEFAULT|INTxx_FLAG_SIGNED, "ZINT64"
  ------------------
  |  |   27|  68.8k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  281|  68.8k|ASN1_ITEM_end(ZINT64)
  ------------------
  |  |  102|  68.8k|                }; \
  |  |  103|  68.8k|        return &local_it; \
  |  |  104|  68.8k|        }
  ------------------
ZUINT64_it:
  283|  68.1k|ASN1_ITEM_start(ZUINT64)
  ------------------
  |  |   95|  68.1k|        { \
  |  |   96|  68.1k|                static const ASN1_ITEM local_it = {
  ------------------
  284|  68.1k|    ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf,
  ------------------
  |  |   80|  68.1k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
                  ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &uint64_pf,
  ------------------
  |  |   64|  68.1k|# define V_ASN1_INTEGER                  2
  ------------------
  285|  68.1k|    INTxx_FLAG_ZERO_DEFAULT, "ZUINT64"
  ------------------
  |  |   26|  68.1k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
  286|  68.1k|ASN1_ITEM_end(ZUINT64)
  ------------------
  |  |  102|  68.1k|                }; \
  |  |  103|  68.1k|        return &local_it; \
  |  |  104|  68.1k|        }
  ------------------
x_int64.c:uint32_free:
  130|  46.0k|{
  131|  46.0k|    OPENSSL_free(*pval);
  ------------------
  |  |  115|  46.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  46.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  46.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  132|  46.0k|    *pval = NULL;
  133|  46.0k|}
x_int64.c:uint32_clear:
  136|   275k|{
  137|   275k|    **(uint32_t **)pval = 0;
  138|   275k|}
x_int64.c:uint32_c2i:
  173|  78.7k|{
  174|  78.7k|    uint64_t utmp = 0;
  175|  78.7k|    uint32_t utmp2 = 0;
  176|  78.7k|    char *cp;
  177|  78.7k|    int neg = 0;
  178|       |
  179|  78.7k|    if (*pval == NULL && !uint64_new(pval, it))
  ------------------
  |  Branch (179:9): [True: 2.08k, False: 76.7k]
  |  Branch (179:26): [True: 0, False: 2.08k]
  ------------------
  180|      0|        return 0;
  181|       |
  182|  78.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|  78.7k|    if (len == 0)
  ------------------
  |  Branch (190:9): [True: 9.92k, False: 68.8k]
  ------------------
  191|  9.92k|        goto long_compat;
  192|       |
  193|  68.8k|    if (!ossl_c2i_uint64_int(&utmp, &neg, &cont, len))
  ------------------
  |  Branch (193:9): [True: 2.03k, False: 66.8k]
  ------------------
  194|  2.03k|        return 0;
  195|  66.8k|    if ((it->size & INTxx_FLAG_SIGNED) == 0 && neg) {
  ------------------
  |  |   27|  66.8k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (195:9): [True: 4.63k, False: 62.1k]
  |  Branch (195:48): [True: 1.24k, False: 3.38k]
  ------------------
  196|  1.24k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE);
  ------------------
  |  |  401|  1.24k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.24k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.24k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  1.24k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  1.24k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  1.24k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.24k|     ERR_set_error)
  |  |  ------------------
  ------------------
  197|  1.24k|        return 0;
  198|  1.24k|    }
  199|  65.5k|    if (neg) {
  ------------------
  |  Branch (199:9): [True: 17.1k, False: 48.4k]
  ------------------
  200|  17.1k|        if (utmp > ABS_INT32_MIN) {
  ------------------
  |  |  169|  17.1k|#define ABS_INT32_MIN ((uint32_t)INT32_MAX + 1)
  ------------------
  |  Branch (200:13): [True: 1.86k, False: 15.3k]
  ------------------
  201|  1.86k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  401|  1.86k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.86k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.86k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  1.86k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  1.86k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  1.86k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.86k|     ERR_set_error)
  |  |  ------------------
  ------------------
  202|  1.86k|            return 0;
  203|  1.86k|        }
  204|  15.3k|        utmp = 0 - utmp;
  205|  48.4k|    } else {
  206|  48.4k|        if (((it->size & INTxx_FLAG_SIGNED) != 0 && utmp > INT32_MAX)
  ------------------
  |  |   27|  48.4k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (206:14): [True: 45.0k, False: 3.38k]
  |  Branch (206:53): [True: 2.11k, False: 42.9k]
  ------------------
  207|  48.4k|            || ((it->size & INTxx_FLAG_SIGNED) == 0 && utmp > UINT32_MAX)) {
  ------------------
  |  |   27|  46.2k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (207:17): [True: 3.38k, False: 42.9k]
  |  Branch (207:56): [True: 410, False: 2.97k]
  ------------------
  208|  2.52k|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|  2.52k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  2.52k|    (ERR_new(),                                                 \
  |  |  |  |  404|  2.52k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  2.52k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  2.52k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  2.52k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  2.52k|     ERR_set_error)
  |  |  ------------------
  ------------------
  209|  2.52k|            return 0;
  210|  2.52k|        }
  211|  48.4k|    }
  212|       |
  213|  71.1k| long_compat:
  214|  71.1k|    utmp2 = (uint32_t)utmp;
  215|  71.1k|    memcpy(cp, &utmp2, sizeof(utmp2));
  216|  71.1k|    return 1;
  217|  65.5k|}
x_int64.c:uint64_new:
   30|  4.16k|{
   31|  4.16k|    if ((*pval = (ASN1_VALUE *)OPENSSL_zalloc(sizeof(uint64_t))) == NULL)
  ------------------
  |  |  104|  4.16k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.16k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.16k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (31:9): [True: 0, False: 4.16k]
  ------------------
   32|      0|        return 0;
   33|  4.16k|    return 1;
   34|  4.16k|}
x_int64.c:uint32_i2c:
  142|  40.6k|{
  143|  40.6k|    uint32_t utmp;
  144|  40.6k|    int neg = 0;
  145|       |    /* this exists to bypass broken gcc optimization */
  146|  40.6k|    char *cp = (char *)*pval;
  147|       |
  148|       |    /* use memcpy, because we may not be uint32_t aligned */
  149|  40.6k|    memcpy(&utmp, cp, sizeof(utmp));
  150|       |
  151|  40.6k|    if ((it->size & INTxx_FLAG_ZERO_DEFAULT) == INTxx_FLAG_ZERO_DEFAULT
  ------------------
  |  |   26|  40.6k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
                  if ((it->size & INTxx_FLAG_ZERO_DEFAULT) == INTxx_FLAG_ZERO_DEFAULT
  ------------------
  |  |   26|  81.3k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
  |  Branch (151:9): [True: 5.97k, False: 34.6k]
  ------------------
  152|  40.6k|        && utmp == 0)
  ------------------
  |  Branch (152:12): [True: 4.91k, False: 1.06k]
  ------------------
  153|  4.91k|        return -1;
  154|  35.7k|    if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  35.7k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
                  if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  71.4k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (154:9): [True: 31.5k, False: 4.16k]
  ------------------
  155|  35.7k|        && (int32_t)utmp < 0) {
  ------------------
  |  Branch (155:12): [True: 9.40k, False: 22.1k]
  ------------------
  156|       |        /* ossl_i2c_uint64_int() assumes positive values */
  157|  9.40k|        utmp = 0 - utmp;
  158|  9.40k|        neg = 1;
  159|  9.40k|    }
  160|       |
  161|  35.7k|    return ossl_i2c_uint64_int(cont, (uint64_t)utmp, neg);
  162|  40.6k|}
x_int64.c:uint32_print:
  221|  3.14k|{
  222|  3.14k|    if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED)
  ------------------
  |  |   27|  3.14k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
                  if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED)
  ------------------
  |  |   27|  3.14k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (222:9): [True: 2.93k, False: 212]
  ------------------
  223|  2.93k|        return BIO_printf(out, "%d\n", (int)**(int32_t **)pval);
  224|    212|    return BIO_printf(out, "%u\n", (unsigned int)**(uint32_t **)pval);
  225|  3.14k|}
x_int64.c:uint64_free:
   37|  46.0k|{
   38|  46.0k|    OPENSSL_free(*pval);
  ------------------
  |  |  115|  46.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  46.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  46.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|  46.0k|    *pval = NULL;
   40|  46.0k|}
x_int64.c:uint64_clear:
   43|  72.4k|{
   44|  72.4k|    **(uint64_t **)pval = 0;
   45|  72.4k|}
x_int64.c:uint64_c2i:
   73|  2.46k|{
   74|  2.46k|    uint64_t utmp = 0;
   75|  2.46k|    char *cp;
   76|  2.46k|    int neg = 0;
   77|       |
   78|  2.46k|    if (*pval == NULL && !uint64_new(pval, it))
  ------------------
  |  Branch (78:9): [True: 2.08k, False: 380]
  |  Branch (78:26): [True: 0, False: 2.08k]
  ------------------
   79|      0|        return 0;
   80|       |
   81|  2.46k|    cp = (char *)*pval;
   82|       |
   83|       |    /*
   84|       |     * Strictly speaking, zero length is malformed.  However, long_c2i
   85|       |     * (x_long.c) encodes 0 as a zero length INTEGER (wrongly, of course),
   86|       |     * so for the sake of backward compatibility, we still decode zero
   87|       |     * length INTEGERs as the number zero.
   88|       |     */
   89|  2.46k|    if (len == 0)
  ------------------
  |  Branch (89:9): [True: 9, False: 2.45k]
  ------------------
   90|      9|        goto long_compat;
   91|       |
   92|  2.45k|    if (!ossl_c2i_uint64_int(&utmp, &neg, &cont, len))
  ------------------
  |  Branch (92:9): [True: 537, False: 1.91k]
  ------------------
   93|    537|        return 0;
   94|  1.91k|    if ((it->size & INTxx_FLAG_SIGNED) == 0 && neg) {
  ------------------
  |  |   27|  1.91k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (94:9): [True: 882, False: 1.03k]
  |  Branch (94:48): [True: 269, False: 613]
  ------------------
   95|    269|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE);
  ------------------
  |  |  401|    269|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    269|    (ERR_new(),                                                 \
  |  |  |  |  404|    269|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    269|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    269|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    269|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    269|     ERR_set_error)
  |  |  ------------------
  ------------------
   96|    269|        return 0;
   97|    269|    }
   98|  1.64k|    if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  1.64k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
                  if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  3.29k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (98:9): [True: 1.03k, False: 613]
  ------------------
   99|  1.64k|            && !neg && utmp > INT64_MAX) {
  ------------------
  |  Branch (99:16): [True: 572, False: 460]
  |  Branch (99:24): [True: 131, False: 441]
  ------------------
  100|    131|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  401|    131|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    131|    (ERR_new(),                                                 \
  |  |  |  |  404|    131|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    131|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    131|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    131|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    131|     ERR_set_error)
  |  |  ------------------
  ------------------
  101|    131|        return 0;
  102|    131|    }
  103|  1.51k|    if (neg)
  ------------------
  |  Branch (103:9): [True: 460, False: 1.05k]
  ------------------
  104|       |        /* ossl_c2i_uint64_int() returns positive values */
  105|    460|        utmp = 0 - utmp;
  106|       |
  107|  1.52k| long_compat:
  108|  1.52k|    memcpy(cp, &utmp, sizeof(utmp));
  109|  1.52k|    return 1;
  110|  1.51k|}
x_int64.c:uint64_i2c:
   49|  9.93k|{
   50|  9.93k|    uint64_t utmp;
   51|  9.93k|    int neg = 0;
   52|       |    /* this exists to bypass broken gcc optimization */
   53|  9.93k|    char *cp = (char *)*pval;
   54|       |
   55|       |    /* use memcpy, because we may not be uint64_t aligned */
   56|  9.93k|    memcpy(&utmp, cp, sizeof(utmp));
   57|       |
   58|  9.93k|    if ((it->size & INTxx_FLAG_ZERO_DEFAULT) == INTxx_FLAG_ZERO_DEFAULT
  ------------------
  |  |   26|  9.93k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
                  if ((it->size & INTxx_FLAG_ZERO_DEFAULT) == INTxx_FLAG_ZERO_DEFAULT
  ------------------
  |  |   26|  19.8k|#define INTxx_FLAG_ZERO_DEFAULT (1<<0)
  ------------------
  |  Branch (58:9): [True: 8.21k, False: 1.71k]
  ------------------
   59|  9.93k|        && utmp == 0)
  ------------------
  |  Branch (59:12): [True: 2.04k, False: 6.17k]
  ------------------
   60|  2.04k|        return -1;
   61|  7.89k|    if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  7.89k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
                  if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED
  ------------------
  |  |   27|  15.7k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (61:9): [True: 5.82k, False: 2.06k]
  ------------------
   62|  7.89k|        && (int64_t)utmp < 0) {
  ------------------
  |  Branch (62:12): [True: 768, False: 5.05k]
  ------------------
   63|       |        /* ossl_i2c_uint64_int() assumes positive values */
   64|    768|        utmp = 0 - utmp;
   65|    768|        neg = 1;
   66|    768|    }
   67|       |
   68|  7.89k|    return ossl_i2c_uint64_int(cont, utmp, neg);
   69|  9.93k|}
x_int64.c:uint64_print:
  114|  1.14k|{
  115|  1.14k|    if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED)
  ------------------
  |  |   27|  1.14k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
                  if ((it->size & INTxx_FLAG_SIGNED) == INTxx_FLAG_SIGNED)
  ------------------
  |  |   27|  1.14k|#define INTxx_FLAG_SIGNED       (1<<1)
  ------------------
  |  Branch (115:9): [True: 642, False: 504]
  ------------------
  116|    642|        return BIO_printf(out, "%jd\n", **(int64_t **)pval);
  117|    504|    return BIO_printf(out, "%ju\n", **(uint64_t **)pval);
  118|  1.14k|}

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

ossl_encode_der_length:
   40|  4.53k|{
   41|  4.53k|    if (cont_len > 0xffff)
  ------------------
  |  Branch (41:9): [True: 2, False: 4.53k]
  ------------------
   42|      2|        return 0; /* Too large for supported length encodings */
   43|       |
   44|  4.53k|    if (cont_len > 0xff) {
  ------------------
  |  Branch (44:9): [True: 27, False: 4.50k]
  ------------------
   45|     27|        if (!WPACKET_put_bytes_u8(pkt, 0x82)
  ------------------
  |  |  878|     54|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (45:13): [True: 0, False: 27]
  ------------------
   46|     27|                || !WPACKET_put_bytes_u16(pkt, cont_len))
  ------------------
  |  |  880|     27|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (46:20): [True: 0, False: 27]
  ------------------
   47|      0|            return 0;
   48|  4.50k|    } else {
   49|  4.50k|        if (cont_len > 0x7f
  ------------------
  |  Branch (49:13): [True: 82, False: 4.42k]
  ------------------
   50|  4.50k|                && !WPACKET_put_bytes_u8(pkt, 0x81))
  ------------------
  |  |  878|     82|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (50:20): [True: 0, False: 82]
  ------------------
   51|      0|            return 0;
   52|  4.50k|        if (!WPACKET_put_bytes_u8(pkt, cont_len))
  ------------------
  |  |  878|  4.50k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (52:13): [True: 0, False: 4.50k]
  ------------------
   53|      0|            return 0;
   54|  4.50k|    }
   55|       |
   56|  4.53k|    return 1;
   57|  4.53k|}
ossl_encode_der_integer:
   67|  3.05k|{
   68|  3.05k|    unsigned char *bnbytes;
   69|  3.05k|    size_t cont_len;
   70|       |
   71|  3.05k|    if (BN_is_negative(n))
  ------------------
  |  Branch (71:9): [True: 0, False: 3.05k]
  ------------------
   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|  3.05k|    cont_len = BN_num_bits(n) / 8 + 1;
   84|       |
   85|  3.05k|    if (!WPACKET_start_sub_packet(pkt)
  ------------------
  |  Branch (85:9): [True: 0, False: 3.05k]
  ------------------
   86|  3.05k|            || !WPACKET_put_bytes_u8(pkt, ID_INTEGER)
  ------------------
  |  |  878|  6.11k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (86:16): [True: 0, False: 3.05k]
  ------------------
   87|  3.05k|            || !ossl_encode_der_length(pkt, cont_len)
  ------------------
  |  Branch (87:16): [True: 1, False: 3.05k]
  ------------------
   88|  3.05k|            || !WPACKET_allocate_bytes(pkt, cont_len, &bnbytes)
  ------------------
  |  Branch (88:16): [True: 0, False: 3.05k]
  ------------------
   89|  3.05k|            || !WPACKET_close(pkt))
  ------------------
  |  Branch (89:16): [True: 0, False: 3.05k]
  ------------------
   90|      1|        return 0;
   91|       |
   92|  3.05k|    if (bnbytes != NULL
  ------------------
  |  Branch (92:9): [True: 104, False: 2.95k]
  ------------------
   93|  3.05k|            && BN_bn2binpad(n, bnbytes, (int)cont_len) != (int)cont_len)
  ------------------
  |  Branch (93:16): [True: 0, False: 104]
  ------------------
   94|      0|        return 0;
   95|       |
   96|  3.05k|    return 1;
   97|  3.05k|}
ossl_encode_der_dsa_sig:
  107|  1.47k|{
  108|  1.47k|    WPACKET tmppkt, *dummypkt;
  109|  1.47k|    size_t cont_len;
  110|  1.47k|    int isnull = WPACKET_is_null_buf(pkt);
  111|       |
  112|  1.47k|    if (!WPACKET_start_sub_packet(pkt))
  ------------------
  |  Branch (112:9): [True: 0, False: 1.47k]
  ------------------
  113|      0|        return 0;
  114|       |
  115|  1.47k|    if (!isnull) {
  ------------------
  |  Branch (115:9): [True: 52, False: 1.42k]
  ------------------
  116|     52|        if (!WPACKET_init_null(&tmppkt, 0))
  ------------------
  |  Branch (116:13): [True: 0, False: 52]
  ------------------
  117|      0|            return 0;
  118|     52|        dummypkt = &tmppkt;
  119|  1.42k|    } else {
  120|       |        /* If the input packet has a NULL buffer, we don't need a dummy packet */
  121|  1.42k|        dummypkt = pkt;
  122|  1.42k|    }
  123|       |
  124|       |    /* Calculate the content length */
  125|  1.47k|    if (!ossl_encode_der_integer(dummypkt, r)
  ------------------
  |  Branch (125:9): [True: 1, False: 1.47k]
  ------------------
  126|  1.47k|            || !ossl_encode_der_integer(dummypkt, s)
  ------------------
  |  Branch (126:16): [True: 0, False: 1.47k]
  ------------------
  127|  1.47k|            || !WPACKET_get_length(dummypkt, &cont_len)
  ------------------
  |  Branch (127:16): [True: 0, False: 1.47k]
  ------------------
  128|  1.47k|            || (!isnull && !WPACKET_finish(dummypkt))) {
  ------------------
  |  Branch (128:17): [True: 52, False: 1.42k]
  |  Branch (128:28): [True: 0, False: 52]
  ------------------
  129|      1|        if (!isnull)
  ------------------
  |  Branch (129:13): [True: 0, False: 1]
  ------------------
  130|      0|            WPACKET_cleanup(dummypkt);
  131|      1|        return 0;
  132|      1|    }
  133|       |
  134|       |    /* Add the tag and length bytes */
  135|  1.47k|    if (!WPACKET_put_bytes_u8(pkt, ID_SEQUENCE)
  ------------------
  |  |  878|  2.95k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (135:9): [True: 0, False: 1.47k]
  ------------------
  136|  1.47k|            || !ossl_encode_der_length(pkt, cont_len)
  ------------------
  |  Branch (136:16): [True: 1, False: 1.47k]
  ------------------
  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|  1.47k|            || (!isnull && !ossl_encode_der_integer(pkt, r))
  ------------------
  |  Branch (141:17): [True: 52, False: 1.42k]
  |  Branch (141:28): [True: 0, False: 52]
  ------------------
  142|  1.47k|            || (!isnull && !ossl_encode_der_integer(pkt, s))
  ------------------
  |  Branch (142:17): [True: 52, False: 1.42k]
  |  Branch (142:28): [True: 0, False: 52]
  ------------------
  143|  1.47k|            || !WPACKET_close(pkt))
  ------------------
  |  Branch (143:16): [True: 0, False: 1.47k]
  ------------------
  144|      1|        return 0;
  145|       |
  146|  1.47k|    return 1;
  147|  1.47k|}
ossl_decode_der_length:
  156|  22.3k|{
  157|  22.3k|    unsigned int byte;
  158|       |
  159|  22.3k|    if (!PACKET_get_1(pkt, &byte))
  ------------------
  |  Branch (159:9): [True: 8, False: 22.3k]
  ------------------
  160|      8|        return 0;
  161|       |
  162|  22.3k|    if (byte < 0x80)
  ------------------
  |  Branch (162:9): [True: 9.30k, False: 13.0k]
  ------------------
  163|  9.30k|        return PACKET_get_sub_packet(pkt, subpkt, (size_t)byte);
  164|  13.0k|    if (byte == 0x81)
  ------------------
  |  Branch (164:9): [True: 140, False: 12.8k]
  ------------------
  165|    140|        return PACKET_get_length_prefixed_1(pkt, subpkt);
  166|  12.8k|    if (byte == 0x82)
  ------------------
  |  Branch (166:9): [True: 1.09k, False: 11.7k]
  ------------------
  167|  1.09k|        return PACKET_get_length_prefixed_2(pkt, subpkt);
  168|       |
  169|       |    /* Too large, invalid, or not DER. */
  170|  11.7k|    return 0;
  171|  12.8k|}
ossl_decode_der_integer:
  188|  8.23k|{
  189|  8.23k|    PACKET contpkt, tmppkt;
  190|  8.23k|    unsigned int tag, tmp;
  191|       |
  192|       |    /* Check we have an integer and get the content bytes */
  193|  8.23k|    if (!PACKET_get_1(pkt, &tag)
  ------------------
  |  Branch (193:9): [True: 318, False: 7.91k]
  ------------------
  194|  8.23k|            || tag != ID_INTEGER
  ------------------
  |  |   30|  16.1k|#define ID_INTEGER 0x02
  ------------------
  |  Branch (194:16): [True: 3.48k, False: 4.43k]
  ------------------
  195|  8.23k|            || !ossl_decode_der_length(pkt, &contpkt))
  ------------------
  |  Branch (195:16): [True: 70, False: 4.36k]
  ------------------
  196|  3.87k|        return 0;
  197|       |
  198|       |    /* Peek ahead at the first bytes to check for proper encoding */
  199|  4.36k|    tmppkt = contpkt;
  200|       |    /* The INTEGER must be positive */
  201|  4.36k|    if (!PACKET_get_1(&tmppkt, &tmp)
  ------------------
  |  Branch (201:9): [True: 530, False: 3.83k]
  ------------------
  202|  4.36k|            || (tmp & 0x80) != 0)
  ------------------
  |  Branch (202:16): [True: 1.03k, False: 2.80k]
  ------------------
  203|  1.56k|        return 0;
  204|       |    /* If there a zero padding byte the next byte must have the msb set */
  205|  2.80k|    if (PACKET_remaining(&tmppkt) > 0 && tmp == 0) {
  ------------------
  |  Branch (205:9): [True: 918, False: 1.88k]
  |  Branch (205:42): [True: 188, False: 730]
  ------------------
  206|    188|        if (!PACKET_get_1(&tmppkt, &tmp)
  ------------------
  |  Branch (206:13): [True: 0, False: 188]
  ------------------
  207|    188|                || (tmp & 0x80) == 0)
  ------------------
  |  Branch (207:20): [True: 6, False: 182]
  ------------------
  208|      6|            return 0;
  209|    188|    }
  210|       |
  211|  2.79k|    if (BN_bin2bn(PACKET_data(&contpkt),
  ------------------
  |  Branch (211:9): [True: 0, False: 2.79k]
  ------------------
  212|  2.79k|                  (int)PACKET_remaining(&contpkt), n) == NULL)
  213|      0|        return 0;
  214|       |
  215|  2.79k|    return 1;
  216|  2.79k|}
ossl_decode_der_dsa_sig:
  235|  23.0k|{
  236|  23.0k|    size_t consumed;
  237|  23.0k|    PACKET pkt, contpkt;
  238|  23.0k|    unsigned int tag;
  239|       |
  240|  23.0k|    if (!PACKET_buf_init(&pkt, *ppin, len)
  ------------------
  |  Branch (240:9): [True: 0, False: 23.0k]
  ------------------
  241|  23.0k|            || !PACKET_get_1(&pkt, &tag)
  ------------------
  |  Branch (241:16): [True: 0, False: 23.0k]
  ------------------
  242|  23.0k|            || tag != ID_SEQUENCE
  ------------------
  |  |   29|  46.0k|#define ID_SEQUENCE 0x30
  ------------------
  |  Branch (242:16): [True: 5.16k, False: 17.8k]
  ------------------
  243|  23.0k|            || !ossl_decode_der_length(&pkt, &contpkt)
  ------------------
  |  Branch (243:16): [True: 11.8k, False: 6.04k]
  ------------------
  244|  23.0k|            || !ossl_decode_der_integer(&contpkt, r)
  ------------------
  |  Branch (244:16): [True: 3.84k, False: 2.19k]
  ------------------
  245|  23.0k|            || !ossl_decode_der_integer(&contpkt, s)
  ------------------
  |  Branch (245:16): [True: 1.59k, False: 600]
  ------------------
  246|  23.0k|            || PACKET_remaining(&contpkt) != 0)
  ------------------
  |  Branch (246:16): [True: 548, False: 52]
  ------------------
  247|  22.9k|        return 0;
  248|       |
  249|     52|    consumed = PACKET_data(&pkt) - *ppin;
  250|     52|    *ppin += consumed;
  251|     52|    return consumed;
  252|  23.0k|}

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

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

BIO_dump_cb:
   24|     89|{
   25|     89|    return BIO_dump_indent_cb(cb, u, s, len, 0);
   26|     89|}
BIO_dump_indent_cb:
   30|  8.22k|{
   31|  8.22k|    const unsigned char *s = v;
   32|  8.22k|    int res, ret = 0;
   33|  8.22k|    char buf[288 + 1];
   34|  8.22k|    int i, j, rows, n;
   35|  8.22k|    unsigned char ch;
   36|  8.22k|    int dump_width;
   37|       |
   38|  8.22k|    if (indent < 0)
  ------------------
  |  Branch (38:9): [True: 0, False: 8.22k]
  ------------------
   39|      0|        indent = 0;
   40|  8.22k|    else if (indent > 64)
  ------------------
  |  Branch (40:14): [True: 15, False: 8.20k]
  ------------------
   41|     15|        indent = 64;
   42|       |
   43|  8.22k|    dump_width = DUMP_WIDTH_LESS_INDENT(indent);
  ------------------
  |  |   18|  8.22k|#define DUMP_WIDTH_LESS_INDENT(i) (DUMP_WIDTH - ((i - (i > 6 ? 6 : i) + 3) / 4))
  |  |  ------------------
  |  |  |  |   17|  8.22k|#define DUMP_WIDTH      16
  |  |  ------------------
  |  |  |  Branch (18:56): [True: 7.02k, False: 1.19k]
  |  |  ------------------
  ------------------
   44|  8.22k|    rows = len / dump_width;
   45|  8.22k|    if ((rows * dump_width) < len)
  ------------------
  |  Branch (45:9): [True: 7.03k, False: 1.18k]
  ------------------
   46|  7.03k|        rows++;
   47|   115k|    for (i = 0; i < rows; i++) {
  ------------------
  |  Branch (47:17): [True: 107k, False: 8.22k]
  ------------------
   48|   107k|        n = BIO_snprintf(buf, sizeof(buf), "%*s%04x - ", indent, "",
   49|   107k|                         i * dump_width);
   50|  1.80M|        for (j = 0; j < dump_width; j++) {
  ------------------
  |  Branch (50:21): [True: 1.69M, False: 107k]
  ------------------
   51|  1.69M|            if (SPACE(buf, n, 3)) {
  ------------------
  |  |   20|  1.69M|#define SPACE(buf, pos, n)   (sizeof(buf) - (pos) > (n))
  |  |  ------------------
  |  |  |  Branch (20:30): [True: 1.69M, False: 0]
  |  |  ------------------
  ------------------
   52|  1.69M|                if (((i * dump_width) + j) >= len) {
  ------------------
  |  Branch (52:21): [True: 67.4k, False: 1.62M]
  ------------------
   53|  67.4k|                    strcpy(buf + n, "   ");
   54|  1.62M|                } else {
   55|  1.62M|                    ch = *(s + i * dump_width + j) & 0xff;
   56|  1.62M|                    BIO_snprintf(buf + n, 4, "%02x%c", ch,
   57|  1.62M|                                 j == 7 ? '-' : ' ');
  ------------------
  |  Branch (57:34): [True: 102k, False: 1.52M]
  ------------------
   58|  1.62M|                }
   59|  1.69M|                n += 3;
   60|  1.69M|            }
   61|  1.69M|        }
   62|   107k|        if (SPACE(buf, n, 2)) {
  ------------------
  |  |   20|   107k|#define SPACE(buf, pos, n)   (sizeof(buf) - (pos) > (n))
  |  |  ------------------
  |  |  |  Branch (20:30): [True: 107k, False: 0]
  |  |  ------------------
  ------------------
   63|   107k|            strcpy(buf + n, "  ");
   64|   107k|            n += 2;
   65|   107k|        }
   66|  1.73M|        for (j = 0; j < dump_width; j++) {
  ------------------
  |  Branch (66:21): [True: 1.63M, False: 100k]
  ------------------
   67|  1.63M|            if (((i * dump_width) + j) >= len)
  ------------------
  |  Branch (67:17): [True: 7.03k, False: 1.62M]
  ------------------
   68|  7.03k|                break;
   69|  1.62M|            if (SPACE(buf, n, 1)) {
  ------------------
  |  |   20|  1.62M|#define SPACE(buf, pos, n)   (sizeof(buf) - (pos) > (n))
  |  |  ------------------
  |  |  |  Branch (20:30): [True: 1.62M, False: 0]
  |  |  ------------------
  ------------------
   70|  1.62M|                ch = *(s + i * dump_width + j) & 0xff;
   71|  1.62M|#ifndef CHARSET_EBCDIC
   72|  1.62M|                buf[n++] = ((ch >= ' ') && (ch <= '~')) ? ch : '.';
  ------------------
  |  Branch (72:29): [True: 1.18M, False: 442k]
  |  Branch (72:44): [True: 136k, False: 1.04M]
  ------------------
   73|       |#else
   74|       |                buf[n++] = ((ch >= os_toascii[' ']) && (ch <= os_toascii['~']))
   75|       |                           ? os_toebcdic[ch]
   76|       |                           : '.';
   77|       |#endif
   78|  1.62M|                buf[n] = '\0';
   79|  1.62M|            }
   80|  1.62M|        }
   81|   107k|        if (SPACE(buf, n, 1)) {
  ------------------
  |  |   20|   107k|#define SPACE(buf, pos, n)   (sizeof(buf) - (pos) > (n))
  |  |  ------------------
  |  |  |  Branch (20:30): [True: 107k, False: 0]
  |  |  ------------------
  ------------------
   82|   107k|            buf[n++] = '\n';
   83|   107k|            buf[n] = '\0';
   84|   107k|        }
   85|       |        /*
   86|       |         * if this is the last call then update the ddt_dump thing so that we
   87|       |         * will move the selection point in the debug window
   88|       |         */
   89|   107k|        res = cb((void *)buf, n, u);
   90|   107k|        if (res < 0)
  ------------------
  |  Branch (90:13): [True: 0, False: 107k]
  ------------------
   91|      0|            return res;
   92|   107k|        ret += res;
   93|   107k|    }
   94|  8.22k|    return ret;
   95|  8.22k|}
BIO_dump:
  120|     89|{
  121|     89|    return BIO_dump_cb(write_bio, bp, s, len);
  122|     89|}
BIO_dump_indent:
  125|  8.13k|{
  126|  8.13k|    return BIO_dump_indent_cb(write_bio, bp, s, len, indent);
  127|  8.13k|}
bio_dump.c:write_bio:
  115|   107k|{
  116|   107k|    return BIO_write((BIO *)bp, (const char *)data, len);
  117|   107k|}

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|  1.62M|{
   83|  1.62M|    BIO *bio = OPENSSL_zalloc(sizeof(*bio));
  ------------------
  |  |  104|  1.62M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.62M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.62M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|       |
   85|  1.62M|    if (bio == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 1.62M]
  ------------------
   86|      0|        return NULL;
   87|       |
   88|  1.62M|    bio->libctx = libctx;
   89|  1.62M|    bio->method = method;
   90|  1.62M|    bio->shutdown = 1;
   91|       |
   92|  1.62M|    if (!CRYPTO_NEW_REF(&bio->references, 1))
  ------------------
  |  Branch (92:9): [True: 0, False: 1.62M]
  ------------------
   93|      0|        goto err;
   94|       |
   95|  1.62M|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data))
  ------------------
  |  |  240|  1.62M|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  |  Branch (95:9): [True: 0, False: 1.62M]
  ------------------
   96|      0|        goto err;
   97|       |
   98|  1.62M|    if (method->create != NULL && !method->create(bio)) {
  ------------------
  |  Branch (98:9): [True: 1.57M, False: 49.3k]
  |  Branch (98:35): [True: 0, False: 1.57M]
  ------------------
   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|  1.62M|    if (method->create == NULL)
  ------------------
  |  Branch (103:9): [True: 49.3k, False: 1.57M]
  ------------------
  104|  49.3k|        bio->init = 1;
  105|       |
  106|  1.62M|    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|  1.62M|}
BIO_new:
  115|  1.62M|{
  116|  1.62M|    return BIO_new_ex(NULL, method);
  117|  1.62M|}
BIO_free:
  120|  1.66M|{
  121|  1.66M|    int ret;
  122|       |
  123|  1.66M|    if (a == NULL)
  ------------------
  |  Branch (123:9): [True: 20.8k, False: 1.64M]
  ------------------
  124|  20.8k|        return 0;
  125|       |
  126|  1.64M|    if (CRYPTO_DOWN_REF(&a->references, &ret) <= 0)
  ------------------
  |  Branch (126:9): [True: 0, False: 1.64M]
  ------------------
  127|      0|        return 0;
  128|       |
  129|  1.64M|    REF_PRINT_COUNT("BIO", a);
  ------------------
  |  |  289|  1.64M|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  1.64M|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  1.64M|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  1.64M|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  130|  1.64M|    if (ret > 0)
  ------------------
  |  Branch (130:9): [True: 16.8k, False: 1.62M]
  ------------------
  131|  16.8k|        return 1;
  132|  1.62M|    REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  281|  1.62M|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 1.62M]
  |  |  ------------------
  ------------------
  133|       |
  134|  1.62M|    if (HAS_CALLBACK(a)) {
  ------------------
  |  |   26|  1.62M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 1.62M]
  |  |  |  Branch (26:52): [True: 0, False: 1.62M]
  |  |  ------------------
  ------------------
  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|  1.62M|    if ((a->method != NULL) && (a->method->destroy != NULL))
  ------------------
  |  Branch (140:9): [True: 1.62M, False: 0]
  |  Branch (140:32): [True: 1.57M, False: 49.3k]
  ------------------
  141|  1.57M|        a->method->destroy(a);
  142|       |
  143|  1.62M|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
  ------------------
  |  |  240|  1.62M|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  144|       |
  145|  1.62M|    CRYPTO_FREE_REF(&a->references);
  146|       |
  147|  1.62M|    OPENSSL_free(a);
  ------------------
  |  |  115|  1.62M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.62M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.62M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  148|       |
  149|  1.62M|    return 1;
  150|  1.62M|}
BIO_set_data:
  153|  1.55M|{
  154|  1.55M|    a->ptr = ptr;
  155|  1.55M|}
BIO_get_data:
  158|   163M|{
  159|   163M|    return a->ptr;
  160|   163M|}
BIO_set_init:
  163|  1.75M|{
  164|  1.75M|    a->init = init;
  165|  1.75M|}
BIO_up_ref:
  188|  16.8k|{
  189|  16.8k|    int i;
  190|       |
  191|  16.8k|    if (CRYPTO_UP_REF(&a->references, &i) <= 0)
  ------------------
  |  Branch (191:9): [True: 0, False: 16.8k]
  ------------------
  192|      0|        return 0;
  193|       |
  194|  16.8k|    REF_PRINT_COUNT("BIO", a);
  ------------------
  |  |  289|  16.8k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  16.8k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  16.8k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  16.8k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  16.8k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|  16.8k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 16.8k]
  |  |  ------------------
  ------------------
  196|  16.8k|    return i > 1;
  197|  16.8k|}
BIO_clear_flags:
  200|   150M|{
  201|   150M|    b->flags &= ~flags;
  202|   150M|}
BIO_read:
  304|   150M|{
  305|   150M|    size_t readbytes;
  306|   150M|    int ret;
  307|       |
  308|   150M|    if (dlen < 0)
  ------------------
  |  Branch (308:9): [True: 0, False: 150M]
  ------------------
  309|      0|        return 0;
  310|       |
  311|   150M|    ret = bio_read_intern(b, data, (size_t)dlen, &readbytes);
  312|       |
  313|   150M|    if (ret > 0) {
  ------------------
  |  Branch (313:9): [True: 150M, False: 241k]
  ------------------
  314|       |        /* *readbytes should always be <= dlen */
  315|   150M|        ret = (int)readbytes;
  316|   150M|    }
  317|       |
  318|   150M|    return ret;
  319|   150M|}
BIO_read_ex:
  322|   150M|{
  323|   150M|    return bio_read_intern(b, data, dlen, readbytes) > 0;
  324|   150M|}
BIO_write:
  371|  11.8M|{
  372|  11.8M|    size_t written;
  373|  11.8M|    int ret;
  374|       |
  375|  11.8M|    if (dlen <= 0)
  ------------------
  |  Branch (375:9): [True: 66.4k, False: 11.8M]
  ------------------
  376|  66.4k|        return 0;
  377|       |
  378|  11.8M|    ret = bio_write_intern(b, data, (size_t)dlen, &written);
  379|       |
  380|  11.8M|    if (ret > 0) {
  ------------------
  |  Branch (380:9): [True: 11.8M, False: 0]
  ------------------
  381|       |        /* written should always be <= dlen */
  382|  11.8M|        ret = (int)written;
  383|  11.8M|    }
  384|       |
  385|  11.8M|    return ret;
  386|  11.8M|}
BIO_write_ex:
  389|  4.20M|{
  390|  4.20M|    return bio_write_intern(b, data, dlen, written) > 0
  ------------------
  |  Branch (390:12): [True: 4.20M, False: 0]
  ------------------
  391|  4.20M|        || (b != NULL && dlen == 0); /* order is important for *written */
  ------------------
  |  Branch (391:13): [True: 0, False: 0]
  |  Branch (391:26): [True: 0, False: 0]
  ------------------
  392|  4.20M|}
BIO_puts:
  499|   913k|{
  500|   913k|    int ret;
  501|   913k|    size_t written = 0;
  502|       |
  503|   913k|    if (b == NULL) {
  ------------------
  |  Branch (503:9): [True: 0, False: 913k]
  ------------------
  504|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  505|      0|        return -1;
  506|      0|    }
  507|   913k|    if (b->method == NULL || b->method->bputs == NULL) {
  ------------------
  |  Branch (507:9): [True: 0, False: 913k]
  |  Branch (507:30): [True: 0, False: 913k]
  ------------------
  508|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  509|      0|        return -2;
  510|      0|    }
  511|       |
  512|   913k|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|   913k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 913k]
  |  |  |  Branch (26:52): [True: 0, False: 913k]
  |  |  ------------------
  ------------------
  513|      0|        ret = (int)bio_call_callback(b, BIO_CB_PUTS, buf, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  291|      0|# define BIO_CB_PUTS        0x04
  ------------------
  514|      0|        if (ret <= 0)
  ------------------
  |  Branch (514:13): [True: 0, False: 0]
  ------------------
  515|      0|            return ret;
  516|      0|    }
  517|       |
  518|   913k|    if (!b->init) {
  ------------------
  |  Branch (518:9): [True: 0, False: 913k]
  ------------------
  519|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  520|      0|        return -1;
  521|      0|    }
  522|       |
  523|   913k|    ret = b->method->bputs(b, buf);
  524|       |
  525|   913k|    if (ret > 0) {
  ------------------
  |  Branch (525:9): [True: 913k, False: 194]
  ------------------
  526|   913k|        b->num_write += (uint64_t)ret;
  527|   913k|        written = ret;
  528|   913k|        ret = 1;
  529|   913k|    }
  530|       |
  531|   913k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|   913k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 913k]
  |  |  |  Branch (26:52): [True: 0, False: 913k]
  |  |  ------------------
  ------------------
  532|      0|        ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  ------------------
  |  |  291|      0|# define BIO_CB_PUTS        0x04
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  ------------------
  |  |  301|      0|# define BIO_CB_RETURN   0x80
  ------------------
  533|      0|                                     0L, ret, &written);
  534|       |
  535|   913k|    if (ret > 0) {
  ------------------
  |  Branch (535:9): [True: 913k, False: 194]
  ------------------
  536|   913k|        if (written > INT_MAX) {
  ------------------
  |  Branch (536:13): [True: 0, False: 913k]
  ------------------
  537|      0|            ERR_raise(ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  538|      0|            ret = -1;
  539|   913k|        } else {
  540|   913k|            ret = (int)written;
  541|   913k|        }
  542|   913k|    }
  543|       |
  544|   913k|    return ret;
  545|   913k|}
BIO_indent:
  631|  34.1k|{
  632|  34.1k|    if (indent < 0)
  ------------------
  |  Branch (632:9): [True: 0, False: 34.1k]
  ------------------
  633|      0|        indent = 0;
  634|  34.1k|    if (indent > max)
  ------------------
  |  Branch (634:9): [True: 0, False: 34.1k]
  ------------------
  635|      0|        indent = max;
  636|  68.2k|    while (indent--)
  ------------------
  |  Branch (636:12): [True: 34.0k, False: 34.1k]
  ------------------
  637|  34.0k|        if (BIO_puts(b, " ") != 1)
  ------------------
  |  Branch (637:13): [True: 0, False: 34.0k]
  ------------------
  638|      0|            return 0;
  639|  34.1k|    return 1;
  640|  34.1k|}
BIO_ctrl:
  661|  12.6M|{
  662|  12.6M|    long ret;
  663|       |
  664|  12.6M|    if (b == NULL)
  ------------------
  |  Branch (664:9): [True: 0, False: 12.6M]
  ------------------
  665|      0|        return -1;
  666|  12.6M|    if (b->method == NULL || b->method->ctrl == NULL) {
  ------------------
  |  Branch (666:9): [True: 0, False: 12.6M]
  |  Branch (666:30): [True: 0, False: 12.6M]
  ------------------
  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|  12.6M|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|  12.6M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 12.6M]
  |  |  |  Branch (26:52): [True: 0, False: 12.6M]
  |  |  ------------------
  ------------------
  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|  12.6M|    ret = b->method->ctrl(b, cmd, larg, parg);
  678|       |
  679|  12.6M|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  12.6M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 12.6M]
  |  |  |  Branch (26:52): [True: 0, False: 12.6M]
  |  |  ------------------
  ------------------
  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|  12.6M|    return ret;
  684|  12.6M|}
BIO_push:
  747|  1.36M|{
  748|  1.36M|    BIO *lb;
  749|       |
  750|  1.36M|    if (b == NULL)
  ------------------
  |  Branch (750:9): [True: 0, False: 1.36M]
  ------------------
  751|      0|        return bio;
  752|  1.36M|    lb = b;
  753|  1.36M|    while (lb->next_bio != NULL)
  ------------------
  |  Branch (753:12): [True: 0, False: 1.36M]
  ------------------
  754|      0|        lb = lb->next_bio;
  755|  1.36M|    lb->next_bio = bio;
  756|  1.36M|    if (bio != NULL)
  ------------------
  |  Branch (756:9): [True: 1.36M, False: 0]
  ------------------
  757|  1.36M|        bio->prev_bio = lb;
  758|       |    /* called to do internal processing */
  759|  1.36M|    BIO_ctrl(b, BIO_CTRL_PUSH, 0, lb);
  ------------------
  |  |   93|  1.36M|# define BIO_CTRL_PUSH           6/* opt - internal, used to signify change */
  ------------------
  760|  1.36M|    return b;
  761|  1.36M|}
BIO_pop:
  765|  1.36M|{
  766|  1.36M|    BIO *ret;
  767|       |
  768|  1.36M|    if (b == NULL)
  ------------------
  |  Branch (768:9): [True: 0, False: 1.36M]
  ------------------
  769|      0|        return NULL;
  770|  1.36M|    ret = b->next_bio;
  771|       |
  772|  1.36M|    BIO_ctrl(b, BIO_CTRL_POP, 0, b);
  ------------------
  |  |   94|  1.36M|# define BIO_CTRL_POP            7/* opt - internal, used to signify change */
  ------------------
  773|       |
  774|  1.36M|    if (b->prev_bio != NULL)
  ------------------
  |  Branch (774:9): [True: 0, False: 1.36M]
  ------------------
  775|      0|        b->prev_bio->next_bio = b->next_bio;
  776|  1.36M|    if (b->next_bio != NULL)
  ------------------
  |  Branch (776:9): [True: 1.36M, False: 0]
  ------------------
  777|  1.36M|        b->next_bio->prev_bio = b->prev_bio;
  778|       |
  779|  1.36M|    b->next_bio = NULL;
  780|  1.36M|    b->prev_bio = NULL;
  781|  1.36M|    return ret;
  782|  1.36M|}
BIO_next:
  838|  9.54M|{
  839|  9.54M|    if (b == NULL)
  ------------------
  |  Branch (839:9): [True: 0, False: 9.54M]
  ------------------
  840|      0|        return NULL;
  841|  9.54M|    return b->next_bio;
  842|  9.54M|}
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|   301M|{
  264|   301M|    int ret;
  265|       |
  266|   301M|    if (b == NULL) {
  ------------------
  |  Branch (266:9): [True: 0, False: 301M]
  ------------------
  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|   301M|    if (b->method == NULL || b->method->bread == NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 301M]
  |  Branch (270:30): [True: 0, False: 301M]
  ------------------
  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|   301M|    if (HAS_CALLBACK(b) &&
  ------------------
  |  |   26|   602M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 301M]
  |  |  |  Branch (26:52): [True: 0, False: 301M]
  |  |  ------------------
  ------------------
  276|   301M|        ((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|   301M|    if (!b->init) {
  ------------------
  |  Branch (280:9): [True: 0, False: 301M]
  ------------------
  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|   301M|    ret = b->method->bread(b, data, dlen, readbytes);
  286|       |
  287|   301M|    if (ret > 0)
  ------------------
  |  Branch (287:9): [True: 300M, False: 482k]
  ------------------
  288|   300M|        b->num_read += (uint64_t)*readbytes;
  289|       |
  290|   301M|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|   301M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 301M]
  |  |  |  Branch (26:52): [True: 0, False: 301M]
  |  |  ------------------
  ------------------
  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|   301M|    if (ret > 0 && *readbytes > dlen) {
  ------------------
  |  Branch (295:9): [True: 300M, False: 482k]
  |  Branch (295:20): [True: 0, False: 300M]
  ------------------
  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|   301M|    return ret;
  301|   301M|}
bio_lib.c:bio_write_intern:
  328|  16.0M|{
  329|  16.0M|    size_t local_written;
  330|  16.0M|    int ret;
  331|       |
  332|  16.0M|    if (written != NULL)
  ------------------
  |  Branch (332:9): [True: 16.0M, False: 0]
  ------------------
  333|  16.0M|        *written = 0;
  334|       |    /*
  335|       |     * b == NULL is not an error but just means that zero bytes are written.
  336|       |     * Do not raise an error here.
  337|       |     */
  338|  16.0M|    if (b == NULL)
  ------------------
  |  Branch (338:9): [True: 0, False: 16.0M]
  ------------------
  339|      0|        return 0;
  340|       |
  341|  16.0M|    if (b->method == NULL || b->method->bwrite == NULL) {
  ------------------
  |  Branch (341:9): [True: 0, False: 16.0M]
  |  Branch (341:30): [True: 0, False: 16.0M]
  ------------------
  342|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|  16.0M|    if (HAS_CALLBACK(b) &&
  ------------------
  |  |   26|  32.0M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 16.0M]
  |  |  |  Branch (26:52): [True: 0, False: 16.0M]
  |  |  ------------------
  ------------------
  347|  16.0M|        ((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|  16.0M|    if (!b->init) {
  ------------------
  |  Branch (351:9): [True: 0, False: 16.0M]
  ------------------
  352|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|  16.0M|    ret = b->method->bwrite(b, data, dlen, &local_written);
  357|       |
  358|  16.0M|    if (ret > 0)
  ------------------
  |  Branch (358:9): [True: 16.0M, False: 0]
  ------------------
  359|  16.0M|        b->num_write += (uint64_t)local_written;
  360|       |
  361|  16.0M|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  16.0M|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 16.0M]
  |  |  |  Branch (26:52): [True: 0, False: 16.0M]
  |  |  ------------------
  ------------------
  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|  16.0M|    if (written != NULL)
  ------------------
  |  Branch (365:9): [True: 16.0M, False: 0]
  ------------------
  366|  16.0M|        *written = local_written;
  367|  16.0M|    return ret;
  368|  16.0M|}

BIO_meth_new:
   38|      1|{
   39|      1|    BIO_METHOD *biom = OPENSSL_zalloc(sizeof(BIO_METHOD));
  ------------------
  |  |  104|      1|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|  13.1M|{
   72|  13.1M|    int ret;
   73|       |
   74|  13.1M|    if (datal > INT_MAX)
  ------------------
  |  Branch (74:9): [True: 0, False: 13.1M]
  ------------------
   75|      0|        datal = INT_MAX;
   76|       |
   77|  13.1M|    ret = bio->method->bwrite_old(bio, data, (int)datal);
   78|       |
   79|  13.1M|    if (ret <= 0) {
  ------------------
  |  Branch (79:9): [True: 0, False: 13.1M]
  ------------------
   80|      0|        *written = 0;
   81|      0|        return ret;
   82|      0|    }
   83|       |
   84|  13.1M|    *written = (size_t)ret;
   85|       |
   86|  13.1M|    return 1;
   87|  13.1M|}
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|   150M|{
  118|   150M|    int ret;
  119|       |
  120|   150M|    if (datal > INT_MAX)
  ------------------
  |  Branch (120:9): [True: 0, False: 150M]
  ------------------
  121|      0|        datal = INT_MAX;
  122|       |
  123|   150M|    ret = bio->method->bread_old(bio, data, (int)datal);
  124|       |
  125|   150M|    if (ret <= 0) {
  ------------------
  |  Branch (125:9): [True: 241k, False: 150M]
  ------------------
  126|   241k|        *readbytes = 0;
  127|   241k|        return ret;
  128|   241k|    }
  129|       |
  130|   150M|    *readbytes = (size_t)ret;
  131|       |
  132|   150M|    return 1;
  133|   150M|}
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_printf:
  879|  8.24M|{
  880|  8.24M|    va_list args;
  881|  8.24M|    int ret;
  882|       |
  883|  8.24M|    va_start(args, format);
  884|       |
  885|  8.24M|    ret = BIO_vprintf(bio, format, args);
  886|       |
  887|  8.24M|    va_end(args);
  888|  8.24M|    return ret;
  889|  8.24M|}
BIO_vprintf:
  892|  8.24M|{
  893|  8.24M|    int ret;
  894|  8.24M|    size_t retlen;
  895|  8.24M|    char hugebuf[1024 * 2];     /* Was previously 10k, which is unreasonable
  896|       |                                 * in small-stack environments, like threads
  897|       |                                 * or DOS programs. */
  898|  8.24M|    char *hugebufp = hugebuf;
  899|  8.24M|    size_t hugebufsize = sizeof(hugebuf);
  900|  8.24M|    char *dynbuf = NULL;
  901|  8.24M|    int ignored;
  902|       |
  903|  8.24M|    dynbuf = NULL;
  904|  8.24M|    if (!_dopr(&hugebufp, &dynbuf, &hugebufsize, &retlen, &ignored, format,
  ------------------
  |  Branch (904:9): [True: 0, False: 8.24M]
  ------------------
  905|  8.24M|                args)) {
  906|      0|        OPENSSL_free(dynbuf);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  907|      0|        return -1;
  908|      0|    }
  909|  8.24M|    if (dynbuf) {
  ------------------
  |  Branch (909:9): [True: 36, False: 8.24M]
  ------------------
  910|     36|        ret = BIO_write(bio, dynbuf, (int)retlen);
  911|     36|        OPENSSL_free(dynbuf);
  ------------------
  |  |  115|     36|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     36|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     36|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  912|  8.24M|    } else {
  913|  8.24M|        ret = BIO_write(bio, hugebuf, (int)retlen);
  914|  8.24M|    }
  915|  8.24M|    return ret;
  916|  8.24M|}
BIO_snprintf:
  925|  3.75M|{
  926|  3.75M|    va_list args;
  927|  3.75M|    int ret;
  928|       |
  929|  3.75M|    va_start(args, format);
  930|       |
  931|  3.75M|    ret = BIO_vsnprintf(buf, n, format, args);
  932|       |
  933|  3.75M|    va_end(args);
  934|  3.75M|    return ret;
  935|  3.75M|}
BIO_vsnprintf:
  938|  3.76M|{
  939|  3.76M|    size_t retlen;
  940|  3.76M|    int truncated;
  941|       |
  942|  3.76M|    if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
  ------------------
  |  Branch (942:9): [True: 0, False: 3.76M]
  ------------------
  943|      0|        return -1;
  944|       |
  945|  3.76M|    if (truncated)
  ------------------
  |  Branch (945:9): [True: 0, False: 3.76M]
  ------------------
  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|  3.76M|    return (retlen <= INT_MAX) ? (int)retlen : -1;
  ------------------
  |  Branch (953:12): [True: 3.76M, False: 0]
  ------------------
  954|  3.76M|}
bio_print.c:_dopr:
   91|  12.0M|{
   92|  12.0M|    char ch;
   93|  12.0M|    int64_t value;
   94|  12.0M|#ifndef OPENSSL_SYS_UEFI
   95|  12.0M|    LDOUBLE fvalue;
  ------------------
  |  |   28|  12.0M|# define LDOUBLE double
  ------------------
   96|  12.0M|#endif
   97|  12.0M|    char *strvalue;
   98|  12.0M|    int min;
   99|  12.0M|    int max;
  100|  12.0M|    int state;
  101|  12.0M|    int flags;
  102|  12.0M|    int cflags;
  103|  12.0M|    size_t currlen;
  104|       |
  105|  12.0M|    state = DP_S_DEFAULT;
  ------------------
  |  |   45|  12.0M|#define DP_S_DEFAULT    0
  ------------------
  106|  12.0M|    flags = currlen = cflags = min = 0;
  107|  12.0M|    max = -1;
  108|  12.0M|    ch = *format++;
  109|       |
  110|   197M|    while (state != DP_S_DONE) {
  ------------------
  |  |   52|   197M|#define DP_S_DONE       7
  ------------------
  |  Branch (110:12): [True: 185M, False: 12.0M]
  ------------------
  111|   185M|        if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
  ------------------
  |  Branch (111:13): [True: 12.0M, False: 173M]
  |  Branch (111:28): [True: 92.5M, False: 80.9M]
  |  Branch (111:46): [True: 0, False: 92.5M]
  ------------------
  112|  12.0M|            state = DP_S_DONE;
  ------------------
  |  |   52|  12.0M|#define DP_S_DONE       7
  ------------------
  113|       |
  114|   185M|        switch (state) {
  115|  43.4M|        case DP_S_DEFAULT:
  ------------------
  |  |   45|  43.4M|#define DP_S_DEFAULT    0
  ------------------
  |  Branch (115:9): [True: 43.4M, False: 142M]
  ------------------
  116|  43.4M|            if (ch == '%')
  ------------------
  |  Branch (116:17): [True: 21.9M, False: 21.5M]
  ------------------
  117|  21.9M|                state = DP_S_FLAGS;
  ------------------
  |  |   46|  21.9M|#define DP_S_FLAGS      1
  ------------------
  118|  21.5M|            else
  119|  21.5M|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (119:21): [True: 0, False: 21.5M]
  ------------------
  120|      0|                    return 0;
  121|  43.4M|            ch = *format++;
  122|  43.4M|            break;
  123|  30.2M|        case DP_S_FLAGS:
  ------------------
  |  |   46|  30.2M|#define DP_S_FLAGS      1
  ------------------
  |  Branch (123:9): [True: 30.2M, False: 155M]
  ------------------
  124|  30.2M|            switch (ch) {
  125|  2.72M|            case '-':
  ------------------
  |  Branch (125:13): [True: 2.72M, False: 27.4M]
  ------------------
  126|  2.72M|                flags |= DP_F_MINUS;
  ------------------
  |  |   56|  2.72M|#define DP_F_MINUS      (1 << 0)
  ------------------
  127|  2.72M|                ch = *format++;
  128|  2.72M|                break;
  129|      0|            case '+':
  ------------------
  |  Branch (129:13): [True: 0, False: 30.2M]
  ------------------
  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: 30.2M]
  ------------------
  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: 30.2M]
  ------------------
  138|      0|                flags |= DP_F_NUM;
  ------------------
  |  |   62|      0|#define DP_F_NUM        (1 << 3)
  ------------------
  139|      0|                ch = *format++;
  140|      0|                break;
  141|  5.59M|            case '0':
  ------------------
  |  Branch (141:13): [True: 5.59M, False: 24.6M]
  ------------------
  142|  5.59M|                flags |= DP_F_ZERO;
  ------------------
  |  |   64|  5.59M|#define DP_F_ZERO       (1 << 4)
  ------------------
  143|  5.59M|                ch = *format++;
  144|  5.59M|                break;
  145|  21.9M|            default:
  ------------------
  |  Branch (145:13): [True: 21.9M, False: 8.31M]
  ------------------
  146|  21.9M|                state = DP_S_MIN;
  ------------------
  |  |   47|  21.9M|#define DP_S_MIN        2
  ------------------
  147|  21.9M|                break;
  148|  30.2M|            }
  149|  30.2M|            break;
  150|  34.1M|        case DP_S_MIN:
  ------------------
  |  |   47|  34.1M|#define DP_S_MIN        2
  ------------------
  |  Branch (150:9): [True: 34.1M, False: 151M]
  ------------------
  151|  34.1M|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (151:17): [True: 12.2M, False: 21.9M]
  ------------------
  152|  12.2M|                min = 10 * min + char_to_int(ch);
  ------------------
  |  |   83|  12.2M|#define char_to_int(p) (p - '0')
  ------------------
  153|  12.2M|                ch = *format++;
  154|  21.9M|            } else if (ch == '*') {
  ------------------
  |  Branch (154:24): [True: 1.61M, False: 20.2M]
  ------------------
  155|  1.61M|                min = va_arg(args, int);
  156|  1.61M|                ch = *format++;
  157|  1.61M|                state = DP_S_DOT;
  ------------------
  |  |   48|  1.61M|#define DP_S_DOT        3
  ------------------
  158|  1.61M|            } else
  159|  20.2M|                state = DP_S_DOT;
  ------------------
  |  |   48|  20.2M|#define DP_S_DOT        3
  ------------------
  160|  34.1M|            break;
  161|  21.9M|        case DP_S_DOT:
  ------------------
  |  |   48|  21.9M|#define DP_S_DOT        3
  ------------------
  |  Branch (161:9): [True: 21.9M, False: 163M]
  ------------------
  162|  21.9M|            if (ch == '.') {
  ------------------
  |  Branch (162:17): [True: 1.69k, False: 21.9M]
  ------------------
  163|  1.69k|                state = DP_S_MAX;
  ------------------
  |  |   49|  1.69k|#define DP_S_MAX        4
  ------------------
  164|  1.69k|                ch = *format++;
  165|  1.69k|            } else
  166|  21.9M|                state = DP_S_MOD;
  ------------------
  |  |   50|  21.9M|#define DP_S_MOD        5
  ------------------
  167|  21.9M|            break;
  168|  1.69k|        case DP_S_MAX:
  ------------------
  |  |   49|  1.69k|#define DP_S_MAX        4
  ------------------
  |  Branch (168:9): [True: 1.69k, False: 185M]
  ------------------
  169|  1.69k|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (169:17): [True: 0, False: 1.69k]
  ------------------
  170|      0|                if (max < 0)
  ------------------
  |  Branch (170:21): [True: 0, False: 0]
  ------------------
  171|      0|                    max = 0;
  172|      0|                max = 10 * max + char_to_int(ch);
  ------------------
  |  |   83|      0|#define char_to_int(p) (p - '0')
  ------------------
  173|      0|                ch = *format++;
  174|  1.69k|            } else if (ch == '*') {
  ------------------
  |  Branch (174:24): [True: 1.69k, False: 0]
  ------------------
  175|  1.69k|                max = va_arg(args, int);
  176|  1.69k|                ch = *format++;
  177|  1.69k|                state = DP_S_MOD;
  ------------------
  |  |   50|  1.69k|#define DP_S_MOD        5
  ------------------
  178|  1.69k|            } else
  179|      0|                state = DP_S_MOD;
  ------------------
  |  |   50|      0|#define DP_S_MOD        5
  ------------------
  180|  1.69k|            break;
  181|  21.9M|        case DP_S_MOD:
  ------------------
  |  |   50|  21.9M|#define DP_S_MOD        5
  ------------------
  |  Branch (181:9): [True: 21.9M, False: 163M]
  ------------------
  182|  21.9M|            switch (ch) {
  183|      0|            case 'h':
  ------------------
  |  Branch (183:13): [True: 0, False: 21.9M]
  ------------------
  184|      0|                cflags = DP_C_SHORT;
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  185|      0|                ch = *format++;
  186|      0|                break;
  187|  4.29M|            case 'l':
  ------------------
  |  Branch (187:13): [True: 4.29M, False: 17.6M]
  ------------------
  188|  4.29M|                if (*format == 'l') {
  ------------------
  |  Branch (188:21): [True: 774, False: 4.29M]
  ------------------
  189|    774|                    cflags = DP_C_LLONG;
  ------------------
  |  |   74|    774|#define DP_C_LLONG      4
  ------------------
  190|    774|                    format++;
  191|    774|                } else
  192|  4.29M|                    cflags = DP_C_LONG;
  ------------------
  |  |   72|  4.29M|#define DP_C_LONG       2
  ------------------
  193|  4.29M|                ch = *format++;
  194|  4.29M|                break;
  195|      0|            case 'q':
  ------------------
  |  Branch (195:13): [True: 0, False: 21.9M]
  ------------------
  196|  1.14k|            case 'j':
  ------------------
  |  Branch (196:13): [True: 1.14k, False: 21.9M]
  ------------------
  197|  1.14k|                cflags = DP_C_LLONG;
  ------------------
  |  |   74|  1.14k|#define DP_C_LLONG      4
  ------------------
  198|  1.14k|                ch = *format++;
  199|  1.14k|                break;
  200|      0|            case 'L':
  ------------------
  |  Branch (200:13): [True: 0, False: 21.9M]
  ------------------
  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: 21.9M]
  ------------------
  205|      0|                cflags = DP_C_SIZE;
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  206|      0|                ch = *format++;
  207|      0|                break;
  208|  17.6M|            default:
  ------------------
  |  Branch (208:13): [True: 17.6M, False: 4.29M]
  ------------------
  209|  17.6M|                break;
  210|  21.9M|            }
  211|  21.9M|            state = DP_S_CONV;
  ------------------
  |  |   51|  21.9M|#define DP_S_CONV       6
  ------------------
  212|  21.9M|            break;
  213|  21.9M|        case DP_S_CONV:
  ------------------
  |  |   51|  21.9M|#define DP_S_CONV       6
  ------------------
  |  Branch (213:9): [True: 21.9M, False: 163M]
  ------------------
  214|  21.9M|            switch (ch) {
  215|  5.48M|            case 'd':
  ------------------
  |  Branch (215:13): [True: 5.48M, False: 16.4M]
  ------------------
  216|  5.48M|            case 'i':
  ------------------
  |  Branch (216:13): [True: 0, False: 21.9M]
  ------------------
  217|  5.48M|                switch (cflags) {
  218|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (218:17): [True: 0, False: 5.48M]
  ------------------
  219|      0|                    value = (short int)va_arg(args, int);
  220|      0|                    break;
  221|  3.87M|                case DP_C_LONG:
  ------------------
  |  |   72|  3.87M|#define DP_C_LONG       2
  ------------------
  |  Branch (221:17): [True: 3.87M, False: 1.61M]
  ------------------
  222|  3.87M|                    value = va_arg(args, long int);
  223|  3.87M|                    break;
  224|  1.41k|                case DP_C_LLONG:
  ------------------
  |  |   74|  1.41k|#define DP_C_LLONG      4
  ------------------
  |  Branch (224:17): [True: 1.41k, False: 5.48M]
  ------------------
  225|  1.41k|                    value = va_arg(args, int64_t);
  226|  1.41k|                    break;
  227|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (227:17): [True: 0, False: 5.48M]
  ------------------
  228|      0|                    value = va_arg(args, ossl_ssize_t);
  229|      0|                    break;
  230|  1.61M|                default:
  ------------------
  |  Branch (230:17): [True: 1.61M, False: 3.87M]
  ------------------
  231|  1.61M|                    value = va_arg(args, int);
  232|  1.61M|                    break;
  233|  5.48M|                }
  234|  5.48M|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min,
  ------------------
  |  Branch (234:21): [True: 0, False: 5.48M]
  ------------------
  235|  5.48M|                            max, flags))
  236|      0|                    return 0;
  237|  5.48M|                break;
  238|  5.48M|            case 'X':
  ------------------
  |  Branch (238:13): [True: 3.68M, False: 18.2M]
  ------------------
  239|  3.68M|                flags |= DP_F_UP;
  ------------------
  |  |   66|  3.68M|#define DP_F_UP         (1 << 5)
  ------------------
  240|       |                /* FALLTHROUGH */
  241|  5.62M|            case 'x':
  ------------------
  |  Branch (241:13): [True: 1.94M, False: 19.9M]
  ------------------
  242|  5.62M|            case 'o':
  ------------------
  |  Branch (242:13): [True: 0, False: 21.9M]
  ------------------
  243|  6.00M|            case 'u':
  ------------------
  |  Branch (243:13): [True: 380k, False: 21.5M]
  ------------------
  244|  6.00M|                flags |= DP_F_UNSIGNED;
  ------------------
  |  |   68|  6.00M|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  245|  6.00M|                switch (cflags) {
  246|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (246:17): [True: 0, False: 6.00M]
  ------------------
  247|      0|                    value = (unsigned short int)va_arg(args, unsigned int);
  248|      0|                    break;
  249|   424k|                case DP_C_LONG:
  ------------------
  |  |   72|   424k|#define DP_C_LONG       2
  ------------------
  |  Branch (249:17): [True: 424k, False: 5.58M]
  ------------------
  250|   424k|                    value = va_arg(args, unsigned long int);
  251|   424k|                    break;
  252|    504|                case DP_C_LLONG:
  ------------------
  |  |   74|    504|#define DP_C_LLONG      4
  ------------------
  |  Branch (252:17): [True: 504, False: 6.00M]
  ------------------
  253|    504|                    value = va_arg(args, uint64_t);
  254|    504|                    break;
  255|      0|                case DP_C_SIZE:
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  |  Branch (255:17): [True: 0, False: 6.00M]
  ------------------
  256|      0|                    value = va_arg(args, size_t);
  257|      0|                    break;
  258|  5.58M|                default:
  ------------------
  |  Branch (258:17): [True: 5.58M, False: 425k]
  ------------------
  259|  5.58M|                    value = va_arg(args, unsigned int);
  260|  5.58M|                    break;
  261|  6.00M|                }
  262|  6.00M|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value,
  ------------------
  |  Branch (262:21): [True: 0, False: 6.00M]
  ------------------
  263|  6.00M|                            ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
  ------------------
  |  Branch (263:29): [True: 0, False: 6.00M]
  |  Branch (263:46): [True: 380k, False: 5.62M]
  ------------------
  264|  6.00M|                            min, max, flags))
  265|      0|                    return 0;
  266|  6.00M|                break;
  267|  6.00M|#ifndef OPENSSL_SYS_UEFI
  268|  6.00M|            case 'f':
  ------------------
  |  Branch (268:13): [True: 0, False: 21.9M]
  ------------------
  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: 21.9M]
  ------------------
  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: 21.9M]
  ------------------
  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: 21.9M]
  ------------------
  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: 21.9M]
  ------------------
  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|  3.96M|            case 'c':
  ------------------
  |  Branch (311:13): [True: 3.96M, False: 17.9M]
  ------------------
  312|  3.96M|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen,
  ------------------
  |  Branch (312:21): [True: 0, False: 3.96M]
  ------------------
  313|  3.96M|                                 va_arg(args, int)))
  314|      0|                    return 0;
  315|  3.96M|                break;
  316|  6.44M|            case 's':
  ------------------
  |  Branch (316:13): [True: 6.44M, False: 15.4M]
  ------------------
  317|  6.44M|                strvalue = va_arg(args, char *);
  318|  6.44M|                if (max < 0) {
  ------------------
  |  Branch (318:21): [True: 6.44M, False: 1.69k]
  ------------------
  319|  6.44M|                    if (buffer)
  ------------------
  |  Branch (319:25): [True: 4.90M, False: 1.53M]
  ------------------
  320|  4.90M|                        max = INT_MAX;
  321|  1.53M|                    else
  322|  1.53M|                        max = *maxlen;
  323|  6.44M|                }
  324|  6.44M|                if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
  ------------------
  |  Branch (324:21): [True: 0, False: 6.44M]
  ------------------
  325|  6.44M|                            flags, min, max))
  326|      0|                    return 0;
  327|  6.44M|                break;
  328|  6.44M|            case 'p':
  ------------------
  |  Branch (328:13): [True: 0, False: 21.9M]
  ------------------
  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: 21.9M]
  ------------------
  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: 21.9M]
  ------------------
  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: 21.9M]
  ------------------
  346|       |                /* not supported yet, treat as next char */
  347|      0|                format++;
  348|      0|                break;
  349|      0|            default:
  ------------------
  |  Branch (349:13): [True: 0, False: 21.9M]
  ------------------
  350|       |                /* unknown, skip */
  351|      0|                break;
  352|  21.9M|            }
  353|  21.9M|            ch = *format++;
  354|  21.9M|            state = DP_S_DEFAULT;
  ------------------
  |  |   45|  21.9M|#define DP_S_DEFAULT    0
  ------------------
  355|  21.9M|            flags = cflags = min = 0;
  356|  21.9M|            max = -1;
  357|  21.9M|            break;
  358|  12.0M|        case DP_S_DONE:
  ------------------
  |  |   52|  12.0M|#define DP_S_DONE       7
  ------------------
  |  Branch (358:9): [True: 12.0M, False: 173M]
  ------------------
  359|  12.0M|            break;
  360|      0|        default:
  ------------------
  |  Branch (360:9): [True: 0, False: 185M]
  ------------------
  361|      0|            break;
  362|   185M|        }
  363|   185M|    }
  364|       |    /*
  365|       |     * We have to truncate if there is no dynamic buffer and we have filled the
  366|       |     * static buffer.
  367|       |     */
  368|  12.0M|    if (buffer == NULL) {
  ------------------
  |  Branch (368:9): [True: 3.76M, False: 8.24M]
  ------------------
  369|  3.76M|        *truncated = (currlen > *maxlen - 1);
  370|  3.76M|        if (*truncated)
  ------------------
  |  Branch (370:13): [True: 0, False: 3.76M]
  ------------------
  371|      0|            currlen = *maxlen - 1;
  372|  3.76M|    }
  373|  12.0M|    if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
  ------------------
  |  Branch (373:9): [True: 0, False: 12.0M]
  ------------------
  374|      0|        return 0;
  375|  12.0M|    *retlen = currlen - 1;
  376|  12.0M|    return 1;
  377|  12.0M|}
bio_print.c:doapr_outch:
  833|   114M|{
  834|       |    /* If we haven't at least one buffer, someone has done a big booboo */
  835|   114M|    if (!ossl_assert(*sbuffer != NULL || buffer != NULL))
  ------------------
  |  |   52|   119M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 110M, False: 4.25M]
  |  |  |  Branch (52:43): [True: 4.25M, False: 0]
  |  |  ------------------
  |  |   53|   114M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (835:9): [True: 0, False: 114M]
  ------------------
  836|      0|        return 0;
  837|       |
  838|       |    /* |currlen| must always be <= |*maxlen| */
  839|   114M|    if (!ossl_assert(*currlen <= *maxlen))
  ------------------
  |  |   52|   114M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   114M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (839:9): [True: 0, False: 114M]
  ------------------
  840|      0|        return 0;
  841|       |
  842|   114M|    if (buffer && *currlen == *maxlen) {
  ------------------
  |  Branch (842:9): [True: 60.8M, False: 53.9M]
  |  Branch (842:19): [True: 4.18k, False: 60.8M]
  ------------------
  843|  4.18k|        if (*maxlen > INT_MAX - BUFFER_INC)
  ------------------
  |  |  828|  4.18k|#define BUFFER_INC  1024
  ------------------
  |  Branch (843:13): [True: 0, False: 4.18k]
  ------------------
  844|      0|            return 0;
  845|       |
  846|  4.18k|        *maxlen += BUFFER_INC;
  ------------------
  |  |  828|  4.18k|#define BUFFER_INC  1024
  ------------------
  847|  4.18k|        if (*buffer == NULL) {
  ------------------
  |  Branch (847:13): [True: 36, False: 4.14k]
  ------------------
  848|     36|            if ((*buffer = OPENSSL_malloc(*maxlen)) == NULL)
  ------------------
  |  |  102|     36|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     36|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     36|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (848:17): [True: 0, False: 36]
  ------------------
  849|      0|                return 0;
  850|     36|            if (*currlen > 0) {
  ------------------
  |  Branch (850:17): [True: 36, False: 0]
  ------------------
  851|     36|                if (!ossl_assert(*sbuffer != NULL))
  ------------------
  |  |   52|     36|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     36|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (851:21): [True: 0, False: 36]
  ------------------
  852|      0|                    return 0;
  853|     36|                memcpy(*buffer, *sbuffer, *currlen);
  854|     36|            }
  855|     36|            *sbuffer = NULL;
  856|  4.14k|        } else {
  857|  4.14k|            char *tmpbuf;
  858|       |
  859|  4.14k|            tmpbuf = OPENSSL_realloc(*buffer, *maxlen);
  ------------------
  |  |  109|  4.14k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.14k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.14k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  860|  4.14k|            if (tmpbuf == NULL)
  ------------------
  |  Branch (860:17): [True: 0, False: 4.14k]
  ------------------
  861|      0|                return 0;
  862|  4.14k|            *buffer = tmpbuf;
  863|  4.14k|        }
  864|  4.18k|    }
  865|       |
  866|   114M|    if (*currlen < *maxlen) {
  ------------------
  |  Branch (866:9): [True: 114M, False: 0]
  ------------------
  867|   114M|        if (*sbuffer)
  ------------------
  |  Branch (867:13): [True: 110M, False: 4.25M]
  ------------------
  868|   110M|            (*sbuffer)[(*currlen)++] = (char)c;
  869|  4.25M|        else
  870|  4.25M|            (*buffer)[(*currlen)++] = (char)c;
  871|   114M|    }
  872|       |
  873|   114M|    return 1;
  874|   114M|}
bio_print.c:fmtint:
  436|  11.4M|{
  437|  11.4M|    int signvalue = 0;
  438|  11.4M|    const char *prefix = "";
  439|  11.4M|    uint64_t uvalue;
  440|  11.4M|    char convert[DECIMAL_SIZE(value) + 3];
  441|  11.4M|    int place = 0;
  442|  11.4M|    int spadlen = 0;
  443|  11.4M|    int zpadlen = 0;
  444|  11.4M|    int caps = 0;
  445|       |
  446|  11.4M|    if (max < 0)
  ------------------
  |  Branch (446:9): [True: 11.4M, False: 0]
  ------------------
  447|  11.4M|        max = 0;
  448|  11.4M|    uvalue = value;
  449|  11.4M|    if (!(flags & DP_F_UNSIGNED)) {
  ------------------
  |  |   68|  11.4M|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  |  Branch (449:9): [True: 5.48M, False: 6.00M]
  ------------------
  450|  5.48M|        if (value < 0) {
  ------------------
  |  Branch (450:13): [True: 1.90k, False: 5.48M]
  ------------------
  451|  1.90k|            signvalue = '-';
  452|  1.90k|            uvalue = 0 - (uint64_t)value;
  453|  5.48M|        } else if (flags & DP_F_PLUS)
  ------------------
  |  |   58|  5.48M|#define DP_F_PLUS       (1 << 1)
  ------------------
  |  Branch (453:20): [True: 0, False: 5.48M]
  ------------------
  454|      0|            signvalue = '+';
  455|  5.48M|        else if (flags & DP_F_SPACE)
  ------------------
  |  |   60|  5.48M|#define DP_F_SPACE      (1 << 2)
  ------------------
  |  Branch (455:18): [True: 0, False: 5.48M]
  ------------------
  456|      0|            signvalue = ' ';
  457|  5.48M|    }
  458|  11.4M|    if (flags & DP_F_NUM) {
  ------------------
  |  |   62|  11.4M|#define DP_F_NUM        (1 << 3)
  ------------------
  |  Branch (458:9): [True: 0, False: 11.4M]
  ------------------
  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|  11.4M|    if (flags & DP_F_UP)
  ------------------
  |  |   66|  11.4M|#define DP_F_UP         (1 << 5)
  ------------------
  |  Branch (464:9): [True: 3.68M, False: 7.81M]
  ------------------
  465|  3.68M|        caps = 1;
  466|  19.0M|    do {
  467|  19.0M|        convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
  ------------------
  |  Branch (467:29): [True: 5.61M, False: 13.4M]
  ------------------
  468|  19.0M|            [uvalue % (unsigned)base];
  469|  19.0M|        uvalue = (uvalue / (unsigned)base);
  470|  19.0M|    } while (uvalue && (place < (int)sizeof(convert)));
  ------------------
  |  Branch (470:14): [True: 7.54M, False: 11.4M]
  |  Branch (470:24): [True: 7.54M, False: 0]
  ------------------
  471|  11.4M|    if (place == sizeof(convert))
  ------------------
  |  Branch (471:9): [True: 0, False: 11.4M]
  ------------------
  472|      0|        place--;
  473|  11.4M|    convert[place] = 0;
  474|       |
  475|  11.4M|    zpadlen = max - place;
  476|  11.4M|    spadlen =
  477|  11.4M|        min - OSSL_MAX(max, place) - (signvalue ? 1 : 0) - strlen(prefix);
  ------------------
  |  |   84|  11.4M|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 11.4M]
  |  |  ------------------
  ------------------
  |  Branch (477:39): [True: 1.90k, False: 11.4M]
  ------------------
  478|  11.4M|    if (zpadlen < 0)
  ------------------
  |  Branch (478:9): [True: 11.4M, False: 0]
  ------------------
  479|  11.4M|        zpadlen = 0;
  480|  11.4M|    if (spadlen < 0)
  ------------------
  |  Branch (480:9): [True: 2.09M, False: 9.40M]
  ------------------
  481|  2.09M|        spadlen = 0;
  482|  11.4M|    if (flags & DP_F_ZERO) {
  ------------------
  |  |   64|  11.4M|#define DP_F_ZERO       (1 << 4)
  ------------------
  |  Branch (482:9): [True: 5.59M, False: 5.90M]
  ------------------
  483|  5.59M|        zpadlen = OSSL_MAX(zpadlen, spadlen);
  ------------------
  |  |   84|  5.59M|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 3.28M, False: 2.30M]
  |  |  ------------------
  ------------------
  484|  5.59M|        spadlen = 0;
  485|  5.59M|    }
  486|  11.4M|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  11.4M|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (486:9): [True: 1.36M, False: 10.1M]
  ------------------
  487|  1.36M|        spadlen = -spadlen;
  488|       |
  489|       |    /* spaces */
  490|  17.5M|    while (spadlen > 0) {
  ------------------
  |  Branch (490:12): [True: 6.02M, False: 11.4M]
  ------------------
  491|  6.02M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (491:13): [True: 0, False: 6.02M]
  ------------------
  492|      0|            return 0;
  493|  6.02M|        --spadlen;
  494|  6.02M|    }
  495|       |
  496|       |    /* sign */
  497|  11.4M|    if (signvalue)
  ------------------
  |  Branch (497:9): [True: 1.90k, False: 11.4M]
  ------------------
  498|  1.90k|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
  ------------------
  |  Branch (498:13): [True: 0, False: 1.90k]
  ------------------
  499|      0|            return 0;
  500|       |
  501|       |    /* prefix */
  502|  11.4M|    while (*prefix) {
  ------------------
  |  Branch (502:12): [True: 0, False: 11.4M]
  ------------------
  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|  11.4M|    if (zpadlen > 0) {
  ------------------
  |  Branch (509:9): [True: 2.30M, False: 9.19M]
  ------------------
  510|  4.63M|        while (zpadlen > 0) {
  ------------------
  |  Branch (510:16): [True: 2.32M, False: 2.30M]
  ------------------
  511|  2.32M|            if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
  ------------------
  |  Branch (511:17): [True: 0, False: 2.32M]
  ------------------
  512|      0|                return 0;
  513|  2.32M|            --zpadlen;
  514|  2.32M|        }
  515|  2.30M|    }
  516|       |    /* digits */
  517|  30.5M|    while (place > 0) {
  ------------------
  |  Branch (517:12): [True: 19.0M, False: 11.4M]
  ------------------
  518|  19.0M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]))
  ------------------
  |  Branch (518:13): [True: 0, False: 19.0M]
  ------------------
  519|      0|            return 0;
  520|  19.0M|    }
  521|       |
  522|       |    /* left justified spaces */
  523|  12.8M|    while (spadlen < 0) {
  ------------------
  |  Branch (523:12): [True: 1.31M, False: 11.4M]
  ------------------
  524|  1.31M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (524:13): [True: 0, False: 1.31M]
  ------------------
  525|      0|            return 0;
  526|  1.31M|        ++spadlen;
  527|  1.31M|    }
  528|  11.4M|    return 1;
  529|  11.4M|}
bio_print.c:fmtstr:
  384|  6.44M|{
  385|  6.44M|    int padlen;
  386|  6.44M|    size_t strln;
  387|  6.44M|    int cnt = 0;
  388|       |
  389|  6.44M|    if (value == 0)
  ------------------
  |  Branch (389:9): [True: 739, False: 6.44M]
  ------------------
  390|    739|        value = "<NULL>";
  391|       |
  392|  6.44M|    strln = OPENSSL_strnlen(value, max < 0 ? SIZE_MAX : (size_t)max);
  ------------------
  |  Branch (392:36): [True: 0, False: 6.44M]
  ------------------
  393|       |
  394|  6.44M|    padlen = min - strln;
  395|  6.44M|    if (min < 0 || padlen < 0)
  ------------------
  |  Branch (395:9): [True: 0, False: 6.44M]
  |  Branch (395:20): [True: 3.00M, False: 3.43M]
  ------------------
  396|  3.00M|        padlen = 0;
  397|  6.44M|    if (max >= 0) {
  ------------------
  |  Branch (397:9): [True: 6.44M, False: 0]
  ------------------
  398|       |        /*
  399|       |         * Calculate the maximum output including padding.
  400|       |         * Make sure max doesn't overflow into negativity
  401|       |         */
  402|  6.44M|        if (max < INT_MAX - padlen)
  ------------------
  |  Branch (402:13): [True: 1.53M, False: 4.90M]
  ------------------
  403|  1.53M|            max += padlen;
  404|  4.90M|        else
  405|  4.90M|            max = INT_MAX;
  406|  6.44M|    }
  407|  6.44M|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  6.44M|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (407:9): [True: 1.36M, False: 5.07M]
  ------------------
  408|  1.36M|        padlen = -padlen;
  409|       |
  410|  13.3M|    while ((padlen > 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (410:12): [True: 6.88M, False: 6.44M]
  |  Branch (410:29): [True: 0, False: 6.88M]
  |  Branch (410:40): [True: 6.88M, False: 0]
  ------------------
  411|  6.88M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (411:13): [True: 0, False: 6.88M]
  ------------------
  412|      0|            return 0;
  413|  6.88M|        --padlen;
  414|  6.88M|        ++cnt;
  415|  6.88M|    }
  416|  33.6M|    while (strln > 0 && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (416:12): [True: 27.1M, False: 6.44M]
  |  Branch (416:26): [True: 0, False: 27.1M]
  |  Branch (416:37): [True: 27.1M, False: 0]
  ------------------
  417|  27.1M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
  ------------------
  |  Branch (417:13): [True: 0, False: 27.1M]
  ------------------
  418|      0|            return 0;
  419|  27.1M|        --strln;
  420|  27.1M|        ++cnt;
  421|  27.1M|    }
  422|  20.9M|    while ((padlen < 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (422:12): [True: 14.5M, False: 6.44M]
  |  Branch (422:29): [True: 0, False: 14.5M]
  |  Branch (422:40): [True: 14.5M, False: 0]
  ------------------
  423|  14.5M|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
  ------------------
  |  Branch (423:13): [True: 0, False: 14.5M]
  ------------------
  424|      0|            return 0;
  425|  14.5M|        ++padlen;
  426|  14.5M|        ++cnt;
  427|  14.5M|    }
  428|  6.44M|    return 1;
  429|  6.44M|}

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|      4|{
   32|      4|    return OPENSSL_zalloc(sizeof(BIO_CORE_GLOBALS));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      4|}

BIO_new_file:
   58|      2|{
   59|      2|    BIO  *ret;
   60|      2|    FILE *file = openssl_fopen(filename, mode);
   61|      2|    int fp_flags = BIO_CLOSE;
  ------------------
  |  |   83|      2|# define BIO_CLOSE               0x01
  ------------------
   62|       |
   63|      2|    if (strchr(mode, 'b') == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 2]
  ------------------
   64|      0|        fp_flags |= BIO_FP_TEXT;
  ------------------
  |  |  217|      0|# define BIO_FP_TEXT             0x10
  ------------------
   65|       |
   66|      2|    if (file == NULL) {
  ------------------
  |  Branch (66:9): [True: 2, False: 0]
  ------------------
   67|      2|        ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  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)
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   72|      2|# define ERR_LIB_SYS             2
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      2|# define get_last_sys_error()    errno
  ------------------
   68|      2|                       "calling fopen(%s, %s)",
   69|      2|                       filename, mode);
   70|      2|        if (errno == ENOENT
  ------------------
  |  Branch (70:13): [True: 2, False: 0]
  ------------------
   71|      2|#ifdef ENXIO
   72|      2|            || errno == ENXIO
  ------------------
  |  Branch (72:16): [True: 0, False: 0]
  ------------------
   73|      2|#endif
   74|      2|            )
   75|      2|            ERR_raise(ERR_LIB_BIO, BIO_R_NO_SUCH_FILE);
  ------------------
  |  |  401|      2|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      2|    (ERR_new(),                                                 \
  |  |  |  |  404|      2|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  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)
  |  |  ------------------
  ------------------
   76|      0|        else
   77|      2|            ERR_raise(ERR_LIB_BIO, ERR_R_SYS_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|      2|        return NULL;
   79|      2|    }
   80|      0|    if ((ret = BIO_new(BIO_s_file())) == NULL) {
  ------------------
  |  Branch (80:9): [True: 0, False: 0]
  ------------------
   81|      0|        fclose(file);
   82|      0|        return NULL;
   83|      0|    }
   84|       |
   85|       |    /* we did fopen -> we disengage UPLINK */
   86|      0|    BIO_clear_flags(ret, BIO_FLAGS_UPLINK_INTERNAL);
  ------------------
  |  |   18|      0|#  define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
   87|      0|    BIO_set_fp(ret, file, fp_flags);
  ------------------
  |  |  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|  18.7k|{
   74|  18.7k|    return &mem_method;
   75|  18.7k|}
BIO_new_mem_buf:
   83|  17.0k|{
   84|  17.0k|    BIO *ret;
   85|  17.0k|    BUF_MEM *b;
   86|  17.0k|    BIO_BUF_MEM *bb;
   87|  17.0k|    size_t sz;
   88|       |
   89|  17.0k|    if (buf == NULL) {
  ------------------
  |  Branch (89:9): [True: 0, False: 17.0k]
  ------------------
   90|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|  17.0k|    sz = (len < 0) ? strlen(buf) : (size_t)len;
  ------------------
  |  Branch (93:10): [True: 0, False: 17.0k]
  ------------------
   94|  17.0k|    if ((ret = BIO_new(BIO_s_mem())) == NULL)
  ------------------
  |  Branch (94:9): [True: 0, False: 17.0k]
  ------------------
   95|      0|        return NULL;
   96|  17.0k|    bb = (BIO_BUF_MEM *)ret->ptr;
   97|  17.0k|    b = bb->buf;
   98|       |    /* Cast away const and trust in the MEM_RDONLY flag. */
   99|  17.0k|    b->data = (void *)buf;
  100|  17.0k|    b->length = sz;
  101|  17.0k|    b->max = sz;
  102|  17.0k|    *bb->readp = *bb->buf;
  103|  17.0k|    ret->flags |= BIO_FLAGS_MEM_RDONLY;
  ------------------
  |  |  236|  17.0k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  104|       |    /* Since this is static data retrying won't help */
  105|  17.0k|    ret->num = 0;
  106|  17.0k|    return ret;
  107|  17.0k|}
bss_mem.c:mem_write:
  215|  1.50k|{
  216|  1.50k|    int ret = -1;
  217|  1.50k|    int blen;
  218|  1.50k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  219|       |
  220|  1.50k|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  236|  1.50k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (220:9): [True: 0, False: 1.50k]
  ------------------
  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|  1.50k|    BIO_clear_retry_flags(b);
  ------------------
  |  |  260|  1.50k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  222|  1.50k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|  1.50k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|  1.50k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  221|  1.50k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|  1.50k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  225|  1.50k|    if (inl == 0)
  ------------------
  |  Branch (225:9): [True: 0, False: 1.50k]
  ------------------
  226|      0|        return 0;
  227|  1.50k|    if (in == NULL) {
  ------------------
  |  Branch (227:9): [True: 0, False: 1.50k]
  ------------------
  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|  1.50k|    blen = bbm->readp->length;
  232|  1.50k|    mem_buf_sync(b);
  233|  1.50k|    if (BUF_MEM_grow_clean(bbm->buf, blen + inl) == 0)
  ------------------
  |  Branch (233:9): [True: 0, False: 1.50k]
  ------------------
  234|      0|        goto end;
  235|  1.50k|    memcpy(bbm->buf->data + blen, in, inl);
  236|  1.50k|    *bbm->readp = *bbm->buf;
  237|  1.50k|    ret = inl;
  238|  1.50k| end:
  239|  1.50k|    return ret;
  240|  1.50k|}
bss_mem.c:mem_buf_sync:
  178|  3.00k|{
  179|  3.00k|    if (b != NULL && b->init != 0 && b->ptr != NULL) {
  ------------------
  |  Branch (179:9): [True: 3.00k, False: 0]
  |  Branch (179:22): [True: 3.00k, False: 0]
  |  Branch (179:38): [True: 3.00k, False: 0]
  ------------------
  180|  3.00k|        BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  181|       |
  182|  3.00k|        if (bbm->readp->data != bbm->buf->data) {
  ------------------
  |  Branch (182:13): [True: 0, False: 3.00k]
  ------------------
  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|  3.00k|    }
  188|  3.00k|    return 0;
  189|  3.00k|}
bss_mem.c:mem_read:
  192|   150M|{
  193|   150M|    int ret = -1;
  194|   150M|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  195|   150M|    BUF_MEM *bm = bbm->readp;
  196|       |
  197|   150M|    if (b->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  236|   150M|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (197:9): [True: 150M, False: 0]
  ------------------
  198|   150M|        bm = bbm->buf;
  199|   150M|    BIO_clear_retry_flags(b);
  ------------------
  |  |  260|   150M|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  222|   150M|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|   150M|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|   150M|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  221|   150M|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|   150M|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  200|   150M|    ret = (outl >= 0 && (size_t)outl > bm->length) ? (int)bm->length : outl;
  ------------------
  |  Branch (200:12): [True: 150M, False: 0]
  |  Branch (200:25): [True: 328k, False: 150M]
  ------------------
  201|   150M|    if ((out != NULL) && (ret > 0)) {
  ------------------
  |  Branch (201:9): [True: 150M, False: 0]
  |  Branch (201:26): [True: 150M, False: 241k]
  ------------------
  202|   150M|        memcpy(out, bm->data, ret);
  203|   150M|        bm->length -= ret;
  204|   150M|        bm->max -= ret;
  205|   150M|        bm->data += ret;
  206|   150M|    } else if (bm->length == 0) {
  ------------------
  |  Branch (206:16): [True: 241k, False: 0]
  ------------------
  207|   241k|        ret = b->num;
  208|   241k|        if (ret != 0)
  ------------------
  |  Branch (208:13): [True: 0, False: 241k]
  ------------------
  209|      0|            BIO_set_retry_read(b);
  ------------------
  |  |  254|      0|                BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  219|      0|# define BIO_FLAGS_READ          0x01
  |  |  ------------------
  |  |                               BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|      0|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  210|   241k|    }
  211|   150M|    return ret;
  212|   150M|}
bss_mem.c:mem_ctrl:
  243|   413k|{
  244|   413k|    long ret = 1;
  245|   413k|    char **pptr;
  246|   413k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  247|   413k|    BUF_MEM *bm, *bo;            /* bio_mem, bio_other */
  248|   413k|    long off, remain;
  249|       |
  250|   413k|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  236|   413k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (250:9): [True: 411k, False: 1.50k]
  ------------------
  251|   411k|        bm = bbm->buf;
  252|   411k|        bo = bbm->readp;
  253|   411k|    } else {
  254|  1.50k|        bm = bbm->readp;
  255|  1.50k|        bo = bbm->buf;
  256|  1.50k|    }
  257|   413k|    off = (bm->data == bo->data) ? 0 : bm->data - bo->data;
  ------------------
  |  Branch (257:11): [True: 232k, False: 181k]
  ------------------
  258|   413k|    remain = bm->length;
  259|       |
  260|   413k|    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: 413k]
  ------------------
  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|   192k|    case BIO_C_FILE_SEEK:
  ------------------
  |  |  458|   192k|# define BIO_C_FILE_SEEK                         128
  ------------------
  |  Branch (276:5): [True: 192k, False: 221k]
  ------------------
  277|   192k|        if (num < 0 || num > off + remain)
  ------------------
  |  Branch (277:13): [True: 0, False: 192k]
  |  Branch (277:24): [True: 0, False: 192k]
  ------------------
  278|      0|            return -1;   /* Can't see outside of the current buffer */
  279|       |
  280|   192k|        bm->data = (num != 0) ? bo->data + num : bo->data;
  ------------------
  |  Branch (280:20): [True: 0, False: 192k]
  ------------------
  281|   192k|        bm->length = bo->length - num;
  282|   192k|        bm->max = bo->max - num;
  283|   192k|        off = num;
  284|       |        /* FALLTHRU */
  285|   410k|    case BIO_C_FILE_TELL:
  ------------------
  |  |  464|   410k|# define BIO_C_FILE_TELL                         133
  ------------------
  |  Branch (285:5): [True: 217k, False: 195k]
  ------------------
  286|   410k|        ret = off;
  287|   410k|        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: 413k]
  ------------------
  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: 413k]
  ------------------
  292|      0|        b->num = (int)num;
  293|      0|        break;
  294|  1.90k|    case BIO_CTRL_INFO:
  ------------------
  |  |   90|  1.90k|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  ------------------
  |  Branch (294:5): [True: 1.90k, False: 411k]
  ------------------
  295|  1.90k|        ret = (long)bm->length;
  296|  1.90k|        if (ptr != NULL) {
  ------------------
  |  Branch (296:13): [True: 1.90k, False: 0]
  ------------------
  297|  1.90k|            pptr = (char **)ptr;
  298|  1.90k|            *pptr = (char *)(bm->data);
  299|  1.90k|        }
  300|  1.90k|        break;
  301|      0|    case BIO_C_SET_BUF_MEM:
  ------------------
  |  |  444|      0|# define BIO_C_SET_BUF_MEM                       114
  ------------------
  |  Branch (301:5): [True: 0, False: 413k]
  ------------------
  302|      0|        mem_buf_free(b);
  303|      0|        b->shutdown = (int)num;
  304|      0|        bbm->buf = ptr;
  305|      0|        *bbm->readp = *bbm->buf;
  306|      0|        break;
  307|  1.50k|    case BIO_C_GET_BUF_MEM_PTR:
  ------------------
  |  |  445|  1.50k|# define BIO_C_GET_BUF_MEM_PTR                   115
  ------------------
  |  Branch (307:5): [True: 1.50k, False: 411k]
  ------------------
  308|  1.50k|        if (ptr != NULL) {
  ------------------
  |  Branch (308:13): [True: 1.50k, False: 0]
  ------------------
  309|  1.50k|            if (!(b->flags & BIO_FLAGS_MEM_RDONLY))
  ------------------
  |  |  236|  1.50k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (309:17): [True: 1.50k, False: 0]
  ------------------
  310|  1.50k|                mem_buf_sync(b);
  311|  1.50k|            bm = bbm->buf;
  312|  1.50k|            pptr = (char **)ptr;
  313|  1.50k|            *pptr = (char *)bm;
  314|  1.50k|        }
  315|  1.50k|        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: 413k]
  ------------------
  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: 413k]
  ------------------
  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: 413k]
  ------------------
  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: 413k]
  ------------------
  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: 413k]
  ------------------
  329|      0|    case BIO_CTRL_FLUSH:
  ------------------
  |  |   98|      0|# define BIO_CTRL_FLUSH          11/* opt - 'flush' buffered output */
  ------------------
  |  Branch (329:5): [True: 0, False: 413k]
  ------------------
  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: 413k]
  ------------------
  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: 413k]
  ------------------
  334|      0|    default:
  ------------------
  |  Branch (334:5): [True: 0, False: 413k]
  ------------------
  335|      0|        ret = 0;
  336|      0|        break;
  337|   413k|    }
  338|   413k|    return ret;
  339|   413k|}
bss_mem.c:mem_buf_free:
  158|  18.7k|{
  159|  18.7k|    if (a == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 18.7k]
  ------------------
  160|      0|        return 0;
  161|       |
  162|  18.7k|    if (a->shutdown && a->init && a->ptr != NULL) {
  ------------------
  |  Branch (162:9): [True: 18.7k, False: 0]
  |  Branch (162:24): [True: 18.7k, False: 0]
  |  Branch (162:35): [True: 18.7k, False: 0]
  ------------------
  163|  18.7k|        BIO_BUF_MEM *bb = (BIO_BUF_MEM *)a->ptr;
  164|  18.7k|        BUF_MEM *b = bb->buf;
  165|       |
  166|  18.7k|        if (a->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  236|  18.7k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (166:13): [True: 17.0k, False: 1.77k]
  ------------------
  167|  17.0k|            b->data = NULL;
  168|  18.7k|        BUF_MEM_free(b);
  169|  18.7k|    }
  170|  18.7k|    return 1;
  171|  18.7k|}
bss_mem.c:mem_new:
  133|  18.7k|{
  134|  18.7k|    return mem_init(bi, 0L);
  135|  18.7k|}
bss_mem.c:mem_init:
  110|  18.7k|{
  111|  18.7k|    BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(*bb));
  ------------------
  |  |  104|  18.7k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  18.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  18.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|       |
  113|  18.7k|    if (bb == NULL)
  ------------------
  |  Branch (113:9): [True: 0, False: 18.7k]
  ------------------
  114|      0|        return 0;
  115|  18.7k|    if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL) {
  ------------------
  |  Branch (115:9): [True: 0, False: 18.7k]
  ------------------
  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|  18.7k|    if ((bb->readp = OPENSSL_zalloc(sizeof(*bb->readp))) == NULL) {
  ------------------
  |  |  104|  18.7k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  18.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  18.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 18.7k]
  ------------------
  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|  18.7k|    *bb->readp = *bb->buf;
  125|  18.7k|    bi->shutdown = 1;
  126|  18.7k|    bi->init = 1;
  127|  18.7k|    bi->num = -1;
  128|  18.7k|    bi->ptr = (char *)bb;
  129|  18.7k|    return 1;
  130|  18.7k|}
bss_mem.c:mem_free:
  143|  18.7k|{
  144|  18.7k|    BIO_BUF_MEM *bb;
  145|       |
  146|  18.7k|    if (a == NULL)
  ------------------
  |  Branch (146:9): [True: 0, False: 18.7k]
  ------------------
  147|      0|        return 0;
  148|       |
  149|  18.7k|    bb = (BIO_BUF_MEM *)a->ptr;
  150|  18.7k|    if (!mem_buf_free(a))
  ------------------
  |  Branch (150:9): [True: 0, False: 18.7k]
  ------------------
  151|      0|        return 0;
  152|  18.7k|    OPENSSL_free(bb->readp);
  ------------------
  |  |  115|  18.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  18.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  18.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  153|  18.7k|    OPENSSL_free(bb);
  ------------------
  |  |  115|  18.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  18.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  18.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|  18.7k|    return 1;
  155|  18.7k|}

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

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

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

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

BN_BLINDING_free:
   80|  84.9k|{
   81|  84.9k|    if (r == NULL)
  ------------------
  |  Branch (81:9): [True: 84.9k, False: 0]
  ------------------
   82|  84.9k|        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_bn2hex:
   18|  5.86k|{
   19|  5.86k|    int i, j, v, z = 0;
   20|  5.86k|    char *buf;
   21|  5.86k|    char *p;
   22|       |
   23|  5.86k|    if (BN_is_zero(a))
  ------------------
  |  Branch (23:9): [True: 16, False: 5.84k]
  ------------------
   24|     16|        return OPENSSL_strdup("0");
  ------------------
  |  |  119|     16|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   25|  5.84k|    buf = OPENSSL_malloc(a->top * BN_BYTES * 2 + 2);
  ------------------
  |  |  102|  5.84k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.84k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.84k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|  5.84k|    if (buf == NULL)
  ------------------
  |  Branch (26:9): [True: 0, False: 5.84k]
  ------------------
   27|      0|        goto err;
   28|  5.84k|    p = buf;
   29|  5.84k|    if (a->neg)
  ------------------
  |  Branch (29:9): [True: 602, False: 5.24k]
  ------------------
   30|    602|        *p++ = '-';
   31|   187k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (31:26): [True: 182k, False: 5.84k]
  ------------------
   32|  1.63M|        for (j = BN_BITS2 - 8; j >= 0; j -= 8) {
  ------------------
  |  |   54|   182k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   182k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (32:32): [True: 1.45M, False: 182k]
  ------------------
   33|       |            /* strip leading zeros */
   34|  1.45M|            v = (int)((a->d[i] >> j) & 0xff);
   35|  1.45M|            if (z || v != 0) {
  ------------------
  |  Branch (35:17): [True: 1.43M, False: 26.1k]
  |  Branch (35:22): [True: 5.84k, False: 20.2k]
  ------------------
   36|  1.43M|                *p++ = Hex[v >> 4];
   37|  1.43M|                *p++ = Hex[v & 0x0f];
   38|  1.43M|                z = 1;
   39|  1.43M|            }
   40|  1.45M|        }
   41|   182k|    }
   42|  5.84k|    *p = '\0';
   43|  5.84k| err:
   44|  5.84k|    return buf;
   45|  5.84k|}
BN_bn2dec:
   51|  18.8k|{
   52|  18.8k|    int i = 0, num, ok = 0, n, tbytes;
   53|  18.8k|    char *buf = NULL;
   54|  18.8k|    char *p;
   55|  18.8k|    BIGNUM *t = NULL;
   56|  18.8k|    BN_ULONG *bn_data = NULL, *lp;
  ------------------
  |  |   37|  18.8k|#  define BN_ULONG        unsigned long
  ------------------
   57|  18.8k|    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|  18.8k|    i = BN_num_bits(a) * 3;
   66|  18.8k|    num = (i / 10 + i / 1000 + 1) + 1;
   67|  18.8k|    tbytes = num + 3;   /* negative and terminator and one spare? */
   68|  18.8k|    bn_data_num = num / BN_DEC_NUM + 1;
  ------------------
  |  |   99|  18.8k|#  define BN_DEC_NUM      19
  ------------------
   69|  18.8k|    bn_data = OPENSSL_malloc(bn_data_num * sizeof(BN_ULONG));
  ------------------
  |  |  102|  18.8k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  18.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  18.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   70|  18.8k|    buf = OPENSSL_malloc(tbytes);
  ------------------
  |  |  102|  18.8k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  18.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  18.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   71|  18.8k|    if (buf == NULL || bn_data == NULL)
  ------------------
  |  Branch (71:9): [True: 0, False: 18.8k]
  |  Branch (71:24): [True: 0, False: 18.8k]
  ------------------
   72|      0|        goto err;
   73|  18.8k|    if ((t = BN_dup(a)) == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 18.8k]
  ------------------
   74|      0|        goto err;
   75|       |
   76|  18.8k|    p = buf;
   77|  18.8k|    lp = bn_data;
   78|  18.8k|    if (BN_is_zero(t)) {
  ------------------
  |  Branch (78:9): [True: 1.21k, False: 17.6k]
  ------------------
   79|  1.21k|        *p++ = '0';
   80|  1.21k|        *p++ = '\0';
   81|  17.6k|    } else {
   82|  17.6k|        if (BN_is_negative(t))
  ------------------
  |  Branch (82:13): [True: 4.25k, False: 13.3k]
  ------------------
   83|  4.25k|            *p++ = '-';
   84|       |
   85|  41.0k|        while (!BN_is_zero(t)) {
  ------------------
  |  Branch (85:16): [True: 23.4k, False: 17.6k]
  ------------------
   86|  23.4k|            if (lp - bn_data >= bn_data_num)
  ------------------
  |  Branch (86:17): [True: 0, False: 23.4k]
  ------------------
   87|      0|                goto err;
   88|  23.4k|            *lp = BN_div_word(t, BN_DEC_CONV);
  ------------------
  |  |   98|  23.4k|#  define BN_DEC_CONV     (10000000000000000000UL)
  ------------------
   89|  23.4k|            if (*lp == (BN_ULONG)-1)
  ------------------
  |  Branch (89:17): [True: 0, False: 23.4k]
  ------------------
   90|      0|                goto err;
   91|  23.4k|            lp++;
   92|  23.4k|        }
   93|  17.6k|        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|  17.6k|        n = BIO_snprintf(p, tbytes - (size_t)(p - buf), BN_DEC_FMT1, *lp);
  ------------------
  |  |  100|  17.6k|#  define BN_DEC_FMT1     "%lu"
  ------------------
  100|  17.6k|        if (n < 0)
  ------------------
  |  Branch (100:13): [True: 0, False: 17.6k]
  ------------------
  101|      0|            goto err;
  102|  17.6k|        p += n;
  103|  23.4k|        while (lp != bn_data) {
  ------------------
  |  Branch (103:16): [True: 5.75k, False: 17.6k]
  ------------------
  104|  5.75k|            lp--;
  105|  5.75k|            n = BIO_snprintf(p, tbytes - (size_t)(p - buf), BN_DEC_FMT2, *lp);
  ------------------
  |  |  101|  5.75k|#  define BN_DEC_FMT2     "%019lu"
  ------------------
  106|  5.75k|            if (n < 0)
  ------------------
  |  Branch (106:17): [True: 0, False: 5.75k]
  ------------------
  107|      0|                goto err;
  108|  5.75k|            p += n;
  109|  5.75k|        }
  110|  17.6k|    }
  111|  18.8k|    ok = 1;
  112|  18.8k| err:
  113|  18.8k|    OPENSSL_free(bn_data);
  ------------------
  |  |  115|  18.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  18.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  18.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  114|  18.8k|    BN_free(t);
  115|  18.8k|    if (ok)
  ------------------
  |  Branch (115:9): [True: 18.8k, False: 0]
  ------------------
  116|  18.8k|        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|  18.8k|}

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

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

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

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

int_bn_mod_inverse:
  201|  6.81k|{
  202|  6.81k|    BIGNUM *A, *B, *X, *Y, *M, *D, *T, *R = NULL;
  203|  6.81k|    BIGNUM *ret = NULL;
  204|  6.81k|    int sign;
  205|       |
  206|       |    /* This is invalid input so we don't worry about constant time here */
  207|  6.81k|    if (BN_abs_is_word(n, 1) || BN_is_zero(n)) {
  ------------------
  |  Branch (207:9): [True: 0, False: 6.81k]
  |  Branch (207:33): [True: 10, False: 6.80k]
  ------------------
  208|     10|        *pnoinv = 1;
  209|     10|        return NULL;
  210|     10|    }
  211|       |
  212|  6.80k|    *pnoinv = 0;
  213|       |
  214|  6.80k|    if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|  6.80k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (214:9): [True: 0, False: 6.80k]
  ------------------
  215|  6.80k|        || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
  ------------------
  |  |   67|  6.80k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (215:12): [True: 0, False: 6.80k]
  ------------------
  216|      0|        return bn_mod_inverse_no_branch(in, a, n, ctx, pnoinv);
  217|      0|    }
  218|       |
  219|  6.80k|    bn_check_top(a);
  220|  6.80k|    bn_check_top(n);
  221|       |
  222|  6.80k|    BN_CTX_start(ctx);
  223|  6.80k|    A = BN_CTX_get(ctx);
  224|  6.80k|    B = BN_CTX_get(ctx);
  225|  6.80k|    X = BN_CTX_get(ctx);
  226|  6.80k|    D = BN_CTX_get(ctx);
  227|  6.80k|    M = BN_CTX_get(ctx);
  228|  6.80k|    Y = BN_CTX_get(ctx);
  229|  6.80k|    T = BN_CTX_get(ctx);
  230|  6.80k|    if (T == NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 6.80k]
  ------------------
  231|      0|        goto err;
  232|       |
  233|  6.80k|    if (in == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 6.80k]
  ------------------
  234|      0|        R = BN_new();
  235|  6.80k|    else
  236|  6.80k|        R = in;
  237|  6.80k|    if (R == NULL)
  ------------------
  |  Branch (237:9): [True: 0, False: 6.80k]
  ------------------
  238|      0|        goto err;
  239|       |
  240|  6.80k|    if (!BN_one(X))
  ------------------
  |  |  197|  6.80k|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (240:9): [True: 0, False: 6.80k]
  ------------------
  241|      0|        goto err;
  242|  6.80k|    BN_zero(Y);
  ------------------
  |  |  202|  6.80k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  243|  6.80k|    if (BN_copy(B, a) == NULL)
  ------------------
  |  Branch (243:9): [True: 0, False: 6.80k]
  ------------------
  244|      0|        goto err;
  245|  6.80k|    if (BN_copy(A, n) == NULL)
  ------------------
  |  Branch (245:9): [True: 0, False: 6.80k]
  ------------------
  246|      0|        goto err;
  247|  6.80k|    A->neg = 0;
  248|  6.80k|    if (B->neg || (BN_ucmp(B, A) >= 0)) {
  ------------------
  |  Branch (248:9): [True: 0, False: 6.80k]
  |  Branch (248:19): [True: 6.80k, False: 0]
  ------------------
  249|  6.80k|        if (!BN_nnmod(B, B, A, ctx))
  ------------------
  |  Branch (249:13): [True: 0, False: 6.80k]
  ------------------
  250|      0|            goto err;
  251|  6.80k|    }
  252|  6.80k|    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|  6.80k|    if (BN_is_odd(n) && (BN_num_bits(n) <= 2048)) {
  ------------------
  |  Branch (261:9): [True: 6.62k, False: 183]
  |  Branch (261:25): [True: 6.62k, 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|  6.62k|        int shift;
  269|       |
  270|   365k|        while (!BN_is_zero(B)) {
  ------------------
  |  Branch (270:16): [True: 358k, False: 6.62k]
  ------------------
  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|   358k|            shift = 0;
  284|   528k|            while (!BN_is_bit_set(B, shift)) { /* note that 0 < B */
  ------------------
  |  Branch (284:20): [True: 169k, False: 358k]
  ------------------
  285|   169k|                shift++;
  286|       |
  287|   169k|                if (BN_is_odd(X)) {
  ------------------
  |  Branch (287:21): [True: 85.6k, False: 83.7k]
  ------------------
  288|  85.6k|                    if (!BN_uadd(X, X, n))
  ------------------
  |  Branch (288:25): [True: 0, False: 85.6k]
  ------------------
  289|      0|                        goto err;
  290|  85.6k|                }
  291|       |                /*
  292|       |                 * now X is even, so we can easily divide it by two
  293|       |                 */
  294|   169k|                if (!BN_rshift1(X, X))
  ------------------
  |  Branch (294:21): [True: 0, False: 169k]
  ------------------
  295|      0|                    goto err;
  296|   169k|            }
  297|   358k|            if (shift > 0) {
  ------------------
  |  Branch (297:17): [True: 154k, False: 204k]
  ------------------
  298|   154k|                if (!BN_rshift(B, B, shift))
  ------------------
  |  Branch (298:21): [True: 0, False: 154k]
  ------------------
  299|      0|                    goto err;
  300|   154k|            }
  301|       |
  302|       |            /*
  303|       |             * Same for A and Y.  Afterwards, (2) still holds.
  304|       |             */
  305|   358k|            shift = 0;
  306|   573k|            while (!BN_is_bit_set(A, shift)) { /* note that 0 < A */
  ------------------
  |  Branch (306:20): [True: 215k, False: 358k]
  ------------------
  307|   215k|                shift++;
  308|       |
  309|   215k|                if (BN_is_odd(Y)) {
  ------------------
  |  Branch (309:21): [True: 119k, False: 95.4k]
  ------------------
  310|   119k|                    if (!BN_uadd(Y, Y, n))
  ------------------
  |  Branch (310:25): [True: 0, False: 119k]
  ------------------
  311|      0|                        goto err;
  312|   119k|                }
  313|       |                /* now Y is even */
  314|   215k|                if (!BN_rshift1(Y, Y))
  ------------------
  |  Branch (314:21): [True: 0, False: 215k]
  ------------------
  315|      0|                    goto err;
  316|   215k|            }
  317|   358k|            if (shift > 0) {
  ------------------
  |  Branch (317:17): [True: 200k, False: 158k]
  ------------------
  318|   200k|                if (!BN_rshift(A, A, shift))
  ------------------
  |  Branch (318:21): [True: 0, False: 200k]
  ------------------
  319|      0|                    goto err;
  320|   200k|            }
  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|   358k|            if (BN_ucmp(B, A) >= 0) {
  ------------------
  |  Branch (334:17): [True: 158k, False: 200k]
  ------------------
  335|       |                /* -sign*(X + Y)*a == B - A  (mod |n|) */
  336|   158k|                if (!BN_uadd(X, X, Y))
  ------------------
  |  Branch (336:21): [True: 0, False: 158k]
  ------------------
  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|   158k|                if (!BN_usub(B, B, A))
  ------------------
  |  Branch (342:21): [True: 0, False: 158k]
  ------------------
  343|      0|                    goto err;
  344|   200k|            } else {
  345|       |                /*  sign*(X + Y)*a == A - B  (mod |n|) */
  346|   200k|                if (!BN_uadd(Y, Y, X))
  ------------------
  |  Branch (346:21): [True: 0, False: 200k]
  ------------------
  347|      0|                    goto err;
  348|       |                /*
  349|       |                 * as above, BN_mod_add_quick(Y, Y, X, n) would slow things down
  350|       |                 */
  351|   200k|                if (!BN_usub(A, A, B))
  ------------------
  |  Branch (351:21): [True: 0, False: 200k]
  ------------------
  352|      0|                    goto err;
  353|   200k|            }
  354|   358k|        }
  355|  6.62k|    } else {
  356|       |        /* general inversion algorithm */
  357|       |
  358|  3.18k|        while (!BN_is_zero(B)) {
  ------------------
  |  Branch (358:16): [True: 3.00k, False: 183]
  ------------------
  359|  3.00k|            BIGNUM *tmp;
  360|       |
  361|       |            /*-
  362|       |             *      0 < B < A,
  363|       |             * (*) -sign*X*a  ==  B   (mod |n|),
  364|       |             *      sign*Y*a  ==  A   (mod |n|)
  365|       |             */
  366|       |
  367|       |            /* (D, M) := (A/B, A%B) ... */
  368|  3.00k|            if (BN_num_bits(A) == BN_num_bits(B)) {
  ------------------
  |  Branch (368:17): [True: 557, False: 2.44k]
  ------------------
  369|    557|                if (!BN_one(D))
  ------------------
  |  |  197|    557|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (369:21): [True: 0, False: 557]
  ------------------
  370|      0|                    goto err;
  371|    557|                if (!BN_sub(M, A, B))
  ------------------
  |  Branch (371:21): [True: 0, False: 557]
  ------------------
  372|      0|                    goto err;
  373|  2.44k|            } else if (BN_num_bits(A) == BN_num_bits(B) + 1) {
  ------------------
  |  Branch (373:24): [True: 1.15k, False: 1.29k]
  ------------------
  374|       |                /* A/B is 1, 2, or 3 */
  375|  1.15k|                if (!BN_lshift1(T, B))
  ------------------
  |  Branch (375:21): [True: 0, False: 1.15k]
  ------------------
  376|      0|                    goto err;
  377|  1.15k|                if (BN_ucmp(A, T) < 0) {
  ------------------
  |  Branch (377:21): [True: 701, False: 451]
  ------------------
  378|       |                    /* A < 2*B, so D=1 */
  379|    701|                    if (!BN_one(D))
  ------------------
  |  |  197|    701|# define BN_one(a)       (BN_set_word((a),1))
  ------------------
  |  Branch (379:25): [True: 0, False: 701]
  ------------------
  380|      0|                        goto err;
  381|    701|                    if (!BN_sub(M, A, B))
  ------------------
  |  Branch (381:25): [True: 0, False: 701]
  ------------------
  382|      0|                        goto err;
  383|    701|                } else {
  384|       |                    /* A >= 2*B, so D=2 or D=3 */
  385|    451|                    if (!BN_sub(M, A, T))
  ------------------
  |  Branch (385:25): [True: 0, False: 451]
  ------------------
  386|      0|                        goto err;
  387|    451|                    if (!BN_add(D, T, B))
  ------------------
  |  Branch (387:25): [True: 0, False: 451]
  ------------------
  388|      0|                        goto err; /* use D (:= 3*B) as temp */
  389|    451|                    if (BN_ucmp(A, D) < 0) {
  ------------------
  |  Branch (389:25): [True: 332, False: 119]
  ------------------
  390|       |                        /* A < 3*B, so D=2 */
  391|    332|                        if (!BN_set_word(D, 2))
  ------------------
  |  Branch (391:29): [True: 0, False: 332]
  ------------------
  392|      0|                            goto err;
  393|       |                        /*
  394|       |                         * M (= A - 2*B) already has the correct value
  395|       |                         */
  396|    332|                    } else {
  397|       |                        /* only D=3 remains */
  398|    119|                        if (!BN_set_word(D, 3))
  ------------------
  |  Branch (398:29): [True: 0, False: 119]
  ------------------
  399|      0|                            goto err;
  400|       |                        /*
  401|       |                         * currently M = A - 2*B, but we need M = A - 3*B
  402|       |                         */
  403|    119|                        if (!BN_sub(M, M, B))
  ------------------
  |  Branch (403:29): [True: 0, False: 119]
  ------------------
  404|      0|                            goto err;
  405|    119|                    }
  406|    451|                }
  407|  1.29k|            } else {
  408|  1.29k|                if (!BN_div(D, M, A, B, ctx))
  ------------------
  |  Branch (408:21): [True: 0, False: 1.29k]
  ------------------
  409|      0|                    goto err;
  410|  1.29k|            }
  411|       |
  412|       |            /*-
  413|       |             * Now
  414|       |             *      A = D*B + M;
  415|       |             * thus we have
  416|       |             * (**)  sign*Y*a  ==  D*B + M   (mod |n|).
  417|       |             */
  418|       |
  419|  3.00k|            tmp = A;    /* keep the BIGNUM object, the value does not matter */
  420|       |
  421|       |            /* (A, B) := (B, A mod B) ... */
  422|  3.00k|            A = B;
  423|  3.00k|            B = M;
  424|       |            /* ... so we have  0 <= B < A  again */
  425|       |
  426|       |            /*-
  427|       |             * Since the former  M  is now  B  and the former  B  is now  A,
  428|       |             * (**) translates into
  429|       |             *       sign*Y*a  ==  D*A + B    (mod |n|),
  430|       |             * i.e.
  431|       |             *       sign*Y*a - D*A  ==  B    (mod |n|).
  432|       |             * Similarly, (*) translates into
  433|       |             *      -sign*X*a  ==  A          (mod |n|).
  434|       |             *
  435|       |             * Thus,
  436|       |             *   sign*Y*a + D*sign*X*a  ==  B  (mod |n|),
  437|       |             * i.e.
  438|       |             *        sign*(Y + D*X)*a  ==  B  (mod |n|).
  439|       |             *
  440|       |             * So if we set  (X, Y, sign) := (Y + D*X, X, -sign), we arrive back at
  441|       |             *      -sign*X*a  ==  B   (mod |n|),
  442|       |             *       sign*Y*a  ==  A   (mod |n|).
  443|       |             * Note that  X  and  Y  stay non-negative all the time.
  444|       |             */
  445|       |
  446|       |            /*
  447|       |             * most of the time D is very small, so we can optimize tmp := D*X+Y
  448|       |             */
  449|  3.00k|            if (BN_is_one(D)) {
  ------------------
  |  Branch (449:17): [True: 1.25k, False: 1.74k]
  ------------------
  450|  1.25k|                if (!BN_add(tmp, X, Y))
  ------------------
  |  Branch (450:21): [True: 0, False: 1.25k]
  ------------------
  451|      0|                    goto err;
  452|  1.74k|            } else {
  453|  1.74k|                if (BN_is_word(D, 2)) {
  ------------------
  |  Branch (453:21): [True: 458, False: 1.29k]
  ------------------
  454|    458|                    if (!BN_lshift1(tmp, X))
  ------------------
  |  Branch (454:25): [True: 0, False: 458]
  ------------------
  455|      0|                        goto err;
  456|  1.29k|                } else if (BN_is_word(D, 4)) {
  ------------------
  |  Branch (456:28): [True: 208, False: 1.08k]
  ------------------
  457|    208|                    if (!BN_lshift(tmp, X, 2))
  ------------------
  |  Branch (457:25): [True: 0, False: 208]
  ------------------
  458|      0|                        goto err;
  459|  1.08k|                } else if (D->top == 1) {
  ------------------
  |  Branch (459:28): [True: 1.08k, False: 0]
  ------------------
  460|  1.08k|                    if (!BN_copy(tmp, X))
  ------------------
  |  Branch (460:25): [True: 0, False: 1.08k]
  ------------------
  461|      0|                        goto err;
  462|  1.08k|                    if (!BN_mul_word(tmp, D->d[0]))
  ------------------
  |  Branch (462:25): [True: 0, False: 1.08k]
  ------------------
  463|      0|                        goto err;
  464|  1.08k|                } else {
  465|      0|                    if (!BN_mul(tmp, D, X, ctx))
  ------------------
  |  Branch (465:25): [True: 0, False: 0]
  ------------------
  466|      0|                        goto err;
  467|      0|                }
  468|  1.74k|                if (!BN_add(tmp, tmp, Y))
  ------------------
  |  Branch (468:21): [True: 0, False: 1.74k]
  ------------------
  469|      0|                    goto err;
  470|  1.74k|            }
  471|       |
  472|  3.00k|            M = Y;      /* keep the BIGNUM object, the value does not matter */
  473|  3.00k|            Y = X;
  474|  3.00k|            X = tmp;
  475|  3.00k|            sign = -sign;
  476|  3.00k|        }
  477|    183|    }
  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|  6.80k|    if (sign < 0) {
  ------------------
  |  Branch (487:9): [True: 6.68k, False: 124]
  ------------------
  488|  6.68k|        if (!BN_sub(Y, n, Y))
  ------------------
  |  Branch (488:13): [True: 0, False: 6.68k]
  ------------------
  489|      0|            goto err;
  490|  6.68k|    }
  491|       |    /* Now  Y*a  ==  A  (mod |n|).  */
  492|       |
  493|  6.80k|    if (BN_is_one(A)) {
  ------------------
  |  Branch (493:9): [True: 6.62k, False: 183]
  ------------------
  494|       |        /* Y*a == 1  (mod |n|) */
  495|  6.62k|        if (!Y->neg && BN_ucmp(Y, n) < 0) {
  ------------------
  |  Branch (495:13): [True: 1.36k, False: 5.25k]
  |  Branch (495:24): [True: 1.36k, False: 0]
  ------------------
  496|  1.36k|            if (!BN_copy(R, Y))
  ------------------
  |  Branch (496:17): [True: 0, False: 1.36k]
  ------------------
  497|      0|                goto err;
  498|  5.25k|        } else {
  499|  5.25k|            if (!BN_nnmod(R, Y, n, ctx))
  ------------------
  |  Branch (499:17): [True: 0, False: 5.25k]
  ------------------
  500|      0|                goto err;
  501|  5.25k|        }
  502|  6.62k|    } else {
  503|    183|        *pnoinv = 1;
  504|    183|        goto err;
  505|    183|    }
  506|  6.62k|    ret = R;
  507|  6.80k| err:
  508|  6.80k|    if ((ret == NULL) && (in == NULL))
  ------------------
  |  Branch (508:9): [True: 183, False: 6.62k]
  |  Branch (508:26): [True: 0, False: 183]
  ------------------
  509|      0|        BN_free(R);
  510|  6.80k|    BN_CTX_end(ctx);
  511|  6.80k|    bn_check_top(ret);
  512|  6.80k|    return ret;
  513|  6.62k|}
BN_mod_inverse:
  518|  6.81k|{
  519|  6.81k|    BN_CTX *new_ctx = NULL;
  520|  6.81k|    BIGNUM *rv;
  521|  6.81k|    int noinv = 0;
  522|       |
  523|  6.81k|    if (ctx == NULL) {
  ------------------
  |  Branch (523:9): [True: 0, False: 6.81k]
  ------------------
  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|  6.81k|    rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
  532|  6.81k|    if (noinv)
  ------------------
  |  Branch (532:9): [True: 193, False: 6.62k]
  ------------------
  533|  6.81k|        ERR_raise(ERR_LIB_BN, BN_R_NO_INVERSE);
  ------------------
  |  |  401|    193|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    193|    (ERR_new(),                                                 \
  |  |  |  |  404|    193|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    193|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    193|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    193|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    193|     ERR_set_error)
  |  |  ------------------
  ------------------
  534|  6.81k|    BN_CTX_free(new_ctx);
  535|  6.81k|    return rv;
  536|  6.81k|}

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

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

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

BN_value_one:
   83|  8.21k|{
   84|  8.21k|    static const BN_ULONG data_one = 1L;
   85|  8.21k|    static const BIGNUM const_one = {
   86|  8.21k|        (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|  8.21k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
   87|  8.21k|    };
   88|       |
   89|  8.21k|    return &const_one;
   90|  8.21k|}
BN_num_bits_word:
  102|  7.37M|{
  103|  7.37M|    BN_ULONG x, mask;
  ------------------
  |  |   37|  7.37M|#  define BN_ULONG        unsigned long
  ------------------
  104|  7.37M|    int bits = (l != 0);
  105|       |
  106|  7.37M|#if BN_BITS2 > 32
  107|  7.37M|    x = l >> 32;
  108|  7.37M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  7.37M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  109|  7.37M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  7.37M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.37M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  110|  7.37M|    bits += 32 & mask;
  111|  7.37M|    l ^= (x ^ l) & mask;
  112|  7.37M|#endif
  113|       |
  114|  7.37M|    x = l >> 16;
  115|  7.37M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  7.37M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  116|  7.37M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  7.37M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.37M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  117|  7.37M|    bits += 16 & mask;
  118|  7.37M|    l ^= (x ^ l) & mask;
  119|       |
  120|  7.37M|    x = l >> 8;
  121|  7.37M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  7.37M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  122|  7.37M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  7.37M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.37M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  123|  7.37M|    bits += 8 & mask;
  124|  7.37M|    l ^= (x ^ l) & mask;
  125|       |
  126|  7.37M|    x = l >> 4;
  127|  7.37M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  7.37M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  128|  7.37M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  7.37M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.37M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  129|  7.37M|    bits += 4 & mask;
  130|  7.37M|    l ^= (x ^ l) & mask;
  131|       |
  132|  7.37M|    x = l >> 2;
  133|  7.37M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  7.37M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  134|  7.37M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  7.37M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.37M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  135|  7.37M|    bits += 2 & mask;
  136|  7.37M|    l ^= (x ^ l) & mask;
  137|       |
  138|  7.37M|    x = l >> 1;
  139|  7.37M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  7.37M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  140|  7.37M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  7.37M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.37M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  141|  7.37M|    bits += 1 & mask;
  142|       |
  143|  7.37M|    return bits;
  144|  7.37M|}
BN_num_bits:
  180|  3.64M|{
  181|  3.64M|    int i = a->top - 1;
  182|  3.64M|    bn_check_top(a);
  183|       |
  184|  3.64M|    if (a->flags & BN_FLG_CONSTTIME) {
  ------------------
  |  |   67|  3.64M|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (184:9): [True: 2.58M, False: 1.05M]
  ------------------
  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|  2.58M|        return bn_num_bits_consttime(a);
  195|  2.58M|    }
  196|       |
  197|  1.05M|    if (BN_is_zero(a))
  ------------------
  |  Branch (197:9): [True: 99.5k, False: 956k]
  ------------------
  198|  99.5k|        return 0;
  199|       |
  200|   956k|    return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
  ------------------
  |  |   54|   956k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   956k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  201|  1.05M|}
BN_clear_free:
  215|   901k|{
  216|   901k|    if (a == NULL)
  ------------------
  |  Branch (216:9): [True: 397k, False: 504k]
  ------------------
  217|   397k|        return;
  218|   504k|    if (a->d != NULL && !BN_get_flags(a, BN_FLG_STATIC_DATA))
  ------------------
  |  |   59|   342k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (218:9): [True: 342k, False: 161k]
  |  Branch (218:25): [True: 342k, False: 25]
  ------------------
  219|   342k|        bn_free_d(a, 1);
  220|   504k|    if (BN_get_flags(a, BN_FLG_MALLOCED)) {
  ------------------
  |  |   58|   504k|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (220:9): [True: 337k, False: 166k]
  ------------------
  221|   337k|        OPENSSL_cleanse(a, sizeof(*a));
  222|   337k|        OPENSSL_free(a);
  ------------------
  |  |  115|   337k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   337k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   337k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  223|   337k|    }
  224|   504k|}
BN_free:
  227|   630k|{
  228|   630k|    if (a == NULL)
  ------------------
  |  Branch (228:9): [True: 437k, False: 193k]
  ------------------
  229|   437k|        return;
  230|   193k|    if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  ------------------
  |  |   59|   193k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (230:9): [True: 193k, False: 0]
  ------------------
  231|   193k|        bn_free_d(a, 0);
  232|   193k|    if (a->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|   193k|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (232:9): [True: 193k, False: 0]
  ------------------
  233|   193k|        OPENSSL_free(a);
  ------------------
  |  |  115|   193k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   193k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   193k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  234|   193k|}
bn_init:
  237|   288k|{
  238|   288k|    static BIGNUM nilbn;
  239|       |
  240|   288k|    *a = nilbn;
  241|   288k|    bn_check_top(a);
  242|   288k|}
BN_new:
  245|   531k|{
  246|   531k|    BIGNUM *ret;
  247|       |
  248|   531k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|   531k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   531k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   531k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (248:9): [True: 0, False: 531k]
  ------------------
  249|      0|        return NULL;
  250|   531k|    ret->flags = BN_FLG_MALLOCED;
  ------------------
  |  |   58|   531k|# define BN_FLG_MALLOCED         0x01
  ------------------
  251|   531k|    bn_check_top(ret);
  252|   531k|    return ret;
  253|   531k|}
BN_secure_new:
  256|   278k| {
  257|   278k|     BIGNUM *ret = BN_new();
  258|   278k|     if (ret != NULL)
  ------------------
  |  Branch (258:10): [True: 278k, False: 0]
  ------------------
  259|   278k|         ret->flags |= BN_FLG_SECURE;
  ------------------
  |  |   68|   278k|# define BN_FLG_SECURE           0x08
  ------------------
  260|   278k|     return ret;
  261|   278k| }
bn_expand2:
  300|   623k|{
  301|   623k|    if (words > b->dmax) {
  ------------------
  |  Branch (301:9): [True: 623k, False: 0]
  ------------------
  302|   623k|        BN_ULONG *a = bn_expand_internal(b, words);
  ------------------
  |  |   37|   623k|#  define BN_ULONG        unsigned long
  ------------------
  303|   623k|        if (!a)
  ------------------
  |  Branch (303:13): [True: 0, False: 623k]
  ------------------
  304|      0|            return NULL;
  305|   623k|        if (b->d != NULL)
  ------------------
  |  Branch (305:13): [True: 127k, False: 496k]
  ------------------
  306|   127k|            bn_free_d(b, 1);
  307|   623k|        b->d = a;
  308|   623k|        b->dmax = words;
  309|   623k|    }
  310|       |
  311|   623k|    return b;
  312|   623k|}
BN_dup:
  315|  19.6k|{
  316|  19.6k|    BIGNUM *t;
  317|       |
  318|  19.6k|    if (a == NULL)
  ------------------
  |  Branch (318:9): [True: 0, False: 19.6k]
  ------------------
  319|      0|        return NULL;
  320|  19.6k|    bn_check_top(a);
  321|       |
  322|  19.6k|    t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();
  ------------------
  |  |   68|  19.6k|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (322:9): [True: 0, False: 19.6k]
  ------------------
  323|  19.6k|    if (t == NULL)
  ------------------
  |  Branch (323:9): [True: 0, False: 19.6k]
  ------------------
  324|      0|        return NULL;
  325|  19.6k|    if (!BN_copy(t, a)) {
  ------------------
  |  Branch (325:9): [True: 0, False: 19.6k]
  ------------------
  326|      0|        BN_free(t);
  327|      0|        return NULL;
  328|      0|    }
  329|  19.6k|    bn_check_top(t);
  330|  19.6k|    return t;
  331|  19.6k|}
BN_copy:
  334|  1.69M|{
  335|  1.69M|    int bn_words;
  336|       |
  337|  1.69M|    bn_check_top(b);
  338|       |
  339|  1.69M|    bn_words = BN_get_flags(b, BN_FLG_CONSTTIME) ? b->dmax : b->top;
  ------------------
  |  |   67|  1.69M|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (339:16): [True: 1.37k, False: 1.69M]
  ------------------
  340|       |
  341|  1.69M|    if (a == b)
  ------------------
  |  Branch (341:9): [True: 0, False: 1.69M]
  ------------------
  342|      0|        return a;
  343|  1.69M|    if (bn_wexpand(a, bn_words) == NULL)
  ------------------
  |  Branch (343:9): [True: 0, False: 1.69M]
  ------------------
  344|      0|        return NULL;
  345|       |
  346|  1.69M|    if (b->top > 0)
  ------------------
  |  Branch (346:9): [True: 1.60M, False: 98.5k]
  ------------------
  347|  1.60M|        memcpy(a->d, b->d, sizeof(b->d[0]) * bn_words);
  348|       |
  349|  1.69M|    a->neg = b->neg;
  350|  1.69M|    a->top = b->top;
  351|  1.69M|    a->flags |= b->flags & BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  1.69M|#  define BN_FLG_FIXED_TOP 0
  ------------------
  352|  1.69M|    bn_check_top(a);
  353|  1.69M|    return a;
  354|  1.69M|}
BN_clear:
  396|   115k|{
  397|   115k|    if (a == NULL)
  ------------------
  |  Branch (397:9): [True: 0, False: 115k]
  ------------------
  398|      0|        return;
  399|   115k|    bn_check_top(a);
  400|   115k|    if (a->d != NULL)
  ------------------
  |  Branch (400:9): [True: 0, False: 115k]
  ------------------
  401|      0|        OPENSSL_cleanse(a->d, sizeof(*a->d) * a->dmax);
  402|   115k|    a->neg = 0;
  403|   115k|    a->top = 0;
  404|   115k|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   115k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  405|   115k|}
BN_get_word:
  408|     42|{
  409|     42|    if (a->top > 1)
  ------------------
  |  Branch (409:9): [True: 1, False: 41]
  ------------------
  410|      1|        return BN_MASK2;
  ------------------
  |  |   94|      1|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  411|     41|    else if (a->top == 1)
  ------------------
  |  Branch (411:14): [True: 38, False: 3]
  ------------------
  412|     38|        return a->d[0];
  413|       |    /* a->top == 0 */
  414|      3|    return 0;
  415|     42|}
BN_set_word:
  418|  27.0k|{
  419|  27.0k|    bn_check_top(a);
  420|  27.0k|    if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
  ------------------
  |  Branch (420:9): [True: 0, False: 27.0k]
  ------------------
  421|      0|        return 0;
  422|  27.0k|    a->neg = 0;
  423|  27.0k|    a->d[0] = w;
  424|  27.0k|    a->top = (w ? 1 : 0);
  ------------------
  |  Branch (424:15): [True: 26.9k, False: 64]
  ------------------
  425|  27.0k|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  27.0k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  426|  27.0k|    bn_check_top(a);
  427|  27.0k|    return 1;
  428|  27.0k|}
BN_bin2bn:
  536|   328k|{
  537|   328k|    return bin2bn(s, len, ret, BIG, UNSIGNED);
  538|   328k|}
BN_bn2binpad:
  629|  5.95k|{
  630|  5.95k|    if (tolen < 0)
  ------------------
  |  Branch (630:9): [True: 0, False: 5.95k]
  ------------------
  631|      0|        return -1;
  632|  5.95k|    return bn2binpad(a, to, tolen, BIG, UNSIGNED);
  633|  5.95k|}
BN_bn2bin:
  643|   206k|{
  644|   206k|    return bn2binpad(a, to, -1, BIG, UNSIGNED);
  645|   206k|}
BN_lebin2bn:
  648|  2.14k|{
  649|  2.14k|    return bin2bn(s, len, ret, LITTLE, UNSIGNED);
  650|  2.14k|}
BN_bn2lebinpad:
  658|  1.86k|{
  659|  1.86k|    if (tolen < 0)
  ------------------
  |  Branch (659:9): [True: 0, False: 1.86k]
  ------------------
  660|      0|        return -1;
  661|  1.86k|    return bn2binpad(a, to, tolen, LITTLE, UNSIGNED);
  662|  1.86k|}
BN_ucmp:
  708|  3.11M|{
  709|  3.11M|    int i;
  710|  3.11M|    BN_ULONG t1, t2, *ap, *bp;
  ------------------
  |  |   37|  3.11M|#  define BN_ULONG        unsigned long
  ------------------
  711|       |
  712|  3.11M|    ap = a->d;
  713|  3.11M|    bp = b->d;
  714|       |
  715|  3.11M|    if (BN_get_flags(a, BN_FLG_CONSTTIME)
  ------------------
  |  |   67|  3.11M|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (715:9): [True: 198k, False: 2.92M]
  ------------------
  716|  3.11M|            && a->top == b->top) {
  ------------------
  |  Branch (716:16): [True: 197k, False: 667]
  ------------------
  717|   197k|        int res = 0;
  718|       |
  719|   958k|        for (i = 0; i < b->top; i++) {
  ------------------
  |  Branch (719:21): [True: 760k, False: 197k]
  ------------------
  720|   760k|            res = constant_time_select_int(constant_time_lt_bn(ap[i], bp[i]),
  721|   760k|                                           -1, res);
  722|   760k|            res = constant_time_select_int(constant_time_lt_bn(bp[i], ap[i]),
  723|   760k|                                           1, res);
  724|   760k|        }
  725|   197k|        return res;
  726|   197k|    }
  727|       |
  728|  2.92M|    bn_check_top(a);
  729|  2.92M|    bn_check_top(b);
  730|       |
  731|  2.92M|    i = a->top - b->top;
  732|  2.92M|    if (i != 0)
  ------------------
  |  Branch (732:9): [True: 188k, False: 2.73M]
  ------------------
  733|   188k|        return i;
  734|       |
  735|  2.75M|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (735:26): [True: 2.74M, False: 14.0k]
  ------------------
  736|  2.74M|        t1 = ap[i];
  737|  2.74M|        t2 = bp[i];
  738|  2.74M|        if (t1 != t2)
  ------------------
  |  Branch (738:13): [True: 2.71M, False: 25.5k]
  ------------------
  739|  2.71M|            return ((t1 > t2) ? 1 : -1);
  ------------------
  |  Branch (739:21): [True: 1.28M, False: 1.43M]
  ------------------
  740|  2.74M|    }
  741|  14.0k|    return 0;
  742|  2.73M|}
BN_cmp:
  745|  1.02M|{
  746|  1.02M|    int i;
  747|  1.02M|    int gt, lt;
  748|  1.02M|    BN_ULONG t1, t2;
  ------------------
  |  |   37|  1.02M|#  define BN_ULONG        unsigned long
  ------------------
  749|       |
  750|  1.02M|    if ((a == NULL) || (b == NULL)) {
  ------------------
  |  Branch (750:9): [True: 0, False: 1.02M]
  |  Branch (750:24): [True: 0, False: 1.02M]
  ------------------
  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|  1.02M|    bn_check_top(a);
  760|  1.02M|    bn_check_top(b);
  761|       |
  762|  1.02M|    if (a->neg != b->neg) {
  ------------------
  |  Branch (762:9): [True: 0, False: 1.02M]
  ------------------
  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|  1.02M|    if (a->neg == 0) {
  ------------------
  |  Branch (768:9): [True: 1.02M, False: 0]
  ------------------
  769|  1.02M|        gt = 1;
  770|  1.02M|        lt = -1;
  771|  1.02M|    } else {
  772|      0|        gt = -1;
  773|      0|        lt = 1;
  774|      0|    }
  775|       |
  776|  1.02M|    if (a->top > b->top)
  ------------------
  |  Branch (776:9): [True: 41.9k, False: 978k]
  ------------------
  777|  41.9k|        return gt;
  778|   978k|    if (a->top < b->top)
  ------------------
  |  Branch (778:9): [True: 136k, False: 842k]
  ------------------
  779|   136k|        return lt;
  780|   866k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (780:26): [True: 861k, False: 5.38k]
  ------------------
  781|   861k|        t1 = a->d[i];
  782|   861k|        t2 = b->d[i];
  783|   861k|        if (t1 > t2)
  ------------------
  |  Branch (783:13): [True: 421k, False: 439k]
  ------------------
  784|   421k|            return gt;
  785|   439k|        if (t1 < t2)
  ------------------
  |  Branch (785:13): [True: 415k, False: 23.9k]
  ------------------
  786|   415k|            return lt;
  787|   439k|    }
  788|  5.38k|    return 0;
  789|   842k|}
BN_set_bit:
  792|  16.1k|{
  793|  16.1k|    int i, j, k;
  794|       |
  795|  16.1k|    if (n < 0)
  ------------------
  |  Branch (795:9): [True: 0, False: 16.1k]
  ------------------
  796|      0|        return 0;
  797|       |
  798|  16.1k|    i = n / BN_BITS2;
  ------------------
  |  |   54|  16.1k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  16.1k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  799|  16.1k|    j = n % BN_BITS2;
  ------------------
  |  |   54|  16.1k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  16.1k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  800|  16.1k|    if (a->top <= i) {
  ------------------
  |  Branch (800:9): [True: 16.1k, False: 0]
  ------------------
  801|  16.1k|        if (bn_wexpand(a, i + 1) == NULL)
  ------------------
  |  Branch (801:13): [True: 0, False: 16.1k]
  ------------------
  802|      0|            return 0;
  803|   110k|        for (k = a->top; k < i + 1; k++)
  ------------------
  |  Branch (803:26): [True: 94.6k, False: 16.1k]
  ------------------
  804|  94.6k|            a->d[k] = 0;
  805|  16.1k|        a->top = i + 1;
  806|  16.1k|        a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  16.1k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  807|  16.1k|    }
  808|       |
  809|  16.1k|    a->d[i] |= (((BN_ULONG)1) << j);
  810|  16.1k|    bn_check_top(a);
  811|  16.1k|    return 1;
  812|  16.1k|}
BN_is_bit_set:
  833|  2.49M|{
  834|  2.49M|    int i, j;
  835|       |
  836|  2.49M|    bn_check_top(a);
  837|  2.49M|    if (n < 0)
  ------------------
  |  Branch (837:9): [True: 0, False: 2.49M]
  ------------------
  838|      0|        return 0;
  839|  2.49M|    i = n / BN_BITS2;
  ------------------
  |  |   54|  2.49M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.49M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  840|  2.49M|    j = n % BN_BITS2;
  ------------------
  |  |   54|  2.49M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.49M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  841|  2.49M|    if (a->top <= i)
  ------------------
  |  Branch (841:9): [True: 205, False: 2.49M]
  ------------------
  842|    205|        return 0;
  843|  2.49M|    return (int)(((a->d[i]) >> j) & ((BN_ULONG)1));
  844|  2.49M|}
BN_set_negative:
  879|  11.3k|{
  880|  11.3k|    if (b && !BN_is_zero(a))
  ------------------
  |  Branch (880:9): [True: 4.95k, False: 6.39k]
  |  Branch (880:14): [True: 4.95k, False: 0]
  ------------------
  881|  4.95k|        a->neg = 1;
  882|  6.39k|    else
  883|  6.39k|        a->neg = 0;
  884|  11.3k|}
bn_cmp_words:
  887|  8.56k|{
  888|  8.56k|    int i;
  889|  8.56k|    BN_ULONG aa, bb;
  ------------------
  |  |   37|  8.56k|#  define BN_ULONG        unsigned long
  ------------------
  890|       |
  891|  8.56k|    if (n == 0)
  ------------------
  |  Branch (891:9): [True: 0, False: 8.56k]
  ------------------
  892|      0|        return 0;
  893|       |
  894|  8.56k|    aa = a[n - 1];
  895|  8.56k|    bb = b[n - 1];
  896|  8.56k|    if (aa != bb)
  ------------------
  |  Branch (896:9): [True: 6.46k, False: 2.10k]
  ------------------
  897|  6.46k|        return ((aa > bb) ? 1 : -1);
  ------------------
  |  Branch (897:17): [True: 3.40k, False: 3.06k]
  ------------------
  898|  9.15k|    for (i = n - 2; i >= 0; i--) {
  ------------------
  |  Branch (898:21): [True: 8.62k, False: 522]
  ------------------
  899|  8.62k|        aa = a[i];
  900|  8.62k|        bb = b[i];
  901|  8.62k|        if (aa != bb)
  ------------------
  |  Branch (901:13): [True: 1.58k, False: 7.04k]
  ------------------
  902|  1.58k|            return ((aa > bb) ? 1 : -1);
  ------------------
  |  Branch (902:21): [True: 977, False: 605]
  ------------------
  903|  8.62k|    }
  904|    522|    return 0;
  905|  2.10k|}
bn_cmp_part_words:
  917|  10.2k|{
  918|  10.2k|    int n, i;
  919|  10.2k|    n = cl - 1;
  920|       |
  921|  10.2k|    if (dl < 0) {
  ------------------
  |  Branch (921:9): [True: 972, False: 9.28k]
  ------------------
  922|  2.26k|        for (i = dl; i < 0; i++) {
  ------------------
  |  Branch (922:22): [True: 2.16k, False: 103]
  ------------------
  923|  2.16k|            if (b[n - i] != 0)
  ------------------
  |  Branch (923:17): [True: 869, False: 1.29k]
  ------------------
  924|    869|                return -1;      /* a < b */
  925|  2.16k|        }
  926|    972|    }
  927|  9.39k|    if (dl > 0) {
  ------------------
  |  Branch (927:9): [True: 972, False: 8.41k]
  ------------------
  928|  3.63k|        for (i = dl; i > 0; i--) {
  ------------------
  |  Branch (928:22): [True: 3.48k, False: 149]
  ------------------
  929|  3.48k|            if (a[n + i] != 0)
  ------------------
  |  Branch (929:17): [True: 823, False: 2.66k]
  ------------------
  930|    823|                return 1;       /* a > b */
  931|  3.48k|        }
  932|    972|    }
  933|  8.56k|    return bn_cmp_words(a, b, cl);
  934|  9.39k|}
BN_consttime_swap:
  944|  1.08M|{
  945|  1.08M|    BN_ULONG t;
  ------------------
  |  |   37|  1.08M|#  define BN_ULONG        unsigned long
  ------------------
  946|  1.08M|    int i;
  947|       |
  948|  1.08M|    bn_wcheck_size(a, nwords);
  949|  1.08M|    bn_wcheck_size(b, nwords);
  950|       |
  951|  1.08M|    condition = ((~condition & ((condition - 1))) >> (BN_BITS2 - 1)) - 1;
  ------------------
  |  |   54|  1.08M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.08M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  952|       |
  953|  1.08M|    t = (a->top ^ b->top) & condition;
  954|  1.08M|    a->top ^= t;
  955|  1.08M|    b->top ^= t;
  956|       |
  957|  1.08M|    t = (a->neg ^ b->neg) & condition;
  958|  1.08M|    a->neg ^= t;
  959|  1.08M|    b->neg ^= t;
  960|       |
  961|       |    /*-
  962|       |     * BN_FLG_STATIC_DATA: indicates that data may not be written to. Intention
  963|       |     * is actually to treat it as it's read-only data, and some (if not most)
  964|       |     * of it does reside in read-only segment. In other words observation of
  965|       |     * BN_FLG_STATIC_DATA in BN_consttime_swap should be treated as fatal
  966|       |     * condition. It would either cause SEGV or effectively cause data
  967|       |     * corruption.
  968|       |     *
  969|       |     * BN_FLG_MALLOCED: refers to BN structure itself, and hence must be
  970|       |     * preserved.
  971|       |     *
  972|       |     * BN_FLG_SECURE: must be preserved, because it determines how x->d was
  973|       |     * allocated and hence how to free it.
  974|       |     *
  975|       |     * BN_FLG_CONSTTIME: sufficient to mask and swap
  976|       |     *
  977|       |     * BN_FLG_FIXED_TOP: indicates that we haven't called bn_correct_top() on
  978|       |     * the data, so the d array may be padded with additional 0 values (i.e.
  979|       |     * top could be greater than the minimal value that it could be). We should
  980|       |     * be swapping it
  981|       |     */
  982|       |
  983|  1.08M|#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP)
  984|       |
  985|  1.08M|    t = ((a->flags ^ b->flags) & BN_CONSTTIME_SWAP_FLAGS) & condition;
  ------------------
  |  |  983|  1.08M|#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP)
  |  |  ------------------
  |  |  |  |   67|  1.08M|# define BN_FLG_CONSTTIME        0x04
  |  |  ------------------
  |  |               #define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP)
  |  |  ------------------
  |  |  |  |  226|  1.08M|#  define BN_FLG_FIXED_TOP 0
  |  |  ------------------
  ------------------
  986|  1.08M|    a->flags ^= t;
  987|  1.08M|    b->flags ^= t;
  988|       |
  989|       |    /* conditionally swap the data */
  990|  5.93M|    for (i = 0; i < nwords; i++) {
  ------------------
  |  Branch (990:17): [True: 4.84M, False: 1.08M]
  ------------------
  991|  4.84M|        t = (a->d[i] ^ b->d[i]) & condition;
  992|  4.84M|        a->d[i] ^= t;
  993|  4.84M|        b->d[i] ^= t;
  994|  4.84M|    }
  995|  1.08M|}
BN_security_bits:
 1002|    703|{
 1003|    703|    int secbits, bits;
 1004|    703|    if (L >= 15360)
  ------------------
  |  Branch (1004:9): [True: 5, False: 698]
  ------------------
 1005|      5|        secbits = 256;
 1006|    698|    else if (L >= 7680)
  ------------------
  |  Branch (1006:14): [True: 3, False: 695]
  ------------------
 1007|      3|        secbits = 192;
 1008|    695|    else if (L >= 3072)
  ------------------
  |  Branch (1008:14): [True: 2, False: 693]
  ------------------
 1009|      2|        secbits = 128;
 1010|    693|    else if (L >= 2048)
  ------------------
  |  Branch (1010:14): [True: 4, False: 689]
  ------------------
 1011|      4|        secbits = 112;
 1012|    689|    else if (L >= 1024)
  ------------------
  |  Branch (1012:14): [True: 395, False: 294]
  ------------------
 1013|    395|        secbits = 80;
 1014|    294|    else
 1015|    294|        return 0;
 1016|    409|    if (N == -1)
  ------------------
  |  Branch (1016:9): [True: 1, False: 408]
  ------------------
 1017|      1|        return secbits;
 1018|    408|    bits = N / 2;
 1019|    408|    if (bits < 80)
  ------------------
  |  Branch (1019:9): [True: 367, False: 41]
  ------------------
 1020|    367|        return 0;
 1021|     41|    return bits >= secbits ? secbits : bits;
  ------------------
  |  Branch (1021:12): [True: 40, False: 1]
  ------------------
 1022|    408|}
BN_zero_ex:
 1025|  11.1M|{
 1026|  11.1M|    a->neg = 0;
 1027|  11.1M|    a->top = 0;
 1028|  11.1M|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  11.1M|#  define BN_FLG_FIXED_TOP 0
  ------------------
 1029|  11.1M|}
BN_abs_is_word:
 1032|   998k|{
 1033|   998k|    return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
  ------------------
  |  Branch (1033:13): [True: 63.3k, False: 934k]
  |  Branch (1033:30): [True: 44.9k, False: 18.4k]
  |  Branch (1033:50): [True: 0, False: 953k]
  |  Branch (1033:62): [True: 0, False: 0]
  ------------------
 1034|   998k|}
BN_is_zero:
 1037|  3.56M|{
 1038|  3.56M|    return a->top == 0;
 1039|  3.56M|}
BN_is_one:
 1042|   986k|{
 1043|   986k|    return BN_abs_is_word(a, 1) && !a->neg;
  ------------------
  |  Branch (1043:12): [True: 44.1k, False: 942k]
  |  Branch (1043:36): [True: 44.1k, False: 0]
  ------------------
 1044|   986k|}
BN_is_word:
 1047|  3.28k|{
 1048|  3.28k|    return BN_abs_is_word(a, w) && (!w || !a->neg);
  ------------------
  |  Branch (1048:12): [True: 754, False: 2.53k]
  |  Branch (1048:37): [True: 0, False: 754]
  |  Branch (1048:43): [True: 754, False: 0]
  ------------------
 1049|  3.28k|}
BN_is_odd:
 1068|   428k|{
 1069|   428k|    return (a->top > 0) && (a->d[0] & 1);
  ------------------
  |  Branch (1069:12): [True: 428k, False: 176]
  |  Branch (1069:28): [True: 239k, False: 189k]
  ------------------
 1070|   428k|}
BN_is_negative:
 1073|  98.7k|{
 1074|  98.7k|    return (a->neg != 0);
 1075|  98.7k|}
BN_to_montgomery:
 1079|  12.2k|{
 1080|  12.2k|    return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx);
 1081|  12.2k|}
BN_with_flags:
 1084|     25|{
 1085|     25|    dest->d = b->d;
 1086|     25|    dest->top = b->top;
 1087|     25|    dest->dmax = b->dmax;
 1088|     25|    dest->neg = b->neg;
 1089|     25|    dest->flags = ((dest->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|     25|# define BN_FLG_MALLOCED         0x01
  ------------------
 1090|     25|                   | (b->flags & ~BN_FLG_MALLOCED)
  ------------------
  |  |   58|     25|# define BN_FLG_MALLOCED         0x01
  ------------------
 1091|     25|                   | BN_FLG_STATIC_DATA | flags);
  ------------------
  |  |   59|     25|# define BN_FLG_STATIC_DATA      0x02
  ------------------
 1092|     25|}
BN_set_flags:
 1112|   227k|{
 1113|   227k|    b->flags |= n;
 1114|   227k|}
BN_get_flags:
 1117|  7.83M|{
 1118|  7.83M|    return b->flags & n;
 1119|  7.83M|}
bn_wexpand:
 1147|  23.9M|{
 1148|  23.9M|    return (words <= a->dmax) ? a : bn_expand2(a, words);
  ------------------
  |  Branch (1148:12): [True: 23.3M, False: 613k]
  ------------------
 1149|  23.9M|}
bn_correct_top:
 1174|  13.3M|{
 1175|  13.3M|    BN_ULONG *ftl;
  ------------------
  |  |   37|  13.3M|#  define BN_ULONG        unsigned long
  ------------------
 1176|  13.3M|    int tmp_top = a->top;
 1177|       |
 1178|  13.3M|    if (tmp_top > 0) {
  ------------------
  |  Branch (1178:9): [True: 13.3M, False: 3.10k]
  ------------------
 1179|  26.5M|        for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) {
  ------------------
  |  Branch (1179:38): [True: 26.0M, False: 467k]
  ------------------
 1180|  26.0M|            ftl--;
 1181|  26.0M|            if (*ftl != 0)
  ------------------
  |  Branch (1181:17): [True: 12.8M, False: 13.1M]
  ------------------
 1182|  12.8M|                break;
 1183|  26.0M|        }
 1184|  13.3M|        a->top = tmp_top;
 1185|  13.3M|    }
 1186|  13.3M|    if (a->top == 0)
  ------------------
  |  Branch (1186:9): [True: 470k, False: 12.8M]
  ------------------
 1187|   470k|        a->neg = 0;
 1188|  13.3M|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  13.3M|#  define BN_FLG_FIXED_TOP 0
  ------------------
 1189|  13.3M|    bn_pollute(a);
 1190|  13.3M|}
bn_lib.c:bn_num_bits_consttime:
  155|  2.58M|{
  156|  2.58M|    int j, ret;
  157|  2.58M|    unsigned int mask, past_i;
  158|  2.58M|    int i = a->top - 1;
  159|  2.58M|    bn_check_top(a);
  160|       |
  161|  7.71M|    for (j = 0, past_i = 0, ret = 0; j < a->dmax; j++) {
  ------------------
  |  Branch (161:38): [True: 5.12M, False: 2.58M]
  ------------------
  162|  5.12M|        mask = constant_time_eq_int(i, j); /* 0xff..ff if i==j, 0x0 otherwise */
  163|       |
  164|  5.12M|        ret += BN_BITS2 & (~mask & ~past_i);
  ------------------
  |  |   54|  5.12M|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  5.12M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  165|  5.12M|        ret += BN_num_bits_word(a->d[j]) & mask;
  166|       |
  167|  5.12M|        past_i |= mask; /* past_i will become 0xff..ff after i==j */
  168|  5.12M|    }
  169|       |
  170|       |    /*
  171|       |     * if BN_is_zero(a) => i is -1 and ret contains garbage, so we mask the
  172|       |     * final result.
  173|       |     */
  174|  2.58M|    mask = ~(constant_time_eq_int(i, ((int)-1)));
  175|       |
  176|  2.58M|    return ret & mask;
  177|  2.58M|}
bn_lib.c:bn_free_d:
  204|   663k|{
  205|   663k|    if (BN_get_flags(a, BN_FLG_SECURE))
  ------------------
  |  |   68|   663k|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (205:9): [True: 171k, False: 491k]
  ------------------
  206|   171k|        OPENSSL_secure_clear_free(a->d, a->dmax * sizeof(a->d[0]));
  ------------------
  |  |  129|   171k|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   171k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   171k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  207|   491k|    else if (clear != 0)
  ------------------
  |  Branch (207:14): [True: 298k, False: 193k]
  ------------------
  208|   298k|        OPENSSL_clear_free(a->d, a->dmax * sizeof(a->d[0]));
  ------------------
  |  |  113|   298k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   298k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   298k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  209|   193k|    else
  210|   193k|        OPENSSL_free(a->d);
  ------------------
  |  |  115|   193k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   193k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   193k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  211|   663k|}
bn_lib.c:bn_expand_internal:
  266|   623k|{
  267|   623k|    BN_ULONG *a = NULL;
  ------------------
  |  |   37|   623k|#  define BN_ULONG        unsigned long
  ------------------
  268|       |
  269|   623k|    if (words > (INT_MAX / (4 * BN_BITS2))) {
  ------------------
  |  |   54|   623k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   623k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (269:9): [True: 0, False: 623k]
  ------------------
  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|   623k|    if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
  ------------------
  |  |   59|   623k|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (273:9): [True: 0, False: 623k]
  ------------------
  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|   623k|    if (BN_get_flags(b, BN_FLG_SECURE))
  ------------------
  |  |   68|   623k|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (277:9): [True: 171k, False: 452k]
  ------------------
  278|   171k|        a = OPENSSL_secure_zalloc(words * sizeof(*a));
  ------------------
  |  |  125|   171k|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   171k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   171k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  279|   452k|    else
  280|   452k|        a = OPENSSL_zalloc(words * sizeof(*a));
  ------------------
  |  |  104|   452k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   452k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   452k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|   623k|    if (a == NULL)
  ------------------
  |  Branch (281:9): [True: 0, False: 623k]
  ------------------
  282|      0|        return NULL;
  283|       |
  284|   623k|    assert(b->top <= words);
  285|   623k|    if (b->top > 0)
  ------------------
  |  Branch (285:9): [True: 64.7k, False: 559k]
  ------------------
  286|  64.7k|        memcpy(a, b->d, sizeof(*a) * b->top);
  287|       |
  288|   623k|    return a;
  289|   623k|}
bn_lib.c:bin2bn:
  435|   330k|{
  436|   330k|    int inc;
  437|   330k|    const unsigned char *s2;
  438|   330k|    int inc2;
  439|   330k|    int neg = 0, xor = 0, carry = 0;
  440|   330k|    unsigned int i;
  441|   330k|    unsigned int n;
  442|   330k|    BIGNUM *bn = NULL;
  443|       |
  444|       |    /* Negative length is not acceptable */
  445|   330k|    if (len < 0)
  ------------------
  |  Branch (445:9): [True: 0, False: 330k]
  ------------------
  446|      0|        return NULL;
  447|       |
  448|   330k|    if (ret == NULL)
  ------------------
  |  Branch (448:9): [True: 35.5k, False: 294k]
  ------------------
  449|  35.5k|        ret = bn = BN_new();
  450|   330k|    if (ret == NULL)
  ------------------
  |  Branch (450:9): [True: 0, False: 330k]
  ------------------
  451|      0|        return NULL;
  452|   330k|    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|   330k|    if (len == 0) {
  ------------------
  |  Branch (458:9): [True: 115k, False: 215k]
  ------------------
  459|   115k|        BN_clear(ret);
  460|   115k|        return ret;
  461|   115k|    }
  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|   215k|    if (endianness == LITTLE) {
  ------------------
  |  Branch (468:9): [True: 2.14k, False: 212k]
  ------------------
  469|  2.14k|        s2 = s + len - 1;
  470|  2.14k|        inc2 = -1;
  471|  2.14k|        inc = 1;
  472|   212k|    } else {
  473|   212k|        s2 = s;
  474|   212k|        inc2 = 1;
  475|   212k|        inc = -1;
  476|   212k|        s += len - 1;
  477|   212k|    }
  478|       |
  479|       |    /* Take note of the signedness of the input bytes*/
  480|   215k|    if (signedness == SIGNED) {
  ------------------
  |  Branch (480:9): [True: 0, False: 215k]
  ------------------
  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|   353k|    for ( ; len > 0 && *s2 == xor; s2 += inc2, len--)
  ------------------
  |  Branch (490:13): [True: 348k, False: 5.33k]
  |  Branch (490:24): [True: 138k, False: 209k]
  ------------------
  491|   138k|        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|   215k|    if (xor == 0xff) {
  ------------------
  |  Branch (498:9): [True: 0, False: 215k]
  ------------------
  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|   215k|    if (len == 0) {
  ------------------
  |  Branch (503:9): [True: 5.33k, False: 209k]
  ------------------
  504|  5.33k|        ret->top = 0;
  505|  5.33k|        return ret;
  506|  5.33k|    }
  507|   209k|    n = ((len - 1) / BN_BYTES) + 1; /* Number of resulting bignum chunks */
  ------------------
  |  |   38|   209k|#  define BN_BYTES        8
  ------------------
  508|   209k|    if (bn_wexpand(ret, (int)n) == NULL) {
  ------------------
  |  Branch (508:9): [True: 0, False: 209k]
  ------------------
  509|      0|        BN_free(bn);
  510|      0|        return NULL;
  511|      0|    }
  512|   209k|    ret->top = n;
  513|   209k|    ret->neg = neg;
  514|  3.14M|    for (i = 0; n-- > 0; i++) {
  ------------------
  |  Branch (514:17): [True: 2.93M, False: 209k]
  ------------------
  515|  2.93M|        BN_ULONG l = 0;        /* Accumulator */
  ------------------
  |  |   37|  2.93M|#  define BN_ULONG        unsigned long
  ------------------
  516|  2.93M|        unsigned int m = 0;    /* Offset in a bignum chunk, in bits */
  517|       |
  518|  25.2M|        for (; len > 0 && m < BN_BYTES * 8; len--, s += inc, m += 8) {
  ------------------
  |  |   38|  25.0M|#  define BN_BYTES        8
  ------------------
  |  Branch (518:16): [True: 25.0M, False: 209k]
  |  Branch (518:27): [True: 22.3M, False: 2.72M]
  ------------------
  519|  22.3M|            BN_ULONG byte_xored = *s ^ xor;
  ------------------
  |  |   37|  22.3M|#  define BN_ULONG        unsigned long
  ------------------
  520|  22.3M|            BN_ULONG byte = (byte_xored + carry) & 0xff;
  ------------------
  |  |   37|  22.3M|#  define BN_ULONG        unsigned long
  ------------------
  521|       |
  522|  22.3M|            carry = byte_xored > byte; /* Implicit 1 or 0 */
  523|  22.3M|            l |= (byte << m);
  524|  22.3M|        }
  525|  2.93M|        ret->d[i] = l;
  526|  2.93M|    }
  527|       |    /*
  528|       |     * need to call this due to clear byte at top if avoiding having the top
  529|       |     * bit set (-ve number)
  530|       |     */
  531|   209k|    bn_correct_top(ret);
  532|   209k|    return ret;
  533|   209k|}
bn_lib.c:bn2binpad:
  547|   213k|{
  548|   213k|    int inc;
  549|   213k|    int n, n8;
  550|   213k|    int xor = 0, carry = 0, ext = 0;
  551|   213k|    size_t i, lasti, j, atop, mask;
  552|   213k|    BN_ULONG l;
  ------------------
  |  |   37|   213k|#  define BN_ULONG        unsigned long
  ------------------
  553|       |
  554|       |    /*
  555|       |     * In case |a| is fixed-top, BN_num_bits can return bogus length,
  556|       |     * but it's assumed that fixed-top inputs ought to be "nominated"
  557|       |     * even for padded output, so it works out...
  558|       |     */
  559|   213k|    n8 = BN_num_bits(a);
  560|   213k|    n = (n8 + 7) / 8;           /* This is what BN_num_bytes() does */
  561|       |
  562|       |    /* Take note of the signedness of the bignum */
  563|   213k|    if (signedness == SIGNED) {
  ------------------
  |  Branch (563:9): [True: 0, False: 213k]
  ------------------
  564|      0|        xor = a->neg ? 0xff : 0x00;
  ------------------
  |  Branch (564:15): [True: 0, False: 0]
  ------------------
  565|      0|        carry = a->neg;
  566|       |
  567|       |        /*
  568|       |         * if |n * 8 == n|, then the MSbit is set, otherwise unset.
  569|       |         * We must compensate with one extra byte if that doesn't
  570|       |         * correspond to the signedness of the bignum with regards
  571|       |         * to 2's complement.
  572|       |         */
  573|      0|        ext = (n * 8 == n8)
  ------------------
  |  Branch (573:15): [True: 0, False: 0]
  ------------------
  574|      0|            ? !a->neg            /* MSbit set on nonnegative bignum */
  575|      0|            : a->neg;            /* MSbit unset on negative bignum */
  576|      0|    }
  577|       |
  578|   213k|    if (tolen == -1) {
  ------------------
  |  Branch (578:9): [True: 206k, False: 7.82k]
  ------------------
  579|   206k|        tolen = n + ext;
  580|   206k|    } else if (tolen < n + ext) { /* uncommon/unlike case */
  ------------------
  |  Branch (580:16): [True: 573, False: 7.24k]
  ------------------
  581|    573|        BIGNUM temp = *a;
  582|       |
  583|    573|        bn_correct_top(&temp);
  584|    573|        n8 = BN_num_bits(&temp);
  585|    573|        n = (n8 + 7) / 8;       /* This is what BN_num_bytes() does */
  586|    573|        if (tolen < n + ext)
  ------------------
  |  Branch (586:13): [True: 573, False: 0]
  ------------------
  587|    573|            return -1;
  588|    573|    }
  589|       |
  590|       |    /* Swipe through whole available data and don't give away padded zero. */
  591|   213k|    atop = a->dmax * BN_BYTES;
  ------------------
  |  |   38|   213k|#  define BN_BYTES        8
  ------------------
  592|   213k|    if (atop == 0) {
  ------------------
  |  Branch (592:9): [True: 95.9k, False: 117k]
  ------------------
  593|  95.9k|        if (tolen != 0)
  ------------------
  |  Branch (593:13): [True: 667, False: 95.2k]
  ------------------
  594|    667|            memset(to, '\0', tolen);
  595|  95.9k|        return tolen;
  596|  95.9k|    }
  597|       |
  598|       |    /*
  599|       |     * The loop that does the work iterates from least significant
  600|       |     * to most significant BIGNUM limb, so we adapt parameters to
  601|       |     * transfer output bytes accordingly.
  602|       |     */
  603|   117k|    if (endianness == LITTLE) {
  ------------------
  |  Branch (603:9): [True: 1.85k, False: 115k]
  ------------------
  604|  1.85k|        inc = 1;
  605|   115k|    } else {
  606|   115k|        inc = -1;
  607|   115k|        to += tolen - 1;         /* Move to the last byte, not beyond */
  608|   115k|    }
  609|       |
  610|   117k|    lasti = atop - 1;
  611|   117k|    atop = a->top * BN_BYTES;
  ------------------
  |  |   38|   117k|#  define BN_BYTES        8
  ------------------
  612|  5.88M|    for (i = 0, j = 0; j < (size_t)tolen; j++) {
  ------------------
  |  Branch (612:24): [True: 5.76M, False: 117k]
  ------------------
  613|  5.76M|        unsigned char byte, byte_xored;
  614|       |
  615|  5.76M|        l = a->d[i / BN_BYTES];
  ------------------
  |  |   38|  5.76M|#  define BN_BYTES        8
  ------------------
  616|  5.76M|        mask = 0 - ((j - atop) >> (8 * sizeof(i) - 1));
  617|  5.76M|        byte = (unsigned char)(l >> (8 * (i % BN_BYTES)) & mask);
  ------------------
  |  |   38|  5.76M|#  define BN_BYTES        8
  ------------------
  618|  5.76M|        byte_xored = byte ^ xor;
  619|  5.76M|        *to = (unsigned char)(byte_xored + carry);
  620|  5.76M|        carry = byte_xored > *to; /* Implicit 1 or 0 */
  621|  5.76M|        to += inc;
  622|  5.76M|        i += (i - lasti) >> (8 * sizeof(i) - 1); /* stay on last limb */
  623|  5.76M|    }
  624|       |
  625|   117k|    return tolen;
  626|   213k|}

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

BN_nnmod:
   15|  1.13M|{
   16|       |    /*
   17|       |     * like BN_mod, but returns non-negative remainder (i.e., 0 <= r < |d|
   18|       |     * always holds)
   19|       |     */
   20|       |
   21|  1.13M|    if (r == d) {
  ------------------
  |  Branch (21:9): [True: 0, False: 1.13M]
  ------------------
   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|  1.13M|    if (!(BN_mod(r, m, d, ctx)))
  ------------------
  |  |  277|  1.13M|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  ------------------
  |  Branch (26:9): [True: 0, False: 1.13M]
  ------------------
   27|      0|        return 0;
   28|  1.13M|    if (!r->neg)
  ------------------
  |  Branch (28:9): [True: 1.13M, False: 5.25k]
  ------------------
   29|  1.13M|        return 1;
   30|       |    /* now   -|d| < r < 0,  so we have to set  r := r + |d| */
   31|  5.25k|    return (d->neg ? BN_sub : BN_add) (r, r, d);
  ------------------
  |  Branch (31:13): [True: 0, False: 5.25k]
  ------------------
   32|  1.13M|}
bn_mod_add_fixed_top:
   56|  1.51M|{
   57|  1.51M|    size_t i, ai, bi, mtop = m->top;
   58|  1.51M|    BN_ULONG storage[1024 / BN_BITS2];
  ------------------
  |  |   37|  1.51M|#  define BN_ULONG        unsigned long
  ------------------
   59|  1.51M|    BN_ULONG carry, temp, mask, *rp, *tp = storage;
  ------------------
  |  |   37|  1.51M|#  define BN_ULONG        unsigned long
  ------------------
   60|  1.51M|    const BN_ULONG *ap, *bp;
   61|       |
   62|  1.51M|    if (bn_wexpand(r, mtop) == NULL)
  ------------------
  |  Branch (62:9): [True: 0, False: 1.51M]
  ------------------
   63|      0|        return 0;
   64|       |
   65|  1.51M|    if (mtop > OSSL_NELEM(storage)) {
  ------------------
  |  |   14|  1.51M|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (65:9): [True: 0, False: 1.51M]
  ------------------
   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|  1.51M|    ap = a->d != NULL ? a->d : tp;
  ------------------
  |  Branch (71:10): [True: 1.51M, False: 0]
  ------------------
   72|  1.51M|    bp = b->d != NULL ? b->d : tp;
  ------------------
  |  Branch (72:10): [True: 1.51M, False: 63]
  ------------------
   73|       |
   74|  7.41M|    for (i = 0, ai = 0, bi = 0, carry = 0; i < mtop;) {
  ------------------
  |  Branch (74:44): [True: 5.89M, False: 1.51M]
  ------------------
   75|  5.89M|        mask = (BN_ULONG)0 - ((i - a->top) >> (8 * sizeof(i) - 1));
   76|  5.89M|        temp = ((ap[ai] & mask) + carry) & BN_MASK2;
  ------------------
  |  |   94|  5.89M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   77|  5.89M|        carry = (temp < carry);
   78|       |
   79|  5.89M|        mask = (BN_ULONG)0 - ((i - b->top) >> (8 * sizeof(i) - 1));
   80|  5.89M|        tp[i] = ((bp[bi] & mask) + temp) & BN_MASK2;
  ------------------
  |  |   94|  5.89M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   81|  5.89M|        carry += (tp[i] < temp);
   82|       |
   83|  5.89M|        i++;
   84|  5.89M|        ai += (i - a->dmax) >> (8 * sizeof(i) - 1);
   85|  5.89M|        bi += (i - b->dmax) >> (8 * sizeof(i) - 1);
   86|  5.89M|    }
   87|  1.51M|    rp = r->d;
   88|  1.51M|    carry -= bn_sub_words(rp, tp, m->d, mtop);
   89|  7.41M|    for (i = 0; i < mtop; i++) {
  ------------------
  |  Branch (89:17): [True: 5.89M, False: 1.51M]
  ------------------
   90|  5.89M|        rp[i] = (carry & tp[i]) | (~carry & rp[i]);
   91|  5.89M|        ((volatile BN_ULONG *)tp)[i] = 0;
   92|  5.89M|    }
   93|  1.51M|    r->top = mtop;
   94|  1.51M|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  1.51M|#  define BN_FLG_FIXED_TOP 0
  ------------------
   95|  1.51M|    r->neg = 0;
   96|       |
   97|  1.51M|    if (tp != storage)
  ------------------
  |  Branch (97:9): [True: 0, False: 1.51M]
  ------------------
   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|  1.51M|    return 1;
  101|  1.51M|}
BN_mod_add_quick:
  105|  1.51M|{
  106|  1.51M|    int ret = bn_mod_add_fixed_top(r, a, b, m);
  107|       |
  108|  1.51M|    if (ret)
  ------------------
  |  Branch (108:9): [True: 1.51M, False: 0]
  ------------------
  109|  1.51M|        bn_correct_top(r);
  110|       |
  111|  1.51M|    return ret;
  112|  1.51M|}
BN_mod_sub_quick:
  192|  1.54M|{
  193|  1.54M|    if (r == m) {
  ------------------
  |  Branch (193:9): [True: 0, False: 1.54M]
  ------------------
  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|  1.54M|    if (!BN_sub(r, a, b))
  ------------------
  |  Branch (198:9): [True: 0, False: 1.54M]
  ------------------
  199|      0|        return 0;
  200|  1.54M|    if (r->neg)
  ------------------
  |  Branch (200:9): [True: 706k, False: 841k]
  ------------------
  201|   706k|        return BN_add(r, r, m);
  202|   841k|    return 1;
  203|  1.54M|}
BN_mod_mul:
  208|   974k|{
  209|   974k|    BIGNUM *t;
  210|   974k|    int ret = 0;
  211|       |
  212|   974k|    bn_check_top(a);
  213|   974k|    bn_check_top(b);
  214|   974k|    bn_check_top(m);
  215|       |
  216|   974k|    BN_CTX_start(ctx);
  217|   974k|    if ((t = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 974k]
  ------------------
  218|      0|        goto err;
  219|   974k|    if (a == b) {
  ------------------
  |  Branch (219:9): [True: 929k, False: 44.7k]
  ------------------
  220|   929k|        if (!BN_sqr(t, a, ctx))
  ------------------
  |  Branch (220:13): [True: 0, False: 929k]
  ------------------
  221|      0|            goto err;
  222|   929k|    } else {
  223|  44.7k|        if (!BN_mul(t, a, b, ctx))
  ------------------
  |  Branch (223:13): [True: 0, False: 44.7k]
  ------------------
  224|      0|            goto err;
  225|  44.7k|    }
  226|   974k|    if (!BN_nnmod(r, t, m, ctx))
  ------------------
  |  Branch (226:9): [True: 0, False: 974k]
  ------------------
  227|      0|        goto err;
  228|   974k|    bn_check_top(r);
  229|   974k|    ret = 1;
  230|   974k| err:
  231|   974k|    BN_CTX_end(ctx);
  232|   974k|    return ret;
  233|   974k|}
BN_mod_sqr:
  236|  44.0k|{
  237|  44.0k|    if (!BN_sqr(r, a, ctx))
  ------------------
  |  Branch (237:9): [True: 0, False: 44.0k]
  ------------------
  238|      0|        return 0;
  239|       |    /* r->neg == 0,  thus we don't need BN_nnmod */
  240|  44.0k|    return BN_mod(r, r, m, ctx);
  ------------------
  |  |  277|  44.0k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  ------------------
  241|  44.0k|}
BN_mod_lshift1_quick:
  256|   568k|{
  257|   568k|    if (!BN_lshift1(r, a))
  ------------------
  |  Branch (257:9): [True: 0, False: 568k]
  ------------------
  258|      0|        return 0;
  259|   568k|    bn_check_top(r);
  260|   568k|    if (BN_cmp(r, m) >= 0)
  ------------------
  |  Branch (260:9): [True: 279k, False: 288k]
  ------------------
  261|   279k|        return BN_sub(r, r, m);
  262|   288k|    return 1;
  263|   568k|}
BN_mod_lshift_quick:
  293|   295k|{
  294|   295k|    if (r != a) {
  ------------------
  |  Branch (294:9): [True: 267k, False: 27.8k]
  ------------------
  295|   267k|        if (BN_copy(r, a) == NULL)
  ------------------
  |  Branch (295:13): [True: 0, False: 267k]
  ------------------
  296|      0|            return 0;
  297|   267k|    }
  298|       |
  299|   735k|    while (n > 0) {
  ------------------
  |  Branch (299:12): [True: 440k, False: 295k]
  ------------------
  300|   440k|        int max_shift;
  301|       |
  302|       |        /* 0 < r < m */
  303|   440k|        max_shift = BN_num_bits(m) - BN_num_bits(r);
  304|       |        /* max_shift >= 0 */
  305|       |
  306|   440k|        if (max_shift < 0) {
  ------------------
  |  Branch (306:13): [True: 0, False: 440k]
  ------------------
  307|      0|            ERR_raise(ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|   440k|        if (max_shift > n)
  ------------------
  |  Branch (311:13): [True: 194k, False: 245k]
  ------------------
  312|   194k|            max_shift = n;
  313|       |
  314|   440k|        if (max_shift) {
  ------------------
  |  Branch (314:13): [True: 346k, False: 93.4k]
  ------------------
  315|   346k|            if (!BN_lshift(r, r, max_shift))
  ------------------
  |  Branch (315:17): [True: 0, False: 346k]
  ------------------
  316|      0|                return 0;
  317|   346k|            n -= max_shift;
  318|   346k|        } else {
  319|  93.4k|            if (!BN_lshift1(r, r))
  ------------------
  |  Branch (319:17): [True: 0, False: 93.4k]
  ------------------
  320|      0|                return 0;
  321|  93.4k|            --n;
  322|  93.4k|        }
  323|       |
  324|       |        /* BN_num_bits(r) <= BN_num_bits(m) */
  325|       |
  326|   440k|        if (BN_cmp(r, m) >= 0) {
  ------------------
  |  Branch (326:13): [True: 183k, False: 256k]
  ------------------
  327|   183k|            if (!BN_sub(r, r, m))
  ------------------
  |  Branch (327:17): [True: 0, False: 183k]
  ------------------
  328|      0|                return 0;
  329|   183k|        }
  330|   440k|    }
  331|   295k|    bn_check_top(r);
  332|       |
  333|   295k|    return 1;
  334|   295k|}

BN_mod_mul_montgomery:
   28|  5.33M|{
   29|  5.33M|    int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx);
   30|       |
   31|  5.33M|    bn_correct_top(r);
   32|  5.33M|    bn_check_top(r);
   33|       |
   34|  5.33M|    return ret;
   35|  5.33M|}
bn_mul_mont_fixed_top:
   39|  5.92M|{
   40|  5.92M|    BIGNUM *tmp;
   41|  5.92M|    int ret = 0;
   42|  5.92M|    int num = mont->N.top;
   43|       |
   44|  5.92M|#if defined(OPENSSL_BN_ASM_MONT) && defined(MONT_WORD)
   45|  5.92M|    if (num > 1 && num <= BN_SOFT_LIMIT && a->top == num && b->top == num) {
  ------------------
  |  |   62|  11.8M|#  define BN_SOFT_LIMIT         (4096 / BN_BYTES)
  |  |  ------------------
  |  |  |  |   38|  5.91M|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (45:9): [True: 5.91M, False: 11.6k]
  |  Branch (45:20): [True: 5.91M, False: 0]
  |  Branch (45:44): [True: 5.61M, False: 303k]
  |  Branch (45:61): [True: 5.44M, False: 164k]
  ------------------
   46|  5.44M|        if (bn_wexpand(r, num) == NULL)
  ------------------
  |  Branch (46:13): [True: 0, False: 5.44M]
  ------------------
   47|      0|            return 0;
   48|  5.44M|        if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) {
  ------------------
  |  Branch (48:13): [True: 5.44M, False: 0]
  ------------------
   49|  5.44M|            r->neg = a->neg ^ b->neg;
   50|  5.44M|            r->top = num;
   51|  5.44M|            r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  5.44M|#  define BN_FLG_FIXED_TOP 0
  ------------------
   52|  5.44M|            return 1;
   53|  5.44M|        }
   54|  5.44M|    }
   55|   479k|#endif
   56|       |
   57|   479k|    if ((a->top + b->top) > 2 * num)
  ------------------
  |  Branch (57:9): [True: 0, False: 479k]
  ------------------
   58|      0|        return 0;
   59|       |
   60|   479k|    BN_CTX_start(ctx);
   61|   479k|    tmp = BN_CTX_get(ctx);
   62|   479k|    if (tmp == NULL)
  ------------------
  |  Branch (62:9): [True: 0, False: 479k]
  ------------------
   63|      0|        goto err;
   64|       |
   65|   479k|    bn_check_top(tmp);
   66|   479k|    if (a == b) {
  ------------------
  |  Branch (66:9): [True: 18.5k, False: 461k]
  ------------------
   67|  18.5k|        if (!bn_sqr_fixed_top(tmp, a, ctx))
  ------------------
  |  Branch (67:13): [True: 0, False: 18.5k]
  ------------------
   68|      0|            goto err;
   69|   461k|    } else {
   70|   461k|        if (!bn_mul_fixed_top(tmp, a, b, ctx))
  ------------------
  |  Branch (70:13): [True: 0, False: 461k]
  ------------------
   71|      0|            goto err;
   72|   461k|    }
   73|       |    /* reduce from aRR to aR */
   74|   479k|#ifdef MONT_WORD
   75|   479k|    if (!bn_from_montgomery_word(r, tmp, mont))
  ------------------
  |  Branch (75:9): [True: 0, False: 479k]
  ------------------
   76|      0|        goto err;
   77|       |#else
   78|       |    if (!BN_from_montgomery(r, tmp, mont, ctx))
   79|       |        goto err;
   80|       |#endif
   81|   479k|    ret = 1;
   82|   479k| err:
   83|   479k|    BN_CTX_end(ctx);
   84|   479k|    return ret;
   85|   479k|}
BN_from_montgomery:
  164|  12.0k|{
  165|  12.0k|    int retn;
  166|       |
  167|  12.0k|    retn = bn_from_mont_fixed_top(ret, a, mont, ctx);
  168|  12.0k|    bn_correct_top(ret);
  169|  12.0k|    bn_check_top(ret);
  170|       |
  171|  12.0k|    return retn;
  172|  12.0k|}
bn_from_mont_fixed_top:
  176|  12.0k|{
  177|  12.0k|    int retn = 0;
  178|  12.0k|#ifdef MONT_WORD
  179|  12.0k|    BIGNUM *t;
  180|       |
  181|  12.0k|    BN_CTX_start(ctx);
  182|  12.0k|    if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) {
  ------------------
  |  Branch (182:9): [True: 12.0k, False: 0]
  |  Branch (182:34): [True: 12.0k, False: 0]
  ------------------
  183|  12.0k|        retn = bn_from_montgomery_word(ret, t, mont);
  184|  12.0k|    }
  185|  12.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|  12.0k|    return retn;
  220|  12.0k|}
bn_to_mont_fixed_top:
  224|  4.88k|{
  225|  4.88k|    return bn_mul_mont_fixed_top(r, a, &(mont->RR), mont, ctx);
  226|  4.88k|}
BN_MONT_CTX_new:
  229|  9.79k|{
  230|  9.79k|    BN_MONT_CTX *ret;
  231|       |
  232|  9.79k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|  9.79k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  9.79k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  9.79k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (232:9): [True: 0, False: 9.79k]
  ------------------
  233|      0|        return NULL;
  234|       |
  235|  9.79k|    BN_MONT_CTX_init(ret);
  236|  9.79k|    ret->flags = BN_FLG_MALLOCED;
  ------------------
  |  |   58|  9.79k|# define BN_FLG_MALLOCED         0x01
  ------------------
  237|  9.79k|    return ret;
  238|  9.79k|}
BN_MONT_CTX_init:
  241|  9.79k|{
  242|  9.79k|    ctx->ri = 0;
  243|  9.79k|    bn_init(&ctx->RR);
  244|  9.79k|    bn_init(&ctx->N);
  245|  9.79k|    bn_init(&ctx->Ni);
  246|  9.79k|    ctx->n0[0] = ctx->n0[1] = 0;
  247|  9.79k|    ctx->flags = 0;
  248|  9.79k|}
BN_MONT_CTX_free:
  251|   283k|{
  252|   283k|    if (mont == NULL)
  ------------------
  |  Branch (252:9): [True: 273k, False: 9.79k]
  ------------------
  253|   273k|        return;
  254|  9.79k|    BN_clear_free(&mont->RR);
  255|  9.79k|    BN_clear_free(&mont->N);
  256|  9.79k|    BN_clear_free(&mont->Ni);
  257|  9.79k|    if (mont->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|  9.79k|# define BN_FLG_MALLOCED         0x01
  ------------------
  |  Branch (257:9): [True: 9.79k, False: 0]
  ------------------
  258|  9.79k|        OPENSSL_free(mont);
  ------------------
  |  |  115|  9.79k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  9.79k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  9.79k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  259|  9.79k|}
BN_MONT_CTX_set:
  262|  8.16k|{
  263|  8.16k|    int i, ret = 0;
  264|  8.16k|    BIGNUM *Ri, *R;
  265|       |
  266|  8.16k|    if (BN_is_zero(mod))
  ------------------
  |  Branch (266:9): [True: 0, False: 8.16k]
  ------------------
  267|      0|        return 0;
  268|       |
  269|  8.16k|    BN_CTX_start(ctx);
  270|  8.16k|    if ((Ri = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (270:9): [True: 0, False: 8.16k]
  ------------------
  271|      0|        goto err;
  272|  8.16k|    R = &(mont->RR);            /* grab RR as a temp */
  273|  8.16k|    if (!BN_copy(&(mont->N), mod))
  ------------------
  |  Branch (273:9): [True: 0, False: 8.16k]
  ------------------
  274|      0|        goto err;               /* Set N */
  275|  8.16k|    if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|  8.16k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (275:9): [True: 0, False: 8.16k]
  ------------------
  276|      0|        BN_set_flags(&(mont->N), BN_FLG_CONSTTIME);
  ------------------
  |  |   67|      0|# define BN_FLG_CONSTTIME        0x04
  ------------------
  277|  8.16k|    mont->N.neg = 0;
  278|       |
  279|  8.16k|#ifdef MONT_WORD
  280|  8.16k|    {
  281|  8.16k|        BIGNUM tmod;
  282|  8.16k|        BN_ULONG buf[2];
  ------------------
  |  |   37|  8.16k|#  define BN_ULONG        unsigned long
  ------------------
  283|       |
  284|  8.16k|        bn_init(&tmod);
  285|  8.16k|        tmod.d = buf;
  286|  8.16k|        tmod.dmax = 2;
  287|  8.16k|        tmod.neg = 0;
  288|       |
  289|  8.16k|        if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|  8.16k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (289:13): [True: 0, False: 8.16k]
  ------------------
  290|      0|            BN_set_flags(&tmod, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|      0|# define BN_FLG_CONSTTIME        0x04
  ------------------
  291|       |
  292|  8.16k|        mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|  8.16k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  8.16k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                      mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|  8.16k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  8.16k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
                      mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|  8.16k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  8.16k|#  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|  8.16k|        BN_zero(R);
  ------------------
  |  |  202|  8.16k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  340|  8.16k|        if (!(BN_set_bit(R, BN_BITS2)))
  ------------------
  |  |   54|  8.16k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  8.16k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (340:13): [True: 0, False: 8.16k]
  ------------------
  341|      0|            goto err;           /* R */
  342|       |
  343|  8.16k|        buf[0] = mod->d[0];     /* tmod = N mod word size */
  344|  8.16k|        buf[1] = 0;
  345|  8.16k|        tmod.top = buf[0] != 0 ? 1 : 0;
  ------------------
  |  Branch (345:20): [True: 8.15k, False: 10]
  ------------------
  346|       |        /* Ri = R^-1 mod N */
  347|  8.16k|        if (BN_is_one(&tmod))
  ------------------
  |  Branch (347:13): [True: 1.35k, False: 6.81k]
  ------------------
  348|  1.35k|            BN_zero(Ri);
  ------------------
  |  |  202|  1.35k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  349|  6.81k|        else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
  ------------------
  |  Branch (349:18): [True: 193, False: 6.62k]
  ------------------
  350|    193|            goto err;
  351|  7.97k|        if (!BN_lshift(Ri, Ri, BN_BITS2))
  ------------------
  |  |   54|  7.97k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.97k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (351:13): [True: 0, False: 7.97k]
  ------------------
  352|      0|            goto err;           /* R*Ri */
  353|  7.97k|        if (!BN_is_zero(Ri)) {
  ------------------
  |  Branch (353:13): [True: 6.62k, False: 1.35k]
  ------------------
  354|  6.62k|            if (!BN_sub_word(Ri, 1))
  ------------------
  |  Branch (354:17): [True: 0, False: 6.62k]
  ------------------
  355|      0|                goto err;
  356|  6.62k|        } else {                /* if N mod word size == 1 */
  357|       |
  358|  1.35k|            if (!BN_set_word(Ri, BN_MASK2))
  ------------------
  |  |   94|  1.35k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  |  Branch (358:17): [True: 0, False: 1.35k]
  ------------------
  359|      0|                goto err;       /* Ri-- (mod word size) */
  360|  1.35k|        }
  361|  7.97k|        if (!BN_div(Ri, NULL, Ri, &tmod, ctx))
  ------------------
  |  Branch (361:13): [True: 0, False: 7.97k]
  ------------------
  362|      0|            goto err;
  363|       |        /*
  364|       |         * Ni = (R*Ri-1)/N, keep only least significant word:
  365|       |         */
  366|  7.97k|        mont->n0[0] = (Ri->top > 0) ? Ri->d[0] : 0;
  ------------------
  |  Branch (366:23): [True: 7.97k, False: 0]
  ------------------
  367|  7.97k|        mont->n0[1] = 0;
  368|  7.97k|# endif
  369|  7.97k|    }
  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|  7.97k|    BN_zero(&(mont->RR));
  ------------------
  |  |  202|  7.97k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  393|  7.97k|    if (!BN_set_bit(&(mont->RR), mont->ri * 2))
  ------------------
  |  Branch (393:9): [True: 0, False: 7.97k]
  ------------------
  394|      0|        goto err;
  395|  7.97k|    if (!BN_mod(&(mont->RR), &(mont->RR), &(mont->N), ctx))
  ------------------
  |  |  277|  7.97k|# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
  ------------------
  |  Branch (395:9): [True: 0, False: 7.97k]
  ------------------
  396|      0|        goto err;
  397|       |
  398|  9.33k|    for (i = mont->RR.top, ret = mont->N.top; i < ret; i++)
  ------------------
  |  Branch (398:47): [True: 1.35k, False: 7.97k]
  ------------------
  399|  1.35k|        mont->RR.d[i] = 0;
  400|  7.97k|    mont->RR.top = ret;
  401|  7.97k|    mont->RR.flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  7.97k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  402|       |
  403|  7.97k|    ret = 1;
  404|  8.16k| err:
  405|  8.16k|    BN_CTX_end(ctx);
  406|  8.16k|    return ret;
  407|  7.97k|}
BN_MONT_CTX_copy:
  410|  1.51k|{
  411|  1.51k|    if (to == from)
  ------------------
  |  Branch (411:9): [True: 0, False: 1.51k]
  ------------------
  412|      0|        return to;
  413|       |
  414|  1.51k|    if (!BN_copy(&(to->RR), &(from->RR)))
  ------------------
  |  Branch (414:9): [True: 0, False: 1.51k]
  ------------------
  415|      0|        return NULL;
  416|  1.51k|    if (!BN_copy(&(to->N), &(from->N)))
  ------------------
  |  Branch (416:9): [True: 0, False: 1.51k]
  ------------------
  417|      0|        return NULL;
  418|  1.51k|    if (!BN_copy(&(to->Ni), &(from->Ni)))
  ------------------
  |  Branch (418:9): [True: 0, False: 1.51k]
  ------------------
  419|      0|        return NULL;
  420|  1.51k|    to->ri = from->ri;
  421|  1.51k|    to->n0[0] = from->n0[0];
  422|  1.51k|    to->n0[1] = from->n0[1];
  423|  1.51k|    return to;
  424|  1.51k|}
BN_MONT_CTX_set_locked:
  428|     27|{
  429|     27|    BN_MONT_CTX *ret;
  430|       |
  431|     27|    if (!CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (431:9): [True: 0, False: 27]
  ------------------
  432|      0|        return NULL;
  433|     27|    ret = *pmont;
  434|     27|    CRYPTO_THREAD_unlock(lock);
  435|     27|    if (ret)
  ------------------
  |  Branch (435:9): [True: 0, False: 27]
  ------------------
  436|      0|        return ret;
  437|       |
  438|       |    /*
  439|       |     * We don't want to serialize globally while doing our lazy-init math in
  440|       |     * BN_MONT_CTX_set. That punishes threads that are doing independent
  441|       |     * things. Instead, punish the case where more than one thread tries to
  442|       |     * lazy-init the same 'pmont', by having each do the lazy-init math work
  443|       |     * independently and only use the one from the thread that wins the race
  444|       |     * (the losers throw away the work they've done).
  445|       |     */
  446|     27|    ret = BN_MONT_CTX_new();
  447|     27|    if (ret == NULL)
  ------------------
  |  Branch (447:9): [True: 0, False: 27]
  ------------------
  448|      0|        return NULL;
  449|     27|    if (!BN_MONT_CTX_set(ret, mod, ctx)) {
  ------------------
  |  Branch (449:9): [True: 2, False: 25]
  ------------------
  450|      2|        BN_MONT_CTX_free(ret);
  451|      2|        return NULL;
  452|      2|    }
  453|       |
  454|       |    /* The locked compare-and-set, after the local work is done. */
  455|     25|    if (!CRYPTO_THREAD_write_lock(lock)) {
  ------------------
  |  Branch (455:9): [True: 0, False: 25]
  ------------------
  456|      0|        BN_MONT_CTX_free(ret);
  457|      0|        return NULL;
  458|      0|    }
  459|       |
  460|     25|    if (*pmont) {
  ------------------
  |  Branch (460:9): [True: 0, False: 25]
  ------------------
  461|      0|        BN_MONT_CTX_free(ret);
  462|      0|        ret = *pmont;
  463|      0|    } else
  464|     25|        *pmont = ret;
  465|     25|    CRYPTO_THREAD_unlock(lock);
  466|     25|    return ret;
  467|     25|}
ossl_bn_mont_ctx_set:
  471|    108|{
  472|    108|    if (BN_copy(&ctx->N, modulus) == NULL)
  ------------------
  |  Branch (472:9): [True: 0, False: 108]
  ------------------
  473|      0|        return 0;
  474|    108|    if (BN_bin2bn(rr, rrlen, &ctx->RR) == NULL)
  ------------------
  |  Branch (474:9): [True: 0, False: 108]
  ------------------
  475|      0|        return 0;
  476|    108|    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|    108|    ctx->n0[0] = ((BN_ULONG)nhi << 32)| nlo;
  485|    108|    ctx->n0[1] = 0;
  486|    108|#endif
  487|       |
  488|    108|    return 1;
  489|    108|}
bn_mont.c:bn_from_montgomery_word:
   89|   491k|{
   90|   491k|    BIGNUM *n;
   91|   491k|    BN_ULONG *ap, *np, *rp, n0, v, carry;
  ------------------
  |  |   37|   491k|#  define BN_ULONG        unsigned long
  ------------------
   92|   491k|    int nl, max, i;
   93|   491k|    unsigned int rtop;
   94|       |
   95|   491k|    n = &(mont->N);
   96|   491k|    nl = n->top;
   97|   491k|    if (nl == 0) {
  ------------------
  |  Branch (97:9): [True: 0, False: 491k]
  ------------------
   98|      0|        ret->top = 0;
   99|      0|        return 1;
  100|      0|    }
  101|       |
  102|   491k|    max = (2 * nl);             /* carry is stored separately */
  103|   491k|    if (bn_wexpand(r, max) == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 491k]
  ------------------
  104|      0|        return 0;
  105|       |
  106|   491k|    r->neg ^= n->neg;
  107|   491k|    np = n->d;
  108|   491k|    rp = r->d;
  109|       |
  110|       |    /* clear the top words of T */
  111|  4.20M|    for (rtop = r->top, i = 0; i < max; i++) {
  ------------------
  |  Branch (111:32): [True: 3.70M, False: 491k]
  ------------------
  112|  3.70M|        v = (BN_ULONG)0 - ((i - rtop) >> (8 * sizeof(rtop) - 1));
  113|  3.70M|        rp[i] &= v;
  114|  3.70M|    }
  115|       |
  116|   491k|    r->top = max;
  117|   491k|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   491k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  118|   491k|    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|  2.34M|    for (carry = 0, i = 0; i < nl; i++, rp++) {
  ------------------
  |  Branch (125:28): [True: 1.85M, False: 491k]
  ------------------
  126|  1.85M|        v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2);
  ------------------
  |  |   94|  1.85M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  127|  1.85M|        v = (v + carry + rp[nl]) & BN_MASK2;
  ------------------
  |  |   94|  1.85M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  128|  1.85M|        carry |= (v != rp[nl]);
  129|  1.85M|        carry &= (v <= rp[nl]);
  130|  1.85M|        rp[nl] = v;
  131|  1.85M|    }
  132|       |
  133|   491k|    if (bn_wexpand(ret, nl) == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 491k]
  ------------------
  134|      0|        return 0;
  135|   491k|    ret->top = nl;
  136|   491k|    ret->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|   491k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  137|   491k|    ret->neg = r->neg;
  138|       |
  139|   491k|    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|   491k|    ap = &(r->d[nl]);
  146|       |
  147|   491k|    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|  2.34M|    for (i = 0; i < nl; i++) {
  ------------------
  |  Branch (153:17): [True: 1.85M, False: 491k]
  ------------------
  154|  1.85M|        rp[i] = (carry & ap[i]) | (~carry & rp[i]);
  155|  1.85M|        ap[i] = 0;
  156|  1.85M|    }
  157|       |
  158|   491k|    return 1;
  159|   491k|}

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

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

BN_print:
   32|  21.9k|{
   33|  21.9k|    int i, j, v, z = 0;
   34|  21.9k|    int ret = 0;
   35|       |
   36|  21.9k|    if ((a->neg) && BIO_write(bp, "-", 1) != 1)
  ------------------
  |  Branch (36:9): [True: 0, False: 21.9k]
  |  Branch (36:21): [True: 0, False: 0]
  ------------------
   37|      0|        goto end;
   38|  21.9k|    if (BN_is_zero(a) && BIO_write(bp, "0", 1) != 1)
  ------------------
  |  Branch (38:9): [True: 9.06k, False: 12.8k]
  |  Branch (38:26): [True: 0, False: 9.06k]
  ------------------
   39|      0|        goto end;
   40|  71.4k|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (40:26): [True: 49.5k, False: 21.9k]
  ------------------
   41|   841k|        for (j = BN_BITS2 - 4; j >= 0; j -= 4) {
  ------------------
  |  |   54|  49.5k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  49.5k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (41:32): [True: 792k, False: 49.5k]
  ------------------
   42|       |            /* strip leading zeros */
   43|   792k|            v = (int)((a->d[i] >> j) & 0x0f);
   44|   792k|            if (z || v != 0) {
  ------------------
  |  Branch (44:17): [True: 633k, False: 159k]
  |  Branch (44:22): [True: 12.8k, False: 146k]
  ------------------
   45|   646k|                if (BIO_write(bp, &Hex[v], 1) != 1)
  ------------------
  |  Branch (45:21): [True: 0, False: 646k]
  ------------------
   46|      0|                    goto end;
   47|   646k|                z = 1;
   48|   646k|            }
   49|   792k|        }
   50|  49.5k|    }
   51|  21.9k|    ret = 1;
   52|  21.9k| end:
   53|  21.9k|    return ret;
   54|  21.9k|}

BN_priv_rand_ex:
  119|  2.91k|{
  120|  2.91k|    return bnrand(PRIVATE, rnd, bits, top, bottom, strength, ctx);
  121|  2.91k|}
BN_priv_rand_range_ex:
  218|  1.16k|{
  219|  1.16k|    return bnrand_range(PRIVATE, r, range, strength, ctx);
  220|  1.16k|}
bn_rand.c:bnrand:
   25|  4.08k|{
   26|  4.08k|    unsigned char *buf = NULL;
   27|  4.08k|    int b, ret = 0, bit, bytes, mask;
   28|  4.08k|    OSSL_LIB_CTX *libctx = ossl_bn_get_libctx(ctx);
   29|       |
   30|  4.08k|    if (bits == 0) {
  ------------------
  |  Branch (30:9): [True: 0, False: 4.08k]
  ------------------
   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|  4.08k|    if (bits < 0 || (bits == 1 && top > 0))
  ------------------
  |  Branch (36:9): [True: 0, False: 4.08k]
  |  Branch (36:22): [True: 0, False: 4.08k]
  |  Branch (36:35): [True: 0, False: 0]
  ------------------
   37|      0|        goto toosmall;
   38|       |
   39|  4.08k|    bytes = (bits + 7) / 8;
   40|  4.08k|    bit = (bits - 1) % 8;
   41|  4.08k|    mask = 0xff << (bit + 1);
   42|       |
   43|  4.08k|    buf = OPENSSL_malloc(bytes);
  ------------------
  |  |  102|  4.08k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.08k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.08k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|  4.08k|    if (buf == NULL)
  ------------------
  |  Branch (44:9): [True: 0, False: 4.08k]
  ------------------
   45|      0|        goto err;
   46|       |
   47|       |    /* make a random number and set the top and bottom bits */
   48|  4.08k|    b = flag == NORMAL ? RAND_bytes_ex(libctx, buf, bytes, strength)
  ------------------
  |  Branch (48:9): [True: 0, False: 4.08k]
  ------------------
   49|  4.08k|                       : RAND_priv_bytes_ex(libctx, buf, bytes, strength);
   50|  4.08k|    if (b <= 0)
  ------------------
  |  Branch (50:9): [True: 0, False: 4.08k]
  ------------------
   51|      0|        goto err;
   52|       |
   53|  4.08k|    if (flag == TESTING) {
  ------------------
  |  Branch (53:9): [True: 0, False: 4.08k]
  ------------------
   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|  4.08k|    if (top >= 0) {
  ------------------
  |  Branch (72:9): [True: 1.42k, False: 2.66k]
  ------------------
   73|  1.42k|        if (top) {
  ------------------
  |  Branch (73:13): [True: 0, False: 1.42k]
  ------------------
   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|  1.42k|        } else {
   81|  1.42k|            buf[0] |= (1 << bit);
   82|  1.42k|        }
   83|  1.42k|    }
   84|  4.08k|    buf[0] &= ~mask;
   85|  4.08k|    if (bottom)                 /* set bottom bit if requested */
  ------------------
  |  Branch (85:9): [True: 0, False: 4.08k]
  ------------------
   86|      0|        buf[bytes - 1] |= 1;
   87|  4.08k|    if (!BN_bin2bn(buf, bytes, rnd))
  ------------------
  |  Branch (87:9): [True: 0, False: 4.08k]
  ------------------
   88|      0|        goto err;
   89|  4.08k|    ret = 1;
   90|  4.08k| err:
   91|  4.08k|    OPENSSL_clear_free(buf, bytes);
  ------------------
  |  |  113|  4.08k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.08k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.08k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  4.08k|    bn_check_top(rnd);
   93|  4.08k|    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|  4.08k|}
bn_rand.c:bnrand_range:
  133|  1.16k|{
  134|  1.16k|    int n;
  135|  1.16k|    int count = 100;
  136|       |
  137|  1.16k|    if (r == NULL) {
  ------------------
  |  Branch (137:9): [True: 0, False: 1.16k]
  ------------------
  138|      0|        ERR_raise(ERR_LIB_BN, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  139|      0|        return 0;
  140|      0|    }
  141|       |
  142|  1.16k|    if (range->neg || BN_is_zero(range)) {
  ------------------
  |  Branch (142:9): [True: 0, False: 1.16k]
  |  Branch (142:23): [True: 0, False: 1.16k]
  ------------------
  143|      0|        ERR_raise(ERR_LIB_BN, BN_R_INVALID_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  144|      0|        return 0;
  145|      0|    }
  146|       |
  147|  1.16k|    n = BN_num_bits(range);     /* n > 0 */
  148|       |
  149|       |    /* BN_is_bit_set(range, n - 1) always holds */
  150|       |
  151|  1.16k|    if (n == 1)
  ------------------
  |  Branch (151:9): [True: 0, False: 1.16k]
  ------------------
  152|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  153|  1.16k|    else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3)) {
  ------------------
  |  Branch (153:14): [True: 392, False: 775]
  |  Branch (153:46): [True: 171, False: 221]
  ------------------
  154|       |        /*
  155|       |         * range = 100..._2, so 3*range (= 11..._2) is exactly one bit longer
  156|       |         * than range
  157|       |         */
  158|    171|        do {
  159|    171|            if (!bnrand(flag, r, n + 1, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   80|    171|#define BN_RAND_TOP_ANY    -1
  ------------------
                          if (!bnrand(flag, r, n + 1, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   85|    171|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  |  Branch (159:17): [True: 0, False: 171]
  ------------------
  160|    171|                        strength, ctx))
  161|      0|                return 0;
  162|       |
  163|       |            /*
  164|       |             * If r < 3*range, use r := r MOD range (which is either r, r -
  165|       |             * range, or r - 2*range). Otherwise, iterate once more. Since
  166|       |             * 3*range = 11..._2, each iteration succeeds with probability >=
  167|       |             * .75.
  168|       |             */
  169|    171|            if (BN_cmp(r, range) >= 0) {
  ------------------
  |  Branch (169:17): [True: 171, False: 0]
  ------------------
  170|    171|                if (!BN_sub(r, r, range))
  ------------------
  |  Branch (170:21): [True: 0, False: 171]
  ------------------
  171|      0|                    return 0;
  172|    171|                if (BN_cmp(r, range) >= 0)
  ------------------
  |  Branch (172:21): [True: 48, False: 123]
  ------------------
  173|     48|                    if (!BN_sub(r, r, range))
  ------------------
  |  Branch (173:25): [True: 0, False: 48]
  ------------------
  174|      0|                        return 0;
  175|    171|            }
  176|       |
  177|    171|            if (!--count) {
  ------------------
  |  Branch (177:17): [True: 0, False: 171]
  ------------------
  178|      0|                ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|                return 0;
  180|      0|            }
  181|       |
  182|    171|        }
  183|    171|        while (BN_cmp(r, range) >= 0);
  ------------------
  |  Branch (183:16): [True: 0, False: 171]
  ------------------
  184|    996|    } else {
  185|    996|        do {
  186|       |            /* range = 11..._2  or  range = 101..._2 */
  187|    996|            if (!bnrand(flag, r, n, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   80|    996|#define BN_RAND_TOP_ANY    -1
  ------------------
                          if (!bnrand(flag, r, n, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   85|    996|#define BN_RAND_BOTTOM_ANY  0
  ------------------
  |  Branch (187:17): [True: 0, False: 996]
  ------------------
  188|    996|                        strength, ctx))
  189|      0|                return 0;
  190|       |
  191|    996|            if (!--count) {
  ------------------
  |  Branch (191:17): [True: 0, False: 996]
  ------------------
  192|      0|                ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  193|      0|                return 0;
  194|      0|            }
  195|    996|        }
  196|    996|        while (BN_cmp(r, range) >= 0);
  ------------------
  |  Branch (196:16): [True: 0, False: 996]
  ------------------
  197|    996|    }
  198|       |
  199|  1.16k|    bn_check_top(r);
  200|  1.16k|    return 1;
  201|  1.16k|}

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

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

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

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

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

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

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

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

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|  13.9k|{
   49|  13.9k|    if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  13.9k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (49:9): [True: 1.97k, False: 11.9k]
  ------------------
   50|  1.97k|        CMS_SignerInfo *si = (CMS_SignerInfo *)*pval;
   51|  1.97k|        EVP_PKEY_free(si->pkey);
   52|  1.97k|        X509_free(si->signer);
   53|  1.97k|        EVP_MD_CTX_free(si->mctx);
   54|  1.97k|        EVP_PKEY_CTX_free(si->pctx);
   55|  1.97k|    }
   56|  13.9k|    return 1;
   57|  13.9k|}
cms_asn1.c:cms_ec_cb:
   96|    581|{
   97|    581|    CMS_EncryptedContentInfo *ec = (CMS_EncryptedContentInfo *)*pval;
   98|       |
   99|    581|    if (operation == ASN1_OP_FREE_POST)
  ------------------
  |  |  745|    581|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (99:9): [True: 52, False: 529]
  ------------------
  100|     52|        OPENSSL_clear_free(ec->key, ec->keylen);
  ------------------
  |  |  113|     52|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     52|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     52|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  101|    581|    return 1;
  102|    581|}
cms_asn1.c:cms_rek_cb:
  135|  4.44k|{
  136|  4.44k|    CMS_RecipientEncryptedKey *rek = (CMS_RecipientEncryptedKey *)*pval;
  137|  4.44k|    if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  4.44k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (137:9): [True: 740, False: 3.70k]
  ------------------
  138|    740|        EVP_PKEY_free(rek->pkey);
  139|    740|    }
  140|  4.44k|    return 1;
  141|  4.44k|}
cms_asn1.c:cms_kari_cb:
  161|  12.9k|{
  162|  12.9k|    CMS_KeyAgreeRecipientInfo *kari = (CMS_KeyAgreeRecipientInfo *)*pval;
  163|  12.9k|    if (operation == ASN1_OP_NEW_POST) {
  ------------------
  |  |  743|  12.9k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (163:9): [True: 1.62k, False: 11.3k]
  ------------------
  164|  1.62k|        kari->ctx = EVP_CIPHER_CTX_new();
  165|  1.62k|        if (kari->ctx == NULL)
  ------------------
  |  Branch (165:13): [True: 0, False: 1.62k]
  ------------------
  166|      0|            return 0;
  167|  1.62k|        EVP_CIPHER_CTX_set_flags(kari->ctx, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW);
  ------------------
  |  |  365|  1.62k|# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1
  ------------------
  168|  1.62k|        kari->pctx = NULL;
  169|  11.3k|    } else if (operation == ASN1_OP_FREE_POST) {
  ------------------
  |  |  745|  11.3k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (169:16): [True: 1.62k, False: 9.68k]
  ------------------
  170|  1.62k|        EVP_PKEY_CTX_free(kari->pctx);
  171|  1.62k|        EVP_CIPHER_CTX_free(kari->ctx);
  172|  1.62k|    }
  173|  12.9k|    return 1;
  174|  12.9k|}
cms_asn1.c:cms_ri_cb:
  212|  61.1k|{
  213|  61.1k|    if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  61.1k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (213:9): [True: 8.58k, False: 52.5k]
  ------------------
  214|  8.58k|        CMS_RecipientInfo *ri = (CMS_RecipientInfo *)*pval;
  215|  8.58k|        if (ri->type == CMS_RECIPINFO_TRANS) {
  ------------------
  |  |  164|  8.58k|# define CMS_RECIPINFO_TRANS             0
  ------------------
  |  Branch (215:13): [True: 270, False: 8.31k]
  ------------------
  216|    270|            CMS_KeyTransRecipientInfo *ktri = ri->d.ktri;
  217|    270|            EVP_PKEY_free(ktri->pkey);
  218|    270|            X509_free(ktri->recip);
  219|    270|            EVP_PKEY_CTX_free(ktri->pctx);
  220|  8.31k|        } else if (ri->type == CMS_RECIPINFO_KEK) {
  ------------------
  |  |  166|  8.31k|# define CMS_RECIPINFO_KEK               2
  ------------------
  |  Branch (220:20): [True: 159, False: 8.15k]
  ------------------
  221|    159|            CMS_KEKRecipientInfo *kekri = ri->d.kekri;
  222|    159|            OPENSSL_clear_free(kekri->key, kekri->keylen);
  ------------------
  |  |  113|    159|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    159|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    159|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  223|  8.15k|        } else if (ri->type == CMS_RECIPINFO_PASS) {
  ------------------
  |  |  167|  8.15k|# define CMS_RECIPINFO_PASS              3
  ------------------
  |  Branch (223:20): [True: 5.29k, False: 2.85k]
  ------------------
  224|  5.29k|            CMS_PasswordRecipientInfo *pwri = ri->d.pwri;
  225|  5.29k|            OPENSSL_clear_free(pwri->pass, pwri->passlen);
  ------------------
  |  |  113|  5.29k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.29k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.29k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  226|  5.29k|        }
  227|  8.58k|    }
  228|  61.1k|    return 1;
  229|  61.1k|}
cms_asn1.c:cms_cb:
  307|  46.7k|{
  308|  46.7k|    ASN1_STREAM_ARG *sarg = exarg;
  309|  46.7k|    CMS_ContentInfo *cms = NULL;
  310|  46.7k|    if (pval)
  ------------------
  |  Branch (310:9): [True: 46.7k, False: 0]
  ------------------
  311|  46.7k|        cms = (CMS_ContentInfo *)*pval;
  312|      0|    else
  313|      0|        return 1;
  314|  46.7k|    switch (operation) {
  ------------------
  |  Branch (314:13): [True: 37.8k, False: 8.87k]
  ------------------
  315|       |
  316|      0|    case ASN1_OP_STREAM_PRE:
  ------------------
  |  |  752|      0|# define ASN1_OP_STREAM_PRE      10
  ------------------
  |  Branch (316:5): [True: 0, False: 46.7k]
  ------------------
  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: 46.7k]
  ------------------
  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: 46.7k]
  ------------------
  327|      0|    case ASN1_OP_DETACHED_POST:
  ------------------
  |  |  755|      0|# define ASN1_OP_DETACHED_POST   13
  ------------------
  |  Branch (327:5): [True: 0, False: 46.7k]
  ------------------
  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|  8.87k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  8.87k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (332:5): [True: 8.87k, False: 37.8k]
  ------------------
  333|  8.87k|        OPENSSL_free(cms->ctx.propq);
  ------------------
  |  |  115|  8.87k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  8.87k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  8.87k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  334|  8.87k|        break;
  335|       |
  336|  46.7k|    }
  337|  46.7k|    return 1;
  338|  46.7k|}

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

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

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

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

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

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

ossl_load_builtin_compressions:
   29|      4|{
   30|      4|    STACK_OF(SSL_COMP) *comp_methods = NULL;
  ------------------
  |  |   31|      4|# define STACK_OF(type) struct stack_st_##type
  ------------------
   31|      4|#ifndef OPENSSL_NO_COMP
   32|      4|    SSL_COMP *comp = NULL;
   33|      4|    COMP_METHOD *method = COMP_zlib();
   34|       |
   35|      4|    comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
  ------------------
  |  |   69|      4|#define sk_SSL_COMP_new(cmp) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new(ossl_check_SSL_COMP_compfunc_type(cmp)))
  ------------------
   36|       |
   37|      4|    if (COMP_get_type(method) != NID_undef && comp_methods != NULL) {
  ------------------
  |  |   18|      8|#define NID_undef                       0
  ------------------
  |  Branch (37:9): [True: 0, False: 4]
  |  Branch (37:47): [True: 0, False: 0]
  ------------------
   38|      0|        comp = OPENSSL_malloc(sizeof(*comp));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|      4|#endif
   48|      4|    return comp_methods;
   49|      4|}
ossl_free_compression_methods_int:
   57|      2|{
   58|      2|    sk_SSL_COMP_pop_free(methods, cmeth_free);
  ------------------
  |  |   81|      2|#define sk_SSL_COMP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SSL_COMP_sk_type(sk),ossl_check_SSL_COMP_freefunc_type(freefunc))
  ------------------
   59|      2|}

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

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

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

NCONF_new_ex:
  183|      2|{
  184|      2|    CONF *ret;
  185|       |
  186|      2|    if (meth == NULL)
  ------------------
  |  Branch (186:9): [True: 2, False: 0]
  ------------------
  187|      2|        meth = NCONF_default();
  188|       |
  189|      2|    ret = meth->create(meth);
  190|      2|    if (ret == NULL) {
  ------------------
  |  Branch (190:9): [True: 0, False: 2]
  ------------------
  191|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_CONF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|      2|    ret->libctx = libctx;
  195|       |
  196|      2|    return ret;
  197|      2|}
NCONF_free:
  205|      2|{
  206|      2|    if (conf == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 2]
  ------------------
  207|      0|        return;
  208|      2|    conf->meth->destroy(conf);
  209|      2|}
NCONF_load:
  251|      2|{
  252|      2|    if (conf == NULL) {
  ------------------
  |  Branch (252:9): [True: 0, False: 2]
  ------------------
  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|      2|    return conf->meth->load(conf, file, eline);
  258|      2|}

CONF_modules_load_file_ex:
  193|      2|{
  194|      2|    char *file = NULL;
  195|      2|    CONF *conf = NULL;
  196|      2|    int ret = 0, diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
  197|       |
  198|      2|    ERR_set_mark();
  199|       |
  200|      2|    if (filename == NULL) {
  ------------------
  |  Branch (200:9): [True: 2, False: 0]
  ------------------
  201|      2|        file = CONF_get1_default_config_file();
  202|      2|        if (file == NULL)
  ------------------
  |  Branch (202:13): [True: 0, False: 2]
  ------------------
  203|      0|            goto err;
  204|      2|        if (*file == '\0') {
  ------------------
  |  Branch (204:13): [True: 0, False: 2]
  ------------------
  205|       |            /* Do not try to load an empty file name but do not error out */
  206|      0|            ret = 1;
  207|      0|            goto err;
  208|      0|        }
  209|      2|    } else {
  210|      0|        file = (char *)filename;
  211|      0|    }
  212|       |
  213|      2|    conf = NCONF_new_ex(libctx, NULL);
  214|      2|    if (conf == NULL)
  ------------------
  |  Branch (214:9): [True: 0, False: 2]
  ------------------
  215|      0|        goto err;
  216|       |
  217|      2|    if (NCONF_load(conf, file, NULL) <= 0) {
  ------------------
  |  Branch (217:9): [True: 2, False: 0]
  ------------------
  218|      2|        if ((flags & CONF_MFLAGS_IGNORE_MISSING_FILE) &&
  ------------------
  |  |  110|      2|# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
  ------------------
  |  Branch (218:13): [True: 2, False: 0]
  ------------------
  219|      2|            (ERR_GET_REASON(ERR_peek_last_error()) == CONF_R_NO_SUCH_FILE)) {
  ------------------
  |  |   36|      2|# define CONF_R_NO_SUCH_FILE                              114
  ------------------
  |  Branch (219:13): [True: 2, False: 0]
  ------------------
  220|      2|            ret = 1;
  221|      2|        }
  222|      2|        goto err;
  223|      2|    }
  224|       |
  225|      0|    ret = CONF_modules_load(conf, appname, flags);
  226|       |    /* CONF_modules_load() might change the diagnostics setting, reread it. */
  227|      0|    diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
  228|       |
  229|      2| err:
  230|      2|    if (filename == NULL)
  ------------------
  |  Branch (230:9): [True: 2, False: 0]
  ------------------
  231|      2|        OPENSSL_free(file);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  232|      2|    NCONF_free(conf);
  233|       |
  234|      2|    if ((flags & CONF_MFLAGS_IGNORE_RETURN_CODES) != 0 && !diagnostics)
  ------------------
  |  |  107|      2|# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
  ------------------
  |  Branch (234:9): [True: 2, False: 0]
  |  Branch (234:59): [True: 2, False: 0]
  ------------------
  235|      2|        ret = 1;
  236|       |
  237|      2|    if (ret > 0)
  ------------------
  |  Branch (237:9): [True: 2, False: 0]
  ------------------
  238|      2|        ERR_pop_to_mark();
  239|      0|    else
  240|      0|        ERR_clear_last_mark();
  241|       |
  242|      2|    return ret;
  243|      0|}
CONF_modules_unload:
  517|      2|{
  518|      2|    int i;
  519|      2|    CONF_MODULE *md;
  520|      2|    STACK_OF(CONF_MODULE) *old_modules;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  521|      2|    STACK_OF(CONF_MODULE) *new_modules;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  522|      2|    STACK_OF(CONF_MODULE) *to_delete;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  523|       |
  524|      2|    if (!conf_modules_finish_int()) /* also inits module list lock */
  ------------------
  |  Branch (524:9): [True: 0, False: 2]
  ------------------
  525|      0|        return;
  526|       |
  527|      2|    ossl_rcu_write_lock(module_list_lock);
  528|       |
  529|      2|    old_modules = ossl_rcu_deref(&supported_modules);
  ------------------
  |  |   30|      2|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  530|      2|    new_modules = sk_CONF_MODULE_dup(old_modules);
  531|       |
  532|      2|    if (new_modules == NULL) {
  ------------------
  |  Branch (532:9): [True: 0, False: 2]
  ------------------
  533|      0|        ossl_rcu_write_unlock(module_list_lock);
  534|      0|        return;
  535|      0|    }
  536|       |
  537|      2|    to_delete = sk_CONF_MODULE_new_null();
  538|       |
  539|       |    /* unload modules in reverse order */
  540|      2|    for (i = sk_CONF_MODULE_num(new_modules) - 1; i >= 0; i--) {
  ------------------
  |  Branch (540:51): [True: 0, False: 2]
  ------------------
  541|      0|        md = sk_CONF_MODULE_value(new_modules, i);
  542|       |        /* If static or in use and 'all' not set ignore it */
  543|      0|        if (((md->links > 0) || !md->dso) && !all)
  ------------------
  |  Branch (543:14): [True: 0, False: 0]
  |  Branch (543:33): [True: 0, False: 0]
  |  Branch (543:46): [True: 0, False: 0]
  ------------------
  544|      0|            continue;
  545|       |        /* Since we're working in reverse this is OK */
  546|      0|        (void)sk_CONF_MODULE_delete(new_modules, i);
  547|      0|        sk_CONF_MODULE_push(to_delete, md);
  548|      0|    }
  549|       |
  550|      2|    if (sk_CONF_MODULE_num(new_modules) == 0) {
  ------------------
  |  Branch (550:9): [True: 2, False: 0]
  ------------------
  551|      2|        sk_CONF_MODULE_free(new_modules);
  552|      2|        new_modules = NULL;
  553|      2|    }
  554|       |
  555|      2|    ossl_rcu_assign_ptr(&supported_modules, &new_modules);
  ------------------
  |  |   31|      2|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  556|      2|    ossl_rcu_write_unlock(module_list_lock);
  557|      2|    ossl_synchronize_rcu(module_list_lock);
  558|      2|    sk_CONF_MODULE_free(old_modules);
  559|      2|    sk_CONF_MODULE_pop_free(to_delete, module_free);
  560|       |
  561|      2|}
ossl_config_modules_free:
  632|      2|{
  633|      2|    CONF_modules_unload(1); /* calls CONF_modules_finish */
  634|      2|    module_lists_free();
  635|      2|}
CONF_get1_default_config_file:
  686|      2|{
  687|      2|    const char *t;
  688|      2|    char *file, *sep = "";
  689|      2|    size_t size;
  690|       |
  691|      2|    if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL)
  ------------------
  |  Branch (691:9): [True: 0, False: 2]
  ------------------
  692|      0|        return OPENSSL_strdup(file);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  693|       |
  694|      2|    t = X509_get_default_cert_area();
  695|       |    /*
  696|       |     * On windows systems with -DOSSL_WINCTX set, if the needed registry
  697|       |     * keys are not yet set, openssl applets will return, due to an inability
  698|       |     * to locate various directories, like the default cert area.  In that
  699|       |     * event, clone an empty string here, so that commands like openssl version
  700|       |     * continue to operate properly without needing to set OPENSSL_CONF.
  701|       |     * Applets like cms will fail gracefully later when they try to parse an
  702|       |     * empty config file
  703|       |     */
  704|      2|    if (t == NULL)
  ------------------
  |  Branch (704:9): [True: 0, False: 2]
  ------------------
  705|      0|        return OPENSSL_strdup("");
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  706|       |
  707|      2|#ifndef OPENSSL_SYS_VMS
  708|      2|    sep = "/";
  709|      2|#endif
  710|      2|    size = strlen(t) + strlen(sep) + strlen(OPENSSL_CONF) + 1;
  ------------------
  |  |   81|      2|# define OPENSSL_CONF             "openssl.cnf"
  ------------------
  711|      2|    file = OPENSSL_malloc(size);
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  712|       |
  713|      2|    if (file == NULL)
  ------------------
  |  Branch (713:9): [True: 0, False: 2]
  ------------------
  714|      0|        return NULL;
  715|      2|    BIO_snprintf(file, size, "%s%s%s", t, sep, OPENSSL_CONF);
  ------------------
  |  |   81|      2|# define OPENSSL_CONF             "openssl.cnf"
  ------------------
  716|       |
  717|      2|    return file;
  718|      2|}
conf_mod.c:do_init_module_list_lock:
  101|      2|{
  102|      2|    module_list_lock = ossl_rcu_lock_new(1, NULL);
  103|      2|    if (module_list_lock == NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 2]
  ------------------
  104|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|      2|{
   48|      2|    int ret = 0;
   49|      2|#if defined(OPENSSL_INIT_DEBUG) || !defined(OPENSSL_SYS_UEFI)
   50|      2|    const char *filename;
   51|      2|    const char *appname;
   52|      2|    unsigned long flags;
   53|      2|#endif
   54|       |
   55|      2|    if (openssl_configured)
  ------------------
  |  Branch (55:9): [True: 0, False: 2]
  ------------------
   56|      0|        return 1;
   57|       |
   58|      2|#if defined(OPENSSL_INIT_DEBUG) || !defined(OPENSSL_SYS_UEFI)
   59|      2|    filename = settings ? settings->filename : NULL;
  ------------------
  |  Branch (59:16): [True: 0, False: 2]
  ------------------
   60|      2|    appname = settings ? settings->appname : NULL;
  ------------------
  |  Branch (60:15): [True: 0, False: 2]
  ------------------
   61|      2|    flags = settings ? settings->flags : DEFAULT_CONF_MFLAGS;
  ------------------
  |  |   17|      4|    (CONF_MFLAGS_DEFAULT_SECTION | \
  |  |  ------------------
  |  |  |  |  111|      2|# define CONF_MFLAGS_DEFAULT_SECTION     0x20
  |  |  ------------------
  |  |   18|      4|     CONF_MFLAGS_IGNORE_MISSING_FILE | \
  |  |  ------------------
  |  |  |  |  110|      2|# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
  |  |  ------------------
  |  |   19|      4|     CONF_MFLAGS_IGNORE_RETURN_CODES)
  |  |  ------------------
  |  |  |  |  107|      2|# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
  |  |  ------------------
  ------------------
  |  Branch (61:13): [True: 0, False: 2]
  ------------------
   62|      2|#endif
   63|       |
   64|       |#ifdef OPENSSL_INIT_DEBUG
   65|       |    fprintf(stderr, "OPENSSL_INIT: ossl_config_int(%s, %s, %lu)\n",
   66|       |            filename, appname, flags);
   67|       |#endif
   68|       |
   69|      2|#ifndef OPENSSL_SYS_UEFI
   70|      2|    ret = CONF_modules_load_file_ex(OSSL_LIB_CTX_get0_global_default(),
   71|      2|                                    filename, appname, flags);
   72|       |#else
   73|       |    ret = 1;
   74|       |#endif
   75|      2|    openssl_configured = 1;
   76|      2|    return ret;
   77|      2|}

ossl_lib_ctx_write_lock:
   60|     57|{
   61|     57|    return CRYPTO_THREAD_write_lock(ossl_lib_ctx_get_concrete(ctx)->lock);
   62|     57|}
ossl_lib_ctx_read_lock:
   65|    206|{
   66|    206|    return CRYPTO_THREAD_read_lock(ossl_lib_ctx_get_concrete(ctx)->lock);
   67|    206|}
ossl_lib_ctx_unlock:
   70|    263|{
   71|    263|    return CRYPTO_THREAD_unlock(ossl_lib_ctx_get_concrete(ctx)->lock);
   72|    263|}
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_new:
  452|      2|{
  453|      2|    OSSL_LIB_CTX *ctx = 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__
  |  |  ------------------
  ------------------
  454|       |
  455|      2|    if (ctx != NULL && !context_init(ctx)) {
  ------------------
  |  Branch (455:9): [True: 2, False: 0]
  |  Branch (455:24): [True: 0, False: 2]
  ------------------
  456|      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__
  |  |  ------------------
  ------------------
  457|      0|        ctx = NULL;
  458|      0|    }
  459|      2|    return ctx;
  460|      2|}
OSSL_LIB_CTX_get0_global_default:
  517|      2|{
  518|      2|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (518:9): [True: 0, False: 2]
  ------------------
  519|      0|        return NULL;
  520|       |
  521|      2|    return &default_context_int;
  522|      2|}
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|  3.86M|{
  549|  3.86M|#ifndef FIPS_MODULE
  550|  3.86M|    if (ctx == NULL)
  ------------------
  |  Branch (550:9): [True: 3.61M, False: 248k]
  ------------------
  551|  3.61M|        return get_default_context();
  552|   248k|#endif
  553|   248k|    return ctx;
  554|  3.86M|}
ossl_lib_ctx_is_default:
  557|  6.97k|{
  558|  6.97k|#ifndef FIPS_MODULE
  559|  6.97k|    if (ctx == NULL || ctx == get_default_context())
  ------------------
  |  Branch (559:9): [True: 184, False: 6.78k]
  |  Branch (559:24): [True: 6.78k, False: 0]
  ------------------
  560|  6.97k|        return 1;
  561|      0|#endif
  562|      0|    return 0;
  563|  6.97k|}
ossl_lib_ctx_get_data:
  575|   286k|{
  576|   286k|    void *p;
  577|       |
  578|   286k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  579|   286k|    if (ctx == NULL)
  ------------------
  |  Branch (579:9): [True: 0, False: 286k]
  ------------------
  580|      0|        return NULL;
  581|       |
  582|   286k|    switch (index) {
  583|   147k|    case OSSL_LIB_CTX_PROPERTY_STRING_INDEX:
  ------------------
  |  |   99|   147k|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  |  Branch (583:5): [True: 147k, False: 138k]
  ------------------
  584|   147k|        return ctx->property_string_data;
  585|  6.27k|    case OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX:
  ------------------
  |  |   96|  6.27k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
  |  Branch (585:5): [True: 6.27k, False: 280k]
  ------------------
  586|  6.27k|        return ctx->evp_method_store;
  587|  6.98k|    case OSSL_LIB_CTX_PROVIDER_STORE_INDEX:
  ------------------
  |  |   97|  6.98k|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  |  Branch (587:5): [True: 6.98k, False: 279k]
  ------------------
  588|  6.98k|        return ctx->provider_store;
  589|  64.1k|    case OSSL_LIB_CTX_NAMEMAP_INDEX:
  ------------------
  |  |  100|  64.1k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  |  Branch (589:5): [True: 64.1k, False: 222k]
  ------------------
  590|  64.1k|        return ctx->namemap;
  591|    263|    case OSSL_LIB_CTX_PROPERTY_DEFN_INDEX:
  ------------------
  |  |   98|    263|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
  |  Branch (591:5): [True: 263, False: 286k]
  ------------------
  592|    263|        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: 286k]
  ------------------
  594|      5|        return ctx->global_properties;
  595|  4.09k|    case OSSL_LIB_CTX_DRBG_INDEX:
  ------------------
  |  |  101|  4.09k|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  |  Branch (595:5): [True: 4.09k, False: 282k]
  ------------------
  596|  4.09k|        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: 286k]
  ------------------
  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: 286k]
  ------------------
  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: 286k]
  ------------------
  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: 286k]
  ------------------
  605|      0|        return ctx->child_provider;
  606|    642|    case OSSL_LIB_CTX_DECODER_STORE_INDEX:
  ------------------
  |  |  109|    642|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  |  Branch (606:5): [True: 642, False: 285k]
  ------------------
  607|    642|        return ctx->decoder_store;
  608|  15.7k|    case OSSL_LIB_CTX_DECODER_CACHE_INDEX:
  ------------------
  |  |  118|  15.7k|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  |  Branch (608:5): [True: 15.7k, False: 270k]
  ------------------
  609|  15.7k|        return ctx->decoder_cache;
  610|  40.8k|    case OSSL_LIB_CTX_ENCODER_STORE_INDEX:
  ------------------
  |  |  108|  40.8k|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  |  Branch (610:5): [True: 40.8k, False: 245k]
  ------------------
  611|  40.8k|        return ctx->encoder_store;
  612|      2|    case OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX:
  ------------------
  |  |  113|      2|# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX      15
  ------------------
  |  Branch (612:5): [True: 2, False: 286k]
  ------------------
  613|      2|        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: 286k]
  ------------------
  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: 286k]
  ------------------
  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: 286k]
  ------------------
  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: 286k]
  ------------------
  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|      4|    case OSSL_LIB_CTX_COMP_METHODS:
  ------------------
  |  |  119|      4|# define OSSL_LIB_CTX_COMP_METHODS                  21
  ------------------
  |  Branch (662:5): [True: 4, False: 286k]
  ------------------
  663|      4|        return (void *)&ctx->comp_methods;
  664|       |
  665|      0|    default:
  ------------------
  |  Branch (665:5): [True: 0, False: 286k]
  ------------------
  666|      0|        return NULL;
  667|   286k|    }
  668|   286k|}
OSSL_LIB_CTX_get_data:
  671|      4|{
  672|      4|    return ossl_lib_ctx_get_data(ctx, index);
  673|      4|}
ossl_lib_ctx_get_ex_data_global:
  676|  3.58M|{
  677|  3.58M|    ctx = ossl_lib_ctx_get_concrete(ctx);
  678|  3.58M|    if (ctx == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 3.58M]
  ------------------
  679|      0|        return NULL;
  680|  3.58M|    return &ctx->global;
  681|  3.58M|}
OSSL_LIB_CTX_get_conf_diagnostics:
  705|      2|{
  706|      2|    libctx = ossl_lib_ctx_get_concrete(libctx);
  707|      2|    if (libctx == NULL)
  ------------------
  |  Branch (707:9): [True: 0, False: 2]
  ------------------
  708|      0|        return 0;
  709|      2|    return libctx->conf_diagnostics;
  710|      2|}
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|      4|{
   87|      4|    int exdata_done = 0;
   88|       |
   89|      4|    if (!CRYPTO_THREAD_init_local(&ctx->rcu_local_key, NULL))
  ------------------
  |  Branch (89:9): [True: 0, False: 4]
  ------------------
   90|      0|        return 0;
   91|       |
   92|      4|    ctx->lock = CRYPTO_THREAD_lock_new();
   93|      4|    if (ctx->lock == NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 4]
  ------------------
   94|      0|        goto err;
   95|       |
   96|      4|    ctx->rand_crngt_lock = CRYPTO_THREAD_lock_new();
   97|      4|    if (ctx->rand_crngt_lock == NULL)
  ------------------
  |  Branch (97:9): [True: 0, False: 4]
  ------------------
   98|      0|        goto err;
   99|       |
  100|       |    /* Initialize ex_data. */
  101|      4|    if (!ossl_do_ex_data_init(ctx))
  ------------------
  |  Branch (101:9): [True: 0, False: 4]
  ------------------
  102|      0|        goto err;
  103|      4|    exdata_done = 1;
  104|       |
  105|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  106|      4|    ctx->evp_method_store = ossl_method_store_new(ctx);
  107|      4|    if (ctx->evp_method_store == NULL)
  ------------------
  |  Branch (107:9): [True: 0, False: 4]
  ------------------
  108|      0|        goto err;
  109|       |
  110|      4|#ifndef FIPS_MODULE
  111|       |    /* P2. Must be freed before the provider store is freed */
  112|      4|    ctx->provider_conf = ossl_prov_conf_ctx_new(ctx);
  113|      4|    if (ctx->provider_conf == NULL)
  ------------------
  |  Branch (113:9): [True: 0, False: 4]
  ------------------
  114|      0|        goto err;
  115|      4|#endif
  116|       |
  117|       |    /* P2. */
  118|      4|    ctx->drbg = ossl_rand_ctx_new(ctx);
  119|      4|    if (ctx->drbg == NULL)
  ------------------
  |  Branch (119:9): [True: 0, False: 4]
  ------------------
  120|      0|        goto err;
  121|       |
  122|      4|#ifndef FIPS_MODULE
  123|       |    /*
  124|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  125|       |     * provider store
  126|       |     */
  127|      4|    ctx->decoder_store = ossl_method_store_new(ctx);
  128|      4|    if (ctx->decoder_store == NULL)
  ------------------
  |  Branch (128:9): [True: 0, False: 4]
  ------------------
  129|      0|        goto err;
  130|      4|    ctx->decoder_cache = ossl_decoder_cache_new(ctx);
  131|      4|    if (ctx->decoder_cache == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 4]
  ------------------
  132|      0|        goto err;
  133|       |
  134|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  135|      4|    ctx->encoder_store = ossl_method_store_new(ctx);
  136|      4|    if (ctx->encoder_store == NULL)
  ------------------
  |  Branch (136:9): [True: 0, False: 4]
  ------------------
  137|      0|        goto err;
  138|       |
  139|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  140|      4|    ctx->store_loader_store = ossl_method_store_new(ctx);
  141|      4|    if (ctx->store_loader_store == NULL)
  ------------------
  |  Branch (141:9): [True: 0, False: 4]
  ------------------
  142|      0|        goto err;
  143|      4|#endif
  144|       |
  145|       |    /* P1. Needs to be freed before the child provider data is freed */
  146|      4|    ctx->provider_store = ossl_provider_store_new(ctx);
  147|      4|    if (ctx->provider_store == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 4]
  ------------------
  148|      0|        goto err;
  149|       |
  150|       |    /* Default priority. */
  151|      4|    ctx->property_string_data = ossl_property_string_data_new(ctx);
  152|      4|    if (ctx->property_string_data == NULL)
  ------------------
  |  Branch (152:9): [True: 0, False: 4]
  ------------------
  153|      0|        goto err;
  154|       |
  155|      4|    ctx->namemap = ossl_stored_namemap_new(ctx);
  156|      4|    if (ctx->namemap == NULL)
  ------------------
  |  Branch (156:9): [True: 0, False: 4]
  ------------------
  157|      0|        goto err;
  158|       |
  159|      4|    ctx->property_defns = ossl_property_defns_new(ctx);
  160|      4|    if (ctx->property_defns == NULL)
  ------------------
  |  Branch (160:9): [True: 0, False: 4]
  ------------------
  161|      0|        goto err;
  162|       |
  163|      4|    ctx->global_properties = ossl_ctx_global_properties_new(ctx);
  164|      4|    if (ctx->global_properties == NULL)
  ------------------
  |  Branch (164:9): [True: 0, False: 4]
  ------------------
  165|      0|        goto err;
  166|       |
  167|      4|#ifndef FIPS_MODULE
  168|      4|    ctx->bio_core = ossl_bio_core_globals_new(ctx);
  169|      4|    if (ctx->bio_core == NULL)
  ------------------
  |  Branch (169:9): [True: 0, False: 4]
  ------------------
  170|      0|        goto err;
  171|      4|#endif
  172|       |
  173|      4|    ctx->drbg_nonce = ossl_prov_drbg_nonce_ctx_new(ctx);
  174|      4|    if (ctx->drbg_nonce == NULL)
  ------------------
  |  Branch (174:9): [True: 0, False: 4]
  ------------------
  175|      0|        goto err;
  176|       |
  177|      4|#ifndef FIPS_MODULE
  178|      4|    ctx->self_test_cb = ossl_self_test_set_callback_new(ctx);
  179|      4|    if (ctx->self_test_cb == NULL)
  ------------------
  |  Branch (179:9): [True: 0, False: 4]
  ------------------
  180|      0|        goto err;
  181|      4|    ctx->indicator_cb = ossl_indicator_set_callback_new(ctx);
  182|      4|    if (ctx->indicator_cb == NULL)
  ------------------
  |  Branch (182:9): [True: 0, False: 4]
  ------------------
  183|      0|        goto err;
  184|      4|#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|      4|#ifndef OPENSSL_NO_THREAD_POOL
  197|      4|    ctx->threads = ossl_threads_ctx_new(ctx);
  198|      4|    if (ctx->threads == NULL)
  ------------------
  |  Branch (198:9): [True: 0, False: 4]
  ------------------
  199|      0|        goto err;
  200|      4|#endif
  201|       |
  202|       |    /* Low priority. */
  203|      4|#ifndef FIPS_MODULE
  204|      4|    ctx->child_provider = ossl_child_prov_ctx_new(ctx);
  205|      4|    if (ctx->child_provider == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 4]
  ------------------
  206|      0|        goto err;
  207|      4|#endif
  208|       |
  209|       |    /* Everything depends on properties, so we also pre-initialise that */
  210|      4|    if (!ossl_property_parse_init(ctx))
  ------------------
  |  Branch (210:9): [True: 0, False: 4]
  ------------------
  211|      0|        goto err;
  212|       |
  213|      4|#ifndef FIPS_MODULE
  214|      4|    ctx->comp_methods = ossl_load_builtin_compressions();
  215|      4|#endif
  216|       |
  217|      4|    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|      4|}
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|  3.62M|{
  435|  3.62M|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  436|       |
  437|  3.62M|    if (current_defctx == NULL)
  ------------------
  |  Branch (437:9): [True: 3.62M, False: 0]
  ------------------
  438|  3.62M|        current_defctx = &default_context_int;
  439|  3.62M|    return current_defctx;
  440|  3.62M|}
context.c:get_thread_default_context:
  426|  3.62M|{
  427|  3.62M|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|  3.62M|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 3.62M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (427:9): [True: 0, False: 3.62M]
  ------------------
  428|      0|        return NULL;
  429|       |
  430|  3.62M|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  431|  3.62M|}

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

ossl_method_construct:
  133|  6.96k|{
  134|  6.96k|    void *method = NULL;
  135|  6.96k|    OSSL_PROVIDER *provider = provider_rw != NULL ? *provider_rw : NULL;
  ------------------
  |  Branch (135:31): [True: 6.96k, False: 0]
  ------------------
  136|  6.96k|    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|  6.96k|    cbdata.store = NULL;
  150|  6.96k|    cbdata.force_store = force_store;
  151|  6.96k|    cbdata.mcm = mcm;
  152|  6.96k|    cbdata.mcm_data = mcm_data;
  153|  6.96k|    ossl_algorithm_do_all(libctx, operation_id, provider,
  154|  6.96k|                          ossl_method_construct_precondition,
  155|  6.96k|                          ossl_method_construct_reserve_store,
  156|  6.96k|                          ossl_method_construct_this,
  157|  6.96k|                          ossl_method_construct_unreserve_store,
  158|  6.96k|                          ossl_method_construct_postcondition,
  159|  6.96k|                          &cbdata);
  160|       |
  161|       |    /* If there is a temporary store, try there first */
  162|  6.96k|    if (cbdata.store != NULL)
  ------------------
  |  Branch (162:9): [True: 0, False: 6.96k]
  ------------------
  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|  6.96k|    if (method == NULL)
  ------------------
  |  Branch (167:9): [True: 6.96k, False: 0]
  ------------------
  168|  6.96k|        method = mcm->get(NULL, (const OSSL_PROVIDER **)provider_rw, mcm_data);
  169|       |
  170|  6.96k|    return method;
  171|  6.96k|}
core_fetch.c:ossl_method_construct_precondition:
   62|  13.9k|{
   63|  13.9k|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|  13.9k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  13.9k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (63:9): [True: 0, False: 13.9k]
  ------------------
   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|  13.9k|    *result = 0;
   70|       |
   71|       |    /* No flag bits for temporary stores */
   72|  13.9k|    if (!is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (72:9): [True: 13.9k, False: 0]
  ------------------
   73|  13.9k|        && !ossl_provider_test_operation_bit(provider, operation_id, result))
  ------------------
  |  Branch (73:12): [True: 0, False: 13.9k]
  ------------------
   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|  13.9k|    *result = !*result;
   82|       |
   83|  13.9k|    return 1;
   84|  13.9k|}
core_fetch.c:is_temporary_method_store:
   28|  27.8k|{
   29|  27.8k|    struct construct_data_st *data = cbdata;
   30|       |
   31|  27.8k|    return no_store && !data->force_store;
  ------------------
  |  Branch (31:12): [True: 0, False: 27.8k]
  |  Branch (31:24): [True: 0, False: 0]
  ------------------
   32|  27.8k|}
core_fetch.c:ossl_method_construct_reserve_store:
   35|  13.9k|{
   36|  13.9k|    struct construct_data_st *data = cbdata;
   37|       |
   38|  13.9k|    if (is_temporary_method_store(no_store, data) && data->store == NULL) {
  ------------------
  |  Branch (38:9): [True: 0, False: 13.9k]
  |  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|  13.9k|    return data->mcm->lock_store(data->store, data->mcm_data);
   50|  13.9k|}
core_fetch.c:ossl_method_construct_this:
  105|    206|{
  106|    206|    struct construct_data_st *data = cbdata;
  107|    206|    void *method = NULL;
  108|       |
  109|    206|    if ((method = data->mcm->construct(algo, provider, data->mcm_data))
  ------------------
  |  Branch (109:9): [True: 0, False: 206]
  ------------------
  110|    206|        == 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|    206|    data->mcm->put(data->store, method, provider, algo->algorithm_names,
  124|    206|                   algo->property_definition, data->mcm_data);
  125|       |
  126|       |    /* refcnt-- because we're dropping the reference */
  127|    206|    data->mcm->destruct(method, data->mcm_data);
  128|    206|}
core_fetch.c:ossl_method_construct_unreserve_store:
   53|  13.9k|{
   54|  13.9k|    struct construct_data_st *data = cbdata;
   55|       |
   56|  13.9k|    return data->mcm->unlock_store(data->store, data->mcm_data);
   57|  13.9k|}
core_fetch.c:ossl_method_construct_postcondition:
   89|     10|{
   90|     10|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|     10|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     10|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (90:9): [True: 0, False: 10]
  ------------------
   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|     10|    *result = 1;
   96|       |
   97|       |    /* No flag bits for temporary stores */
   98|     10|    return is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (98:12): [True: 0, False: 10]
  ------------------
   99|     10|        || ossl_provider_set_operation_bit(provider, operation_id);
  ------------------
  |  Branch (99:12): [True: 10, False: 0]
  ------------------
  100|     10|}

ossl_stored_namemap_new:
   65|      4|{
   66|      4|    OSSL_NAMEMAP *namemap = ossl_namemap_new();
   67|       |
   68|      4|    if (namemap != NULL)
  ------------------
  |  Branch (68:9): [True: 4, False: 0]
  ------------------
   69|      4|        namemap->stored = 1;
   70|       |
   71|      4|    return namemap;
   72|      4|}
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|  64.1k|{
   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|  64.1k|    return namemap == NULL || tsan_load(&namemap->max_number) == 0;
  ------------------
  |  |   61|  64.1k|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (106:12): [True: 0, False: 64.1k]
  |  Branch (106:31): [True: 1, False: 64.1k]
  ------------------
  107|  64.1k|#endif
  108|  64.1k|}
ossl_namemap_doall_names:
  132|  5.34k|{
  133|  5.34k|    DOALL_NAMES_DATA cbdata;
  134|  5.34k|    size_t num_names;
  135|  5.34k|    int i;
  136|       |
  137|  5.34k|    cbdata.number = number;
  138|  5.34k|    cbdata.found = 0;
  139|       |
  140|  5.34k|    if (namemap == NULL)
  ------------------
  |  Branch (140:9): [True: 0, False: 5.34k]
  ------------------
  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|  5.34k|    if (!CRYPTO_THREAD_read_lock(namemap->lock))
  ------------------
  |  Branch (148:9): [True: 0, False: 5.34k]
  ------------------
  149|      0|        return 0;
  150|       |
  151|  5.34k|    num_names = lh_NAMENUM_ENTRY_num_items(namemap->namenum);
  152|  5.34k|    if (num_names == 0) {
  ------------------
  |  Branch (152:9): [True: 0, False: 5.34k]
  ------------------
  153|      0|        CRYPTO_THREAD_unlock(namemap->lock);
  154|      0|        return 0;
  155|      0|    }
  156|  5.34k|    cbdata.names = OPENSSL_malloc(sizeof(*cbdata.names) * num_names);
  ------------------
  |  |  102|  5.34k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.34k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.34k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  157|  5.34k|    if (cbdata.names == NULL) {
  ------------------
  |  Branch (157:9): [True: 0, False: 5.34k]
  ------------------
  158|      0|        CRYPTO_THREAD_unlock(namemap->lock);
  159|      0|        return 0;
  160|      0|    }
  161|  5.34k|    lh_NAMENUM_ENTRY_doall_DOALL_NAMES_DATA(namemap->namenum, do_name,
  162|  5.34k|                                            &cbdata);
  163|  5.34k|    CRYPTO_THREAD_unlock(namemap->lock);
  164|       |
  165|  27.9k|    for (i = 0; i < cbdata.found; i++)
  ------------------
  |  Branch (165:17): [True: 22.5k, False: 5.34k]
  ------------------
  166|  22.5k|        fn(cbdata.names[i], data);
  167|       |
  168|  5.34k|    OPENSSL_free(cbdata.names);
  ------------------
  |  |  115|  5.34k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.34k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.34k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  169|  5.34k|    return 1;
  170|  5.34k|}
ossl_namemap_name2num:
  186|  68.5k|{
  187|  68.5k|    int number;
  188|       |
  189|  68.5k|#ifndef FIPS_MODULE
  190|  68.5k|    if (namemap == NULL)
  ------------------
  |  Branch (190:9): [True: 0, False: 68.5k]
  ------------------
  191|      0|        namemap = ossl_namemap_stored(NULL);
  192|  68.5k|#endif
  193|       |
  194|  68.5k|    if (namemap == NULL)
  ------------------
  |  Branch (194:9): [True: 0, False: 68.5k]
  ------------------
  195|      0|        return 0;
  196|       |
  197|  68.5k|    if (!CRYPTO_THREAD_read_lock(namemap->lock))
  ------------------
  |  Branch (197:9): [True: 0, False: 68.5k]
  ------------------
  198|      0|        return 0;
  199|  68.5k|    number = namemap_name2num(namemap, name);
  200|  68.5k|    CRYPTO_THREAD_unlock(namemap->lock);
  201|       |
  202|  68.5k|    return number;
  203|  68.5k|}
ossl_namemap_name2num_n:
  207|    207|{
  208|    207|    char *tmp;
  209|    207|    int ret;
  210|       |
  211|    207|    if (name == NULL || (tmp = OPENSSL_strndup(name, name_len)) == NULL)
  ------------------
  |  |  121|    207|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    207|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    207|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (211:9): [True: 0, False: 207]
  |  Branch (211:25): [True: 0, False: 207]
  ------------------
  212|      0|        return 0;
  213|       |
  214|    207|    ret = ossl_namemap_name2num(namemap, tmp);
  215|    207|    OPENSSL_free(tmp);
  ------------------
  |  |  115|    207|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    207|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    207|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  216|    207|    return ret;
  217|    207|}
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|    206|{
  300|    206|    char *tmp, *p, *q, *endp;
  301|       |
  302|       |    /* Check that we have a namemap */
  303|    206|    if (!ossl_assert(namemap != NULL)) {
  ------------------
  |  |   52|    206|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    206|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (303:9): [True: 0, False: 206]
  ------------------
  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|    206|    if ((tmp = OPENSSL_strdup(names)) == NULL)
  ------------------
  |  |  119|    206|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    206|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    206|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (308:9): [True: 0, False: 206]
  ------------------
  309|      0|        return 0;
  310|       |
  311|    206|    if (!CRYPTO_THREAD_write_lock(namemap->lock)) {
  ------------------
  |  Branch (311:9): [True: 0, False: 206]
  ------------------
  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|    476|    for (p = tmp; *p != '\0'; p = q) {
  ------------------
  |  Branch (319:19): [True: 270, False: 206]
  ------------------
  320|    270|        int this_number;
  321|    270|        size_t l;
  322|       |
  323|    270|        if ((q = strchr(p, separator)) == NULL) {
  ------------------
  |  Branch (323:13): [True: 206, False: 64]
  ------------------
  324|    206|            l = strlen(p);       /* offset to \0 */
  325|    206|            q = p + l;
  326|    206|        } else {
  327|     64|            l = q - p;           /* offset to the next separator */
  328|     64|            *q++ = '\0';
  329|     64|        }
  330|       |
  331|    270|        if (*p == '\0') {
  ------------------
  |  Branch (331:13): [True: 0, False: 270]
  ------------------
  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|    270|        this_number = namemap_name2num(namemap, p);
  338|       |
  339|    270|        if (number == 0) {
  ------------------
  |  Branch (339:13): [True: 229, False: 41]
  ------------------
  340|    229|            number = this_number;
  341|    229|        } else if (this_number != 0 && this_number != number) {
  ------------------
  |  Branch (341:20): [True: 36, False: 5]
  |  Branch (341:40): [True: 0, False: 36]
  ------------------
  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|    270|    }
  349|    206|    endp = p;
  350|       |
  351|       |    /* Now that we have checked, register all names */
  352|    476|    for (p = tmp; p < endp; p = q) {
  ------------------
  |  Branch (352:19): [True: 270, False: 206]
  ------------------
  353|    270|        int this_number;
  354|       |
  355|    270|        q = p + strlen(p) + 1;
  356|       |
  357|    270|        this_number = namemap_add_name(namemap, number, p);
  358|    270|        if (number == 0) {
  ------------------
  |  Branch (358:13): [True: 22, False: 248]
  ------------------
  359|     22|            number = this_number;
  360|    248|        } else if (this_number != number) {
  ------------------
  |  Branch (360:20): [True: 0, False: 248]
  ------------------
  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|    270|    }
  368|       |
  369|    206| end:
  370|    206|    CRYPTO_THREAD_unlock(namemap->lock);
  371|    206|    OPENSSL_free(tmp);
  ------------------
  |  |  115|    206|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    206|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    206|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  372|    206|    return number;
  373|    206|}
ossl_namemap_stored:
  471|  64.1k|{
  472|  64.1k|#ifndef FIPS_MODULE
  473|  64.1k|    int nms;
  474|  64.1k|#endif
  475|  64.1k|    OSSL_NAMEMAP *namemap =
  476|  64.1k|        ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_NAMEMAP_INDEX);
  ------------------
  |  |  100|  64.1k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  477|       |
  478|  64.1k|    if (namemap == NULL)
  ------------------
  |  Branch (478:9): [True: 0, False: 64.1k]
  ------------------
  479|      0|        return NULL;
  480|       |
  481|  64.1k|#ifndef FIPS_MODULE
  482|  64.1k|    nms = ossl_namemap_empty(namemap);
  483|  64.1k|    if (nms < 0) {
  ------------------
  |  Branch (483:9): [True: 0, False: 64.1k]
  ------------------
  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|  64.1k|    if (nms == 1) {
  ------------------
  |  Branch (490:9): [True: 1, False: 64.1k]
  ------------------
  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|  64.1k|#endif
  507|       |
  508|  64.1k|    return namemap;
  509|  64.1k|}
ossl_namemap_new:
  512|      4|{
  513|      4|    OSSL_NAMEMAP *namemap;
  514|       |
  515|      4|    if ((namemap = OPENSSL_zalloc(sizeof(*namemap))) != NULL
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (515:9): [True: 4, False: 0]
  ------------------
  516|      4|        && (namemap->lock = CRYPTO_THREAD_lock_new()) != NULL
  ------------------
  |  Branch (516:12): [True: 4, False: 0]
  ------------------
  517|      4|        && (namemap->namenum =
  ------------------
  |  Branch (517:12): [True: 4, False: 0]
  ------------------
  518|      4|            lh_NAMENUM_ENTRY_new(namenum_hash, namenum_cmp)) != NULL)
  519|      4|        return namemap;
  520|       |
  521|      0|    ossl_namemap_free(namemap);
  522|      0|    return NULL;
  523|      4|}
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|  1.60M|{
  118|  1.60M|    if (namenum->number == data->number)
  ------------------
  |  Branch (118:9): [True: 22.5k, False: 1.58M]
  ------------------
  119|  22.5k|        data->names[data->found++] = namenum->name;
  120|  1.60M|}
core_namemap.c:namemap_name2num:
  175|  69.7k|{
  176|  69.7k|    NAMENUM_ENTRY *namenum_entry, namenum_tmpl;
  177|       |
  178|  69.7k|    namenum_tmpl.name = (char *)name;
  179|  69.7k|    namenum_tmpl.number = 0;
  180|  69.7k|    namenum_entry =
  181|  69.7k|        lh_NAMENUM_ENTRY_retrieve(namemap->namenum, &namenum_tmpl);
  182|  69.7k|    return namenum_entry != NULL ? namenum_entry->number : 0;
  ------------------
  |  Branch (182:12): [True: 61.4k, False: 8.24k]
  ------------------
  183|  69.7k|}
core_namemap.c:namemap_add_name:
  249|    918|{
  250|    918|    NAMENUM_ENTRY *namenum = NULL;
  251|    918|    int tmp_number;
  252|       |
  253|       |    /* If it already exists, we don't add it */
  254|    918|    if ((tmp_number = namemap_name2num(namemap, name)) != 0)
  ------------------
  |  Branch (254:9): [True: 609, False: 309]
  ------------------
  255|    609|        return tmp_number;
  256|       |
  257|    309|    if ((namenum = OPENSSL_zalloc(sizeof(*namenum))) == NULL)
  ------------------
  |  |  104|    309|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    309|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    309|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (257:9): [True: 0, False: 309]
  ------------------
  258|      0|        return 0;
  259|       |
  260|    309|    if ((namenum->name = OPENSSL_strdup(name)) == NULL)
  ------------------
  |  |  119|    309|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    309|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    309|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (260:9): [True: 0, False: 309]
  ------------------
  261|      0|        goto err;
  262|       |
  263|       |    /* The tsan_counter use here is safe since we're under lock */
  264|    309|    namenum->number =
  265|    309|        number != 0 ? number : 1 + tsan_counter(&namemap->max_number);
  ------------------
  |  |  150|    140|# define tsan_counter(ptr) tsan_add((ptr), 1)
  |  |  ------------------
  |  |  |  |   63|    449|#   define tsan_add(ptr, n) atomic_fetch_add_explicit((ptr), (n), memory_order_relaxed)
  |  |  ------------------
  ------------------
  |  Branch (265:9): [True: 169, False: 140]
  ------------------
  266|    309|    (void)lh_NAMENUM_ENTRY_insert(namemap->namenum, namenum);
  267|       |
  268|    309|    if (lh_NAMENUM_ENTRY_error(namemap->namenum))
  ------------------
  |  Branch (268:9): [True: 0, False: 309]
  ------------------
  269|      0|        goto err;
  270|    309|    return namenum->number;
  271|       |
  272|      0| err:
  273|      0|    namenum_free(namenum);
  274|      0|    return 0;
  275|    309|}
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|  70.0k|{
   47|  70.0k|    return ossl_lh_strcasehash(n->name);
   48|  70.0k|}
core_namemap.c:namenum_cmp:
   51|  61.4k|{
   52|  61.4k|    return OPENSSL_strcasecmp(a->name, b->name);
   53|  61.4k|}
core_namemap.c:namenum_free:
   56|    309|{
   57|    309|    if (n != NULL)
  ------------------
  |  Branch (57:9): [True: 309, False: 0]
  ------------------
   58|    309|        OPENSSL_free(n->name);
  ------------------
  |  |  115|    309|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    309|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    309|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   59|    309|    OPENSSL_free(n);
  ------------------
  |  |  115|    309|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    309|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    309|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   60|    309|}

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|   838k|{
  254|   838k|    const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
  255|   838k|    const int a = ossl_toascii(c);
  ------------------
  |  |   56|   838k|#  define ossl_toascii(c)       (c)
  ------------------
  256|       |
  257|   838k|    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
  ------------------
  |  Branch (257:12): [True: 838k, False: 0]
  |  Branch (257:22): [True: 831k, False: 7.35k]
  |  Branch (257:33): [True: 267k, False: 563k]
  ------------------
  258|   838k|}
ossl_isdigit:
  270|  34.1M|{
  271|  34.1M|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  34.1M|#  define ossl_toascii(c)       (c)
  ------------------
  272|       |
  273|  34.1M|    return ASCII_IS_DIGIT(a);
  ------------------
  |  |  265|  34.1M|#define ASCII_IS_DIGIT(c)   (c >= 0x30 && c <= 0x39)
  |  |  ------------------
  |  |  |  Branch (265:30): [True: 32.5M, False: 1.61M]
  |  |  |  Branch (265:43): [True: 12.2M, False: 20.2M]
  |  |  ------------------
  ------------------
  274|  34.1M|}
ossl_isupper:
  277|  1.62k|{
  278|  1.62k|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  1.62k|#  define ossl_toascii(c)       (c)
  ------------------
  279|       |
  280|  1.62k|    return ASCII_IS_UPPER(a);
  ------------------
  |  |  266|  1.62k|#define ASCII_IS_UPPER(c)   (c >= 0x41 && c <= 0x5A)
  |  |  ------------------
  |  |  |  Branch (266:30): [True: 1.20k, False: 429]
  |  |  |  Branch (266:43): [True: 770, False: 430]
  |  |  ------------------
  ------------------
  281|  1.62k|}
ossl_tolower:
  297|  4.26M|{
  298|  4.26M|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  4.26M|#  define ossl_toascii(c)       (c)
  ------------------
  299|       |
  300|  4.26M|    return ASCII_IS_UPPER(a) ? c ^ case_change : c;
  ------------------
  |  |  266|  4.26M|#define ASCII_IS_UPPER(c)   (c >= 0x41 && c <= 0x5A)
  |  |  ------------------
  |  |  |  Branch (266:30): [True: 3.07M, False: 1.18M]
  |  |  |  Branch (266:43): [True: 1.17M, False: 1.89M]
  |  |  ------------------
  ------------------
  301|  4.26M|}
ossl_ascii_isdigit:
  311|   215k|{
  312|   215k|    return ASCII_IS_DIGIT(c);
  ------------------
  |  |  265|   215k|#define ASCII_IS_DIGIT(c)   (c >= 0x30 && c <= 0x39)
  |  |  ------------------
  |  |  |  Branch (265:30): [True: 205k, False: 10.8k]
  |  |  |  Branch (265:43): [True: 201k, False: 3.48k]
  |  |  ------------------
  ------------------
  313|   215k|}

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

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

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

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

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

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

ossl_dh_get_method:
   53|     72|{
   54|     72|    return dh->meth;
   55|     72|}
DH_new:
   58|  29.3k|{
   59|  29.3k|    return dh_new_intern(NULL, NULL);
   60|  29.3k|}
DH_free:
  137|  49.4k|{
  138|  49.4k|    int i;
  139|       |
  140|  49.4k|    if (r == NULL)
  ------------------
  |  Branch (140:9): [True: 19.9k, False: 29.4k]
  ------------------
  141|  19.9k|        return;
  142|       |
  143|  29.4k|    CRYPTO_DOWN_REF(&r->references, &i);
  144|  29.4k|    REF_PRINT_COUNT("DH", r);
  ------------------
  |  |  289|  29.4k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  29.4k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  29.4k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  29.4k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|  29.4k|    if (i > 0)
  ------------------
  |  Branch (145:9): [True: 73, False: 29.3k]
  ------------------
  146|     73|        return;
  147|  29.3k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|  29.3k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 29.3k]
  |  |  ------------------
  ------------------
  148|       |
  149|  29.3k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (149:9): [True: 29.3k, False: 0]
  |  Branch (149:28): [True: 29.3k, False: 0]
  ------------------
  150|  29.3k|        r->meth->finish(r);
  151|  29.3k|#if !defined(FIPS_MODULE)
  152|  29.3k|# if !defined(OPENSSL_NO_ENGINE)
  153|  29.3k|    ENGINE_finish(r->engine);
  154|  29.3k|# endif
  155|  29.3k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data);
  ------------------
  |  |  234|  29.3k|# define CRYPTO_EX_INDEX_DH               6
  ------------------
  156|  29.3k|#endif
  157|       |
  158|  29.3k|    CRYPTO_THREAD_lock_free(r->lock);
  159|  29.3k|    CRYPTO_FREE_REF(&r->references);
  160|       |
  161|  29.3k|    ossl_ffc_params_cleanup(&r->params);
  162|  29.3k|    BN_clear_free(r->pub_key);
  163|  29.3k|    BN_clear_free(r->priv_key);
  164|  29.3k|    OPENSSL_free(r);
  ------------------
  |  |  115|  29.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  29.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  29.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  165|  29.3k|}
DH_up_ref:
  168|     73|{
  169|     73|    int i;
  170|       |
  171|     73|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (171:9): [True: 0, False: 73]
  ------------------
  172|      0|        return 0;
  173|       |
  174|     73|    REF_PRINT_COUNT("DH", r);
  ------------------
  |  |  289|     73|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|     73|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|     73|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|     73|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|     73|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|     73|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 73]
  |  |  ------------------
  ------------------
  176|     73|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (176:13): [True: 73, False: 0]
  ------------------
  177|     73|}
ossl_dh_set0_libctx:
  180|     98|{
  181|     98|    d->libctx = libctx;
  182|     98|}
DH_bits:
  197|     98|{
  198|     98|    if (dh->params.p != NULL)
  ------------------
  |  Branch (198:9): [True: 98, False: 0]
  ------------------
  199|     98|        return BN_num_bits(dh->params.p);
  200|      0|    return -1;
  201|     98|}
DH_size:
  204|     98|{
  205|     98|    if (dh->params.p != NULL)
  ------------------
  |  Branch (205:9): [True: 98, False: 0]
  ------------------
  206|     98|        return BN_num_bytes(dh->params.p);
  ------------------
  |  |  189|     98|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  207|      0|    return -1;
  208|     98|}
DH_security_bits:
  211|     98|{
  212|     98|    int N;
  213|       |
  214|     98|    if (dh->params.q != NULL)
  ------------------
  |  Branch (214:9): [True: 26, False: 72]
  ------------------
  215|     26|        N = BN_num_bits(dh->params.q);
  216|     72|    else if (dh->length)
  ------------------
  |  Branch (216:14): [True: 70, False: 2]
  ------------------
  217|     70|        N = dh->length;
  218|      2|    else
  219|      2|        N = -1;
  220|     98|    if (dh->params.p != NULL)
  ------------------
  |  Branch (220:9): [True: 98, False: 0]
  ------------------
  221|     98|        return BN_security_bits(BN_num_bits(dh->params.p), N);
  222|      0|    return -1;
  223|     98|}
DH_set0_pqg:
  232|     99|{
  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|     99|    if ((dh->params.p == NULL && p == NULL)
  ------------------
  |  Branch (237:10): [True: 99, False: 0]
  |  Branch (237:34): [True: 0, False: 99]
  ------------------
  238|     99|        || (dh->params.g == NULL && g == NULL))
  ------------------
  |  Branch (238:13): [True: 99, False: 0]
  |  Branch (238:37): [True: 0, False: 99]
  ------------------
  239|      0|        return 0;
  240|       |
  241|     99|    ossl_ffc_params_set0_pqg(&dh->params, p, q, g);
  242|     99|    ossl_dh_cache_named_group(dh);
  243|     99|    dh->dirty_cnt++;
  244|     99|    return 1;
  245|     99|}
DH_get_length:
  248|    123|{
  249|    123|    return dh->length;
  250|    123|}
DH_get0_key:
  260|     98|{
  261|     98|    if (pub_key != NULL)
  ------------------
  |  Branch (261:9): [True: 98, False: 0]
  ------------------
  262|     98|        *pub_key = dh->pub_key;
  263|     98|    if (priv_key != NULL)
  ------------------
  |  Branch (263:9): [True: 98, False: 0]
  ------------------
  264|     98|        *priv_key = dh->priv_key;
  265|     98|}
DH_set0_key:
  268|     31|{
  269|     31|    if (pub_key != NULL) {
  ------------------
  |  Branch (269:9): [True: 0, False: 31]
  ------------------
  270|      0|        BN_clear_free(dh->pub_key);
  271|      0|        dh->pub_key = pub_key;
  272|      0|    }
  273|     31|    if (priv_key != NULL) {
  ------------------
  |  Branch (273:9): [True: 31, False: 0]
  ------------------
  274|     31|        BN_clear_free(dh->priv_key);
  275|     31|        dh->priv_key = priv_key;
  276|     31|    }
  277|       |
  278|     31|    dh->dirty_cnt++;
  279|     31|    return 1;
  280|     31|}
DH_get0_p:
  283|     25|{
  284|     25|    return dh->params.p;
  285|     25|}
DH_get0_priv_key:
  298|     75|{
  299|     75|    return dh->priv_key;
  300|     75|}
DH_get0_pub_key:
  303|     25|{
  304|     25|    return dh->pub_key;
  305|     25|}
DH_clear_flags:
  308|    291|{
  309|    291|    dh->flags &= ~flags;
  310|    291|}
DH_test_flags:
  313|     25|{
  314|     25|    return dh->flags & flags;
  315|     25|}
DH_set_flags:
  318|    291|{
  319|    291|    dh->flags |= flags;
  320|    291|}
ossl_dh_get0_params:
  330|    123|{
  331|    123|    return &dh->params;
  332|    123|}
dh_lib.c:dh_new_intern:
   75|  29.3k|{
   76|  29.3k|    DH *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  29.3k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  29.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  29.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|       |
   78|  29.3k|    if (ret == NULL)
  ------------------
  |  Branch (78:9): [True: 0, False: 29.3k]
  ------------------
   79|      0|        return NULL;
   80|       |
   81|  29.3k|    ret->lock = CRYPTO_THREAD_lock_new();
   82|  29.3k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (82:9): [True: 0, False: 29.3k]
  ------------------
   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|  29.3k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (88:9): [True: 0, False: 29.3k]
  ------------------
   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|  29.3k|    ret->libctx = libctx;
   95|  29.3k|    ret->meth = DH_get_default_method();
   96|  29.3k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   97|  29.3k|    ret->flags = ret->meth->flags;  /* early default init */
   98|  29.3k|    if (engine) {
  ------------------
  |  Branch (98:9): [True: 0, False: 29.3k]
  ------------------
   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|  29.3k|        ret->engine = ENGINE_get_default_DH();
  106|  29.3k|    if (ret->engine) {
  ------------------
  |  Branch (106:9): [True: 0, False: 29.3k]
  ------------------
  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|  29.3k|#endif
  114|       |
  115|  29.3k|    ret->flags = ret->meth->flags;
  116|       |
  117|  29.3k|#ifndef FIPS_MODULE
  118|  29.3k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data))
  ------------------
  |  |  234|  29.3k|# define CRYPTO_EX_INDEX_DH               6
  ------------------
  |  Branch (118:9): [True: 0, False: 29.3k]
  ------------------
  119|      0|        goto err;
  120|  29.3k|#endif /* FIPS_MODULE */
  121|       |
  122|  29.3k|    ossl_ffc_params_init(&ret->params);
  123|       |
  124|  29.3k|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (124:9): [True: 29.3k, False: 0]
  |  Branch (124:38): [True: 0, False: 29.3k]
  ------------------
  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|  29.3k|    return ret;
  130|       |
  131|      0| err:
  132|      0|    DH_free(ret);
  133|      0|    return NULL;
  134|  29.3k|}

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

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

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

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

DSA_get_method:
  129|      6|{
  130|      6|    return d->meth;
  131|      6|}
DSA_new:
  208|  39.0k|{
  209|  39.0k|    return dsa_new_intern(NULL, NULL);
  210|  39.0k|}
DSA_free:
  214|  69.7k|{
  215|  69.7k|    int i;
  216|       |
  217|  69.7k|    if (r == NULL)
  ------------------
  |  Branch (217:9): [True: 30.7k, False: 39.0k]
  ------------------
  218|  30.7k|        return;
  219|       |
  220|  39.0k|    CRYPTO_DOWN_REF(&r->references, &i);
  221|  39.0k|    REF_PRINT_COUNT("DSA", r);
  ------------------
  |  |  289|  39.0k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  39.0k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  39.0k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  39.0k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  222|  39.0k|    if (i > 0)
  ------------------
  |  Branch (222:9): [True: 2, False: 39.0k]
  ------------------
  223|      2|        return;
  224|  39.0k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|  39.0k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 39.0k]
  |  |  ------------------
  ------------------
  225|       |
  226|  39.0k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (226:9): [True: 39.0k, False: 0]
  |  Branch (226:28): [True: 39.0k, False: 0]
  ------------------
  227|  39.0k|        r->meth->finish(r);
  228|  39.0k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
  229|  39.0k|    ENGINE_finish(r->engine);
  230|  39.0k|#endif
  231|       |
  232|  39.0k|#ifndef FIPS_MODULE
  233|  39.0k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data);
  ------------------
  |  |  235|  39.0k|# define CRYPTO_EX_INDEX_DSA              7
  ------------------
  234|  39.0k|#endif
  235|       |
  236|  39.0k|    CRYPTO_THREAD_lock_free(r->lock);
  237|  39.0k|    CRYPTO_FREE_REF(&r->references);
  238|       |
  239|  39.0k|    ossl_ffc_params_cleanup(&r->params);
  240|  39.0k|    BN_clear_free(r->pub_key);
  241|  39.0k|    BN_clear_free(r->priv_key);
  242|  39.0k|    OPENSSL_free(r);
  ------------------
  |  |  115|  39.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  39.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  39.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  243|  39.0k|}
DSA_up_ref:
  246|      2|{
  247|      2|    int i;
  248|       |
  249|      2|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (249:9): [True: 0, False: 2]
  ------------------
  250|      0|        return 0;
  251|       |
  252|      2|    REF_PRINT_COUNT("DSA", r);
  ------------------
  |  |  289|      2|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|      2|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|      2|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|      2|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|      2|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  254|      2|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (254:13): [True: 2, False: 0]
  ------------------
  255|      2|}
ossl_dsa_set0_libctx:
  258|    605|{
  259|    605|    d->libctx = libctx;
  260|    605|}
DSA_get0_pqg:
  264|      2|{
  265|      2|    ossl_ffc_params_get0_pqg(&d->params, p, q, g);
  266|      2|}
DSA_get0_p:
  285|  1.15k|{
  286|  1.15k|    return d->params.p;
  287|  1.15k|}
DSA_get0_g:
  295|    550|{
  296|    550|    return d->params.g;
  297|    550|}
DSA_get0_pub_key:
  300|    604|{
  301|    604|    return d->pub_key;
  302|    604|}
DSA_get0_priv_key:
  305|  1.20k|{
  306|  1.20k|    return d->priv_key;
  307|  1.20k|}
DSA_get0_key:
  311|    605|{
  312|    605|    if (pub_key != NULL)
  ------------------
  |  Branch (312:9): [True: 605, False: 0]
  ------------------
  313|    605|        *pub_key = d->pub_key;
  314|    605|    if (priv_key != NULL)
  ------------------
  |  Branch (314:9): [True: 605, False: 0]
  ------------------
  315|    605|        *priv_key = d->priv_key;
  316|    605|}
DSA_set0_key:
  319|    546|{
  320|    546|    if (pub_key != NULL) {
  ------------------
  |  Branch (320:9): [True: 546, False: 0]
  ------------------
  321|    546|        BN_free(d->pub_key);
  322|    546|        d->pub_key = pub_key;
  323|    546|    }
  324|    546|    if (priv_key != NULL) {
  ------------------
  |  Branch (324:9): [True: 546, False: 0]
  ------------------
  325|    546|        BN_free(d->priv_key);
  326|    546|        d->priv_key = priv_key;
  327|    546|    }
  328|    546|    d->dirty_cnt++;
  329|       |
  330|    546|    return 1;
  331|    546|}
DSA_security_bits:
  334|    605|{
  335|    605|    if (d->params.p != NULL && d->params.q != NULL)
  ------------------
  |  Branch (335:9): [True: 605, False: 0]
  |  Branch (335:32): [True: 605, False: 0]
  ------------------
  336|    605|        return BN_security_bits(BN_num_bits(d->params.p),
  337|    605|                                BN_num_bits(d->params.q));
  338|      0|    return -1;
  339|    605|}
DSA_bits:
  342|    609|{
  343|    609|    if (dsa->params.p != NULL)
  ------------------
  |  Branch (343:9): [True: 609, False: 0]
  ------------------
  344|    609|        return BN_num_bits(dsa->params.p);
  345|      0|    return -1;
  346|    609|}
ossl_dsa_get0_params:
  349|  1.20k|{
  350|  1.20k|    return &dsa->params;
  351|  1.20k|}
dsa_lib.c:dsa_new_intern:
  134|  39.0k|{
  135|  39.0k|    DSA *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  39.0k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  39.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  39.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|       |
  137|  39.0k|    if (ret == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 39.0k]
  ------------------
  138|      0|        return NULL;
  139|       |
  140|  39.0k|    ret->lock = CRYPTO_THREAD_lock_new();
  141|  39.0k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (141:9): [True: 0, False: 39.0k]
  ------------------
  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|  39.0k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 39.0k]
  ------------------
  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|  39.0k|    ret->libctx = libctx;
  154|  39.0k|    ret->meth = DSA_get_default_method();
  155|  39.0k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
  156|  39.0k|    ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW; /* early default init */
  ------------------
  |  |   99|  39.0k|#   define DSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
  157|  39.0k|    if (engine) {
  ------------------
  |  Branch (157:9): [True: 0, False: 39.0k]
  ------------------
  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|  39.0k|        ret->engine = ENGINE_get_default_DSA();
  165|  39.0k|    if (ret->engine) {
  ------------------
  |  Branch (165:9): [True: 0, False: 39.0k]
  ------------------
  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|  39.0k|#endif
  173|       |
  174|  39.0k|    ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |   99|  39.0k|#   define DSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
  175|       |
  176|  39.0k|#ifndef FIPS_MODULE
  177|  39.0k|    if (!ossl_crypto_new_ex_data_ex(libctx, CRYPTO_EX_INDEX_DSA, ret,
  ------------------
  |  |  235|  39.0k|# define CRYPTO_EX_INDEX_DSA              7
  ------------------
  |  Branch (177:9): [True: 0, False: 39.0k]
  ------------------
  178|  39.0k|                                    &ret->ex_data))
  179|      0|        goto err;
  180|  39.0k|#endif
  181|       |
  182|  39.0k|    ossl_ffc_params_init(&ret->params);
  183|       |
  184|  39.0k|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (184:9): [True: 39.0k, False: 0]
  |  Branch (184:38): [True: 0, False: 39.0k]
  ------------------
  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|  39.0k|    return ret;
  190|       |
  191|      0| err:
  192|      0|    DSA_free(ret);
  193|      0|    return NULL;
  194|  39.0k|}

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

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

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

f_impl64.c:widemul:
   23|   243k|{
   24|   243k|    return ((uint128_t) a) * b;
   25|   243k|}

curve448.c:gf_sub_RAW:
   32|  1.59k|{
   33|  1.59k|    uint64_t co1 = ((1ULL << 56) - 1) * 2, co2 = co1 - 2;
   34|  1.59k|    unsigned int i;
   35|       |
   36|  14.3k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |   21|  14.3k|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (36:17): [True: 12.7k, False: 1.59k]
  ------------------
   37|  12.7k|        out->limb[i] = a->limb[i] - b->limb[i] + ((i == NLIMBS / 2) ? co2 : co1);
  ------------------
  |  |   21|  12.7k|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (37:51): [True: 1.59k, False: 11.1k]
  ------------------
   38|       |
   39|  1.59k|    gf_weak_reduce(out);
   40|  1.59k|}
curve448.c:gf_bias:
   43|  1.59k|{
   44|  1.59k|}
curve448.c:gf_weak_reduce:
   47|  3.18k|{
   48|  3.18k|    uint64_t mask = (1ULL << 56) - 1;
   49|  3.18k|    uint64_t tmp = a->limb[NLIMBS - 1] >> 56;
  ------------------
  |  |   21|  3.18k|# define NLIMBS (64/sizeof(word_t))
  ------------------
   50|  3.18k|    unsigned int i;
   51|       |
   52|  3.18k|    a->limb[NLIMBS / 2] += tmp;
  ------------------
  |  |   21|  3.18k|# define NLIMBS (64/sizeof(word_t))
  ------------------
   53|  25.4k|    for (i = NLIMBS - 1; i > 0; i--)
  ------------------
  |  |   21|  3.18k|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (53:26): [True: 22.2k, False: 3.18k]
  ------------------
   54|  22.2k|        a->limb[i] = (a->limb[i] & mask) + (a->limb[i - 1] >> 56);
   55|  3.18k|    a->limb[0] = (a->limb[0] & mask) + tmp;
   56|  3.18k|}
curve448.c:gf_add_RAW:
   22|  1.59k|{
   23|  1.59k|    unsigned int i;
   24|       |
   25|  14.3k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |   21|  14.3k|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (25:17): [True: 12.7k, False: 1.59k]
  ------------------
   26|  12.7k|        out->limb[i] = a->limb[i] + b->limb[i];
   27|       |
   28|  1.59k|    gf_weak_reduce(out);
   29|  1.59k|}
f_generic.c:gf_weak_reduce:
   47|    966|{
   48|    966|    uint64_t mask = (1ULL << 56) - 1;
   49|    966|    uint64_t tmp = a->limb[NLIMBS - 1] >> 56;
  ------------------
  |  |   21|    966|# define NLIMBS (64/sizeof(word_t))
  ------------------
   50|    966|    unsigned int i;
   51|       |
   52|    966|    a->limb[NLIMBS / 2] += tmp;
  ------------------
  |  |   21|    966|# define NLIMBS (64/sizeof(word_t))
  ------------------
   53|  7.72k|    for (i = NLIMBS - 1; i > 0; i--)
  ------------------
  |  |   21|    966|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (53:26): [True: 6.76k, False: 966]
  ------------------
   54|  6.76k|        a->limb[i] = (a->limb[i] & mask) + (a->limb[i - 1] >> 56);
   55|    966|    a->limb[0] = (a->limb[0] & mask) + tmp;
   56|    966|}
f_generic.c:gf_sub_RAW:
   32|    466|{
   33|    466|    uint64_t co1 = ((1ULL << 56) - 1) * 2, co2 = co1 - 2;
   34|    466|    unsigned int i;
   35|       |
   36|  4.19k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |   21|  4.19k|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (36:17): [True: 3.72k, False: 466]
  ------------------
   37|  3.72k|        out->limb[i] = a->limb[i] - b->limb[i] + ((i == NLIMBS / 2) ? co2 : co1);
  ------------------
  |  |   21|  3.72k|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (37:51): [True: 466, False: 3.26k]
  ------------------
   38|       |
   39|    466|    gf_weak_reduce(out);
   40|    466|}
f_generic.c:gf_bias:
   43|    466|{
   44|    466|}
f_generic.c:gf_add_RAW:
   22|     11|{
   23|     11|    unsigned int i;
   24|       |
   25|     99|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |   21|     99|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (25:17): [True: 88, False: 11]
  ------------------
   26|     88|        out->limb[i] = a->limb[i] + b->limb[i];
   27|       |
   28|     11|    gf_weak_reduce(out);
   29|     11|}

ossl_gf_mul:
   25|  3.45k|{
   26|  3.45k|    const uint64_t *a = as->limb, *b = bs->limb;
   27|  3.45k|    uint64_t *c = cs->limb;
   28|  3.45k|    uint128_t accum0 = 0, accum1 = 0, accum2;
   29|  3.45k|    uint64_t mask = (1ULL << 56) - 1;
   30|  3.45k|    uint64_t aa[4], bb[4], bbb[4];
   31|  3.45k|    unsigned int i, j;
   32|       |
   33|  17.2k|    for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (33:17): [True: 13.8k, False: 3.45k]
  ------------------
   34|  13.8k|        aa[i] = a[i] + a[i + 4];
   35|  13.8k|        bb[i] = b[i] + b[i + 4];
   36|  13.8k|        bbb[i] = bb[i] + b[i + 4];
   37|  13.8k|    }
   38|       |
   39|  17.2k|    for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (39:17): [True: 13.8k, False: 3.45k]
  ------------------
   40|  13.8k|        accum2 = 0;
   41|       |
   42|  48.4k|        for (j = 0; j <= i; j++) {
  ------------------
  |  Branch (42:21): [True: 34.5k, False: 13.8k]
  ------------------
   43|  34.5k|            accum2 += widemul(a[j], b[i - j]);
   44|  34.5k|            accum1 += widemul(aa[j], bb[i - j]);
   45|  34.5k|            accum0 += widemul(a[j + 4], b[i - j + 4]);
   46|  34.5k|        }
   47|  34.5k|        for (; j < 4; j++) {
  ------------------
  |  Branch (47:16): [True: 20.7k, False: 13.8k]
  ------------------
   48|  20.7k|            accum2 += widemul(a[j], b[i + 8 - j]);
   49|  20.7k|            accum1 += widemul(aa[j], bbb[i + 4 - j]);
   50|  20.7k|            accum0 += widemul(a[j + 4], bb[i + 4 - j]);
   51|  20.7k|        }
   52|       |
   53|  13.8k|        accum1 -= accum2;
   54|  13.8k|        accum0 += accum2;
   55|       |
   56|  13.8k|        c[i] = ((uint64_t)(accum0)) & mask;
   57|  13.8k|        c[i + 4] = ((uint64_t)(accum1)) & mask;
   58|       |
   59|  13.8k|        accum0 >>= 56;
   60|  13.8k|        accum1 >>= 56;
   61|  13.8k|    }
   62|       |
   63|  3.45k|    accum0 += accum1;
   64|  3.45k|    accum0 += c[4];
   65|  3.45k|    accum1 += c[0];
   66|  3.45k|    c[4] = ((uint64_t)(accum0)) & mask;
   67|  3.45k|    c[0] = ((uint64_t)(accum1)) & mask;
   68|       |
   69|  3.45k|    accum0 >>= 56;
   70|  3.45k|    accum1 >>= 56;
   71|       |
   72|  3.45k|    c[5] += ((uint64_t)(accum0));
   73|  3.45k|    c[1] += ((uint64_t)(accum1));
   74|  3.45k|}
ossl_gf_sqr:
  103|  2.59k|{
  104|  2.59k|    const uint64_t *a = as->limb;
  105|  2.59k|    uint64_t *c = cs->limb;
  106|  2.59k|    uint128_t accum0 = 0, accum1 = 0, accum2;
  107|  2.59k|    uint64_t mask = (1ULL << 56) - 1;
  108|  2.59k|    uint64_t aa[4];
  109|  2.59k|    unsigned int i;
  110|       |
  111|       |    /* For some reason clang doesn't vectorize this without prompting? */
  112|  12.9k|    for (i = 0; i < 4; i++)
  ------------------
  |  Branch (112:17): [True: 10.3k, False: 2.59k]
  ------------------
  113|  10.3k|        aa[i] = a[i] + a[i + 4];
  114|       |
  115|  2.59k|    accum2 = widemul(a[0], a[3]);
  116|  2.59k|    accum0 = widemul(aa[0], aa[3]);
  117|  2.59k|    accum1 = widemul(a[4], a[7]);
  118|       |
  119|  2.59k|    accum2 += widemul(a[1], a[2]);
  120|  2.59k|    accum0 += widemul(aa[1], aa[2]);
  121|  2.59k|    accum1 += widemul(a[5], a[6]);
  122|       |
  123|  2.59k|    accum0 -= accum2;
  124|  2.59k|    accum1 += accum2;
  125|       |
  126|  2.59k|    c[3] = ((uint64_t)(accum1)) << 1 & mask;
  127|  2.59k|    c[7] = ((uint64_t)(accum0)) << 1 & mask;
  128|       |
  129|  2.59k|    accum0 >>= 55;
  130|  2.59k|    accum1 >>= 55;
  131|       |
  132|  2.59k|    accum0 += widemul(2 * aa[1], aa[3]);
  133|  2.59k|    accum1 += widemul(2 * a[5], a[7]);
  134|  2.59k|    accum0 += widemul(aa[2], aa[2]);
  135|  2.59k|    accum1 += accum0;
  136|       |
  137|  2.59k|    accum0 -= widemul(2 * a[1], a[3]);
  138|  2.59k|    accum1 += widemul(a[6], a[6]);
  139|       |
  140|  2.59k|    accum2 = widemul(a[0], a[0]);
  141|  2.59k|    accum1 -= accum2;
  142|  2.59k|    accum0 += accum2;
  143|       |
  144|  2.59k|    accum0 -= widemul(a[2], a[2]);
  145|  2.59k|    accum1 += widemul(aa[0], aa[0]);
  146|  2.59k|    accum0 += widemul(a[4], a[4]);
  147|       |
  148|  2.59k|    c[0] = ((uint64_t)(accum0)) & mask;
  149|  2.59k|    c[4] = ((uint64_t)(accum1)) & mask;
  150|       |
  151|  2.59k|    accum0 >>= 56;
  152|  2.59k|    accum1 >>= 56;
  153|       |
  154|  2.59k|    accum2 = widemul(2 * aa[2], aa[3]);
  155|  2.59k|    accum0 -= widemul(2 * a[2], a[3]);
  156|  2.59k|    accum1 += widemul(2 * a[6], a[7]);
  157|       |
  158|  2.59k|    accum1 += accum2;
  159|  2.59k|    accum0 += accum2;
  160|       |
  161|  2.59k|    accum2 = widemul(2 * a[0], a[1]);
  162|  2.59k|    accum1 += widemul(2 * aa[0], aa[1]);
  163|  2.59k|    accum0 += widemul(2 * a[4], a[5]);
  164|       |
  165|  2.59k|    accum1 -= accum2;
  166|  2.59k|    accum0 += accum2;
  167|       |
  168|  2.59k|    c[1] = ((uint64_t)(accum0)) & mask;
  169|  2.59k|    c[5] = ((uint64_t)(accum1)) & mask;
  170|       |
  171|  2.59k|    accum0 >>= 56;
  172|  2.59k|    accum1 >>= 56;
  173|       |
  174|  2.59k|    accum2 = widemul(aa[3], aa[3]);
  175|  2.59k|    accum0 -= widemul(a[3], a[3]);
  176|  2.59k|    accum1 += widemul(a[7], a[7]);
  177|       |
  178|  2.59k|    accum1 += accum2;
  179|  2.59k|    accum0 += accum2;
  180|       |
  181|  2.59k|    accum2 = widemul(2 * a[0], a[2]);
  182|  2.59k|    accum1 += widemul(2 * aa[0], aa[2]);
  183|  2.59k|    accum0 += widemul(2 * a[4], a[6]);
  184|       |
  185|  2.59k|    accum2 += widemul(a[1], a[1]);
  186|  2.59k|    accum1 += widemul(aa[1], aa[1]);
  187|  2.59k|    accum0 += widemul(a[5], a[5]);
  188|       |
  189|  2.59k|    accum1 -= accum2;
  190|  2.59k|    accum0 += accum2;
  191|       |
  192|  2.59k|    c[2] = ((uint64_t)(accum0)) & mask;
  193|  2.59k|    c[6] = ((uint64_t)(accum1)) & mask;
  194|       |
  195|  2.59k|    accum0 >>= 56;
  196|  2.59k|    accum1 >>= 56;
  197|       |
  198|  2.59k|    accum0 += c[3];
  199|  2.59k|    accum1 += c[7];
  200|  2.59k|    c[3] = ((uint64_t)(accum0)) & mask;
  201|  2.59k|    c[7] = ((uint64_t)(accum1)) & mask;
  202|       |
  203|       |    /* we could almost stop here, but it wouldn't be stable, so... */
  204|       |
  205|  2.59k|    accum0 >>= 56;
  206|  2.59k|    accum1 >>= 56;
  207|  2.59k|    c[4] += ((uint64_t)(accum0)) + ((uint64_t)(accum1));
  208|  2.59k|    c[0] += ((uint64_t)(accum1));
  209|  2.59k|}

ossl_curve448_precomputed_scalarmul:
  235|      5|{
  236|      5|    unsigned int i, j, k;
  237|      5|    const unsigned int n = COMBS_N, t = COMBS_T, s = COMBS_S;
  ------------------
  |  |   20|      5|#define COMBS_N 5
  ------------------
                  const unsigned int n = COMBS_N, t = COMBS_T, s = COMBS_S;
  ------------------
  |  |   21|      5|#define COMBS_T 5
  ------------------
                  const unsigned int n = COMBS_N, t = COMBS_T, s = COMBS_S;
  ------------------
  |  |   22|      5|#define COMBS_S 18
  ------------------
  238|      5|    niels_t ni;
  239|      5|    curve448_scalar_t scalar1x;
  240|       |
  241|      5|    ossl_curve448_scalar_add(scalar1x, scalar, precomputed_scalarmul_adjustment);
  242|      5|    ossl_curve448_scalar_halve(scalar1x, scalar1x);
  243|       |
  244|     95|    for (i = s; i > 0; i--) {
  ------------------
  |  Branch (244:17): [True: 90, False: 5]
  ------------------
  245|     90|        if (i != s)
  ------------------
  |  Branch (245:13): [True: 85, False: 5]
  ------------------
  246|     85|            point_double_internal(out, out, 0);
  247|       |
  248|    540|        for (j = 0; j < n; j++) {
  ------------------
  |  Branch (248:21): [True: 450, False: 90]
  ------------------
  249|    450|            int tab = 0;
  250|    450|            mask_t invert;
  251|       |
  252|  2.70k|            for (k = 0; k < t; k++) {
  ------------------
  |  Branch (252:25): [True: 2.25k, False: 450]
  ------------------
  253|  2.25k|                unsigned int bit = (i - 1) + s * (k + j * t);
  254|       |
  255|  2.25k|                if (bit < C448_SCALAR_BITS)
  ------------------
  |  |   41|  2.25k|# define C448_SCALAR_BITS 446
  ------------------
  |  Branch (255:21): [True: 2.23k, False: 20]
  ------------------
  256|  2.23k|                    tab |=
  257|  2.23k|                        (scalar1x->limb[bit / WBITS] >> (bit % WBITS) & 1) << k;
  ------------------
  |  |   39|  2.23k|#define WBITS C448_WORD_BITS   /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|  2.23k|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
                                      (scalar1x->limb[bit / WBITS] >> (bit % WBITS) & 1) << k;
  ------------------
  |  |   39|  2.23k|#define WBITS C448_WORD_BITS   /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|  2.23k|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  258|  2.25k|            }
  259|       |
  260|    450|            invert = (tab >> (t - 1)) - 1;
  261|    450|            tab ^= invert;
  262|    450|            tab &= (1 << (t - 1)) - 1;
  263|       |
  264|    450|            constant_time_lookup_niels(ni, &table->table[j << (t - 1)],
  265|    450|                                       1 << (t - 1), tab);
  266|       |
  267|    450|            cond_neg_niels(ni, invert);
  268|    450|            if ((i != s) || j != 0)
  ------------------
  |  Branch (268:17): [True: 425, False: 25]
  |  Branch (268:29): [True: 20, False: 5]
  ------------------
  269|    445|                add_niels_to_pt(out, ni, j == n - 1 && i != 1);
  ------------------
  |  Branch (269:42): [True: 90, False: 355]
  |  Branch (269:56): [True: 85, False: 5]
  ------------------
  270|      5|            else
  271|      5|                niels_to_pt(out, ni);
  272|    450|        }
  273|     90|    }
  274|       |
  275|      5|    OPENSSL_cleanse(ni, sizeof(ni));
  276|      5|    OPENSSL_cleanse(scalar1x, sizeof(scalar1x));
  277|      5|}
ossl_curve448_point_mul_by_ratio_and_encode_like_eddsa:
  283|      2|{
  284|      2|    gf x, y, z, t;
  285|      2|    curve448_point_t q;
  286|       |
  287|       |    /* The point is now on the twisted curve.  Move it to untwisted. */
  288|      2|    curve448_point_copy(q, p);
  289|       |
  290|      2|    {
  291|       |        /* 4-isogeny: 2xy/(y^+x^2), (y^2-x^2)/(2z^2-y^2+x^2) */
  292|      2|        gf u;
  293|       |
  294|      2|        ossl_gf_sqr(x, q->x);
  295|      2|        ossl_gf_sqr(t, q->y);
  296|      2|        gf_add(u, x, t);
  297|      2|        gf_add(z, q->y, q->x);
  298|      2|        ossl_gf_sqr(y, z);
  299|      2|        gf_sub(y, y, u);
  300|      2|        gf_sub(z, t, x);
  301|      2|        ossl_gf_sqr(x, q->z);
  302|      2|        gf_add(t, x, x);
  303|      2|        gf_sub(t, t, z);
  304|      2|        ossl_gf_mul(x, t, y);
  305|      2|        ossl_gf_mul(y, z, u);
  306|      2|        ossl_gf_mul(z, u, t);
  307|      2|        OPENSSL_cleanse(u, sizeof(u));
  308|      2|    }
  309|       |
  310|       |    /* Affinize */
  311|      2|    gf_invert(z, z, 1);
  312|      2|    ossl_gf_mul(t, x, z);
  313|      2|    ossl_gf_mul(x, y, z);
  314|       |
  315|       |    /* Encode */
  316|      2|    enc[EDDSA_448_PRIVATE_BYTES - 1] = 0;
  ------------------
  |  |   22|      2|# define EDDSA_448_PRIVATE_BYTES EDDSA_448_PUBLIC_BYTES
  |  |  ------------------
  |  |  |  |   19|      2|# define EDDSA_448_PUBLIC_BYTES 57
  |  |  ------------------
  ------------------
  317|      2|    gf_serialize(enc, x, 1);
  318|      2|    enc[EDDSA_448_PRIVATE_BYTES - 1] |= 0x80 & gf_lobit(t);
  ------------------
  |  |   22|      2|# define EDDSA_448_PRIVATE_BYTES EDDSA_448_PUBLIC_BYTES
  |  |  ------------------
  |  |  |  |   19|      2|# define EDDSA_448_PUBLIC_BYTES 57
  |  |  ------------------
  ------------------
  319|       |
  320|      2|    OPENSSL_cleanse(x, sizeof(x));
  321|      2|    OPENSSL_cleanse(y, sizeof(y));
  322|      2|    OPENSSL_cleanse(z, sizeof(z));
  323|      2|    OPENSSL_cleanse(t, sizeof(t));
  324|      2|    ossl_curve448_point_destroy(q);
  325|      2|}
ossl_curve448_point_mul_by_ratio_and_encode_like_x448:
  470|      3|{
  471|      3|    curve448_point_t q;
  472|       |
  473|      3|    curve448_point_copy(q, p);
  474|      3|    gf_invert(q->t, q->x, 0);   /* 1/x */
  475|      3|    ossl_gf_mul(q->z, q->t, q->y);   /* y/x */
  476|      3|    ossl_gf_sqr(q->y, q->z);         /* (y/x)^2 */
  477|      3|    gf_serialize(out, q->y, 1);
  478|      3|    ossl_curve448_point_destroy(q);
  479|      3|}
ossl_x448_derive_public_key:
  483|      3|{
  484|       |    /* Scalar conditioning */
  485|      3|    uint8_t scalar2[X_PRIVATE_BYTES];
  486|      3|    curve448_scalar_t the_scalar;
  487|      3|    curve448_point_t p;
  488|      3|    unsigned int i;
  489|       |
  490|      3|    memcpy(scalar2, scalar, sizeof(scalar2));
  491|      3|    scalar2[0] &= -(uint8_t)COFACTOR;
  ------------------
  |  |   21|      3|#define COFACTOR 4
  ------------------
  492|       |
  493|      3|    scalar2[X_PRIVATE_BYTES - 1] &= ~((0u - 1u) << ((X_PRIVATE_BITS + 7) % 8));
  ------------------
  |  |   41|      3|# define X_PRIVATE_BYTES X_PUBLIC_BYTES
  |  |  ------------------
  |  |  |  |   40|      3|# define X_PUBLIC_BYTES  X_SER_BYTES
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      3|# define X_SER_BYTES 56
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  scalar2[X_PRIVATE_BYTES - 1] &= ~((0u - 1u) << ((X_PRIVATE_BITS + 7) % 8));
  ------------------
  |  |   42|      3|# define X_PRIVATE_BITS  448
  ------------------
  494|      3|    scalar2[X_PRIVATE_BYTES - 1] |= 1 << ((X_PRIVATE_BITS + 7) % 8);
  ------------------
  |  |   41|      3|# define X_PRIVATE_BYTES X_PUBLIC_BYTES
  |  |  ------------------
  |  |  |  |   40|      3|# define X_PUBLIC_BYTES  X_SER_BYTES
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      3|# define X_SER_BYTES 56
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  scalar2[X_PRIVATE_BYTES - 1] |= 1 << ((X_PRIVATE_BITS + 7) % 8);
  ------------------
  |  |   42|      3|# define X_PRIVATE_BITS  448
  ------------------
  495|       |
  496|      3|    ossl_curve448_scalar_decode_long(the_scalar, scalar2, sizeof(scalar2));
  497|       |
  498|       |    /* Compensate for the encoding ratio */
  499|      6|    for (i = 1; i < X448_ENCODE_RATIO; i <<= 1)
  ------------------
  |  |   47|      6|# define X448_ENCODE_RATIO 2
  ------------------
  |  Branch (499:17): [True: 3, False: 3]
  ------------------
  500|      3|        ossl_curve448_scalar_halve(the_scalar, the_scalar);
  501|       |
  502|      3|    ossl_curve448_precomputed_scalarmul(p, ossl_curve448_precomputed_base,
  503|      3|                                        the_scalar);
  504|      3|    ossl_curve448_point_mul_by_ratio_and_encode_like_x448(out, p);
  505|      3|    ossl_curve448_point_destroy(p);
  506|      3|}
ossl_curve448_point_destroy:
  731|     10|{
  732|     10|    OPENSSL_cleanse(point, sizeof(curve448_point_t));
  733|     10|}
ossl_x448_public_from_private:
  744|      3|{
  745|      3|    ossl_x448_derive_public_key(out_public_value, private_key);
  746|      3|}
curve448.c:point_double_internal:
   64|     85|{
   65|     85|    gf a, b, c, d;
   66|       |
   67|     85|    ossl_gf_sqr(c, q->x);
   68|     85|    ossl_gf_sqr(a, q->y);
   69|     85|    gf_add_nr(d, c, a);         /* 2+e */
  ------------------
  |  |  101|     85|# define gf_add_nr gf_add_RAW
  ------------------
   70|     85|    gf_add_nr(p->t, q->y, q->x); /* 2+e */
  ------------------
  |  |  101|     85|# define gf_add_nr gf_add_RAW
  ------------------
   71|     85|    ossl_gf_sqr(b, p->t);
   72|     85|    gf_subx_nr(b, b, d, 3);     /* 4+e */
   73|     85|    gf_sub_nr(p->t, a, c);      /* 3+e */
   74|     85|    ossl_gf_sqr(p->x, q->z);
   75|     85|    gf_add_nr(p->z, p->x, p->x); /* 2+e */
  ------------------
  |  |  101|     85|# define gf_add_nr gf_add_RAW
  ------------------
   76|     85|    gf_subx_nr(a, p->z, p->t, 4); /* 6+e */
   77|     85|    if (GF_HEADROOM == 5)
  ------------------
  |  |   16|     85|# define GF_HEADROOM 9999        /* Everything is reduced anyway */
  ------------------
  |  Branch (77:9): [Folded - Ignored]
  ------------------
   78|      0|        gf_weak_reduce(a);      /* or 1+e */
   79|     85|    ossl_gf_mul(p->x, a, b);
   80|     85|    ossl_gf_mul(p->z, p->t, a);
   81|     85|    ossl_gf_mul(p->y, p->t, d);
   82|     85|    if (!before_double)
  ------------------
  |  Branch (82:9): [True: 85, False: 0]
  ------------------
   83|     85|        ossl_gf_mul(p->t, b, d);
   84|     85|}
curve448.c:constant_time_lookup_niels:
  227|    450|{
  228|    450|    constant_time_lookup(ni, table, sizeof(niels_s), nelts, idx);
  229|    450|}
curve448.c:cond_neg_niels:
   93|    450|{
   94|    450|    gf_cond_swap(n->a, n->b, neg);
   95|    450|    gf_cond_neg(n->c, neg);
   96|    450|}
curve448.c:add_niels_to_pt:
  128|    445|{
  129|    445|    gf a, b, c;
  130|       |
  131|    445|    gf_sub_nr(b, d->y, d->x);   /* 3+e */
  132|    445|    ossl_gf_mul(a, e->a, b);
  133|    445|    gf_add_nr(b, d->x, d->y);   /* 2+e */
  ------------------
  |  |  101|    445|# define gf_add_nr gf_add_RAW
  ------------------
  134|    445|    ossl_gf_mul(d->y, e->b, b);
  135|    445|    ossl_gf_mul(d->x, e->c, d->t);
  136|    445|    gf_add_nr(c, a, d->y);      /* 2+e */
  ------------------
  |  |  101|    445|# define gf_add_nr gf_add_RAW
  ------------------
  137|    445|    gf_sub_nr(b, d->y, a);      /* 3+e */
  138|    445|    gf_sub_nr(d->y, d->z, d->x); /* 3+e */
  139|    445|    gf_add_nr(a, d->x, d->z);   /* 2+e */
  ------------------
  |  |  101|    445|# define gf_add_nr gf_add_RAW
  ------------------
  140|    445|    ossl_gf_mul(d->z, a, d->y);
  141|    445|    ossl_gf_mul(d->x, d->y, b);
  142|    445|    ossl_gf_mul(d->y, a, c);
  143|    445|    if (!before_double)
  ------------------
  |  Branch (143:9): [True: 360, False: 85]
  ------------------
  144|    360|        ossl_gf_mul(d->t, b, c);
  145|    445|}
curve448.c:niels_to_pt:
  119|      5|{
  120|      5|    gf_add(e->y, n->b, n->a);
  121|      5|    gf_sub(e->x, n->b, n->a);
  122|      5|    ossl_gf_mul(e->t, e->y, e->x);
  123|      5|    gf_copy(e->z, ONE);
  124|      5|}
curve448.c:gf_invert:
   43|      5|{
   44|      5|    mask_t ret;
   45|      5|    gf t1, t2;
   46|       |
   47|      5|    ossl_gf_sqr(t1, x);              /* o^2 */
   48|      5|    ret = gf_isr(t2, t1);       /* +-1/sqrt(o^2) = +-1/o */
   49|      5|    (void)ret;
   50|      5|    if (assert_nonzero)
  ------------------
  |  Branch (50:9): [True: 2, False: 3]
  ------------------
   51|      2|        assert(ret);
   52|      5|    ossl_gf_sqr(t1, t2);
   53|      5|    ossl_gf_mul(t2, t1, x);          /* not direct to y in case of alias. */
   54|      5|    gf_copy(y, t2);
   55|      5|}

scalar.c:c448_succeed_if:
   78|      2|{
   79|      2|    return (c448_error_t) x;
   80|      2|}

ossl_c448_ed448_derive_public_key:
  112|      2|{
  113|       |    /* only this much used for keygen */
  114|      2|    uint8_t secret_scalar_ser[EDDSA_448_PRIVATE_BYTES];
  115|      2|    curve448_scalar_t secret_scalar;
  116|      2|    unsigned int c;
  117|      2|    curve448_point_t p;
  118|       |
  119|      2|    if (!oneshot_hash(ctx, secret_scalar_ser, sizeof(secret_scalar_ser),
  ------------------
  |  Branch (119:9): [True: 0, False: 2]
  ------------------
  120|      2|                      privkey,
  121|      2|                      EDDSA_448_PRIVATE_BYTES,
  ------------------
  |  |   22|      2|# define EDDSA_448_PRIVATE_BYTES EDDSA_448_PUBLIC_BYTES
  |  |  ------------------
  |  |  |  |   19|      2|# define EDDSA_448_PUBLIC_BYTES 57
  |  |  ------------------
  ------------------
  122|      2|                      propq))
  123|      0|        return C448_FAILURE;
  124|       |
  125|      2|    clamp(secret_scalar_ser);
  126|       |
  127|      2|    ossl_curve448_scalar_decode_long(secret_scalar, secret_scalar_ser,
  128|      2|                                     sizeof(secret_scalar_ser));
  129|       |
  130|       |    /*
  131|       |     * Since we are going to mul_by_cofactor during encoding, divide by it
  132|       |     * here. However, the EdDSA base point is not the same as the decaf base
  133|       |     * point if the sigma isogeny is in use: the EdDSA base point is on
  134|       |     * Etwist_d/(1-d) and the decaf base point is on Etwist_d, and when
  135|       |     * converted it effectively picks up a factor of 2 from the isogenies.  So
  136|       |     * we might start at 2 instead of 1.
  137|       |     */
  138|      6|    for (c = 1; c < C448_EDDSA_ENCODE_RATIO; c <<= 1)
  ------------------
  |  |   29|      6|# define C448_EDDSA_ENCODE_RATIO 4
  ------------------
  |  Branch (138:17): [True: 4, False: 2]
  ------------------
  139|      4|        ossl_curve448_scalar_halve(secret_scalar, secret_scalar);
  140|       |
  141|      2|    ossl_curve448_precomputed_scalarmul(p, ossl_curve448_precomputed_base,
  142|      2|                                        secret_scalar);
  143|       |
  144|      2|    ossl_curve448_point_mul_by_ratio_and_encode_like_eddsa(pubkey, p);
  145|       |
  146|       |    /* Cleanup */
  147|      2|    ossl_curve448_scalar_destroy(secret_scalar);
  148|      2|    ossl_curve448_point_destroy(p);
  149|      2|    OPENSSL_cleanse(secret_scalar_ser, sizeof(secret_scalar_ser));
  150|       |
  151|      2|    return C448_SUCCESS;
  152|      2|}
ossl_ed448_public_from_private:
  398|      2|{
  399|      2|    return ossl_c448_ed448_derive_public_key(ctx, out_public_key, private_key,
  400|      2|                                             propq) == C448_SUCCESS;
  401|      2|}
eddsa.c:oneshot_hash:
   26|      2|{
   27|      2|    EVP_MD_CTX *hashctx = EVP_MD_CTX_new();
   28|      2|    EVP_MD *shake256 = NULL;
   29|      2|    c448_error_t ret = C448_FAILURE;
   30|       |
   31|      2|    if (hashctx == NULL)
  ------------------
  |  Branch (31:9): [True: 0, False: 2]
  ------------------
   32|      0|        return C448_FAILURE;
   33|       |
   34|      2|    shake256 = EVP_MD_fetch(ctx, "SHAKE256", propq);
   35|      2|    if (shake256 == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 2]
  ------------------
   36|      0|        goto err;
   37|       |
   38|      2|    if (!EVP_DigestInit_ex(hashctx, shake256, NULL)
  ------------------
  |  Branch (38:9): [True: 0, False: 2]
  ------------------
   39|      2|            || !EVP_DigestUpdate(hashctx, in, inlen)
  ------------------
  |  Branch (39:16): [True: 0, False: 2]
  ------------------
   40|      2|            || !EVP_DigestFinalXOF(hashctx, out, outlen))
  ------------------
  |  Branch (40:16): [True: 0, False: 2]
  ------------------
   41|      0|        goto err;
   42|       |
   43|      2|    ret = C448_SUCCESS;
   44|      2| err:
   45|      2|    EVP_MD_CTX_free(hashctx);
   46|      2|    EVP_MD_free(shake256);
   47|      2|    return ret;
   48|      2|}
eddsa.c:clamp:
   51|      2|{
   52|      2|    secret_scalar_ser[0] &= -COFACTOR;
  ------------------
  |  |   21|      2|#define COFACTOR 4
  ------------------
   53|      2|    secret_scalar_ser[EDDSA_448_PRIVATE_BYTES - 1] = 0;
  ------------------
  |  |   22|      2|# define EDDSA_448_PRIVATE_BYTES EDDSA_448_PUBLIC_BYTES
  |  |  ------------------
  |  |  |  |   19|      2|# define EDDSA_448_PUBLIC_BYTES 57
  |  |  ------------------
  ------------------
   54|      2|    secret_scalar_ser[EDDSA_448_PRIVATE_BYTES - 2] |= 0x80;
  ------------------
  |  |   22|      2|# define EDDSA_448_PRIVATE_BYTES EDDSA_448_PUBLIC_BYTES
  |  |  ------------------
  |  |  |  |   19|      2|# define EDDSA_448_PUBLIC_BYTES 57
  |  |  ------------------
  ------------------
   55|      2|}

gf_serialize:
   22|      5|{
   23|      5|    unsigned int j = 0, fill = 0;
   24|      5|    dword_t buffer = 0;
   25|      5|    int i;
   26|      5|    gf red;
   27|       |
   28|      5|    gf_copy(red, x);
   29|      5|    gf_strong_reduce(red);
   30|      5|    if (!with_hibit)
  ------------------
  |  Branch (30:9): [True: 0, False: 5]
  ------------------
   31|      0|        assert(gf_hibit(red) == 0);
   32|       |
   33|    285|    for (i = 0; i < (with_hibit ? X_SER_BYTES : SER_BYTES); i++) {
  ------------------
  |  |   22|    285|# define X_SER_BYTES 56
  ------------------
                  for (i = 0; i < (with_hibit ? X_SER_BYTES : SER_BYTES); i++) {
  ------------------
  |  |   23|      0|# define SER_BYTES 56
  ------------------
  |  Branch (33:17): [True: 280, False: 5]
  |  Branch (33:22): [True: 285, False: 0]
  ------------------
   34|    280|        if (fill < 8 && j < NLIMBS) {
  ------------------
  |  |   21|     40|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (34:13): [True: 40, False: 240]
  |  Branch (34:25): [True: 40, False: 0]
  ------------------
   35|     40|            buffer |= ((dword_t) red->limb[LIMBPERM(j)]) << fill;
  ------------------
  |  |   70|     40|# define LIMBPERM(i) (i)
  ------------------
   36|     40|            fill += LIMB_PLACE_VALUE(LIMBPERM(j));
  ------------------
  |  |   19|     40|# define LIMB_PLACE_VALUE(i) 56
  ------------------
   37|     40|            j++;
   38|     40|        }
   39|    280|        serial[i] = (uint8_t)buffer;
   40|    280|        fill -= 8;
   41|    280|        buffer >>= 8;
   42|    280|    }
   43|      5|}
gf_lobit:
   57|      2|{
   58|      2|    gf y;
   59|       |
   60|      2|    gf_copy(y, x);
   61|      2|    gf_strong_reduce(y);
   62|      2|    return 0 - (y->limb[0] & 1);
   63|      2|}
gf_strong_reduce:
  101|     12|{
  102|     12|    dsword_t scarry;
  103|     12|    word_t scarry_0;
  104|     12|    dword_t carry = 0;
  105|     12|    unsigned int i;
  106|       |
  107|       |    /* first, clear high */
  108|     12|    gf_weak_reduce(a);          /* Determined to have negligible perf impact. */
  109|       |
  110|       |    /* now the total is less than 2p */
  111|       |
  112|       |    /* compute total_value - p.  No need to reduce mod p. */
  113|     12|    scarry = 0;
  114|    108|    for (i = 0; i < NLIMBS; i++) {
  ------------------
  |  |   21|    108|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (114:17): [True: 96, False: 12]
  ------------------
  115|     96|        scarry = scarry + a->limb[LIMBPERM(i)] - MODULUS->limb[LIMBPERM(i)];
  ------------------
  |  |   70|     96|# define LIMBPERM(i) (i)
  ------------------
                      scarry = scarry + a->limb[LIMBPERM(i)] - MODULUS->limb[LIMBPERM(i)];
  ------------------
  |  |   70|     96|# define LIMBPERM(i) (i)
  ------------------
  116|     96|        a->limb[LIMBPERM(i)] = scarry & LIMB_MASK(LIMBPERM(i));
  ------------------
  |  |   70|     96|# define LIMBPERM(i) (i)
  ------------------
                      a->limb[LIMBPERM(i)] = scarry & LIMB_MASK(LIMBPERM(i));
  ------------------
  |  |   76|     96|#  define LIMB_MASK(i) (((1ULL)<<LIMB_PLACE_VALUE(i))-1)
  |  |  ------------------
  |  |  |  |   19|     96|# define LIMB_PLACE_VALUE(i) 56
  |  |  ------------------
  ------------------
  117|     96|        scarry >>= LIMB_PLACE_VALUE(LIMBPERM(i));
  ------------------
  |  |   19|     96|# define LIMB_PLACE_VALUE(i) 56
  ------------------
  118|     96|    }
  119|       |
  120|       |    /*
  121|       |     * uncommon case: it was >= p, so now scarry = 0 and this = x common case:
  122|       |     * it was < p, so now scarry = -1 and this = x - p + 2^255 so let's add
  123|       |     * back in p.  will carry back off the top for 2^255.
  124|       |     */
  125|     12|    assert(scarry == 0 || scarry == -1);
  126|       |
  127|     12|    scarry_0 = (word_t)scarry;
  128|       |
  129|       |    /* add it back */
  130|    108|    for (i = 0; i < NLIMBS; i++) {
  ------------------
  |  |   21|    108|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (130:17): [True: 96, False: 12]
  ------------------
  131|     96|        carry =
  132|     96|            carry + a->limb[LIMBPERM(i)] +
  ------------------
  |  |   70|     96|# define LIMBPERM(i) (i)
  ------------------
  133|     96|            (scarry_0 & MODULUS->limb[LIMBPERM(i)]);
  ------------------
  |  |   70|     96|# define LIMBPERM(i) (i)
  ------------------
  134|     96|        a->limb[LIMBPERM(i)] = carry & LIMB_MASK(LIMBPERM(i));
  ------------------
  |  |   70|     96|# define LIMBPERM(i) (i)
  ------------------
                      a->limb[LIMBPERM(i)] = carry & LIMB_MASK(LIMBPERM(i));
  ------------------
  |  |   76|     96|#  define LIMB_MASK(i) (((1ULL)<<LIMB_PLACE_VALUE(i))-1)
  |  |  ------------------
  |  |  |  |   19|     96|# define LIMB_PLACE_VALUE(i) 56
  |  |  ------------------
  ------------------
  135|     96|        carry >>= LIMB_PLACE_VALUE(LIMBPERM(i));
  ------------------
  |  |   19|     96|# define LIMB_PLACE_VALUE(i) 56
  ------------------
  136|     96|    }
  137|       |
  138|     12|    assert(carry < 2 && ((word_t)carry + scarry_0) == 0);
  139|     12|}
gf_sub:
  143|    466|{
  144|    466|    gf_sub_RAW(d, a, b);
  145|    466|    gf_bias(d, 2);
  146|    466|    gf_weak_reduce(d);
  147|    466|}
gf_add:
  151|     11|{
  152|     11|    gf_add_RAW(d, a, b);
  153|     11|    gf_weak_reduce(d);
  154|     11|}
gf_eq:
  158|      5|{
  159|      5|    gf c;
  160|      5|    mask_t ret = 0;
  161|      5|    unsigned int i;
  162|       |
  163|      5|    gf_sub(c, a, b);
  164|      5|    gf_strong_reduce(c);
  165|       |
  166|     45|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |   21|     45|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (166:17): [True: 40, False: 5]
  ------------------
  167|     40|        ret |= c->limb[LIMBPERM(i)];
  ------------------
  |  |   70|     40|# define LIMBPERM(i) (i)
  ------------------
  168|       |
  169|      5|    return word_is_zero(ret);
  ------------------
  |  |   20|      5|# define word_is_zero(a)     constant_time_is_zero_64(a)
  ------------------
  170|      5|}
gf_isr:
  173|      5|{
  174|      5|    gf L0, L1, L2;
  175|       |
  176|      5|    ossl_gf_sqr(L1, x);
  177|      5|    ossl_gf_mul(L2, x, L1);
  178|      5|    ossl_gf_sqr(L1, L2);
  179|      5|    ossl_gf_mul(L2, x, L1);
  180|      5|    gf_sqrn(L1, L2, 3);
  181|      5|    ossl_gf_mul(L0, L2, L1);
  182|      5|    gf_sqrn(L1, L0, 3);
  183|      5|    ossl_gf_mul(L0, L2, L1);
  184|      5|    gf_sqrn(L2, L0, 9);
  185|      5|    ossl_gf_mul(L1, L0, L2);
  186|      5|    ossl_gf_sqr(L0, L1);
  187|      5|    ossl_gf_mul(L2, x, L0);
  188|      5|    gf_sqrn(L0, L2, 18);
  189|      5|    ossl_gf_mul(L2, L1, L0);
  190|      5|    gf_sqrn(L0, L2, 37);
  191|      5|    ossl_gf_mul(L1, L2, L0);
  192|      5|    gf_sqrn(L0, L1, 37);
  193|      5|    ossl_gf_mul(L1, L2, L0);
  194|      5|    gf_sqrn(L0, L1, 111);
  195|      5|    ossl_gf_mul(L2, L1, L0);
  196|      5|    ossl_gf_sqr(L0, L2);
  197|      5|    ossl_gf_mul(L1, x, L0);
  198|      5|    gf_sqrn(L0, L1, 223);
  199|      5|    ossl_gf_mul(L1, L2, L0);
  200|      5|    ossl_gf_sqr(L2, L1);
  201|      5|    ossl_gf_mul(L0, L2, x);
  202|      5|    gf_copy(a, L1);
  203|      5|    return gf_eq(L0, ONE);
  204|      5|}

curve448.c:gf_subx_nr:
  114|    170|{
  115|    170|    gf_sub_RAW(c, a, b);
  116|    170|    gf_bias(c, amt);
  117|    170|    if (GF_HEADROOM < amt + 1)
  ------------------
  |  |   16|    170|# define GF_HEADROOM 9999        /* Everything is reduced anyway */
  ------------------
  |  Branch (117:9): [True: 0, False: 170]
  ------------------
  118|      0|        gf_weak_reduce(c);
  119|    170|}
curve448.c:gf_cond_neg:
  151|    450|{
  152|    450|    gf y;
  153|       |
  154|    450|    gf_sub(y, ZERO, x);
  155|    450|    gf_cond_sel(x, x, y, neg);
  156|    450|}
curve448.c:gf_cond_sel:
  134|    450|{
  135|    450|    size_t i;
  136|       |
  137|  4.05k|    for (i = 0; i < NLIMBS; i++) {
  ------------------
  |  |   21|  4.05k|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (137:17): [True: 3.60k, False: 450]
  ------------------
  138|       |#if ARCH_WORD_BITS == 32
  139|       |        x[0].limb[i] = constant_time_select_32(is_z, z[0].limb[i],
  140|       |                                               y[0].limb[i]);
  141|       |#else
  142|       |        /* Must be 64 bit */
  143|  3.60k|        x[0].limb[i] = constant_time_select_64(is_z, z[0].limb[i],
  144|  3.60k|                                               y[0].limb[i]);
  145|  3.60k|#endif
  146|  3.60k|    }
  147|    450|}
curve448.c:gf_copy:
   45|     10|{
   46|     10|    *out = *a;
   47|     10|}
curve448.c:gf_cond_swap:
  160|    450|{
  161|    450|    size_t i;
  162|       |
  163|  4.05k|    for (i = 0; i < NLIMBS; i++) {
  ------------------
  |  |   21|  4.05k|# define NLIMBS (64/sizeof(word_t))
  ------------------
  |  Branch (163:17): [True: 3.60k, False: 450]
  ------------------
  164|       |#if ARCH_WORD_BITS == 32
  165|       |        constant_time_cond_swap_32(swap, &(x[0].limb[i]), &(y->limb[i]));
  166|       |#else
  167|       |        /* Must be 64 bit */
  168|  3.60k|        constant_time_cond_swap_64(swap, &(x[0].limb[i]), &(y->limb[i]));
  169|  3.60k|#endif
  170|  3.60k|    }
  171|    450|}
curve448.c:gf_sub_nr:
  105|  1.42k|{
  106|  1.42k|    gf_sub_RAW(c, a, b);
  107|  1.42k|    gf_bias(c, 2);
  108|  1.42k|    if (GF_HEADROOM < 3)
  ------------------
  |  |   16|  1.42k|# define GF_HEADROOM 9999        /* Everything is reduced anyway */
  ------------------
  |  Branch (108:9): [Folded - Ignored]
  ------------------
  109|      0|        gf_weak_reduce(c);
  110|  1.42k|}
f_generic.c:gf_copy:
   45|     12|{
   46|     12|    *out = *a;
   47|     12|}
f_generic.c:gf_sqrn:
   83|     40|{
   84|     40|    gf tmp;
   85|       |
   86|     40|    assert(n > 0);
   87|     40|    if (n & 1) {
  ------------------
  |  Branch (87:9): [True: 35, False: 5]
  ------------------
   88|     35|        ossl_gf_sqr(y, x);
   89|     35|        n--;
   90|     35|    } else {
   91|      5|        ossl_gf_sqr(tmp, x);
   92|      5|        ossl_gf_sqr(y, tmp);
   93|      5|        n -= 2;
   94|      5|    }
   95|  1.12k|    for (; n; n -= 2) {
  ------------------
  |  Branch (95:12): [True: 1.08k, False: 40]
  ------------------
   96|  1.08k|        ossl_gf_sqr(tmp, y);
   97|  1.08k|        ossl_gf_sqr(y, tmp);
   98|  1.08k|    }
   99|     40|}

curve448.c:curve448_point_copy:
  183|      5|{
  184|      5|    *a = *b;
  185|      5|}
scalar.c:curve448_scalar_copy:
  170|      2|{
  171|      2|    *out = *a;
  172|      2|}

ossl_curve448_scalar_mul:
  111|      5|{
  112|      5|    sc_montmul(out, a, b);
  113|      5|    sc_montmul(out, out, sc_r2);
  114|      5|}
ossl_curve448_scalar_add:
  126|      7|{
  127|      7|    c448_dword_t chain = 0;
  128|      7|    unsigned int i;
  129|       |
  130|     56|    for (i = 0; i < C448_SCALAR_LIMBS; i++) {
  ------------------
  |  |   38|     56|# define C448_SCALAR_LIMBS ((446-1)/C448_WORD_BITS+1)
  |  |  ------------------
  |  |  |  |   32|     56|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (130:17): [True: 49, False: 7]
  ------------------
  131|     49|        chain = (chain + a->limb[i]) + b->limb[i];
  132|     49|        out->limb[i] = (c448_word_t)chain;
  133|     49|        chain >>= WBITS;
  ------------------
  |  |   39|     49|#define WBITS C448_WORD_BITS   /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|     49|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  134|     49|    }
  135|      7|    sc_subx(out, out->limb, sc_p, sc_p, (c448_word_t)chain);
  136|      7|}
ossl_curve448_scalar_decode:
  156|      2|{
  157|      2|    unsigned int i;
  158|      2|    c448_dsword_t accum = 0;
  159|       |
  160|      2|    scalar_decode_short(s, ser, C448_SCALAR_BYTES);
  ------------------
  |  |   44|      2|# define C448_SCALAR_BYTES 56
  ------------------
  161|     16|    for (i = 0; i < C448_SCALAR_LIMBS; i++)
  ------------------
  |  |   38|     16|# define C448_SCALAR_LIMBS ((446-1)/C448_WORD_BITS+1)
  |  |  ------------------
  |  |  |  |   32|     16|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (161:17): [True: 14, False: 2]
  ------------------
  162|     14|        accum = (accum + s->limb[i] - sc_p->limb[i]) >> WBITS;
  ------------------
  |  |   39|     14|#define WBITS C448_WORD_BITS   /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|     14|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  163|       |    /* Here accum == 0 or -1 */
  164|       |
  165|      2|    ossl_curve448_scalar_mul(s, s, ossl_curve448_scalar_one); /* ham-handed reduce */
  166|       |
  167|      2|    return c448_succeed_if(~word_is_zero((uint32_t)accum));
  ------------------
  |  |   20|      2|# define word_is_zero(a)     constant_time_is_zero_64(a)
  ------------------
  168|      2|}
ossl_curve448_scalar_destroy:
  171|      9|{
  172|      9|    OPENSSL_cleanse(scalar, sizeof(curve448_scalar_t));
  173|      9|}
ossl_curve448_scalar_decode_long:
  178|      5|{
  179|      5|    size_t i;
  180|      5|    curve448_scalar_t t1, t2;
  181|       |
  182|      5|    if (ser_len == 0) {
  ------------------
  |  Branch (182:9): [True: 0, False: 5]
  ------------------
  183|      0|        curve448_scalar_copy(s, ossl_curve448_scalar_zero);
  184|      0|        return;
  185|      0|    }
  186|       |
  187|      5|    i = ser_len - (ser_len % C448_SCALAR_BYTES);
  ------------------
  |  |   44|      5|# define C448_SCALAR_BYTES 56
  ------------------
  188|      5|    if (i == ser_len)
  ------------------
  |  Branch (188:9): [True: 3, False: 2]
  ------------------
  189|      3|        i -= C448_SCALAR_BYTES;
  ------------------
  |  |   44|      3|# define C448_SCALAR_BYTES 56
  ------------------
  190|       |
  191|      5|    scalar_decode_short(t1, &ser[i], ser_len - i);
  192|       |
  193|      5|    if (ser_len == sizeof(curve448_scalar_t)) {
  ------------------
  |  Branch (193:9): [True: 3, False: 2]
  ------------------
  194|      3|        assert(i == 0);
  195|       |        /* ham-handed reduce */
  196|      3|        ossl_curve448_scalar_mul(s, t1, ossl_curve448_scalar_one);
  197|      3|        ossl_curve448_scalar_destroy(t1);
  198|      3|        return;
  199|      3|    }
  200|       |
  201|      4|    while (i) {
  ------------------
  |  Branch (201:12): [True: 2, False: 2]
  ------------------
  202|      2|        i -= C448_SCALAR_BYTES;
  ------------------
  |  |   44|      2|# define C448_SCALAR_BYTES 56
  ------------------
  203|      2|        sc_montmul(t1, t1, sc_r2);
  204|      2|        (void)ossl_curve448_scalar_decode(t2, ser + i);
  205|      2|        ossl_curve448_scalar_add(t1, t1, t2);
  206|      2|    }
  207|       |
  208|      2|    curve448_scalar_copy(s, t1);
  209|      2|    ossl_curve448_scalar_destroy(t1);
  210|      2|    ossl_curve448_scalar_destroy(t2);
  211|      2|}
ossl_curve448_scalar_halve:
  227|     12|{
  228|     12|    c448_word_t mask = 0 - (a->limb[0] & 1);
  229|     12|    c448_dword_t chain = 0;
  230|     12|    unsigned int i;
  231|       |
  232|     96|    for (i = 0; i < C448_SCALAR_LIMBS; i++) {
  ------------------
  |  |   38|     96|# define C448_SCALAR_LIMBS ((446-1)/C448_WORD_BITS+1)
  |  |  ------------------
  |  |  |  |   32|     96|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (232:17): [True: 84, False: 12]
  ------------------
  233|     84|        chain = (chain + a->limb[i]) + (sc_p->limb[i] & mask);
  234|     84|        out->limb[i] = (c448_word_t)chain;
  235|     84|        chain >>= C448_WORD_BITS;
  ------------------
  |  |   32|     84|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  ------------------
  236|     84|    }
  237|     84|    for (i = 0; i < C448_SCALAR_LIMBS - 1; i++)
  ------------------
  |  |   38|     84|# define C448_SCALAR_LIMBS ((446-1)/C448_WORD_BITS+1)
  |  |  ------------------
  |  |  |  |   32|     84|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (237:17): [True: 72, False: 12]
  ------------------
  238|     72|        out->limb[i] = out->limb[i] >> 1 | out->limb[i + 1] << (WBITS - 1);
  ------------------
  |  |   39|     72|#define WBITS C448_WORD_BITS   /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|     72|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  239|     12|    out->limb[i] = out->limb[i] >> 1 | (c448_word_t)(chain << (WBITS - 1));
  ------------------
  |  |   39|     12|#define WBITS C448_WORD_BITS   /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|     12|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  240|     12|}
scalar.c:sc_montmul:
   74|     12|{
   75|     12|    unsigned int i, j;
   76|     12|    c448_word_t accum[C448_SCALAR_LIMBS + 1] = { 0 };
   77|     12|    c448_word_t hi_carry = 0;
   78|       |
   79|     96|    for (i = 0; i < C448_SCALAR_LIMBS; i++) {
  ------------------
  |  |   38|     96|# define C448_SCALAR_LIMBS ((446-1)/C448_WORD_BITS+1)
  |  |  ------------------
  |  |  |  |   32|     96|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (79:17): [True: 84, False: 12]
  ------------------
   80|     84|        c448_word_t mand = a->limb[i];
   81|     84|        const c448_word_t *mier = b->limb;
   82|       |
   83|     84|        c448_dword_t chain = 0;
   84|    672|        for (j = 0; j < C448_SCALAR_LIMBS; j++) {
  ------------------
  |  |   38|    672|# define C448_SCALAR_LIMBS ((446-1)/C448_WORD_BITS+1)
  |  |  ------------------
  |  |  |  |   32|    672|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (84:21): [True: 588, False: 84]
  ------------------
   85|    588|            chain += ((c448_dword_t) mand) * mier[j] + accum[j];
   86|    588|            accum[j] = (c448_word_t)chain;
   87|    588|            chain >>= WBITS;
  ------------------
  |  |   39|    588|#define WBITS C448_WORD_BITS   /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|    588|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
   88|    588|        }
   89|     84|        accum[j] = (c448_word_t)chain;
   90|       |
   91|     84|        mand = accum[0] * MONTGOMERY_FACTOR;
   92|     84|        chain = 0;
   93|     84|        mier = sc_p->limb;
   94|    672|        for (j = 0; j < C448_SCALAR_LIMBS; j++) {
  ------------------
  |  |   38|    672|# define C448_SCALAR_LIMBS ((446-1)/C448_WORD_BITS+1)
  |  |  ------------------
  |  |  |  |   32|    672|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (94:21): [True: 588, False: 84]
  ------------------
   95|    588|            chain += (c448_dword_t) mand *mier[j] + accum[j];
   96|    588|            if (j)
  ------------------
  |  Branch (96:17): [True: 504, False: 84]
  ------------------
   97|    504|                accum[j - 1] = (c448_word_t)chain;
   98|    588|            chain >>= WBITS;
  ------------------
  |  |   39|    588|#define WBITS C448_WORD_BITS   /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|    588|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
   99|    588|        }
  100|     84|        chain += accum[j];
  101|     84|        chain += hi_carry;
  102|     84|        accum[j - 1] = (c448_word_t)chain;
  103|     84|        hi_carry = chain >> WBITS;
  ------------------
  |  |   39|     84|#define WBITS C448_WORD_BITS   /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|     84|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  104|     84|    }
  105|       |
  106|     12|    sc_subx(out, accum, sc_p, sc_p, hi_carry);
  107|     12|}
scalar.c:sc_subx:
   52|     19|{
   53|     19|    c448_dsword_t chain = 0;
   54|     19|    unsigned int i;
   55|     19|    c448_word_t borrow;
   56|       |
   57|    152|    for (i = 0; i < C448_SCALAR_LIMBS; i++) {
  ------------------
  |  |   38|    152|# define C448_SCALAR_LIMBS ((446-1)/C448_WORD_BITS+1)
  |  |  ------------------
  |  |  |  |   32|    152|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (57:17): [True: 133, False: 19]
  ------------------
   58|    133|        chain = (chain + accum[i]) - sub->limb[i];
   59|    133|        out->limb[i] = (c448_word_t)chain;
   60|    133|        chain >>= WBITS;
  ------------------
  |  |   39|    133|#define WBITS C448_WORD_BITS   /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|    133|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
   61|    133|    }
   62|     19|    borrow = (c448_word_t)chain + extra;     /* = 0 or -1 */
   63|       |
   64|     19|    chain = 0;
   65|    152|    for (i = 0; i < C448_SCALAR_LIMBS; i++) {
  ------------------
  |  |   38|    152|# define C448_SCALAR_LIMBS ((446-1)/C448_WORD_BITS+1)
  |  |  ------------------
  |  |  |  |   32|    152|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (65:17): [True: 133, False: 19]
  ------------------
   66|    133|        chain = (chain + out->limb[i]) + (p->limb[i] & borrow);
   67|    133|        out->limb[i] = (c448_word_t)chain;
   68|    133|        chain >>= WBITS;
  ------------------
  |  |   39|    133|#define WBITS C448_WORD_BITS   /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|    133|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
   69|    133|    }
   70|     19|}
scalar.c:scalar_decode_short:
  141|      7|{
  142|      7|    size_t i, j, k = 0;
  143|       |
  144|     56|    for (i = 0; i < C448_SCALAR_LIMBS; i++) {
  ------------------
  |  |   38|     56|# define C448_SCALAR_LIMBS ((446-1)/C448_WORD_BITS+1)
  |  |  ------------------
  |  |  |  |   32|     56|#   define C448_WORD_BITS 64      /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (144:17): [True: 49, False: 7]
  ------------------
  145|     49|        c448_word_t out = 0;
  146|       |
  147|    331|        for (j = 0; j < sizeof(c448_word_t) && k < nbytes; j++, k++)
  ------------------
  |  Branch (147:21): [True: 296, False: 35]
  |  Branch (147:48): [True: 282, False: 14]
  ------------------
  148|    282|            out |= ((c448_word_t) ser[k]) << (8 * j);
  149|     49|        s->limb[i] = out;
  150|     49|    }
  151|      7|}

ossl_ec_GF2m_simple_set_compressed_coordinates:
   43|     54|{
   44|     54|    BIGNUM *tmp, *x, *y, *z;
   45|     54|    int ret = 0, z0;
   46|     54|#ifndef FIPS_MODULE
   47|     54|    BN_CTX *new_ctx = NULL;
   48|       |
   49|     54|    if (ctx == NULL) {
  ------------------
  |  Branch (49:9): [True: 0, False: 54]
  ------------------
   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|     54|#endif
   55|       |
   56|     54|    y_bit = (y_bit != 0) ? 1 : 0;
  ------------------
  |  Branch (56:13): [True: 35, False: 19]
  ------------------
   57|       |
   58|     54|    BN_CTX_start(ctx);
   59|     54|    tmp = BN_CTX_get(ctx);
   60|     54|    x = BN_CTX_get(ctx);
   61|     54|    y = BN_CTX_get(ctx);
   62|     54|    z = BN_CTX_get(ctx);
   63|     54|    if (z == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 54]
  ------------------
   64|      0|        goto err;
   65|       |
   66|     54|    if (!BN_GF2m_mod_arr(x, x_, group->poly))
  ------------------
  |  Branch (66:9): [True: 0, False: 54]
  ------------------
   67|      0|        goto err;
   68|     54|    if (BN_is_zero(x)) {
  ------------------
  |  Branch (68:9): [True: 4, False: 50]
  ------------------
   69|      4|        if (!BN_GF2m_mod_sqrt_arr(y, group->b, group->poly, ctx))
  ------------------
  |  Branch (69:13): [True: 0, False: 4]
  ------------------
   70|      0|            goto err;
   71|     50|    } else {
   72|     50|        if (!group->meth->field_sqr(group, tmp, x, ctx))
  ------------------
  |  Branch (72:13): [True: 0, False: 50]
  ------------------
   73|      0|            goto err;
   74|     50|        if (!group->meth->field_div(group, tmp, group->b, tmp, ctx))
  ------------------
  |  Branch (74:13): [True: 0, False: 50]
  ------------------
   75|      0|            goto err;
   76|     50|        if (!BN_GF2m_add(tmp, group->a, tmp))
  ------------------
  |  Branch (76:13): [True: 0, False: 50]
  ------------------
   77|      0|            goto err;
   78|     50|        if (!BN_GF2m_add(tmp, x, tmp))
  ------------------
  |  Branch (78:13): [True: 0, False: 50]
  ------------------
   79|      0|            goto err;
   80|     50|        ERR_set_mark();
   81|     50|        if (!BN_GF2m_mod_solve_quad_arr(z, tmp, group->poly, ctx)) {
  ------------------
  |  Branch (81:13): [True: 23, False: 27]
  ------------------
   82|     23|#ifndef FIPS_MODULE
   83|     23|            unsigned long err = ERR_peek_last_error();
   84|       |
   85|     23|            if (ERR_GET_LIB(err) == ERR_LIB_BN
  ------------------
  |  |   73|     46|# define ERR_LIB_BN              3
  ------------------
  |  Branch (85:17): [True: 23, False: 0]
  ------------------
   86|     23|                && ERR_GET_REASON(err) == BN_R_NO_SOLUTION) {
  ------------------
  |  |   40|     23|# define BN_R_NO_SOLUTION                                 116
  ------------------
  |  Branch (86:20): [True: 23, False: 0]
  ------------------
   87|     23|                ERR_pop_to_mark();
   88|     23|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
   89|     23|            } 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|     23|            goto err;
   96|     23|        }
   97|     27|        ERR_clear_last_mark();
   98|     27|        z0 = (BN_is_odd(z)) ? 1 : 0;
  ------------------
  |  Branch (98:14): [True: 6, False: 21]
  ------------------
   99|     27|        if (!group->meth->field_mul(group, y, x, z, ctx))
  ------------------
  |  Branch (99:13): [True: 0, False: 27]
  ------------------
  100|      0|            goto err;
  101|     27|        if (z0 != y_bit) {
  ------------------
  |  Branch (101:13): [True: 13, False: 14]
  ------------------
  102|     13|            if (!BN_GF2m_add(y, y, x))
  ------------------
  |  Branch (102:17): [True: 0, False: 13]
  ------------------
  103|      0|                goto err;
  104|     13|        }
  105|     27|    }
  106|       |
  107|     31|    if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (107:9): [True: 0, False: 31]
  ------------------
  108|      0|        goto err;
  109|       |
  110|     31|    ret = 1;
  111|       |
  112|     54| err:
  113|     54|    BN_CTX_end(ctx);
  114|     54|#ifndef FIPS_MODULE
  115|     54|    BN_CTX_free(new_ctx);
  116|     54|#endif
  117|     54|    return ret;
  118|     31|}
ossl_ec_GF2m_simple_point2oct:
  129|    623|{
  130|    623|    size_t ret;
  131|    623|    int used_ctx = 0;
  132|    623|    BIGNUM *x, *y, *yxi;
  133|    623|    size_t field_len, i, skip;
  134|    623|#ifndef FIPS_MODULE
  135|    623|    BN_CTX *new_ctx = NULL;
  136|    623|#endif
  137|       |
  138|    623|    if ((form != POINT_CONVERSION_COMPRESSED)
  ------------------
  |  Branch (138:9): [True: 623, False: 0]
  ------------------
  139|    623|        && (form != POINT_CONVERSION_UNCOMPRESSED)
  ------------------
  |  Branch (139:12): [True: 17, False: 606]
  ------------------
  140|    623|        && (form != POINT_CONVERSION_HYBRID)) {
  ------------------
  |  Branch (140:12): [True: 17, False: 0]
  ------------------
  141|     17|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FORM);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  142|     17|        goto err;
  143|     17|    }
  144|       |
  145|    606|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (145:9): [True: 94, False: 512]
  ------------------
  146|       |        /* encodes to a single 0 octet */
  147|     94|        if (buf != NULL) {
  ------------------
  |  Branch (147:13): [True: 47, False: 47]
  ------------------
  148|     47|            if (len < 1) {
  ------------------
  |  Branch (148:17): [True: 0, False: 47]
  ------------------
  149|      0|                ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  150|      0|                return 0;
  151|      0|            }
  152|     47|            buf[0] = 0;
  153|     47|        }
  154|     94|        return 1;
  155|     94|    }
  156|       |
  157|       |    /* ret := required output buffer length */
  158|    512|    field_len = (EC_GROUP_get_degree(group) + 7) / 8;
  159|    512|    ret =
  160|    512|        (form ==
  ------------------
  |  Branch (160:9): [True: 0, False: 512]
  ------------------
  161|    512|         POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;
  162|       |
  163|       |    /* if 'buf' is NULL, just return required length */
  164|    512|    if (buf != NULL) {
  ------------------
  |  Branch (164:9): [True: 256, False: 256]
  ------------------
  165|    256|        if (len < ret) {
  ------------------
  |  Branch (165:13): [True: 0, False: 256]
  ------------------
  166|      0|            ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|       |
  170|    256|#ifndef FIPS_MODULE
  171|    256|        if (ctx == NULL) {
  ------------------
  |  Branch (171:13): [True: 256, False: 0]
  ------------------
  172|    256|            ctx = new_ctx = BN_CTX_new();
  173|    256|            if (ctx == NULL)
  ------------------
  |  Branch (173:17): [True: 0, False: 256]
  ------------------
  174|      0|                return 0;
  175|    256|        }
  176|    256|#endif
  177|       |
  178|    256|        BN_CTX_start(ctx);
  179|    256|        used_ctx = 1;
  180|    256|        x = BN_CTX_get(ctx);
  181|    256|        y = BN_CTX_get(ctx);
  182|    256|        yxi = BN_CTX_get(ctx);
  183|    256|        if (yxi == NULL)
  ------------------
  |  Branch (183:13): [True: 0, False: 256]
  ------------------
  184|      0|            goto err;
  185|       |
  186|    256|        if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (186:13): [True: 0, False: 256]
  ------------------
  187|      0|            goto err;
  188|       |
  189|    256|        buf[0] = form;
  190|    256|        if ((form != POINT_CONVERSION_UNCOMPRESSED) && !BN_is_zero(x)) {
  ------------------
  |  Branch (190:13): [True: 0, False: 256]
  |  Branch (190:56): [True: 0, False: 0]
  ------------------
  191|      0|            if (!group->meth->field_div(group, yxi, y, x, ctx))
  ------------------
  |  Branch (191:17): [True: 0, False: 0]
  ------------------
  192|      0|                goto err;
  193|      0|            if (BN_is_odd(yxi))
  ------------------
  |  Branch (193:17): [True: 0, False: 0]
  ------------------
  194|      0|                buf[0]++;
  195|      0|        }
  196|       |
  197|    256|        i = 1;
  198|       |
  199|    256|        skip = field_len - BN_num_bytes(x);
  ------------------
  |  |  189|    256|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  200|    256|        if (skip > field_len) {
  ------------------
  |  Branch (200:13): [True: 0, False: 256]
  ------------------
  201|      0|            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|            goto err;
  203|      0|        }
  204|    333|        while (skip > 0) {
  ------------------
  |  Branch (204:16): [True: 77, False: 256]
  ------------------
  205|     77|            buf[i++] = 0;
  206|     77|            skip--;
  207|     77|        }
  208|    256|        skip = BN_bn2bin(x, buf + i);
  209|    256|        i += skip;
  210|    256|        if (i != 1 + field_len) {
  ------------------
  |  Branch (210:13): [True: 0, False: 256]
  ------------------
  211|      0|            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|            goto err;
  213|      0|        }
  214|       |
  215|    256|        if (form == POINT_CONVERSION_UNCOMPRESSED
  ------------------
  |  Branch (215:13): [True: 256, False: 0]
  ------------------
  216|    256|            || form == POINT_CONVERSION_HYBRID) {
  ------------------
  |  Branch (216:16): [True: 0, False: 0]
  ------------------
  217|    256|            skip = field_len - BN_num_bytes(y);
  ------------------
  |  |  189|    256|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
  218|    256|            if (skip > field_len) {
  ------------------
  |  Branch (218:17): [True: 0, False: 256]
  ------------------
  219|      0|                ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|    333|            while (skip > 0) {
  ------------------
  |  Branch (222:20): [True: 77, False: 256]
  ------------------
  223|     77|                buf[i++] = 0;
  224|     77|                skip--;
  225|     77|            }
  226|    256|            skip = BN_bn2bin(y, buf + i);
  227|    256|            i += skip;
  228|    256|        }
  229|       |
  230|    256|        if (i != ret) {
  ------------------
  |  Branch (230:13): [True: 0, False: 256]
  ------------------
  231|      0|            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  232|      0|            goto err;
  233|      0|        }
  234|    256|    }
  235|       |
  236|    512|    if (used_ctx)
  ------------------
  |  Branch (236:9): [True: 256, False: 256]
  ------------------
  237|    256|        BN_CTX_end(ctx);
  238|    512|#ifndef FIPS_MODULE
  239|    512|    BN_CTX_free(new_ctx);
  240|    512|#endif
  241|    512|    return ret;
  242|       |
  243|     17| err:
  244|     17|    if (used_ctx)
  ------------------
  |  Branch (244:9): [True: 0, False: 17]
  ------------------
  245|      0|        BN_CTX_end(ctx);
  246|     17|#ifndef FIPS_MODULE
  247|     17|    BN_CTX_free(new_ctx);
  248|     17|#endif
  249|     17|    return 0;
  250|    512|}
ossl_ec_GF2m_simple_oct2point:
  259|    173|{
  260|    173|    point_conversion_form_t form;
  261|    173|    int y_bit, m;
  262|    173|    BIGNUM *x, *y, *yxi;
  263|    173|    size_t field_len, enc_len;
  264|    173|    int ret = 0;
  265|    173|#ifndef FIPS_MODULE
  266|    173|    BN_CTX *new_ctx = NULL;
  267|    173|#endif
  268|       |
  269|    173|    if (len == 0) {
  ------------------
  |  Branch (269:9): [True: 6, False: 167]
  ------------------
  270|      6|        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      6|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      6|    (ERR_new(),                                                 \
  |  |  |  |  404|      6|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      6|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      6|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      6|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      6|     ERR_set_error)
  |  |  ------------------
  ------------------
  271|      6|        return 0;
  272|      6|    }
  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|    167|    y_bit = buf[0] & 1;
  286|    167|    form = buf[0] & ~1U;
  287|       |
  288|    167|    if ((form != 0) && (form != POINT_CONVERSION_COMPRESSED)
  ------------------
  |  Branch (288:9): [True: 136, False: 31]
  |  Branch (288:24): [True: 58, False: 78]
  ------------------
  289|    167|        && (form != POINT_CONVERSION_UNCOMPRESSED)
  ------------------
  |  Branch (289:12): [True: 50, False: 8]
  ------------------
  290|    167|        && (form != POINT_CONVERSION_HYBRID)) {
  ------------------
  |  Branch (290:12): [True: 23, False: 27]
  ------------------
  291|     23|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  292|     23|        return 0;
  293|     23|    }
  294|    144|    if ((form == 0 || form == POINT_CONVERSION_UNCOMPRESSED) && y_bit) {
  ------------------
  |  Branch (294:10): [True: 31, False: 113]
  |  Branch (294:23): [True: 8, False: 105]
  |  Branch (294:65): [True: 8, False: 31]
  ------------------
  295|      8|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|      8|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      8|    (ERR_new(),                                                 \
  |  |  |  |  404|      8|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      8|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      8|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      8|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      8|     ERR_set_error)
  |  |  ------------------
  ------------------
  296|      8|        return 0;
  297|      8|    }
  298|       |
  299|       |    /* The point at infinity is represented by a single zero octet. */
  300|    136|    if (form == 0) {
  ------------------
  |  Branch (300:9): [True: 25, False: 111]
  ------------------
  301|     25|        if (len != 1) {
  ------------------
  |  Branch (301:13): [True: 12, False: 13]
  ------------------
  302|     12|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     12|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     12|    (ERR_new(),                                                 \
  |  |  |  |  404|     12|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     12|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     12|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     12|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     12|     ERR_set_error)
  |  |  ------------------
  ------------------
  303|     12|            return 0;
  304|     12|        }
  305|       |
  306|     13|        return EC_POINT_set_to_infinity(group, point);
  307|     25|    }
  308|       |
  309|    111|    m = EC_GROUP_get_degree(group);
  310|    111|    field_len = (m + 7) / 8;
  311|    111|    enc_len =
  312|    111|        (form ==
  ------------------
  |  Branch (312:9): [True: 78, False: 33]
  ------------------
  313|    111|         POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;
  314|       |
  315|    111|    if (len != enc_len) {
  ------------------
  |  Branch (315:9): [True: 40, False: 71]
  ------------------
  316|     40|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     40|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     40|    (ERR_new(),                                                 \
  |  |  |  |  404|     40|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     40|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     40|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     40|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     40|     ERR_set_error)
  |  |  ------------------
  ------------------
  317|     40|        return 0;
  318|     40|    }
  319|       |
  320|     71|#ifndef FIPS_MODULE
  321|     71|    if (ctx == NULL) {
  ------------------
  |  Branch (321:9): [True: 71, False: 0]
  ------------------
  322|     71|        ctx = new_ctx = BN_CTX_new();
  323|     71|        if (ctx == NULL)
  ------------------
  |  Branch (323:13): [True: 0, False: 71]
  ------------------
  324|      0|            return 0;
  325|     71|    }
  326|     71|#endif
  327|       |
  328|     71|    BN_CTX_start(ctx);
  329|     71|    x = BN_CTX_get(ctx);
  330|     71|    y = BN_CTX_get(ctx);
  331|     71|    yxi = BN_CTX_get(ctx);
  332|     71|    if (yxi == NULL)
  ------------------
  |  Branch (332:9): [True: 0, False: 71]
  ------------------
  333|      0|        goto err;
  334|       |
  335|     71|    if (!BN_bin2bn(buf + 1, field_len, x))
  ------------------
  |  Branch (335:9): [True: 0, False: 71]
  ------------------
  336|      0|        goto err;
  337|     71|    if (BN_num_bits(x) > m) {
  ------------------
  |  Branch (337:9): [True: 2, False: 69]
  ------------------
  338|      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)
  |  |  ------------------
  ------------------
  339|      2|        goto err;
  340|      2|    }
  341|       |
  342|     69|    if (form == POINT_CONVERSION_COMPRESSED) {
  ------------------
  |  Branch (342:9): [True: 54, False: 15]
  ------------------
  343|     54|        if (!EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx))
  ------------------
  |  Branch (343:13): [True: 23, False: 31]
  ------------------
  344|     23|            goto err;
  345|     54|    } else {
  346|     15|        if (!BN_bin2bn(buf + 1 + field_len, field_len, y))
  ------------------
  |  Branch (346:13): [True: 0, False: 15]
  ------------------
  347|      0|            goto err;
  348|     15|        if (BN_num_bits(y) > m) {
  ------------------
  |  Branch (348:13): [True: 1, False: 14]
  ------------------
  349|      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)
  |  |  ------------------
  ------------------
  350|      1|            goto err;
  351|      1|        }
  352|     14|        if (form == POINT_CONVERSION_HYBRID) {
  ------------------
  |  Branch (352:13): [True: 13, False: 1]
  ------------------
  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|     13|            if (BN_is_zero(x)) {
  ------------------
  |  Branch (358:17): [True: 2, False: 11]
  ------------------
  359|      2|                if (y_bit != 0) {
  ------------------
  |  Branch (359:21): [True: 1, False: 1]
  ------------------
  360|      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)
  |  |  ------------------
  ------------------
  361|      1|                    goto err;
  362|      1|                }
  363|     11|            } else {
  364|     11|                if (!group->meth->field_div(group, yxi, y, x, ctx))
  ------------------
  |  Branch (364:21): [True: 0, False: 11]
  ------------------
  365|      0|                    goto err;
  366|     11|                if (y_bit != BN_is_odd(yxi)) {
  ------------------
  |  Branch (366:21): [True: 5, False: 6]
  ------------------
  367|      5|                    ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|      5|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      5|    (ERR_new(),                                                 \
  |  |  |  |  404|      5|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      5|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      5|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      5|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      5|     ERR_set_error)
  |  |  ------------------
  ------------------
  368|      5|                    goto err;
  369|      5|                }
  370|     11|            }
  371|     13|        }
  372|       |
  373|       |        /*
  374|       |         * EC_POINT_set_affine_coordinates is responsible for checking that
  375|       |         * the point is on the curve.
  376|       |         */
  377|      8|        if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (377:13): [True: 7, False: 1]
  ------------------
  378|      7|            goto err;
  379|      8|    }
  380|       |
  381|     32|    ret = 1;
  382|       |
  383|     71| err:
  384|     71|    BN_CTX_end(ctx);
  385|     71|#ifndef FIPS_MODULE
  386|     71|    BN_CTX_free(new_ctx);
  387|     71|#endif
  388|     71|    return ret;
  389|     32|}

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

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

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

ossl_ec_check_group_type_id2name:
   76|    820|{
   77|    820|    size_t i, sz;
   78|       |
   79|    820|    for (i = 0, sz = OSSL_NELEM(check_group_type_nameid_map); i < sz; i++) {
  ------------------
  |  |   14|    820|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (79:63): [True: 820, False: 0]
  ------------------
   80|    820|        if (id == (int)check_group_type_nameid_map[i].id)
  ------------------
  |  Branch (80:13): [True: 820, False: 0]
  ------------------
   81|    820|            return check_group_type_nameid_map[i].ptr;
   82|    820|    }
   83|      0|    return NULL;
   84|    820|}
ossl_ec_pt_format_id2name:
  147|  1.64k|{
  148|  1.64k|    size_t i, sz;
  149|       |
  150|  2.13k|    for (i = 0, sz = OSSL_NELEM(format_nameid_map); i < sz; i++) {
  ------------------
  |  |   14|  1.64k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (150:53): [True: 2.12k, False: 14]
  ------------------
  151|  2.12k|        if (id == (int)format_nameid_map[i].id)
  ------------------
  |  Branch (151:13): [True: 1.62k, False: 496]
  ------------------
  152|  1.62k|            return format_nameid_map[i].ptr;
  153|  2.12k|    }
  154|     14|    return NULL;
  155|  1.64k|}
ossl_ec_group_todata:
  292|    820|{
  293|    820|    int ret = 0, curve_nid, encoding_flag;
  294|    820|    const char *encoding_name, *pt_form_name;
  295|    820|    point_conversion_form_t genform;
  296|       |
  297|    820|    if (group == NULL) {
  ------------------
  |  Branch (297:9): [True: 0, False: 820]
  ------------------
  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|    820|    genform = EC_GROUP_get_point_conversion_form(group);
  303|    820|    pt_form_name = ossl_ec_pt_format_id2name(genform);
  304|    820|    if (pt_form_name == NULL
  ------------------
  |  Branch (304:9): [True: 0, False: 820]
  ------------------
  305|    820|        || !ossl_param_build_set_utf8_string(
  ------------------
  |  Branch (305:12): [True: 0, False: 820]
  ------------------
  306|    820|                tmpl, params,
  307|    820|                OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, pt_form_name)) {
  ------------------
  |  |  359|    820|# 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|    820|    encoding_flag = EC_GROUP_get_asn1_flag(group) & OPENSSL_EC_NAMED_CURVE;
  ------------------
  |  |   31|    820|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  312|    820|    encoding_name = ec_param_encoding_id2name(encoding_flag);
  313|    820|    if (encoding_name == NULL
  ------------------
  |  Branch (313:9): [True: 0, False: 820]
  ------------------
  314|    820|        || !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (314:12): [True: 0, False: 820]
  ------------------
  315|    820|                                             OSSL_PKEY_PARAM_EC_ENCODING,
  ------------------
  |  |  352|    820|# define OSSL_PKEY_PARAM_EC_ENCODING "encoding"
  ------------------
  316|    820|                                             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|    820|    if (!ossl_param_build_set_int(tmpl, params,
  ------------------
  |  Branch (321:9): [True: 0, False: 820]
  ------------------
  322|    820|                                  OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS,
  ------------------
  |  |  351|    820|# define OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS "decoded-from-explicit"
  ------------------
  323|    820|                                  group->decoded_from_explicit_params))
  324|      0|        return 0;
  325|       |
  326|    820|    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|    820|    if (tmpl == NULL || curve_nid == NID_undef)
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (333:9): [True: 820, False: 0]
  |  Branch (333:25): [True: 0, False: 0]
  ------------------
  334|    820|        if (!ec_group_explicit_todata(group, tmpl, params, bnctx, genbuf))
  ------------------
  |  Branch (334:13): [True: 0, False: 820]
  ------------------
  335|      0|            goto err;
  336|       |
  337|    820|    if (curve_nid != NID_undef) {
  ------------------
  |  |   18|    820|#define NID_undef                       0
  ------------------
  |  Branch (337:9): [True: 710, False: 110]
  ------------------
  338|       |        /* Named curve */
  339|    710|        const char *curve_name = OSSL_EC_curve_nid2name(curve_nid);
  340|       |
  341|    710|        if (curve_name == NULL
  ------------------
  |  Branch (341:13): [True: 0, False: 710]
  ------------------
  342|    710|            || !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (342:16): [True: 0, False: 710]
  ------------------
  343|    710|                                                 OSSL_PKEY_PARAM_GROUP_NAME,
  ------------------
  |  |  383|    710|# define OSSL_PKEY_PARAM_GROUP_NAME "group"
  ------------------
  344|    710|                                                 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|    710|    }
  349|    820|    ret = 1;
  350|    820|err:
  351|    820|    return ret;
  352|    820|}
ossl_ec_key_is_foreign:
  588|    202|{
  589|    202|#ifndef FIPS_MODULE
  590|    202|    if (ec->engine != NULL || EC_KEY_get_method(ec) != EC_KEY_OpenSSL())
  ------------------
  |  Branch (590:9): [True: 0, False: 202]
  |  Branch (590:31): [True: 0, False: 202]
  ------------------
  591|      0|        return 1;
  592|    202|#endif
  593|    202|    return 0;
  594|       |
  595|    202|}
ossl_x509_algor_is_sm2:
  738|    954|{
  739|    954|    int ptype = 0;
  740|    954|    const void *pval = NULL;
  741|       |
  742|    954|    X509_ALGOR_get0(NULL, &ptype, &pval, palg);
  743|       |
  744|    954|    if (ptype == V_ASN1_OBJECT)
  ------------------
  |  |   68|    954|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (744:9): [True: 812, False: 142]
  ------------------
  745|    812|        return OBJ_obj2nid((ASN1_OBJECT *)pval) == NID_sm2;
  ------------------
  |  | 1232|    812|#define NID_sm2         1172
  ------------------
  746|       |
  747|    142|    if (ptype == V_ASN1_SEQUENCE) {
  ------------------
  |  |   74|    142|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (747:9): [True: 77, False: 65]
  ------------------
  748|     77|        const ASN1_STRING *str = pval;
  749|     77|        const unsigned char *der = str->data;
  750|     77|        int derlen = str->length;
  751|     77|        EC_GROUP *group;
  752|     77|        int ret;
  753|       |
  754|     77|        if ((group = d2i_ECPKParameters(NULL, &der, derlen)) == NULL)
  ------------------
  |  Branch (754:13): [True: 63, False: 14]
  ------------------
  755|     63|            ret = 0;
  756|     14|        else
  757|     14|            ret = (EC_GROUP_get_curve_name(group) == NID_sm2);
  ------------------
  |  | 1232|     14|#define NID_sm2         1172
  ------------------
  758|       |
  759|     77|        EC_GROUP_free(group);
  760|     77|        return ret;
  761|     77|    }
  762|       |
  763|     65|    return 0;
  764|    142|}
ossl_ec_key_param_from_x509_algor:
  768|    566|{
  769|    566|    int ptype = 0;
  770|    566|    const void *pval = NULL;
  771|    566|    EC_KEY *eckey = NULL;
  772|    566|    EC_GROUP *group = NULL;
  773|       |
  774|    566|    X509_ALGOR_get0(NULL, &ptype, &pval, palg);
  775|    566|    if ((eckey = EC_KEY_new_ex(libctx, propq)) == NULL) {
  ------------------
  |  Branch (775:9): [True: 0, False: 566]
  ------------------
  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|    566|    if (ptype == V_ASN1_SEQUENCE) {
  ------------------
  |  |   74|    566|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (780:9): [True: 49, False: 517]
  ------------------
  781|     49|        const ASN1_STRING *pstr = pval;
  782|     49|        const unsigned char *pm = pstr->data;
  783|     49|        int pmlen = pstr->length;
  784|       |
  785|       |
  786|     49|        if (d2i_ECParameters(&eckey, &pm, pmlen) == NULL) {
  ------------------
  |  Branch (786:13): [True: 39, False: 10]
  ------------------
  787|     39|            ERR_raise(ERR_LIB_EC, EC_R_DECODE_ERROR);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  788|     39|            goto ecerr;
  789|     39|        }
  790|    517|    } else if (ptype == V_ASN1_OBJECT) {
  ------------------
  |  |   68|    517|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (790:16): [True: 480, False: 37]
  ------------------
  791|    480|        const ASN1_OBJECT *poid = pval;
  792|       |
  793|       |        /*
  794|       |         * type == V_ASN1_OBJECT => the parameters are given by an asn1 OID
  795|       |         */
  796|       |
  797|    480|        group = EC_GROUP_new_by_curve_name_ex(libctx, propq, OBJ_obj2nid(poid));
  798|    480|        if (group == NULL)
  ------------------
  |  Branch (798:13): [True: 13, False: 467]
  ------------------
  799|     13|            goto ecerr;
  800|    467|        EC_GROUP_set_asn1_flag(group, OPENSSL_EC_NAMED_CURVE);
  ------------------
  |  |   31|    467|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  801|    467|        if (EC_KEY_set_group(eckey, group) == 0)
  ------------------
  |  Branch (801:13): [True: 0, False: 467]
  ------------------
  802|      0|            goto ecerr;
  803|    467|        EC_GROUP_free(group);
  804|    467|    } else {
  805|     37|        ERR_raise(ERR_LIB_EC, EC_R_DECODE_ERROR);
  ------------------
  |  |  401|     37|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     37|    (ERR_new(),                                                 \
  |  |  |  |  404|     37|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     37|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     37|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     37|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     37|     ERR_set_error)
  |  |  ------------------
  ------------------
  806|     37|        goto ecerr;
  807|     37|    }
  808|       |
  809|    477|    return eckey;
  810|       |
  811|     89| ecerr:
  812|     89|    EC_KEY_free(eckey);
  813|     89|    EC_GROUP_free(group);
  814|     89|    return NULL;
  815|    566|}
ossl_ec_key_from_pkcs8:
  819|     68|{
  820|     68|    const unsigned char *p = NULL;
  821|     68|    int pklen;
  822|     68|    EC_KEY *eckey = NULL;
  823|     68|    const X509_ALGOR *palg;
  824|       |
  825|     68|    if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8inf))
  ------------------
  |  Branch (825:9): [True: 0, False: 68]
  ------------------
  826|      0|        return 0;
  827|     68|    eckey = ossl_ec_key_param_from_x509_algor(palg, libctx, propq);
  828|     68|    if (eckey == NULL)
  ------------------
  |  Branch (828:9): [True: 14, False: 54]
  ------------------
  829|     14|        goto err;
  830|       |
  831|       |    /* We have parameters now set private key */
  832|     54|    if (!d2i_ECPrivateKey(&eckey, &p, pklen)) {
  ------------------
  |  Branch (832:9): [True: 29, False: 25]
  ------------------
  833|     29|        ERR_raise(ERR_LIB_EC, EC_R_DECODE_ERROR);
  ------------------
  |  |  401|     29|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     29|    (ERR_new(),                                                 \
  |  |  |  |  404|     29|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     29|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     29|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     29|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     29|     ERR_set_error)
  |  |  ------------------
  ------------------
  834|     29|        goto err;
  835|     29|    }
  836|       |
  837|     25|    return eckey;
  838|     43| err:
  839|     43|    EC_KEY_free(eckey);
  840|     43|    return NULL;
  841|     54|}
ec_backend.c:ec_param_encoding_id2name:
   65|    820|{
   66|    820|    size_t i, sz;
   67|       |
   68|  1.53k|    for (i = 0, sz = OSSL_NELEM(encoding_nameid_map); i < sz; i++) {
  ------------------
  |  |   14|    820|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (68:55): [True: 1.53k, False: 0]
  ------------------
   69|  1.53k|        if (id == (int)encoding_nameid_map[i].id)
  ------------------
  |  Branch (69:13): [True: 820, False: 710]
  ------------------
   70|    820|            return encoding_nameid_map[i].ptr;
   71|  1.53k|    }
   72|      0|    return NULL;
   73|    820|}
ec_backend.c:ec_group_explicit_todata:
  160|    820|{
  161|    820|    int ret = 0, fid;
  162|    820|    const char *field_type;
  163|    820|    const OSSL_PARAM *param = NULL;
  164|    820|    const OSSL_PARAM *param_p = NULL;
  165|    820|    const OSSL_PARAM *param_a = NULL;
  166|    820|    const OSSL_PARAM *param_b = NULL;
  167|       |
  168|    820|    fid = EC_GROUP_get_field_type(group);
  169|       |
  170|    820|    if (fid == NID_X9_62_prime_field) {
  ------------------
  |  |  152|    820|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (170:9): [True: 618, False: 202]
  ------------------
  171|    618|        field_type = SN_X9_62_prime_field;
  ------------------
  |  |  151|    618|#define SN_X9_62_prime_field            "prime-field"
  ------------------
  172|    618|    } else if (fid == NID_X9_62_characteristic_two_field) {
  ------------------
  |  |  156|    202|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (172:16): [True: 202, False: 0]
  ------------------
  173|       |#ifdef OPENSSL_NO_EC2M
  174|       |        ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
  175|       |        goto err;
  176|       |#else
  177|    202|        field_type = SN_X9_62_characteristic_two_field;
  ------------------
  |  |  155|    202|#define SN_X9_62_characteristic_two_field               "characteristic-two-field"
  ------------------
  178|    202|#endif
  179|    202|    } 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|    820|    param_p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_P);
  ------------------
  |  |  358|    820|# define OSSL_PKEY_PARAM_EC_P "p"
  ------------------
  185|    820|    param_a = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_A);
  ------------------
  |  |  342|    820|# define OSSL_PKEY_PARAM_EC_A "a"
  ------------------
  186|    820|    param_b = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_B);
  ------------------
  |  |  343|    820|# define OSSL_PKEY_PARAM_EC_B "b"
  ------------------
  187|    820|    if (tmpl != NULL || param_p != NULL || param_a != NULL || param_b != NULL) {
  ------------------
  |  Branch (187:9): [True: 0, False: 820]
  |  Branch (187:25): [True: 0, False: 820]
  |  Branch (187:44): [True: 0, False: 820]
  |  Branch (187:63): [True: 0, False: 820]
  ------------------
  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|    820|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_ORDER);
  ------------------
  |  |  357|    820|# define OSSL_PKEY_PARAM_EC_ORDER "order"
  ------------------
  210|    820|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (210:9): [True: 0, False: 820]
  |  Branch (210:25): [True: 0, False: 820]
  ------------------
  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|    820|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_FIELD_TYPE);
  ------------------
  |  |  353|    820|# define OSSL_PKEY_PARAM_EC_FIELD_TYPE "field-type"
  ------------------
  225|    820|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (225:9): [True: 0, False: 820]
  |  Branch (225:25): [True: 0, False: 820]
  ------------------
  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|    820|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_GENERATOR);
  ------------------
  |  |  354|    820|# define OSSL_PKEY_PARAM_EC_GENERATOR "generator"
  ------------------
  235|    820|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (235:9): [True: 0, False: 820]
  |  Branch (235:25): [True: 0, False: 820]
  ------------------
  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|    820|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_COFACTOR);
  ------------------
  |  |  350|    820|# define OSSL_PKEY_PARAM_EC_COFACTOR "cofactor"
  ------------------
  258|    820|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (258:9): [True: 0, False: 820]
  |  Branch (258:25): [True: 0, False: 820]
  ------------------
  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|    820|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_SEED);
  ------------------
  |  |  362|    820|# define OSSL_PKEY_PARAM_EC_SEED "seed"
  ------------------
  270|    820|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 820]
  |  Branch (270:25): [True: 0, False: 820]
  ------------------
  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|    820|    ret = 1;
  284|    820|err:
  285|    820|    return ret;
  286|    820|}

EC_GROUP_new_by_curve_name_ex:
 3315|  3.09k|{
 3316|  3.09k|    EC_GROUP *ret = NULL;
 3317|  3.09k|    const ec_list_element *curve;
 3318|       |
 3319|  3.09k|    if ((curve = ec_curve_nid2curve(nid)) == NULL
  ------------------
  |  Branch (3319:9): [True: 547, False: 2.54k]
  ------------------
 3320|  3.09k|        || (ret = ec_group_new_from_data(libctx, propq, *curve)) == NULL) {
  ------------------
  |  Branch (3320:12): [True: 0, False: 2.54k]
  ------------------
 3321|    547|#ifndef FIPS_MODULE
 3322|    547|        ERR_raise_data(ERR_LIB_EC, EC_R_UNKNOWN_GROUP,
  ------------------
  |  |  403|    547|    (ERR_new(),                                                 \
  |  |  404|    547|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|    547|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|    547|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  312|    547|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|    547|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EC, EC_R_UNKNOWN_GROUP,
  ------------------
  |  |   86|    547|# define ERR_LIB_EC              16
  ------------------
                      ERR_raise_data(ERR_LIB_EC, EC_R_UNKNOWN_GROUP,
  ------------------
  |  |   97|    547|#  define EC_R_UNKNOWN_GROUP                               129
  ------------------
 3323|    547|                       "name=%s", OBJ_nid2sn(nid));
 3324|       |#else
 3325|       |        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_GROUP);
 3326|       |#endif
 3327|    547|        return NULL;
 3328|    547|    }
 3329|       |
 3330|  2.54k|    return ret;
 3331|  3.09k|}
EC_GROUP_new_by_curve_name:
 3335|  2.61k|{
 3336|  2.61k|    return EC_GROUP_new_by_curve_name_ex(NULL, NULL, nid);
 3337|  2.61k|}
EC_curve_nid2nist:
 3358|  1.05k|{
 3359|  1.05k|    return ossl_ec_curve_nid2nist_int(nid);
 3360|  1.05k|}
ossl_ec_curve_nid_from_params:
 3377|    478|{
 3378|    478|    int ret = -1, nid, len, field_type, param_len;
 3379|    478|    size_t i, seed_len;
 3380|    478|    const unsigned char *seed, *params_seed, *params;
 3381|    478|    unsigned char *param_bytes = NULL;
 3382|    478|    const EC_CURVE_DATA *data;
 3383|    478|    const EC_POINT *generator = NULL;
 3384|    478|    const BIGNUM *cofactor = NULL;
 3385|       |    /* An array of BIGNUMs for (p, a, b, x, y, order) */
 3386|    478|    BIGNUM *bn[NUM_BN_FIELDS] = {NULL, NULL, NULL, NULL, NULL, NULL};
 3387|       |
 3388|       |    /* Use the optional named curve nid as a search field */
 3389|    478|    nid = EC_GROUP_get_curve_name(group);
 3390|    478|    field_type = EC_GROUP_get_field_type(group);
 3391|    478|    seed_len = EC_GROUP_get_seed_len(group);
 3392|    478|    seed = EC_GROUP_get0_seed(group);
 3393|    478|    cofactor = EC_GROUP_get0_cofactor(group);
 3394|       |
 3395|    478|    BN_CTX_start(ctx);
 3396|       |
 3397|       |    /*
 3398|       |     * The built-in curves contains data fields (p, a, b, x, y, order) that are
 3399|       |     * all zero-padded to be the same size. The size of the padding is
 3400|       |     * determined by either the number of bytes in the field modulus (p) or the
 3401|       |     * EC group order, whichever is larger.
 3402|       |     */
 3403|    478|    param_len = BN_num_bytes(group->order);
  ------------------
  |  |  189|    478|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
 3404|    478|    len = BN_num_bytes(group->field);
  ------------------
  |  |  189|    478|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
 3405|    478|    if (len > param_len)
  ------------------
  |  Branch (3405:9): [True: 401, False: 77]
  ------------------
 3406|    401|        param_len = len;
 3407|       |
 3408|       |    /* Allocate space to store the padded data for (p, a, b, x, y, order)  */
 3409|    478|    param_bytes = OPENSSL_malloc(param_len * NUM_BN_FIELDS);
  ------------------
  |  |  102|    478|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    478|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    478|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3410|    478|    if (param_bytes == NULL)
  ------------------
  |  Branch (3410:9): [True: 0, False: 478]
  ------------------
 3411|      0|        goto end;
 3412|       |
 3413|       |    /* Create the bignums */
 3414|  3.34k|    for (i = 0; i < NUM_BN_FIELDS; ++i) {
  ------------------
  |  | 3367|  3.34k|#define NUM_BN_FIELDS 6
  ------------------
  |  Branch (3414:17): [True: 2.86k, False: 478]
  ------------------
 3415|  2.86k|        if ((bn[i] = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (3415:13): [True: 0, False: 2.86k]
  ------------------
 3416|      0|            goto end;
 3417|  2.86k|    }
 3418|       |    /*
 3419|       |     * Fill in the bn array with the same values as the internal curves
 3420|       |     * i.e. the values are p, a, b, x, y, order.
 3421|       |     */
 3422|       |    /* Get p, a & b */
 3423|    478|    if (!(EC_GROUP_get_curve(group, bn[0], bn[1], bn[2], ctx)
  ------------------
  |  Branch (3423:11): [True: 478, False: 0]
  ------------------
 3424|    478|        && ((generator = EC_GROUP_get0_generator(group)) != NULL)
  ------------------
  |  Branch (3424:12): [True: 478, False: 0]
  ------------------
 3425|       |        /* Get x & y */
 3426|    478|        && EC_POINT_get_affine_coordinates(group, generator, bn[3], bn[4], ctx)
  ------------------
  |  Branch (3426:12): [True: 437, False: 41]
  ------------------
 3427|       |        /* Get order */
 3428|    478|        && EC_GROUP_get_order(group, bn[5], ctx)))
  ------------------
  |  Branch (3428:12): [True: 437, False: 0]
  ------------------
 3429|     41|        goto end;
 3430|       |
 3431|       |   /*
 3432|       |     * Convert the bignum array to bytes that are joined together to form
 3433|       |     * a single buffer that contains data for all fields.
 3434|       |     * (p, a, b, x, y, order) are all zero padded to be the same size.
 3435|       |     */
 3436|  3.05k|    for (i = 0; i < NUM_BN_FIELDS; ++i) {
  ------------------
  |  | 3367|  3.05k|#define NUM_BN_FIELDS 6
  ------------------
  |  Branch (3436:17): [True: 2.62k, False: 437]
  ------------------
 3437|  2.62k|        if (BN_bn2binpad(bn[i], &param_bytes[i*param_len], param_len) <= 0)
  ------------------
  |  Branch (3437:13): [True: 0, False: 2.62k]
  ------------------
 3438|      0|            goto end;
 3439|  2.62k|    }
 3440|       |
 3441|  35.4k|    for (i = 0; i < curve_list_length; i++) {
  ------------------
  |  | 3134|  35.4k|#define curve_list_length OSSL_NELEM(curve_list)
  |  |  ------------------
  |  |  |  |   14|  35.4k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
  |  Branch (3441:17): [True: 35.0k, False: 424]
  ------------------
 3442|  35.0k|        const ec_list_element curve = curve_list[i];
 3443|       |
 3444|  35.0k|        data = curve.data;
 3445|       |        /* Get the raw order byte data */
 3446|  35.0k|        params_seed = (const unsigned char *)(data + 1); /* skip header */
 3447|  35.0k|        params = params_seed + data->seed_len;
 3448|       |
 3449|       |        /* Look for unique fields in the fixed curve data */
 3450|  35.0k|        if (data->field_type == field_type
  ------------------
  |  Branch (3450:13): [True: 17.1k, False: 17.8k]
  ------------------
 3451|  35.0k|            && param_len == data->param_len
  ------------------
  |  Branch (3451:16): [True: 1.61k, False: 15.5k]
  ------------------
 3452|  35.0k|            && (nid <= 0 || nid == curve.nid)
  ------------------
  |  Branch (3452:17): [True: 1.61k, False: 0]
  |  Branch (3452:29): [True: 0, False: 0]
  ------------------
 3453|       |            /* check the optional cofactor (ignore if its zero) */
 3454|  35.0k|            && (BN_is_zero(cofactor)
  ------------------
  |  Branch (3454:17): [True: 1.36k, False: 248]
  ------------------
 3455|  1.61k|                || BN_is_word(cofactor, (const BN_ULONG)curve.data->cofactor))
  ------------------
  |  Branch (3455:20): [True: 88, False: 160]
  ------------------
 3456|       |            /* Check the optional seed (ignore if its not set) */
 3457|  35.0k|            && (data->seed_len == 0 || seed_len == 0
  ------------------
  |  Branch (3457:17): [True: 1.09k, False: 363]
  |  Branch (3457:40): [True: 363, False: 0]
  ------------------
 3458|  1.45k|                || ((size_t)data->seed_len == seed_len
  ------------------
  |  Branch (3458:21): [True: 0, False: 0]
  ------------------
 3459|      0|                     && memcmp(params_seed, seed, seed_len) == 0))
  ------------------
  |  Branch (3459:25): [True: 0, False: 0]
  ------------------
 3460|       |            /* Check that the groups params match the built-in curve params */
 3461|  35.0k|            && memcmp(param_bytes, params, param_len * NUM_BN_FIELDS)
  ------------------
  |  | 3367|  1.45k|#define NUM_BN_FIELDS 6
  ------------------
  |  Branch (3461:16): [True: 13, False: 1.44k]
  ------------------
 3462|  1.45k|                             == 0) {
 3463|     13|            ret = curve.nid;
 3464|     13|            goto end;
 3465|     13|        }
 3466|  35.0k|    }
 3467|       |    /* Gets here if the group was not found */
 3468|    424|    ret = NID_undef;
  ------------------
  |  |   18|    424|#define NID_undef                       0
  ------------------
 3469|    478|end:
 3470|    478|    OPENSSL_free(param_bytes);
  ------------------
  |  |  115|    478|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    478|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    478|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3471|    478|    BN_CTX_end(ctx);
 3472|    478|    return ret;
 3473|    424|}
ec_curve.c:ec_curve_nid2curve:
 3137|  3.09k|{
 3138|  3.09k|    size_t i;
 3139|       |
 3140|  3.09k|    if (nid <= 0)
  ------------------
  |  Branch (3140:9): [True: 484, False: 2.61k]
  ------------------
 3141|    484|        return NULL;
 3142|       |
 3143|  67.8k|    for (i = 0; i < curve_list_length; i++) {
  ------------------
  |  | 3134|  67.8k|#define curve_list_length OSSL_NELEM(curve_list)
  |  |  ------------------
  |  |  |  |   14|  67.8k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
  |  Branch (3143:17): [True: 67.8k, False: 63]
  ------------------
 3144|  67.8k|        if (curve_list[i].nid == nid)
  ------------------
  |  Branch (3144:13): [True: 2.54k, False: 65.2k]
  ------------------
 3145|  2.54k|            return &curve_list[i];
 3146|  67.8k|    }
 3147|     63|    return NULL;
 3148|  2.61k|}
ec_curve.c:ec_group_new_from_data:
 3153|  2.54k|{
 3154|  2.54k|    EC_GROUP *group = NULL;
 3155|  2.54k|    EC_POINT *P = NULL;
 3156|  2.54k|    BN_CTX *ctx = NULL;
 3157|  2.54k|    BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL, *order =
 3158|  2.54k|        NULL;
 3159|  2.54k|    int ok = 0;
 3160|  2.54k|    int seed_len, param_len;
 3161|  2.54k|    const EC_METHOD *meth;
 3162|  2.54k|    const EC_CURVE_DATA *data;
 3163|  2.54k|    const unsigned char *params;
 3164|       |
 3165|       |    /* If no curve data curve method must handle everything */
 3166|  2.54k|    if (curve.data == NULL)
  ------------------
  |  Branch (3166:9): [True: 0, False: 2.54k]
  ------------------
 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|  2.54k|    if ((ctx = BN_CTX_new_ex(libctx)) == NULL) {
  ------------------
  |  Branch (3170:9): [True: 0, False: 2.54k]
  ------------------
 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|  2.54k|    data = curve.data;
 3176|  2.54k|    seed_len = data->seed_len;
 3177|  2.54k|    param_len = data->param_len;
 3178|  2.54k|    params = (const unsigned char *)(data + 1); /* skip header */
 3179|       |
 3180|  2.54k|    if (curve.meth != NULL) {
  ------------------
  |  Branch (3180:9): [True: 869, False: 1.67k]
  ------------------
 3181|    869|        meth = curve.meth();
 3182|    869|        if ((group = ossl_ec_group_new_ex(libctx, propq, meth)) == NULL) {
  ------------------
  |  Branch (3182:13): [True: 0, False: 869]
  ------------------
 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|    869|        if (group->meth->group_full_init != NULL) {
  ------------------
  |  Branch (3186:13): [True: 54, False: 815]
  ------------------
 3187|     54|            if (!group->meth->group_full_init(group, params)){
  ------------------
  |  Branch (3187:17): [True: 0, False: 54]
  ------------------
 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|     54|            EC_GROUP_set_curve_name(group, curve.nid);
 3192|     54|            BN_CTX_free(ctx);
 3193|     54|            return group;
 3194|     54|        }
 3195|    869|    }
 3196|       |
 3197|  2.49k|    params += seed_len;         /* skip seed */
 3198|       |
 3199|  2.49k|    if ((p = BN_bin2bn(params + 0 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3199:9): [True: 0, False: 2.49k]
  ------------------
 3200|  2.49k|        || (a = BN_bin2bn(params + 1 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3200:12): [True: 0, False: 2.49k]
  ------------------
 3201|  2.49k|        || (b = BN_bin2bn(params + 2 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (3201:12): [True: 0, False: 2.49k]
  ------------------
 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|  2.49k|    if (group != NULL) {
  ------------------
  |  Branch (3206:9): [True: 815, False: 1.67k]
  ------------------
 3207|    815|        if (group->meth->group_set_curve(group, p, a, b, ctx) == 0) {
  ------------------
  |  Branch (3207:13): [True: 0, False: 815]
  ------------------
 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|  1.67k|    } else if (data->field_type == NID_X9_62_prime_field) {
  ------------------
  |  |  152|  1.67k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (3211:16): [True: 936, False: 742]
  ------------------
 3212|    936|        if ((group = EC_GROUP_new_curve_GFp(p, a, b, ctx)) == NULL) {
  ------------------
  |  Branch (3212:13): [True: 0, False: 936]
  ------------------
 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|    936|    }
 3217|    742|#ifndef OPENSSL_NO_EC2M
 3218|    742|    else {                      /* field_type ==
 3219|       |                                 * NID_X9_62_characteristic_two_field */
 3220|       |
 3221|    742|        if ((group = EC_GROUP_new_curve_GF2m(p, a, b, ctx)) == NULL) {
  ------------------
  |  Branch (3221:13): [True: 0, False: 742]
  ------------------
 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|    742|    }
 3226|  2.49k|#endif
 3227|       |
 3228|  2.49k|    EC_GROUP_set_curve_name(group, curve.nid);
 3229|       |
 3230|  2.49k|    if ((P = EC_POINT_new(group)) == NULL) {
  ------------------
  |  Branch (3230:9): [True: 0, False: 2.49k]
  ------------------
 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|  2.49k|    if ((x = BN_bin2bn(params + 3 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3235:9): [True: 0, False: 2.49k]
  ------------------
 3236|  2.49k|        || (y = BN_bin2bn(params + 4 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (3236:12): [True: 0, False: 2.49k]
  ------------------
 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|  2.49k|    if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) {
  ------------------
  |  Branch (3240:9): [True: 0, False: 2.49k]
  ------------------
 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|  2.49k|    if ((order = BN_bin2bn(params + 5 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3244:9): [True: 0, False: 2.49k]
  ------------------
 3245|  2.49k|        || !BN_set_word(x, (BN_ULONG)data->cofactor)) {
  ------------------
  |  Branch (3245:12): [True: 0, False: 2.49k]
  ------------------
 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|  2.49k|    if (!EC_GROUP_set_generator(group, P, order, x)) {
  ------------------
  |  Branch (3249:9): [True: 0, False: 2.49k]
  ------------------
 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|  2.49k|    if (seed_len) {
  ------------------
  |  Branch (3253:9): [True: 1.56k, False: 930]
  ------------------
 3254|  1.56k|        if (!EC_GROUP_set_seed(group, params - seed_len, seed_len)) {
  ------------------
  |  Branch (3254:13): [True: 0, False: 1.56k]
  ------------------
 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|  1.56k|    }
 3259|       |
 3260|  2.49k|#ifndef FIPS_MODULE
 3261|  2.49k|    if (EC_GROUP_get_asn1_flag(group) == OPENSSL_EC_NAMED_CURVE) {
  ------------------
  |  |   31|  2.49k|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  |  Branch (3261:9): [True: 2.49k, 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|  2.49k|        ASN1_OBJECT *asn1obj = OBJ_nid2obj(curve.nid);
 3275|       |
 3276|  2.49k|        if (asn1obj == NULL) {
  ------------------
  |  Branch (3276:13): [True: 0, False: 2.49k]
  ------------------
 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|  2.49k|        if (OBJ_length(asn1obj) == 0)
  ------------------
  |  Branch (3280:13): [True: 0, False: 2.49k]
  ------------------
 3281|      0|            EC_GROUP_set_asn1_flag(group, OPENSSL_EC_EXPLICIT_CURVE);
  ------------------
  |  |   30|      0|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
 3282|       |
 3283|  2.49k|        ASN1_OBJECT_free(asn1obj);
 3284|  2.49k|    }
 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|  2.49k|    ok = 1;
 3297|  2.49k| err:
 3298|  2.49k|    if (!ok) {
  ------------------
  |  Branch (3298:9): [True: 0, False: 2.49k]
  ------------------
 3299|      0|        EC_GROUP_free(group);
 3300|      0|        group = NULL;
 3301|      0|    }
 3302|  2.49k|    EC_POINT_free(P);
 3303|  2.49k|    BN_CTX_free(ctx);
 3304|  2.49k|    BN_free(p);
 3305|  2.49k|    BN_free(a);
 3306|  2.49k|    BN_free(b);
 3307|  2.49k|    BN_free(order);
 3308|  2.49k|    BN_free(x);
 3309|  2.49k|    BN_free(y);
 3310|  2.49k|    return group;
 3311|  2.49k|}

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

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

EC_KEY_new:
   35|  14.1k|{
   36|  14.1k|    return ossl_ec_key_new_method_int(NULL, NULL, NULL);
   37|  14.1k|}
EC_KEY_new_ex:
   41|    566|{
   42|    566|    return ossl_ec_key_new_method_int(ctx, propq, NULL);
   43|    566|}
EC_KEY_free:
   72|  66.2k|{
   73|  66.2k|    int i;
   74|       |
   75|  66.2k|    if (r == NULL)
  ------------------
  |  Branch (75:9): [True: 51.3k, False: 14.8k]
  ------------------
   76|  51.3k|        return;
   77|       |
   78|  14.8k|    CRYPTO_DOWN_REF(&r->references, &i);
   79|  14.8k|    REF_PRINT_COUNT("EC_KEY", r);
  ------------------
  |  |  289|  14.8k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  14.8k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  14.8k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  14.8k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|  14.8k|    if (i > 0)
  ------------------
  |  Branch (80:9): [True: 197, False: 14.6k]
  ------------------
   81|    197|        return;
   82|  14.6k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|  14.6k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 14.6k]
  |  |  ------------------
  ------------------
   83|       |
   84|  14.6k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (84:9): [True: 14.6k, False: 0]
  |  Branch (84:28): [True: 0, False: 14.6k]
  ------------------
   85|      0|        r->meth->finish(r);
   86|       |
   87|  14.6k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   88|  14.6k|    ENGINE_finish(r->engine);
   89|  14.6k|#endif
   90|       |
   91|  14.6k|    if (r->group && r->group->meth->keyfinish)
  ------------------
  |  Branch (91:9): [True: 2.86k, False: 11.8k]
  |  Branch (91:21): [True: 0, False: 2.86k]
  ------------------
   92|      0|        r->group->meth->keyfinish(r);
   93|       |
   94|  14.6k|#ifndef FIPS_MODULE
   95|  14.6k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EC_KEY, r, &r->ex_data);
  ------------------
  |  |  236|  14.6k|# define CRYPTO_EX_INDEX_EC_KEY           8
  ------------------
   96|  14.6k|#endif
   97|  14.6k|    CRYPTO_FREE_REF(&r->references);
   98|  14.6k|    EC_GROUP_free(r->group);
   99|  14.6k|    EC_POINT_free(r->pub_key);
  100|  14.6k|    BN_clear_free(r->priv_key);
  101|  14.6k|    OPENSSL_free(r->propq);
  ------------------
  |  |  115|  14.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  14.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  14.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|       |
  103|  14.6k|    OPENSSL_clear_free((void *)r, sizeof(EC_KEY));
  ------------------
  |  |  113|  14.6k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  14.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  14.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|  14.6k|}
EC_KEY_up_ref:
  194|    197|{
  195|    197|    int i;
  196|       |
  197|    197|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (197:9): [True: 0, False: 197]
  ------------------
  198|      0|        return 0;
  199|       |
  200|    197|    REF_PRINT_COUNT("EC_KEY", r);
  ------------------
  |  |  289|    197|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|    197|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|    197|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|    197|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  201|    197|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|    197|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 197]
  |  |  ------------------
  ------------------
  202|    197|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (202:13): [True: 197, False: 0]
  ------------------
  203|    197|}
ossl_ec_key_simple_generate_public_key:
  448|  1.41k|{
  449|  1.41k|    int ret;
  450|  1.41k|    BN_CTX *ctx = BN_CTX_new_ex(eckey->libctx);
  451|       |
  452|  1.41k|    if (ctx == NULL)
  ------------------
  |  Branch (452:9): [True: 0, False: 1.41k]
  ------------------
  453|      0|        return 0;
  454|       |
  455|       |    /*
  456|       |     * See SP800-56AR3 5.6.1.2.2: Step (8)
  457|       |     * pub_key = priv_key * G (where G is a point on the curve)
  458|       |     */
  459|  1.41k|    ret = EC_POINT_mul(eckey->group, eckey->pub_key, eckey->priv_key, NULL,
  460|  1.41k|                       NULL, ctx);
  461|       |
  462|  1.41k|    BN_CTX_free(ctx);
  463|  1.41k|    if (ret == 1)
  ------------------
  |  Branch (463:9): [True: 1.41k, False: 0]
  ------------------
  464|  1.41k|        eckey->dirty_cnt++;
  465|       |
  466|  1.41k|    return ret;
  467|  1.41k|}
ossl_ec_key_get_libctx:
  752|  2.14k|{
  753|  2.14k|    return key->libctx;
  754|  2.14k|}
ossl_ec_key_get0_propq:
  757|    820|{
  758|    820|    return key->propq;
  759|    820|}
ossl_ec_key_set0_libctx:
  762|    820|{
  763|    820|    key->libctx = libctx;
  764|       |    /* Do we need to propagate this to the group? */
  765|    820|}
EC_KEY_get0_group:
  768|  5.01k|{
  769|  5.01k|    return key->group;
  770|  5.01k|}
EC_KEY_set_group:
  773|    467|{
  774|    467|    if (key->meth->set_group != NULL && key->meth->set_group(key, group) == 0)
  ------------------
  |  Branch (774:9): [True: 0, False: 467]
  |  Branch (774:41): [True: 0, False: 0]
  ------------------
  775|      0|        return 0;
  776|    467|    EC_GROUP_free(key->group);
  777|    467|    key->group = EC_GROUP_dup(group);
  778|    467|    if (key->group != NULL && EC_GROUP_get_curve_name(key->group) == NID_sm2)
  ------------------
  |  | 1232|    467|#define NID_sm2         1172
  ------------------
  |  Branch (778:9): [True: 467, False: 0]
  |  Branch (778:31): [True: 2, False: 465]
  ------------------
  779|      2|        EC_KEY_set_flags(key, EC_FLAG_SM2_RANGE);
  ------------------
  |  |  962|      2|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
  780|       |
  781|    467|    key->dirty_cnt++;
  782|    467|    return (key->group == NULL) ? 0 : 1;
  ------------------
  |  Branch (782:12): [True: 0, False: 467]
  ------------------
  783|    467|}
EC_KEY_get0_private_key:
  786|  3.43k|{
  787|  3.43k|    return key->priv_key;
  788|  3.43k|}
EC_KEY_get0_public_key:
  886|  2.02k|{
  887|  2.02k|    return key->pub_key;
  888|  2.02k|}
EC_KEY_get_enc_flags:
  902|    938|{
  903|    938|    return key->enc_flag;
  904|    938|}
EC_KEY_set_enc_flags:
  907|    236|{
  908|    236|    key->enc_flag = flags;
  909|    236|}
EC_KEY_get_conv_form:
  912|  2.02k|{
  913|  2.02k|    return key->conv_form;
  914|  2.02k|}
EC_KEY_get_flags:
  939|  3.05k|{
  940|  3.05k|    return key->flags;
  941|  3.05k|}
EC_KEY_set_flags:
  944|     25|{
  945|     25|    key->flags |= flags;
  946|     25|    key->dirty_cnt++;
  947|     25|}
EC_KEY_key2buf:
  964|  1.53k|{
  965|  1.53k|    if (key == NULL || key->pub_key == NULL || key->group == NULL)
  ------------------
  |  Branch (965:9): [True: 0, False: 1.53k]
  |  Branch (965:24): [True: 0, False: 1.53k]
  |  Branch (965:48): [True: 0, False: 1.53k]
  ------------------
  966|      0|        return 0;
  967|  1.53k|    return EC_POINT_point2buf(key->group, key->pub_key, form, pbuf, ctx);
  968|  1.53k|}
EC_KEY_oct2key:
  972|  1.34k|{
  973|  1.34k|    if (key == NULL || key->group == NULL)
  ------------------
  |  Branch (973:9): [True: 0, False: 1.34k]
  |  Branch (973:24): [True: 0, False: 1.34k]
  ------------------
  974|      0|        return 0;
  975|  1.34k|    if (key->pub_key == NULL)
  ------------------
  |  Branch (975:9): [True: 423, False: 923]
  ------------------
  976|    423|        key->pub_key = EC_POINT_new(key->group);
  977|  1.34k|    if (key->pub_key == NULL)
  ------------------
  |  Branch (977:9): [True: 0, False: 1.34k]
  ------------------
  978|      0|        return 0;
  979|  1.34k|    if (EC_POINT_oct2point(key->group, key->pub_key, buf, len, ctx) == 0)
  ------------------
  |  Branch (979:9): [True: 655, False: 691]
  ------------------
  980|    655|        return 0;
  981|    691|    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|    691|    if ((key->group->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0)
  ------------------
  |  |   29|    691|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (989:9): [True: 691, False: 0]
  ------------------
  990|    691|        key->conv_form = (point_conversion_form_t)(buf[0] & ~0x01);
  991|    691|    return 1;
  992|  1.34k|}
EC_KEY_priv2oct:
  996|  5.48k|{
  997|  5.48k|    if (eckey->group == NULL || eckey->group->meth == NULL)
  ------------------
  |  Branch (997:9): [True: 0, False: 5.48k]
  |  Branch (997:33): [True: 0, False: 5.48k]
  ------------------
  998|      0|        return 0;
  999|  5.48k|    if (eckey->group->meth->priv2oct == NULL) {
  ------------------
  |  Branch (999:9): [True: 0, False: 5.48k]
  ------------------
 1000|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1001|      0|        return 0;
 1002|      0|    }
 1003|       |
 1004|  5.48k|    return eckey->group->meth->priv2oct(eckey, buf, len);
 1005|  5.48k|}
ossl_ec_key_simple_priv2oct:
 1009|  5.48k|{
 1010|  5.48k|    size_t buf_len;
 1011|       |
 1012|  5.48k|    buf_len = (EC_GROUP_order_bits(eckey->group) + 7) / 8;
 1013|  5.48k|    if (eckey->priv_key == NULL)
  ------------------
  |  Branch (1013:9): [True: 0, False: 5.48k]
  ------------------
 1014|      0|        return 0;
 1015|  5.48k|    if (buf == NULL)
  ------------------
  |  Branch (1015:9): [True: 2.74k, False: 2.74k]
  ------------------
 1016|  2.74k|        return buf_len;
 1017|  2.74k|    else if (len < buf_len)
  ------------------
  |  Branch (1017:14): [True: 0, False: 2.74k]
  ------------------
 1018|      0|        return 0;
 1019|       |
 1020|       |    /* Octetstring may need leading zeros if BN is to short */
 1021|       |
 1022|  2.74k|    if (BN_bn2binpad(eckey->priv_key, buf, buf_len) == -1) {
  ------------------
  |  Branch (1022:9): [True: 573, False: 2.17k]
  ------------------
 1023|    573|        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|    573|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    573|    (ERR_new(),                                                 \
  |  |  |  |  404|    573|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    573|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    573|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    573|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    573|     ERR_set_error)
  |  |  ------------------
  ------------------
 1024|    573|        return 0;
 1025|    573|    }
 1026|       |
 1027|  2.17k|    return buf_len;
 1028|  2.74k|}
EC_KEY_oct2priv:
 1031|  2.34k|{
 1032|  2.34k|    int ret;
 1033|       |
 1034|  2.34k|    if (eckey->group == NULL || eckey->group->meth == NULL)
  ------------------
  |  Branch (1034:9): [True: 0, False: 2.34k]
  |  Branch (1034:33): [True: 0, False: 2.34k]
  ------------------
 1035|      0|        return 0;
 1036|  2.34k|    if (eckey->group->meth->oct2priv == NULL) {
  ------------------
  |  Branch (1036:9): [True: 0, False: 2.34k]
  ------------------
 1037|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1038|      0|        return 0;
 1039|      0|    }
 1040|  2.34k|    ret = eckey->group->meth->oct2priv(eckey, buf, len);
 1041|  2.34k|    if (ret == 1)
  ------------------
  |  Branch (1041:9): [True: 2.34k, False: 0]
  ------------------
 1042|  2.34k|        eckey->dirty_cnt++;
 1043|  2.34k|    return ret;
 1044|  2.34k|}
ossl_ec_key_simple_oct2priv:
 1048|  2.34k|{
 1049|  2.34k|    if (eckey->priv_key == NULL)
  ------------------
  |  Branch (1049:9): [True: 2.34k, False: 0]
  ------------------
 1050|  2.34k|        eckey->priv_key = BN_secure_new();
 1051|  2.34k|    if (eckey->priv_key == NULL) {
  ------------------
  |  Branch (1051:9): [True: 0, False: 2.34k]
  ------------------
 1052|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1053|      0|        return 0;
 1054|      0|    }
 1055|  2.34k|    if (BN_bin2bn(buf, len, eckey->priv_key) == NULL) {
  ------------------
  |  Branch (1055:9): [True: 0, False: 2.34k]
  ------------------
 1056|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1057|      0|        return 0;
 1058|      0|    }
 1059|  2.34k|    eckey->dirty_cnt++;
 1060|  2.34k|    return 1;
 1061|  2.34k|}
EC_KEY_priv2buf:
 1064|  2.74k|{
 1065|  2.74k|    size_t len;
 1066|  2.74k|    unsigned char *buf;
 1067|       |
 1068|  2.74k|    len = EC_KEY_priv2oct(eckey, NULL, 0);
 1069|  2.74k|    if (len == 0)
  ------------------
  |  Branch (1069:9): [True: 0, False: 2.74k]
  ------------------
 1070|      0|        return 0;
 1071|  2.74k|    if ((buf = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  102|  2.74k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.74k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.74k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (1071:9): [True: 0, False: 2.74k]
  ------------------
 1072|      0|        return 0;
 1073|  2.74k|    len = EC_KEY_priv2oct(eckey, buf, len);
 1074|  2.74k|    if (len == 0) {
  ------------------
  |  Branch (1074:9): [True: 573, False: 2.17k]
  ------------------
 1075|    573|        OPENSSL_free(buf);
  ------------------
  |  |  115|    573|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    573|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    573|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1076|    573|        return 0;
 1077|    573|    }
 1078|  2.17k|    *pbuf = buf;
 1079|  2.17k|    return len;
 1080|  2.74k|}

EC_KEY_OpenSSL:
   41|    202|{
   42|    202|    return &openssl_ec_key_method;
   43|    202|}
EC_KEY_get_default_method:
   46|  14.6k|{
   47|  14.6k|    return default_ec_key_meth;
   48|  14.6k|}
EC_KEY_get_method:
   59|    202|{
   60|    202|    return key->meth;
   61|    202|}
ossl_ec_key_new_method_int:
   83|  14.6k|{
   84|  14.6k|    EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  14.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  14.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  14.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   85|       |
   86|  14.6k|    if (ret == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 14.6k]
  ------------------
   87|      0|        return NULL;
   88|       |
   89|  14.6k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 14.6k]
  ------------------
   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|  14.6k|    ret->libctx = libctx;
   95|  14.6k|    if (propq != NULL) {
  ------------------
  |  Branch (95:9): [True: 47, False: 14.6k]
  ------------------
   96|     47|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|     47|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     47|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     47|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   97|     47|        if (ret->propq == NULL)
  ------------------
  |  Branch (97:13): [True: 0, False: 47]
  ------------------
   98|      0|            goto err;
   99|     47|    }
  100|       |
  101|  14.6k|    ret->meth = EC_KEY_get_default_method();
  102|  14.6k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  103|  14.6k|    if (engine != NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 14.6k]
  ------------------
  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|  14.6k|        ret->engine = ENGINE_get_default_EC();
  111|  14.6k|    if (ret->engine != NULL) {
  ------------------
  |  Branch (111:9): [True: 0, False: 14.6k]
  ------------------
  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|  14.6k|#endif
  119|       |
  120|  14.6k|    ret->version = 1;
  121|  14.6k|    ret->conv_form = POINT_CONVERSION_UNCOMPRESSED;
  122|       |
  123|       |/* No ex_data inside the FIPS provider */
  124|  14.6k|#ifndef FIPS_MODULE
  125|  14.6k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_EC_KEY, ret, &ret->ex_data)) {
  ------------------
  |  |  236|  14.6k|# define CRYPTO_EX_INDEX_EC_KEY           8
  ------------------
  |  Branch (125:9): [True: 0, False: 14.6k]
  ------------------
  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|  14.6k|#endif
  130|       |
  131|  14.6k|    if (ret->meth->init != NULL && ret->meth->init(ret) == 0) {
  ------------------
  |  Branch (131:9): [True: 0, False: 14.6k]
  |  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|  14.6k|    return ret;
  136|       |
  137|      0| err:
  138|      0|    EC_KEY_free(ret);
  139|      0|    return NULL;
  140|  14.6k|}

ossl_ec_group_new_ex:
   31|  4.55k|{
   32|  4.55k|    EC_GROUP *ret;
   33|       |
   34|  4.55k|    if (meth == NULL) {
  ------------------
  |  Branch (34:9): [True: 0, False: 4.55k]
  ------------------
   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|  4.55k|    if (meth->group_init == 0) {
  ------------------
  |  Branch (38:9): [True: 0, False: 4.55k]
  ------------------
   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|  4.55k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  4.55k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.55k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.55k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|  4.55k|    if (ret == NULL)
  ------------------
  |  Branch (44:9): [True: 0, False: 4.55k]
  ------------------
   45|      0|        return NULL;
   46|       |
   47|  4.55k|    ret->libctx = libctx;
   48|  4.55k|    if (propq != NULL) {
  ------------------
  |  Branch (48:9): [True: 16, False: 4.53k]
  ------------------
   49|     16|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|     16|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   50|     16|        if (ret->propq == NULL)
  ------------------
  |  Branch (50:13): [True: 0, False: 16]
  ------------------
   51|      0|            goto err;
   52|     16|    }
   53|  4.55k|    ret->meth = meth;
   54|  4.55k|    if ((ret->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
  ------------------
  |  |   29|  4.55k|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (54:9): [True: 4.55k, False: 0]
  ------------------
   55|  4.55k|        ret->order = BN_new();
   56|  4.55k|        if (ret->order == NULL)
  ------------------
  |  Branch (56:13): [True: 0, False: 4.55k]
  ------------------
   57|      0|            goto err;
   58|  4.55k|        ret->cofactor = BN_new();
   59|  4.55k|        if (ret->cofactor == NULL)
  ------------------
  |  Branch (59:13): [True: 0, False: 4.55k]
  ------------------
   60|      0|            goto err;
   61|  4.55k|    }
   62|  4.55k|    ret->asn1_flag = OPENSSL_EC_EXPLICIT_CURVE;
  ------------------
  |  |   30|  4.55k|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
   63|  4.55k|    ret->asn1_form = POINT_CONVERSION_UNCOMPRESSED;
   64|  4.55k|    if (!meth->group_init(ret))
  ------------------
  |  Branch (64:9): [True: 0, False: 4.55k]
  ------------------
   65|      0|        goto err;
   66|  4.55k|    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|  4.55k|}
EC_pre_comp_free:
   86|  4.55k|{
   87|  4.55k|    switch (group->pre_comp_type) {
  ------------------
  |  Branch (87:13): [True: 0, False: 4.55k]
  ------------------
   88|  4.55k|    case PCT_none:
  ------------------
  |  Branch (88:5): [True: 4.55k, False: 0]
  ------------------
   89|  4.55k|        break;
   90|      0|    case PCT_nistz256:
  ------------------
  |  Branch (90:5): [True: 0, False: 4.55k]
  ------------------
   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: 4.55k]
  ------------------
   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: 4.55k]
  ------------------
  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: 4.55k]
  ------------------
  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: 4.55k]
  ------------------
  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: 4.55k]
  ------------------
  116|      0|        EC_ec_pre_comp_free(group->pre_comp.ec);
  117|      0|        break;
  118|  4.55k|    }
  119|  4.55k|    group->pre_comp.ec = NULL;
  120|  4.55k|}
EC_GROUP_free:
  123|  20.4k|{
  124|  20.4k|    if (!group)
  ------------------
  |  Branch (124:9): [True: 15.9k, False: 4.55k]
  ------------------
  125|  15.9k|        return;
  126|       |
  127|  4.55k|    if (group->meth->group_finish != 0)
  ------------------
  |  Branch (127:9): [True: 4.55k, False: 0]
  ------------------
  128|  4.55k|        group->meth->group_finish(group);
  129|       |
  130|  4.55k|    EC_pre_comp_free(group);
  131|  4.55k|    BN_MONT_CTX_free(group->mont_data);
  132|  4.55k|    EC_POINT_free(group->generator);
  133|  4.55k|    BN_free(group->order);
  134|  4.55k|    BN_free(group->cofactor);
  135|  4.55k|    OPENSSL_free(group->seed);
  ------------------
  |  |  115|  4.55k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.55k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.55k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|  4.55k|    OPENSSL_free(group->propq);
  ------------------
  |  |  115|  4.55k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.55k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.55k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|  4.55k|    OPENSSL_free(group);
  ------------------
  |  |  115|  4.55k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.55k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.55k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  138|  4.55k|}
EC_GROUP_copy:
  162|    945|{
  163|    945|    if (dest->meth->group_copy == 0) {
  ------------------
  |  Branch (163:9): [True: 0, False: 945]
  ------------------
  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|    945|    if (dest->meth != src->meth) {
  ------------------
  |  Branch (167:9): [True: 0, False: 945]
  ------------------
  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|    945|    if (dest == src)
  ------------------
  |  Branch (171:9): [True: 0, False: 945]
  ------------------
  172|      0|        return 1;
  173|       |
  174|    945|    dest->libctx = src->libctx;
  175|    945|    dest->curve_name = src->curve_name;
  176|       |
  177|       |    /* Copy precomputed */
  178|    945|    dest->pre_comp_type = src->pre_comp_type;
  179|    945|    switch (src->pre_comp_type) {
  ------------------
  |  Branch (179:13): [True: 0, False: 945]
  ------------------
  180|    945|    case PCT_none:
  ------------------
  |  Branch (180:5): [True: 945, False: 0]
  ------------------
  181|    945|        dest->pre_comp.ec = NULL;
  182|    945|        break;
  183|      0|    case PCT_nistz256:
  ------------------
  |  Branch (183:5): [True: 0, False: 945]
  ------------------
  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: 945]
  ------------------
  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: 945]
  ------------------
  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: 945]
  ------------------
  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: 945]
  ------------------
  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: 945]
  ------------------
  209|      0|        dest->pre_comp.ec = EC_ec_pre_comp_dup(src->pre_comp.ec);
  210|      0|        break;
  211|    945|    }
  212|       |
  213|    945|    if (src->mont_data != NULL) {
  ------------------
  |  Branch (213:9): [True: 754, False: 191]
  ------------------
  214|    754|        if (dest->mont_data == NULL) {
  ------------------
  |  Branch (214:13): [True: 754, False: 0]
  ------------------
  215|    754|            dest->mont_data = BN_MONT_CTX_new();
  216|    754|            if (dest->mont_data == NULL)
  ------------------
  |  Branch (216:17): [True: 0, False: 754]
  ------------------
  217|      0|                return 0;
  218|    754|        }
  219|    754|        if (!BN_MONT_CTX_copy(dest->mont_data, src->mont_data))
  ------------------
  |  Branch (219:13): [True: 0, False: 754]
  ------------------
  220|      0|            return 0;
  221|    754|    } else {
  222|       |        /* src->generator == NULL */
  223|    191|        BN_MONT_CTX_free(dest->mont_data);
  224|    191|        dest->mont_data = NULL;
  225|    191|    }
  226|       |
  227|    945|    if (src->generator != NULL) {
  ------------------
  |  Branch (227:9): [True: 945, False: 0]
  ------------------
  228|    945|        if (dest->generator == NULL) {
  ------------------
  |  Branch (228:13): [True: 945, False: 0]
  ------------------
  229|    945|            dest->generator = EC_POINT_new(dest);
  230|    945|            if (dest->generator == NULL)
  ------------------
  |  Branch (230:17): [True: 0, False: 945]
  ------------------
  231|      0|                return 0;
  232|    945|        }
  233|    945|        if (!EC_POINT_copy(dest->generator, src->generator))
  ------------------
  |  Branch (233:13): [True: 0, False: 945]
  ------------------
  234|      0|            return 0;
  235|    945|    } else {
  236|       |        /* src->generator == NULL */
  237|      0|        EC_POINT_clear_free(dest->generator);
  238|      0|        dest->generator = NULL;
  239|      0|    }
  240|       |
  241|    945|    if ((src->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
  ------------------
  |  |   29|    945|#define EC_FLAGS_CUSTOM_CURVE   0x2
  ------------------
  |  Branch (241:9): [True: 945, False: 0]
  ------------------
  242|    945|        if (!BN_copy(dest->order, src->order))
  ------------------
  |  Branch (242:13): [True: 0, False: 945]
  ------------------
  243|      0|            return 0;
  244|    945|        if (!BN_copy(dest->cofactor, src->cofactor))
  ------------------
  |  Branch (244:13): [True: 0, False: 945]
  ------------------
  245|      0|            return 0;
  246|    945|    }
  247|       |
  248|    945|    dest->asn1_flag = src->asn1_flag;
  249|    945|    dest->asn1_form = src->asn1_form;
  250|    945|    dest->decoded_from_explicit_params = src->decoded_from_explicit_params;
  251|       |
  252|    945|    if (src->seed) {
  ------------------
  |  Branch (252:9): [True: 391, False: 554]
  ------------------
  253|    391|        OPENSSL_free(dest->seed);
  ------------------
  |  |  115|    391|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    391|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    391|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  254|    391|        if ((dest->seed = OPENSSL_malloc(src->seed_len)) == NULL)
  ------------------
  |  |  102|    391|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    391|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    391|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (254:13): [True: 0, False: 391]
  ------------------
  255|      0|            return 0;
  256|    391|        if (!memcpy(dest->seed, src->seed, src->seed_len))
  ------------------
  |  Branch (256:13): [True: 0, False: 391]
  ------------------
  257|      0|            return 0;
  258|    391|        dest->seed_len = src->seed_len;
  259|    554|    } else {
  260|    554|        OPENSSL_free(dest->seed);
  ------------------
  |  |  115|    554|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    554|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    554|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|    554|        dest->seed = NULL;
  262|    554|        dest->seed_len = 0;
  263|    554|    }
  264|       |
  265|    945|    return dest->meth->group_copy(dest, src);
  266|    945|}
EC_GROUP_dup:
  269|    945|{
  270|    945|    EC_GROUP *t = NULL;
  271|    945|    int ok = 0;
  272|       |
  273|    945|    if (a == NULL)
  ------------------
  |  Branch (273:9): [True: 0, False: 945]
  ------------------
  274|      0|        return NULL;
  275|       |
  276|    945|    if ((t = ossl_ec_group_new_ex(a->libctx, a->propq, a->meth)) == NULL)
  ------------------
  |  Branch (276:9): [True: 0, False: 945]
  ------------------
  277|      0|        return NULL;
  278|    945|    if (!EC_GROUP_copy(t, a))
  ------------------
  |  Branch (278:9): [True: 0, False: 945]
  ------------------
  279|      0|        goto err;
  280|       |
  281|    945|    ok = 1;
  282|       |
  283|    945| err:
  284|    945|    if (!ok) {
  ------------------
  |  Branch (284:9): [True: 0, False: 945]
  ------------------
  285|      0|        EC_GROUP_free(t);
  286|      0|        return NULL;
  287|      0|    }
  288|    945|        return t;
  289|    945|}
EC_GROUP_set_generator:
  368|  3.45k|{
  369|  3.45k|    if (generator == NULL) {
  ------------------
  |  Branch (369:9): [True: 0, False: 3.45k]
  ------------------
  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|  3.45k|    if (group->field == NULL || BN_is_zero(group->field)
  ------------------
  |  Branch (375:9): [True: 0, False: 3.45k]
  |  Branch (375:33): [True: 0, False: 3.45k]
  ------------------
  376|  3.45k|        || BN_is_negative(group->field)) {
  ------------------
  |  Branch (376:12): [True: 0, False: 3.45k]
  ------------------
  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|  3.45k|    if (order == NULL || BN_is_zero(order) || BN_is_negative(order)
  ------------------
  |  Branch (386:9): [True: 0, False: 3.45k]
  |  Branch (386:26): [True: 0, False: 3.45k]
  |  Branch (386:47): [True: 0, False: 3.45k]
  ------------------
  387|  3.45k|        || BN_num_bits(order) > BN_num_bits(group->field) + 1) {
  ------------------
  |  Branch (387:12): [True: 0, False: 3.45k]
  ------------------
  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|  3.45k|    if (cofactor != NULL && BN_is_negative(cofactor)) {
  ------------------
  |  Branch (397:9): [True: 2.64k, False: 813]
  |  Branch (397:29): [True: 10, False: 2.63k]
  ------------------
  398|     10|        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR);
  ------------------
  |  |  401|     10|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     10|    (ERR_new(),                                                 \
  |  |  |  |  404|     10|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  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)
  |  |  ------------------
  ------------------
  399|     10|        return 0;
  400|     10|    }
  401|       |
  402|  3.44k|    if (group->generator == NULL) {
  ------------------
  |  Branch (402:9): [True: 2.97k, False: 478]
  ------------------
  403|  2.97k|        group->generator = EC_POINT_new(group);
  404|  2.97k|        if (group->generator == NULL)
  ------------------
  |  Branch (404:13): [True: 0, False: 2.97k]
  ------------------
  405|      0|            return 0;
  406|  2.97k|    }
  407|  3.44k|    if (!EC_POINT_copy(group->generator, generator))
  ------------------
  |  Branch (407:9): [True: 0, False: 3.44k]
  ------------------
  408|      0|        return 0;
  409|       |
  410|  3.44k|    if (!BN_copy(group->order, order))
  ------------------
  |  Branch (410:9): [True: 0, False: 3.44k]
  ------------------
  411|      0|        return 0;
  412|       |
  413|       |    /* Either take the provided positive cofactor, or try to compute it */
  414|  3.44k|    if (cofactor != NULL && !BN_is_zero(cofactor)) {
  ------------------
  |  Branch (414:9): [True: 2.63k, False: 813]
  |  Branch (414:29): [True: 2.62k, False: 12]
  ------------------
  415|  2.62k|        if (!BN_copy(group->cofactor, cofactor))
  ------------------
  |  Branch (415:13): [True: 0, False: 2.62k]
  ------------------
  416|      0|            return 0;
  417|  2.62k|    } else if (!ec_guess_cofactor(group)) {
  ------------------
  |  Branch (417:16): [True: 0, False: 825]
  ------------------
  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|  3.44k|    if (BN_is_odd(group->order)) {
  ------------------
  |  Branch (427:9): [True: 3.06k, False: 382]
  ------------------
  428|  3.06k|        return ec_precompute_mont_data(group);
  429|  3.06k|    }
  430|       |
  431|    382|    BN_MONT_CTX_free(group->mont_data);
  432|    382|    group->mont_data = NULL;
  433|    382|    return 1;
  434|  3.44k|}
EC_GROUP_get0_generator:
  437|  1.18k|{
  438|  1.18k|    return group->generator;
  439|  1.18k|}
EC_GROUP_get_order:
  447|    437|{
  448|    437|    if (group->order == NULL)
  ------------------
  |  Branch (448:9): [True: 0, False: 437]
  ------------------
  449|      0|        return 0;
  450|    437|    if (!BN_copy(order, group->order))
  ------------------
  |  Branch (450:9): [True: 0, False: 437]
  ------------------
  451|      0|        return 0;
  452|       |
  453|    437|    return !BN_is_zero(order);
  454|    437|}
EC_GROUP_get0_order:
  457|  1.25k|{
  458|  1.25k|    return group->order;
  459|  1.25k|}
EC_GROUP_order_bits:
  462|  8.90k|{
  463|  8.90k|    return group->meth->group_order_bits(group);
  464|  8.90k|}
EC_GROUP_get0_cofactor:
  479|    914|{
  480|    914|    return group->cofactor;
  481|    914|}
EC_GROUP_set_curve_name:
  484|  2.54k|{
  485|  2.54k|    group->curve_name = nid;
  486|  2.54k|    group->asn1_flag =
  487|  2.54k|        (nid != NID_undef)
  ------------------
  |  |   18|  2.54k|#define NID_undef                       0
  ------------------
  |  Branch (487:9): [True: 2.54k, False: 0]
  ------------------
  488|  2.54k|        ? OPENSSL_EC_NAMED_CURVE
  ------------------
  |  |   31|  2.54k|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  489|  2.54k|        : OPENSSL_EC_EXPLICIT_CURVE;
  ------------------
  |  |   30|  2.54k|# define OPENSSL_EC_EXPLICIT_CURVE  0x000
  ------------------
  490|  2.54k|}
EC_GROUP_get_curve_name:
  493|  7.48k|{
  494|  7.48k|    return group->curve_name;
  495|  7.48k|}
EC_GROUP_get_field_type:
  503|  3.02k|{
  504|  3.02k|    return group->meth->field_type;
  505|  3.02k|}
EC_GROUP_set_asn1_flag:
  508|  2.98k|{
  509|  2.98k|    group->asn1_flag = flag;
  510|  2.98k|}
EC_GROUP_get_asn1_flag:
  513|  5.94k|{
  514|  5.94k|    return group->asn1_flag;
  515|  5.94k|}
EC_GROUP_set_point_conversion_form:
  519|    850|{
  520|    850|    group->asn1_form = form;
  521|    850|}
EC_GROUP_get_point_conversion_form:
  525|  1.25k|{
  526|  1.25k|    return group->asn1_form;
  527|  1.25k|}
EC_GROUP_set_seed:
  530|  2.09k|{
  531|  2.09k|    OPENSSL_free(group->seed);
  ------------------
  |  |  115|  2.09k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.09k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.09k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  532|  2.09k|    group->seed = NULL;
  533|  2.09k|    group->seed_len = 0;
  534|       |
  535|  2.09k|    if (!len || !p)
  ------------------
  |  Branch (535:9): [True: 480, False: 1.61k]
  |  Branch (535:17): [True: 0, False: 1.61k]
  ------------------
  536|    480|        return 1;
  537|       |
  538|  1.61k|    if ((group->seed = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  102|  1.61k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.61k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.61k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (538:9): [True: 0, False: 1.61k]
  ------------------
  539|      0|        return 0;
  540|  1.61k|    memcpy(group->seed, p, len);
  541|  1.61k|    group->seed_len = len;
  542|       |
  543|  1.61k|    return len;
  544|  1.61k|}
EC_GROUP_get0_seed:
  547|    673|{
  548|    673|    return group->seed;
  549|    673|}
EC_GROUP_get_seed_len:
  552|    530|{
  553|    530|    return group->seed_len;
  554|    530|}
EC_GROUP_set_curve:
  558|  2.74k|{
  559|  2.74k|    if (group->meth->group_set_curve == 0) {
  ------------------
  |  Branch (559:9): [True: 0, False: 2.74k]
  ------------------
  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|  2.74k|    return group->meth->group_set_curve(group, p, a, b, ctx);
  564|  2.74k|}
EC_GROUP_get_curve:
  568|  1.15k|{
  569|  1.15k|    if (group->meth->group_get_curve == NULL) {
  ------------------
  |  Branch (569:9): [True: 0, False: 1.15k]
  ------------------
  570|      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)
  |  |  ------------------
  ------------------
  571|      0|        return 0;
  572|      0|    }
  573|  1.15k|    return group->meth->group_get_curve(group, p, a, b, ctx);
  574|  1.15k|}
EC_GROUP_get_degree:
  605|  1.06k|{
  606|  1.06k|    if (group->meth->group_get_degree == 0) {
  ------------------
  |  Branch (606:9): [True: 0, False: 1.06k]
  ------------------
  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|  1.06k|    return group->meth->group_get_degree(group);
  611|  1.06k|}
EC_POINT_new:
  717|  13.3k|{
  718|  13.3k|    EC_POINT *ret;
  719|       |
  720|  13.3k|    if (group == NULL) {
  ------------------
  |  Branch (720:9): [True: 0, False: 13.3k]
  ------------------
  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|  13.3k|    if (group->meth->point_init == NULL) {
  ------------------
  |  Branch (724:9): [True: 0, False: 13.3k]
  ------------------
  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|  13.3k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  13.3k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  13.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  13.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  730|  13.3k|    if (ret == NULL)
  ------------------
  |  Branch (730:9): [True: 0, False: 13.3k]
  ------------------
  731|      0|        return NULL;
  732|       |
  733|  13.3k|    ret->meth = group->meth;
  734|  13.3k|    ret->curve_name = group->curve_name;
  735|       |
  736|  13.3k|    if (!ret->meth->point_init(ret)) {
  ------------------
  |  Branch (736:9): [True: 0, False: 13.3k]
  ------------------
  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|  13.3k|    return ret;
  742|  13.3k|}
EC_POINT_free:
  745|  24.2k|{
  746|  24.2k|    if (point == NULL)
  ------------------
  |  Branch (746:9): [True: 12.7k, False: 11.5k]
  ------------------
  747|  12.7k|        return;
  748|       |
  749|       |#ifdef FIPS_MODULE
  750|       |    EC_POINT_clear_free(point);
  751|       |#else
  752|  11.5k|    if (point->meth->point_finish != 0)
  ------------------
  |  Branch (752:9): [True: 11.5k, False: 0]
  ------------------
  753|  11.5k|        point->meth->point_finish(point);
  754|  11.5k|    OPENSSL_free(point);
  ------------------
  |  |  115|  11.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  11.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  11.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  755|  11.5k|#endif
  756|  11.5k|}
EC_POINT_clear_free:
  759|  4.18k|{
  760|  4.18k|    if (point == NULL)
  ------------------
  |  Branch (760:9): [True: 2.34k, False: 1.84k]
  ------------------
  761|  2.34k|        return;
  762|       |
  763|  1.84k|    if (point->meth->point_clear_finish != 0)
  ------------------
  |  Branch (763:9): [True: 1.84k, False: 0]
  ------------------
  764|  1.84k|        point->meth->point_clear_finish(point);
  765|      0|    else if (point->meth->point_finish != 0)
  ------------------
  |  Branch (765:14): [True: 0, False: 0]
  ------------------
  766|      0|        point->meth->point_finish(point);
  767|  1.84k|    OPENSSL_clear_free(point, sizeof(*point));
  ------------------
  |  |  113|  1.84k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.84k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.84k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  768|  1.84k|}
EC_POINT_copy:
  771|  7.53k|{
  772|  7.53k|    if (dest->meth->point_copy == 0) {
  ------------------
  |  Branch (772:9): [True: 0, False: 7.53k]
  ------------------
  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|  7.53k|    if (dest->meth != src->meth
  ------------------
  |  Branch (776:9): [True: 0, False: 7.53k]
  ------------------
  777|  7.53k|            || (dest->curve_name != src->curve_name
  ------------------
  |  Branch (777:17): [True: 2, False: 7.53k]
  ------------------
  778|  7.53k|                 && dest->curve_name != 0
  ------------------
  |  Branch (778:21): [True: 2, False: 0]
  ------------------
  779|  7.53k|                 && src->curve_name != 0)) {
  ------------------
  |  Branch (779:21): [True: 0, False: 2]
  ------------------
  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|  7.53k|    if (dest == src)
  ------------------
  |  Branch (783:9): [True: 0, False: 7.53k]
  ------------------
  784|      0|        return 1;
  785|  7.53k|    return dest->meth->point_copy(dest, src);
  786|  7.53k|}
EC_POINT_set_to_infinity:
  815|    254|{
  816|    254|    if (group->meth->point_set_to_infinity == 0) {
  ------------------
  |  Branch (816:9): [True: 0, False: 254]
  ------------------
  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|    254|    if (group->meth != point->meth) {
  ------------------
  |  Branch (820:9): [True: 0, False: 254]
  ------------------
  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|    254|    return group->meth->point_set_to_infinity(group, point);
  825|    254|}
EC_POINT_set_Jprojective_coordinates_GFp:
  832|  2.95k|{
  833|  2.95k|    if (group->meth->field_type != NID_X9_62_prime_field) {
  ------------------
  |  |  152|  2.95k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (833:9): [True: 0, False: 2.95k]
  ------------------
  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|  2.95k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (837:9): [True: 0, False: 2.95k]
  ------------------
  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|  2.95k|    return ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group, point,
  842|  2.95k|                                                              x, y, z, ctx);
  843|  2.95k|}
EC_POINT_set_affine_coordinates:
  866|  3.73k|{
  867|  3.73k|    if (group->meth->point_set_affine_coordinates == NULL) {
  ------------------
  |  Branch (867:9): [True: 0, False: 3.73k]
  ------------------
  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|  3.73k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (871:9): [True: 0, False: 3.73k]
  ------------------
  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|  3.73k|    if (!group->meth->point_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (875:9): [True: 0, False: 3.73k]
  ------------------
  876|      0|        return 0;
  877|       |
  878|  3.73k|    if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
  ------------------
  |  Branch (878:9): [True: 40, False: 3.69k]
  ------------------
  879|     40|        ERR_raise(ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE);
  ------------------
  |  |  401|     40|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     40|    (ERR_new(),                                                 \
  |  |  |  |  404|     40|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     40|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     40|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     40|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     40|     ERR_set_error)
  |  |  ------------------
  ------------------
  880|     40|        return 0;
  881|     40|    }
  882|  3.69k|    return 1;
  883|  3.73k|}
EC_POINT_get_affine_coordinates:
  906|  2.27k|{
  907|  2.27k|    if (group->meth->point_get_affine_coordinates == NULL) {
  ------------------
  |  Branch (907:9): [True: 0, False: 2.27k]
  ------------------
  908|      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)
  |  |  ------------------
  ------------------
  909|      0|        return 0;
  910|      0|    }
  911|  2.27k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (911:9): [True: 0, False: 2.27k]
  ------------------
  912|      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)
  |  |  ------------------
  ------------------
  913|      0|        return 0;
  914|      0|    }
  915|  2.27k|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (915:9): [True: 41, False: 2.23k]
  ------------------
  916|     41|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  401|     41|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     41|    (ERR_new(),                                                 \
  |  |  |  |  404|     41|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     41|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     41|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     41|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     41|     ERR_set_error)
  |  |  ------------------
  ------------------
  917|     41|        return 0;
  918|     41|    }
  919|  2.23k|    return group->meth->point_get_affine_coordinates(group, point, x, y, ctx);
  920|  2.27k|}
EC_POINT_add:
  942|  5.63k|{
  943|  5.63k|    if (group->meth->add == 0) {
  ------------------
  |  Branch (943:9): [True: 0, False: 5.63k]
  ------------------
  944|      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)
  |  |  ------------------
  ------------------
  945|      0|        return 0;
  946|      0|    }
  947|  5.63k|    if (!ec_point_is_compat(r, group) || !ec_point_is_compat(a, group)
  ------------------
  |  Branch (947:9): [True: 0, False: 5.63k]
  |  Branch (947:42): [True: 0, False: 5.63k]
  ------------------
  948|  5.63k|        || !ec_point_is_compat(b, group)) {
  ------------------
  |  Branch (948:12): [True: 0, False: 5.63k]
  ------------------
  949|      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)
  |  |  ------------------
  ------------------
  950|      0|        return 0;
  951|      0|    }
  952|  5.63k|    return group->meth->add(group, r, a, b, ctx);
  953|  5.63k|}
EC_POINT_dbl:
  957|  38.9k|{
  958|  38.9k|    if (group->meth->dbl == 0) {
  ------------------
  |  Branch (958:9): [True: 0, False: 38.9k]
  ------------------
  959|      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)
  |  |  ------------------
  ------------------
  960|      0|        return 0;
  961|      0|    }
  962|  38.9k|    if (!ec_point_is_compat(r, group) || !ec_point_is_compat(a, group)) {
  ------------------
  |  Branch (962:9): [True: 0, False: 38.9k]
  |  Branch (962:42): [True: 0, False: 38.9k]
  ------------------
  963|      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)
  |  |  ------------------
  ------------------
  964|      0|        return 0;
  965|      0|    }
  966|  38.9k|    return group->meth->dbl(group, r, a, ctx);
  967|  38.9k|}
EC_POINT_invert:
  970|  2.47k|{
  971|  2.47k|    if (group->meth->invert == 0) {
  ------------------
  |  Branch (971:9): [True: 0, False: 2.47k]
  ------------------
  972|      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)
  |  |  ------------------
  ------------------
  973|      0|        return 0;
  974|      0|    }
  975|  2.47k|    if (!ec_point_is_compat(a, group)) {
  ------------------
  |  Branch (975:9): [True: 0, False: 2.47k]
  ------------------
  976|      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)
  |  |  ------------------
  ------------------
  977|      0|        return 0;
  978|      0|    }
  979|  2.47k|    return group->meth->invert(group, a, ctx);
  980|  2.47k|}
EC_POINT_is_at_infinity:
  983|  63.6k|{
  984|  63.6k|    if (group->meth->is_at_infinity == 0) {
  ------------------
  |  Branch (984:9): [True: 0, False: 63.6k]
  ------------------
  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|  63.6k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (988:9): [True: 0, False: 63.6k]
  ------------------
  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|  63.6k|    return group->meth->is_at_infinity(group, point);
  993|  63.6k|}
EC_POINT_is_on_curve:
 1004|  3.73k|{
 1005|  3.73k|    if (group->meth->is_on_curve == 0) {
  ------------------
  |  Branch (1005:9): [True: 0, False: 3.73k]
  ------------------
 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|  3.73k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (1009:9): [True: 0, False: 3.73k]
  ------------------
 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|  3.73k|    return group->meth->is_on_curve(group, point, ctx);
 1014|  3.73k|}
EC_POINT_cmp:
 1018|    168|{
 1019|    168|    if (group->meth->point_cmp == 0) {
  ------------------
  |  Branch (1019:9): [True: 0, False: 168]
  ------------------
 1020|      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)
  |  |  ------------------
  ------------------
 1021|      0|        return -1;
 1022|      0|    }
 1023|    168|    if (!ec_point_is_compat(a, group) || !ec_point_is_compat(b, group)) {
  ------------------
  |  Branch (1023:9): [True: 0, False: 168]
  |  Branch (1023:42): [True: 0, False: 168]
  ------------------
 1024|      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)
  |  |  ------------------
  ------------------
 1025|      0|        return -1;
 1026|      0|    }
 1027|    168|    return group->meth->point_cmp(group, a, b, ctx);
 1028|    168|}
EC_POINT_mul:
 1119|  1.41k|{
 1120|  1.41k|    int ret = 0;
 1121|  1.41k|    size_t num;
 1122|  1.41k|#ifndef FIPS_MODULE
 1123|  1.41k|    BN_CTX *new_ctx = NULL;
 1124|  1.41k|#endif
 1125|       |
 1126|  1.41k|    if (!ec_point_is_compat(r, group)
  ------------------
  |  Branch (1126:9): [True: 0, False: 1.41k]
  ------------------
 1127|  1.41k|        || (point != NULL && !ec_point_is_compat(point, group))) {
  ------------------
  |  Branch (1127:13): [True: 0, False: 1.41k]
  |  Branch (1127:30): [True: 0, False: 0]
  ------------------
 1128|      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)
  |  |  ------------------
  ------------------
 1129|      0|        return 0;
 1130|      0|    }
 1131|       |
 1132|  1.41k|    if (g_scalar == NULL && p_scalar == NULL)
  ------------------
  |  Branch (1132:9): [True: 0, False: 1.41k]
  |  Branch (1132:29): [True: 0, False: 0]
  ------------------
 1133|      0|        return EC_POINT_set_to_infinity(group, r);
 1134|       |
 1135|  1.41k|#ifndef FIPS_MODULE
 1136|  1.41k|    if (ctx == NULL)
  ------------------
  |  Branch (1136:9): [True: 0, False: 1.41k]
  ------------------
 1137|      0|        ctx = new_ctx = BN_CTX_secure_new();
 1138|  1.41k|#endif
 1139|  1.41k|    if (ctx == NULL) {
  ------------------
  |  Branch (1139:9): [True: 0, False: 1.41k]
  ------------------
 1140|      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)
  |  |  ------------------
  ------------------
 1141|      0|        return 0;
 1142|      0|    }
 1143|       |
 1144|  1.41k|    num = (point != NULL && p_scalar != NULL) ? 1 : 0;
  ------------------
  |  Branch (1144:12): [True: 0, False: 1.41k]
  |  Branch (1144:29): [True: 0, False: 0]
  ------------------
 1145|  1.41k|    if (group->meth->mul != NULL)
  ------------------
  |  Branch (1145:9): [True: 700, False: 717]
  ------------------
 1146|    700|        ret = group->meth->mul(group, r, g_scalar, num, &point, &p_scalar, ctx);
 1147|    717|    else
 1148|       |        /* use default */
 1149|    717|        ret = ossl_ec_wNAF_mul(group, r, g_scalar, num, &point, &p_scalar, ctx);
 1150|       |
 1151|  1.41k|#ifndef FIPS_MODULE
 1152|  1.41k|    BN_CTX_free(new_ctx);
 1153|  1.41k|#endif
 1154|  1.41k|    return ret;
 1155|  1.41k|}
ossl_ec_group_simple_order_bits:
 1230|  8.90k|{
 1231|  8.90k|    if (group->order == NULL)
  ------------------
  |  Branch (1231:9): [True: 0, False: 8.90k]
  ------------------
 1232|      0|        return 0;
 1233|  8.90k|    return BN_num_bits(group->order);
 1234|  8.90k|}
ossl_ec_point_blind_coordinates:
 1318|    205|{
 1319|    205|    if (group->meth->blind_coordinates == NULL)
  ------------------
  |  Branch (1319:9): [True: 0, False: 205]
  ------------------
 1320|      0|        return 1; /* ignore if not implemented */
 1321|       |
 1322|    205|    return group->meth->blind_coordinates(group, p, ctx);
 1323|    205|}
EC_GROUP_get_basis_type:
 1326|    202|{
 1327|    202|    int i;
 1328|       |
 1329|    202|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field)
  ------------------
  |  |  156|    202|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1329:9): [True: 0, False: 202]
  ------------------
 1330|       |        /* everything else is currently not supported */
 1331|      0|        return 0;
 1332|       |
 1333|       |    /* Find the last non-zero element of group->poly[] */
 1334|    202|    for (i = 0;
 1335|    806|         i < (int)OSSL_NELEM(group->poly) && group->poly[i] != 0;
  ------------------
  |  |   14|  1.61k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1335:10): [True: 806, False: 0]
  |  Branch (1335:46): [True: 604, False: 202]
  ------------------
 1336|    604|         i++)
 1337|    604|        continue;
 1338|       |
 1339|    202|    if (i == 4)
  ------------------
  |  Branch (1339:9): [True: 100, False: 102]
  ------------------
 1340|    100|        return NID_X9_62_ppBasis;
  ------------------
  |  |  172|    100|#define NID_X9_62_ppBasis               683
  ------------------
 1341|    102|    else if (i == 2)
  ------------------
  |  Branch (1341:14): [True: 102, False: 0]
  ------------------
 1342|    102|        return NID_X9_62_tpBasis;
  ------------------
  |  |  168|    102|#define NID_X9_62_tpBasis               682
  ------------------
 1343|      0|    else
 1344|       |        /* everything else is currently not supported */
 1345|      0|        return 0;
 1346|    202|}
EC_GROUP_get_trinomial_basis:
 1350|    102|{
 1351|    102|    if (group == NULL)
  ------------------
  |  Branch (1351:9): [True: 0, False: 102]
  ------------------
 1352|      0|        return 0;
 1353|       |
 1354|    102|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field
  ------------------
  |  |  156|    204|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1354:9): [True: 0, False: 102]
  ------------------
 1355|    102|        || !((group->poly[0] != 0) && (group->poly[1] != 0)
  ------------------
  |  Branch (1355:14): [True: 102, False: 0]
  |  Branch (1355:39): [True: 102, False: 0]
  ------------------
 1356|    102|             && (group->poly[2] == 0))) {
  ------------------
  |  Branch (1356:17): [True: 102, 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|    102|    if (k)
  ------------------
  |  Branch (1361:9): [True: 102, False: 0]
  ------------------
 1362|    102|        *k = group->poly[1];
 1363|       |
 1364|    102|    return 1;
 1365|    102|}
EC_GROUP_get_pentanomial_basis:
 1369|    100|{
 1370|    100|    if (group == NULL)
  ------------------
  |  Branch (1370:9): [True: 0, False: 100]
  ------------------
 1371|      0|        return 0;
 1372|       |
 1373|    100|    if (EC_GROUP_get_field_type(group) != NID_X9_62_characteristic_two_field
  ------------------
  |  |  156|    200|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (1373:9): [True: 0, False: 100]
  ------------------
 1374|    100|        || !((group->poly[0] != 0) && (group->poly[1] != 0)
  ------------------
  |  Branch (1374:14): [True: 100, False: 0]
  |  Branch (1374:39): [True: 100, False: 0]
  ------------------
 1375|    100|             && (group->poly[2] != 0) && (group->poly[3] != 0)
  ------------------
  |  Branch (1375:17): [True: 100, False: 0]
  |  Branch (1375:42): [True: 100, False: 0]
  ------------------
 1376|    100|             && (group->poly[4] == 0))) {
  ------------------
  |  Branch (1376:17): [True: 100, 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|    100|    if (k1)
  ------------------
  |  Branch (1381:9): [True: 100, False: 0]
  ------------------
 1382|    100|        *k1 = group->poly[3];
 1383|    100|    if (k2)
  ------------------
  |  Branch (1383:9): [True: 100, False: 0]
  ------------------
 1384|    100|        *k2 = group->poly[2];
 1385|    100|    if (k3)
  ------------------
  |  Branch (1385:9): [True: 100, False: 0]
  ------------------
 1386|    100|        *k3 = group->poly[1];
 1387|       |
 1388|    100|    return 1;
 1389|    100|}
ec_lib.c:ec_guess_cofactor:
  318|    825|static int ec_guess_cofactor(EC_GROUP *group) {
  319|    825|    int ret = 0;
  320|    825|    BN_CTX *ctx = NULL;
  321|    825|    BIGNUM *q = NULL;
  322|       |
  323|       |    /*-
  324|       |     * If the cofactor is too large, we cannot guess it.
  325|       |     * The RHS of below is a strict overestimate of lg(4 * sqrt(q))
  326|       |     */
  327|    825|    if (BN_num_bits(group->order) <= (BN_num_bits(group->field) + 1) / 2 + 3) {
  ------------------
  |  Branch (327:9): [True: 620, False: 205]
  ------------------
  328|       |        /* default to 0 */
  329|    620|        BN_zero(group->cofactor);
  ------------------
  |  |  202|    620|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  330|       |        /* return success */
  331|    620|        return 1;
  332|    620|    }
  333|       |
  334|    205|    if ((ctx = BN_CTX_new_ex(group->libctx)) == NULL)
  ------------------
  |  Branch (334:9): [True: 0, False: 205]
  ------------------
  335|      0|        return 0;
  336|       |
  337|    205|    BN_CTX_start(ctx);
  338|    205|    if ((q = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (338:9): [True: 0, False: 205]
  ------------------
  339|      0|        goto err;
  340|       |
  341|       |    /* set q = 2**m for binary fields; q = p otherwise */
  342|    205|    if (group->meth->field_type == NID_X9_62_characteristic_two_field) {
  ------------------
  |  |  156|    205|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (342:9): [True: 0, False: 205]
  ------------------
  343|      0|        BN_zero(q);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  344|      0|        if (!BN_set_bit(q, BN_num_bits(group->field) - 1))
  ------------------
  |  Branch (344:13): [True: 0, False: 0]
  ------------------
  345|      0|            goto err;
  346|    205|    } else {
  347|    205|        if (!BN_copy(q, group->field))
  ------------------
  |  Branch (347:13): [True: 0, False: 205]
  ------------------
  348|      0|            goto err;
  349|    205|    }
  350|       |
  351|       |    /* compute h = \lfloor (q + 1)/n \rceil = \lfloor (q + 1 + n/2)/n \rfloor */
  352|    205|    if (!BN_rshift1(group->cofactor, group->order) /* n/2 */
  ------------------
  |  Branch (352:9): [True: 0, False: 205]
  ------------------
  353|    205|        || !BN_add(group->cofactor, group->cofactor, q) /* q + n/2 */
  ------------------
  |  Branch (353:12): [True: 0, False: 205]
  ------------------
  354|       |        /* q + 1 + n/2 */
  355|    205|        || !BN_add(group->cofactor, group->cofactor, BN_value_one())
  ------------------
  |  Branch (355:12): [True: 0, False: 205]
  ------------------
  356|       |        /* (q + 1 + n/2)/n */
  357|    205|        || !BN_div(group->cofactor, NULL, group->cofactor, group->order, ctx))
  ------------------
  |  Branch (357:12): [True: 0, False: 205]
  ------------------
  358|      0|        goto err;
  359|    205|    ret = 1;
  360|    205| err:
  361|    205|    BN_CTX_end(ctx);
  362|    205|    BN_CTX_free(ctx);
  363|    205|    return ret;
  364|    205|}
ec_lib.c:ec_precompute_mont_data:
 1189|  3.06k|{
 1190|  3.06k|    BN_CTX *ctx = BN_CTX_new_ex(group->libctx);
 1191|  3.06k|    int ret = 0;
 1192|       |
 1193|  3.06k|    BN_MONT_CTX_free(group->mont_data);
 1194|  3.06k|    group->mont_data = NULL;
 1195|       |
 1196|  3.06k|    if (ctx == NULL)
  ------------------
  |  Branch (1196:9): [True: 0, False: 3.06k]
  ------------------
 1197|      0|        goto err;
 1198|       |
 1199|  3.06k|    group->mont_data = BN_MONT_CTX_new();
 1200|  3.06k|    if (group->mont_data == NULL)
  ------------------
  |  Branch (1200:9): [True: 0, False: 3.06k]
  ------------------
 1201|      0|        goto err;
 1202|       |
 1203|  3.06k|    if (!BN_MONT_CTX_set(group->mont_data, group->order, ctx)) {
  ------------------
  |  Branch (1203:9): [True: 0, False: 3.06k]
  ------------------
 1204|      0|        BN_MONT_CTX_free(group->mont_data);
 1205|      0|        group->mont_data = NULL;
 1206|      0|        goto err;
 1207|      0|    }
 1208|       |
 1209|  3.06k|    ret = 1;
 1210|       |
 1211|  3.06k| err:
 1212|       |
 1213|  3.06k|    BN_CTX_free(ctx);
 1214|  3.06k|    return ret;
 1215|  3.06k|}

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

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

EC_POINT_set_compressed_coordinates:
   26|  1.74k|{
   27|  1.74k|    if (group->meth->point_set_compressed_coordinates == NULL
  ------------------
  |  Branch (27:9): [True: 1.74k, False: 0]
  ------------------
   28|  1.74k|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|  1.74k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (28:12): [True: 0, False: 1.74k]
  ------------------
   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|  1.74k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (32:9): [True: 0, False: 1.74k]
  ------------------
   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|  1.74k|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|  1.74k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (36:9): [True: 1.74k, False: 0]
  ------------------
   37|  1.74k|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|  1.74k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (37:13): [True: 1.69k, False: 54]
  ------------------
   38|  1.69k|            return ossl_ec_GFp_simple_set_compressed_coordinates(group, point, x,
   39|  1.69k|                                                                 y_bit, ctx);
   40|     54|        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|     54|            return ossl_ec_GF2m_simple_set_compressed_coordinates(group, point,
   48|     54|                                                                  x, y_bit, ctx);
   49|  1.74k|#endif
   50|  1.74k|    }
   51|      0|    return group->meth->point_set_compressed_coordinates(group, point, x,
   52|      0|                                                         y_bit, ctx);
   53|  1.74k|}
EC_POINT_point2oct:
   76|  3.90k|{
   77|  3.90k|    if (group->meth->point2oct == 0
  ------------------
  |  Branch (77:9): [True: 3.90k, False: 0]
  ------------------
   78|  3.90k|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|  3.90k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (78:12): [True: 0, False: 3.90k]
  ------------------
   79|      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)
  |  |  ------------------
  ------------------
   80|      0|        return 0;
   81|      0|    }
   82|  3.90k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (82:9): [True: 0, False: 3.90k]
  ------------------
   83|      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)
  |  |  ------------------
  ------------------
   84|      0|        return 0;
   85|      0|    }
   86|  3.90k|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|  3.90k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (86:9): [True: 3.90k, False: 0]
  ------------------
   87|  3.90k|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|  3.90k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (87:13): [True: 3.28k, False: 623]
  ------------------
   88|  3.28k|            return ossl_ec_GFp_simple_point2oct(group, point, form, buf, len,
   89|  3.28k|                                                ctx);
   90|    623|        else
   91|       |#ifdef OPENSSL_NO_EC2M
   92|       |        {
   93|       |            ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
   94|       |            return 0;
   95|       |        }
   96|       |#else
   97|    623|            return ossl_ec_GF2m_simple_point2oct(group, point,
   98|    623|                                                 form, buf, len, ctx);
   99|  3.90k|#endif
  100|  3.90k|    }
  101|       |
  102|      0|    return group->meth->point2oct(group, point, form, buf, len, ctx);
  103|  3.90k|}
EC_POINT_oct2point:
  107|  2.19k|{
  108|  2.19k|    if (group->meth->oct2point == 0
  ------------------
  |  Branch (108:9): [True: 2.19k, False: 0]
  ------------------
  109|  2.19k|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|  2.19k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (109:12): [True: 0, False: 2.19k]
  ------------------
  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|  2.19k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (113:9): [True: 0, False: 2.19k]
  ------------------
  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|  2.19k|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|  2.19k|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
  |  Branch (117:9): [True: 2.19k, False: 0]
  ------------------
  118|  2.19k|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|  2.19k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (118:13): [True: 2.02k, False: 173]
  ------------------
  119|  2.02k|            return ossl_ec_GFp_simple_oct2point(group, point, buf, len, ctx);
  120|    173|        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|    173|            return ossl_ec_GF2m_simple_oct2point(group, point, buf, len, ctx);
  128|  2.19k|#endif
  129|  2.19k|    }
  130|      0|    return group->meth->oct2point(group, point, buf, len, ctx);
  131|  2.19k|}
EC_POINT_point2buf:
  136|  1.97k|{
  137|  1.97k|    size_t len;
  138|  1.97k|    unsigned char *buf;
  139|       |
  140|  1.97k|    len = EC_POINT_point2oct(group, point, form, NULL, 0, NULL);
  141|  1.97k|    if (len == 0)
  ------------------
  |  Branch (141:9): [True: 45, False: 1.92k]
  ------------------
  142|     45|        return 0;
  143|  1.92k|    if ((buf = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  102|  1.92k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.92k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.92k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (143:9): [True: 0, False: 1.92k]
  ------------------
  144|      0|        return 0;
  145|  1.92k|    len = EC_POINT_point2oct(group, point, form, buf, len, ctx);
  146|  1.92k|    if (len == 0) {
  ------------------
  |  Branch (146:9): [True: 0, False: 1.92k]
  ------------------
  147|      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__
  |  |  ------------------
  ------------------
  148|      0|        return 0;
  149|      0|    }
  150|  1.92k|    *pbuf = buf;
  151|  1.92k|    return len;
  152|  1.92k|}

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

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

ossl_ec_GFp_nist_group_copy:
   86|     67|{
   87|     67|    dest->field_mod_func = src->field_mod_func;
   88|       |
   89|     67|    return ossl_ec_GFp_simple_group_copy(dest, src);
   90|     67|}
ossl_ec_GFp_nist_field_mul:
  130|  1.78k|{
  131|  1.78k|    int ret = 0;
  132|  1.78k|    BN_CTX *ctx_new = NULL;
  133|       |
  134|  1.78k|    if (!group || !r || !a || !b) {
  ------------------
  |  Branch (134:9): [True: 0, False: 1.78k]
  |  Branch (134:19): [True: 0, False: 1.78k]
  |  Branch (134:25): [True: 0, False: 1.78k]
  |  Branch (134:31): [True: 0, False: 1.78k]
  ------------------
  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|  1.78k|    if (!ctx)
  ------------------
  |  Branch (138:9): [True: 0, False: 1.78k]
  ------------------
  139|      0|        if ((ctx_new = ctx = BN_CTX_new_ex(group->libctx)) == NULL)
  ------------------
  |  Branch (139:13): [True: 0, False: 0]
  ------------------
  140|      0|            goto err;
  141|       |
  142|  1.78k|    if (!BN_mul(r, a, b, ctx))
  ------------------
  |  Branch (142:9): [True: 0, False: 1.78k]
  ------------------
  143|      0|        goto err;
  144|  1.78k|    if (!group->field_mod_func(r, r, group->field, ctx))
  ------------------
  |  Branch (144:9): [True: 0, False: 1.78k]
  ------------------
  145|      0|        goto err;
  146|       |
  147|  1.78k|    ret = 1;
  148|  1.78k| err:
  149|  1.78k|    BN_CTX_free(ctx_new);
  150|  1.78k|    return ret;
  151|  1.78k|}
ossl_ec_GFp_nist_field_sqr:
  155|  2.98k|{
  156|  2.98k|    int ret = 0;
  157|  2.98k|    BN_CTX *ctx_new = NULL;
  158|       |
  159|  2.98k|    if (!group || !r || !a) {
  ------------------
  |  Branch (159:9): [True: 0, False: 2.98k]
  |  Branch (159:19): [True: 0, False: 2.98k]
  |  Branch (159:25): [True: 0, False: 2.98k]
  ------------------
  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|  2.98k|    if (!ctx)
  ------------------
  |  Branch (163:9): [True: 0, False: 2.98k]
  ------------------
  164|      0|        if ((ctx_new = ctx = BN_CTX_new_ex(group->libctx)) == NULL)
  ------------------
  |  Branch (164:13): [True: 0, False: 0]
  ------------------
  165|      0|            goto err;
  166|       |
  167|  2.98k|    if (!BN_sqr(r, a, ctx))
  ------------------
  |  Branch (167:9): [True: 0, False: 2.98k]
  ------------------
  168|      0|        goto err;
  169|  2.98k|    if (!group->field_mod_func(r, r, group->field, ctx))
  ------------------
  |  Branch (169:9): [True: 0, False: 2.98k]
  ------------------
  170|      0|        goto err;
  171|       |
  172|  2.98k|    ret = 1;
  173|  2.98k| err:
  174|  2.98k|    BN_CTX_free(ctx_new);
  175|  2.98k|    return ret;
  176|  2.98k|}

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

ossl_ec_GFp_nistp384_method:
 1464|    229|{
 1465|    229|    static const EC_METHOD ret = {
 1466|    229|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|    229|#define EC_FLAGS_DEFAULT_OCT    0x1
  ------------------
 1467|    229|        NID_X9_62_prime_field,
  ------------------
  |  |  152|    229|#define NID_X9_62_prime_field           406
  ------------------
 1468|    229|        ossl_ec_GFp_nistp384_group_init,
 1469|    229|        ossl_ec_GFp_simple_group_finish,
 1470|    229|        ossl_ec_GFp_simple_group_clear_finish,
 1471|    229|        ossl_ec_GFp_nist_group_copy,
 1472|    229|        ossl_ec_GFp_nistp384_group_set_curve,
 1473|    229|        ossl_ec_GFp_simple_group_get_curve,
 1474|    229|        ossl_ec_GFp_simple_group_get_degree,
 1475|    229|        ossl_ec_group_simple_order_bits,
 1476|    229|        ossl_ec_GFp_simple_group_check_discriminant,
 1477|    229|        ossl_ec_GFp_simple_point_init,
 1478|    229|        ossl_ec_GFp_simple_point_finish,
 1479|    229|        ossl_ec_GFp_simple_point_clear_finish,
 1480|    229|        ossl_ec_GFp_simple_point_copy,
 1481|    229|        ossl_ec_GFp_simple_point_set_to_infinity,
 1482|    229|        ossl_ec_GFp_simple_point_set_affine_coordinates,
 1483|    229|        ossl_ec_GFp_nistp384_point_get_affine_coordinates,
 1484|    229|        0, /* point_set_compressed_coordinates */
 1485|    229|        0, /* point2oct */
 1486|    229|        0, /* oct2point */
 1487|    229|        ossl_ec_GFp_simple_add,
 1488|    229|        ossl_ec_GFp_simple_dbl,
 1489|    229|        ossl_ec_GFp_simple_invert,
 1490|    229|        ossl_ec_GFp_simple_is_at_infinity,
 1491|    229|        ossl_ec_GFp_simple_is_on_curve,
 1492|    229|        ossl_ec_GFp_simple_cmp,
 1493|    229|        ossl_ec_GFp_simple_make_affine,
 1494|    229|        ossl_ec_GFp_simple_points_make_affine,
 1495|    229|        ossl_ec_GFp_nistp384_points_mul,
 1496|    229|        ossl_ec_GFp_nistp384_precompute_mult,
 1497|    229|        ossl_ec_GFp_nistp384_have_precompute_mult,
 1498|    229|        ossl_ec_GFp_nist_field_mul,
 1499|    229|        ossl_ec_GFp_nist_field_sqr,
 1500|    229|        0, /* field_div */
 1501|    229|        ossl_ec_GFp_simple_field_inv,
 1502|    229|        0, /* field_encode */
 1503|    229|        0, /* field_decode */
 1504|    229|        0, /* field_set_to_one */
 1505|    229|        ossl_ec_key_simple_priv2oct,
 1506|    229|        ossl_ec_key_simple_oct2priv,
 1507|    229|        0, /* set private */
 1508|    229|        ossl_ec_key_simple_generate_key,
 1509|    229|        ossl_ec_key_simple_check_key,
 1510|    229|        ossl_ec_key_simple_generate_public_key,
 1511|    229|        0, /* keycopy */
 1512|    229|        0, /* keyfinish */
 1513|    229|        ossl_ecdh_simple_compute_key,
 1514|    229|        ossl_ecdsa_simple_sign_setup,
 1515|    229|        ossl_ecdsa_simple_sign_sig,
 1516|    229|        ossl_ecdsa_simple_verify_sig,
 1517|    229|        0, /* field_inverse_mod_ord */
 1518|    229|        0, /* blind_coordinates */
 1519|    229|        0, /* ladder_pre */
 1520|    229|        0, /* ladder_step */
 1521|    229|        0  /* ladder_post */
 1522|    229|    };
 1523|       |
 1524|    229|    return &ret;
 1525|    229|}
ossl_ec_GFp_nistp384_group_init:
 1578|    253|{
 1579|    253|    int ret;
 1580|       |
 1581|    253|    ret = ossl_ec_GFp_simple_group_init(group);
 1582|    253|    group->a_is_minus3 = 1;
 1583|    253|    return ret;
 1584|    253|}
ossl_ec_GFp_nistp384_group_set_curve:
 1589|    229|{
 1590|    229|    int ret = 0;
 1591|    229|    BIGNUM *curve_p, *curve_a, *curve_b;
 1592|    229|#ifndef FIPS_MODULE
 1593|    229|    BN_CTX *new_ctx = NULL;
 1594|       |
 1595|    229|    if (ctx == NULL)
  ------------------
  |  Branch (1595:9): [True: 0, False: 229]
  ------------------
 1596|      0|        ctx = new_ctx = BN_CTX_new();
 1597|    229|#endif
 1598|    229|    if (ctx == NULL)
  ------------------
  |  Branch (1598:9): [True: 0, False: 229]
  ------------------
 1599|      0|        return 0;
 1600|       |
 1601|    229|    BN_CTX_start(ctx);
 1602|    229|    curve_p = BN_CTX_get(ctx);
 1603|    229|    curve_a = BN_CTX_get(ctx);
 1604|    229|    curve_b = BN_CTX_get(ctx);
 1605|    229|    if (curve_b == NULL)
  ------------------
  |  Branch (1605:9): [True: 0, False: 229]
  ------------------
 1606|      0|        goto err;
 1607|    229|    BN_bin2bn(nistp384_curve_params[0], sizeof(felem_bytearray), curve_p);
 1608|    229|    BN_bin2bn(nistp384_curve_params[1], sizeof(felem_bytearray), curve_a);
 1609|    229|    BN_bin2bn(nistp384_curve_params[2], sizeof(felem_bytearray), curve_b);
 1610|    229|    if ((BN_cmp(curve_p, p)) || (BN_cmp(curve_a, a)) || (BN_cmp(curve_b, b))) {
  ------------------
  |  Branch (1610:9): [True: 0, False: 229]
  |  Branch (1610:33): [True: 0, False: 229]
  |  Branch (1610:57): [True: 0, False: 229]
  ------------------
 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|    229|    group->field_mod_func = BN_nist_mod_384;
 1615|    229|    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
 1616|    229| err:
 1617|    229|    BN_CTX_end(ctx);
 1618|    229|#ifndef FIPS_MODULE
 1619|    229|    BN_CTX_free(new_ctx);
 1620|    229|#endif
 1621|    229|    return ret;
 1622|    229|}
ossl_ec_GFp_nistp384_point_get_affine_coordinates:
 1632|     97|{
 1633|     97|    felem z1, z2, x_in, y_in, x_out, y_out;
 1634|     97|    widefelem tmp;
 1635|       |
 1636|     97|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (1636:9): [True: 0, False: 97]
  ------------------
 1637|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1638|      0|        return 0;
 1639|      0|    }
 1640|     97|    if ((!BN_to_felem(x_in, point->X)) || (!BN_to_felem(y_in, point->Y)) ||
  ------------------
  |  Branch (1640:9): [True: 0, False: 97]
  |  Branch (1640:43): [True: 0, False: 97]
  ------------------
 1641|     97|        (!BN_to_felem(z1, point->Z)))
  ------------------
  |  Branch (1641:9): [True: 0, False: 97]
  ------------------
 1642|      0|        return 0;
 1643|     97|    felem_inv(z2, z1);
 1644|     97|    felem_square(tmp, z2);
  ------------------
  |  |  723|     97|# define felem_square felem_square_ref
  ------------------
 1645|     97|    felem_reduce(z1, tmp);
 1646|     97|    felem_mul(tmp, x_in, z1);
  ------------------
  |  |  724|     97|# define felem_mul felem_mul_ref
  ------------------
 1647|     97|    felem_reduce(x_in, tmp);
 1648|     97|    felem_contract(x_out, x_in);
 1649|     97|    if (x != NULL) {
  ------------------
  |  Branch (1649:9): [True: 97, False: 0]
  ------------------
 1650|     97|        if (!felem_to_BN(x, x_out)) {
  ------------------
  |  Branch (1650:13): [True: 0, False: 97]
  ------------------
 1651|      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)
  |  |  ------------------
  ------------------
 1652|      0|            return 0;
 1653|      0|        }
 1654|     97|    }
 1655|     97|    felem_mul(tmp, z1, z2);
  ------------------
  |  |  724|     97|# define felem_mul felem_mul_ref
  ------------------
 1656|     97|    felem_reduce(z1, tmp);
 1657|     97|    felem_mul(tmp, y_in, z1);
  ------------------
  |  |  724|     97|# define felem_mul felem_mul_ref
  ------------------
 1658|     97|    felem_reduce(y_in, tmp);
 1659|     97|    felem_contract(y_out, y_in);
 1660|     97|    if (y != NULL) {
  ------------------
  |  Branch (1660:9): [True: 97, False: 0]
  ------------------
 1661|     97|        if (!felem_to_BN(y, y_out)) {
  ------------------
  |  Branch (1661:13): [True: 0, False: 97]
  ------------------
 1662|      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)
  |  |  ------------------
  ------------------
 1663|      0|            return 0;
 1664|      0|        }
 1665|     97|    }
 1666|     97|    return 1;
 1667|     97|}
ossl_ec_GFp_nistp384_points_mul:
 1703|     12|{
 1704|     12|    int ret = 0;
 1705|     12|    int j;
 1706|     12|    int mixed = 0;
 1707|     12|    BIGNUM *x, *y, *z, *tmp_scalar;
 1708|     12|    felem_bytearray g_secret;
 1709|     12|    felem_bytearray *secrets = NULL;
 1710|     12|    felem (*pre_comp)[17][3] = NULL;
 1711|     12|    felem *tmp_felems = NULL;
 1712|     12|    unsigned int i;
 1713|     12|    int num_bytes;
 1714|     12|    int have_pre_comp = 0;
 1715|     12|    size_t num_points = num;
 1716|     12|    felem x_in, y_in, z_in, x_out, y_out, z_out;
 1717|     12|    NISTP384_PRE_COMP *pre = NULL;
 1718|     12|    felem(*g_pre_comp)[3] = NULL;
 1719|     12|    EC_POINT *generator = NULL;
 1720|     12|    const EC_POINT *p = NULL;
 1721|     12|    const BIGNUM *p_scalar = NULL;
 1722|       |
 1723|     12|    BN_CTX_start(ctx);
 1724|     12|    x = BN_CTX_get(ctx);
 1725|     12|    y = BN_CTX_get(ctx);
 1726|     12|    z = BN_CTX_get(ctx);
 1727|     12|    tmp_scalar = BN_CTX_get(ctx);
 1728|     12|    if (tmp_scalar == NULL)
  ------------------
  |  Branch (1728:9): [True: 0, False: 12]
  ------------------
 1729|      0|        goto err;
 1730|       |
 1731|     12|    if (scalar != NULL) {
  ------------------
  |  Branch (1731:9): [True: 12, False: 0]
  ------------------
 1732|     12|        pre = group->pre_comp.nistp384;
 1733|     12|        if (pre)
  ------------------
  |  Branch (1733:13): [True: 0, False: 12]
  ------------------
 1734|       |            /* we have precomputation, try to use it */
 1735|      0|            g_pre_comp = &pre->g_pre_comp[0];
 1736|     12|        else
 1737|       |            /* try to use the standard precomputation */
 1738|     12|            g_pre_comp = (felem(*)[3]) gmul;
 1739|     12|        generator = EC_POINT_new(group);
 1740|     12|        if (generator == NULL)
  ------------------
  |  Branch (1740:13): [True: 0, False: 12]
  ------------------
 1741|      0|            goto err;
 1742|       |        /* get the generator from precomputation */
 1743|     12|        if (!felem_to_BN(x, g_pre_comp[1][0]) ||
  ------------------
  |  Branch (1743:13): [True: 0, False: 12]
  ------------------
 1744|     12|            !felem_to_BN(y, g_pre_comp[1][1]) ||
  ------------------
  |  Branch (1744:13): [True: 0, False: 12]
  ------------------
 1745|     12|            !felem_to_BN(z, g_pre_comp[1][2])) {
  ------------------
  |  Branch (1745:13): [True: 0, False: 12]
  ------------------
 1746|      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)
  |  |  ------------------
  ------------------
 1747|      0|            goto err;
 1748|      0|        }
 1749|     12|        if (!ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group,
  ------------------
  |  Branch (1749:13): [True: 0, False: 12]
  ------------------
 1750|     12|                                                                generator,
 1751|     12|                                                                x, y, z, ctx))
 1752|      0|            goto err;
 1753|     12|        if (0 == EC_POINT_cmp(group, generator, group->generator, ctx))
  ------------------
  |  Branch (1753:13): [True: 12, False: 0]
  ------------------
 1754|       |            /* precomputation matches generator */
 1755|     12|            have_pre_comp = 1;
 1756|      0|        else
 1757|       |            /*
 1758|       |             * we don't have valid precomputation: treat the generator as a
 1759|       |             * random point
 1760|       |             */
 1761|      0|            num_points++;
 1762|     12|    }
 1763|       |
 1764|     12|    if (num_points > 0) {
  ------------------
  |  Branch (1764:9): [True: 0, False: 12]
  ------------------
 1765|      0|        if (num_points >= 2) {
  ------------------
  |  Branch (1765:13): [True: 0, False: 0]
  ------------------
 1766|       |            /*
 1767|       |             * unless we precompute multiples for just one point, converting
 1768|       |             * those into affine form is time well spent
 1769|       |             */
 1770|      0|            mixed = 1;
 1771|      0|        }
 1772|      0|        secrets = OPENSSL_zalloc(sizeof(*secrets) * num_points);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
 1773|      0|        pre_comp = OPENSSL_zalloc(sizeof(*pre_comp) * num_points);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
 1774|      0|        if (mixed)
  ------------------
  |  Branch (1774:13): [True: 0, False: 0]
  ------------------
 1775|      0|            tmp_felems =
 1776|      0|                OPENSSL_malloc(sizeof(*tmp_felems) * (num_points * 17 + 1));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
 1777|      0|        if ((secrets == NULL) || (pre_comp == NULL)
  ------------------
  |  Branch (1777:13): [True: 0, False: 0]
  |  Branch (1777:34): [True: 0, False: 0]
  ------------------
 1778|      0|            || (mixed && (tmp_felems == NULL)))
  ------------------
  |  Branch (1778:17): [True: 0, False: 0]
  |  Branch (1778:26): [True: 0, False: 0]
  ------------------
 1779|      0|            goto err;
 1780|       |
 1781|       |        /*
 1782|       |         * we treat NULL scalars as 0, and NULL points as points at infinity,
 1783|       |         * i.e., they contribute nothing to the linear combination
 1784|       |         */
 1785|      0|        for (i = 0; i < num_points; ++i) {
  ------------------
  |  Branch (1785:21): [True: 0, False: 0]
  ------------------
 1786|      0|            if (i == num) {
  ------------------
  |  Branch (1786:17): [True: 0, False: 0]
  ------------------
 1787|       |                /*
 1788|       |                 * we didn't have a valid precomputation, so we pick the
 1789|       |                 * generator
 1790|       |                 */
 1791|      0|                p = EC_GROUP_get0_generator(group);
 1792|      0|                p_scalar = scalar;
 1793|      0|            } else {
 1794|       |                /* the i^th point */
 1795|      0|                p = points[i];
 1796|      0|                p_scalar = scalars[i];
 1797|      0|            }
 1798|      0|            if (p_scalar != NULL && p != NULL) {
  ------------------
  |  Branch (1798:17): [True: 0, False: 0]
  |  Branch (1798:37): [True: 0, False: 0]
  ------------------
 1799|       |                /* reduce scalar to 0 <= scalar < 2^384 */
 1800|      0|                if ((BN_num_bits(p_scalar) > 384)
  ------------------
  |  Branch (1800:21): [True: 0, False: 0]
  ------------------
 1801|      0|                    || (BN_is_negative(p_scalar))) {
  ------------------
  |  Branch (1801:24): [True: 0, False: 0]
  ------------------
 1802|       |                    /*
 1803|       |                     * this is an unusual input, and we don't guarantee
 1804|       |                     * constant-timeness
 1805|       |                     */
 1806|      0|                    if (!BN_nnmod(tmp_scalar, p_scalar, group->order, ctx)) {
  ------------------
  |  Branch (1806:25): [True: 0, False: 0]
  ------------------
 1807|      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)
  |  |  ------------------
  ------------------
 1808|      0|                        goto err;
 1809|      0|                    }
 1810|      0|                    num_bytes = BN_bn2lebinpad(tmp_scalar,
 1811|      0|                                               secrets[i], sizeof(secrets[i]));
 1812|      0|                } else {
 1813|      0|                    num_bytes = BN_bn2lebinpad(p_scalar,
 1814|      0|                                               secrets[i], sizeof(secrets[i]));
 1815|      0|                }
 1816|      0|                if (num_bytes < 0) {
  ------------------
  |  Branch (1816:21): [True: 0, False: 0]
  ------------------
 1817|      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)
  |  |  ------------------
  ------------------
 1818|      0|                    goto err;
 1819|      0|                }
 1820|       |                /* precompute multiples */
 1821|      0|                if ((!BN_to_felem(x_out, p->X)) ||
  ------------------
  |  Branch (1821:21): [True: 0, False: 0]
  ------------------
 1822|      0|                    (!BN_to_felem(y_out, p->Y)) ||
  ------------------
  |  Branch (1822:21): [True: 0, False: 0]
  ------------------
 1823|      0|                    (!BN_to_felem(z_out, p->Z)))
  ------------------
  |  Branch (1823:21): [True: 0, False: 0]
  ------------------
 1824|      0|                    goto err;
 1825|      0|                memcpy(pre_comp[i][1][0], x_out, sizeof(felem));
 1826|      0|                memcpy(pre_comp[i][1][1], y_out, sizeof(felem));
 1827|      0|                memcpy(pre_comp[i][1][2], z_out, sizeof(felem));
 1828|      0|                for (j = 2; j <= 16; ++j) {
  ------------------
  |  Branch (1828:29): [True: 0, False: 0]
  ------------------
 1829|      0|                    if (j & 1) {
  ------------------
  |  Branch (1829:25): [True: 0, False: 0]
  ------------------
 1830|      0|                        point_add(pre_comp[i][j][0],     pre_comp[i][j][1],     pre_comp[i][j][2],
 1831|      0|                                  pre_comp[i][1][0],     pre_comp[i][1][1],     pre_comp[i][1][2], 0,
 1832|      0|                                  pre_comp[i][j - 1][0], pre_comp[i][j - 1][1], pre_comp[i][j - 1][2]);
 1833|      0|                    } else {
 1834|      0|                        point_double(pre_comp[i][j][0],     pre_comp[i][j][1],     pre_comp[i][j][2],
 1835|      0|                                     pre_comp[i][j / 2][0], pre_comp[i][j / 2][1], pre_comp[i][j / 2][2]);
 1836|      0|                    }
 1837|      0|                }
 1838|      0|            }
 1839|      0|        }
 1840|      0|        if (mixed)
  ------------------
  |  Branch (1840:13): [True: 0, False: 0]
  ------------------
 1841|      0|            make_points_affine(num_points * 17, pre_comp[0], tmp_felems);
 1842|      0|    }
 1843|       |
 1844|       |    /* the scalar for the generator */
 1845|     12|    if (scalar != NULL && have_pre_comp) {
  ------------------
  |  Branch (1845:9): [True: 12, False: 0]
  |  Branch (1845:27): [True: 12, False: 0]
  ------------------
 1846|     12|        memset(g_secret, 0, sizeof(g_secret));
 1847|       |        /* reduce scalar to 0 <= scalar < 2^384 */
 1848|     12|        if ((BN_num_bits(scalar) > 384) || (BN_is_negative(scalar))) {
  ------------------
  |  Branch (1848:13): [True: 3, False: 9]
  |  Branch (1848:44): [True: 0, False: 9]
  ------------------
 1849|       |            /*
 1850|       |             * this is an unusual input, and we don't guarantee
 1851|       |             * constant-timeness
 1852|       |             */
 1853|      3|            if (!BN_nnmod(tmp_scalar, scalar, group->order, ctx)) {
  ------------------
  |  Branch (1853:17): [True: 0, False: 3]
  ------------------
 1854|      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)
  |  |  ------------------
  ------------------
 1855|      0|                goto err;
 1856|      0|            }
 1857|      3|            num_bytes = BN_bn2lebinpad(tmp_scalar, g_secret, sizeof(g_secret));
 1858|      9|        } else {
 1859|      9|            num_bytes = BN_bn2lebinpad(scalar, g_secret, sizeof(g_secret));
 1860|      9|        }
 1861|       |        /* do the multiplication with generator precomputation */
 1862|     12|        batch_mul(x_out, y_out, z_out,
 1863|     12|                  (const felem_bytearray(*))secrets, num_points,
 1864|     12|                  g_secret,
 1865|     12|                  mixed, (const felem(*)[17][3])pre_comp,
 1866|     12|                  (const felem(*)[3])g_pre_comp);
 1867|     12|    } else {
 1868|       |        /* do the multiplication without generator precomputation */
 1869|      0|        batch_mul(x_out, y_out, z_out,
 1870|      0|                  (const felem_bytearray(*))secrets, num_points,
 1871|      0|                  NULL, mixed, (const felem(*)[17][3])pre_comp, NULL);
 1872|      0|    }
 1873|       |    /* reduce the output to its unique minimal representation */
 1874|     12|    felem_contract(x_in, x_out);
 1875|     12|    felem_contract(y_in, y_out);
 1876|     12|    felem_contract(z_in, z_out);
 1877|     12|    if ((!felem_to_BN(x, x_in)) || (!felem_to_BN(y, y_in)) ||
  ------------------
  |  Branch (1877:9): [True: 0, False: 12]
  |  Branch (1877:36): [True: 0, False: 12]
  ------------------
 1878|     12|        (!felem_to_BN(z, z_in))) {
  ------------------
  |  Branch (1878:9): [True: 0, False: 12]
  ------------------
 1879|      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)
  |  |  ------------------
  ------------------
 1880|      0|        goto err;
 1881|      0|    }
 1882|     12|    ret = ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group, r, x, y, z,
 1883|     12|                                                             ctx);
 1884|       |
 1885|     12| err:
 1886|     12|    BN_CTX_end(ctx);
 1887|     12|    EC_POINT_free(generator);
 1888|     12|    OPENSSL_free(secrets);
  ------------------
  |  |  115|     12|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1889|     12|    OPENSSL_free(pre_comp);
  ------------------
  |  |  115|     12|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1890|     12|    OPENSSL_free(tmp_felems);
  ------------------
  |  |  115|     12|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1891|     12|    return ret;
 1892|     12|}
ecp_nistp384.c:BN_to_felem:
  142|    291|{
  143|    291|    felem_bytearray b_out;
  144|    291|    int num_bytes;
  145|       |
  146|    291|    if (BN_is_negative(bn)) {
  ------------------
  |  Branch (146:9): [True: 0, False: 291]
  ------------------
  147|      0|        ERR_raise(ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|        return 0;
  149|      0|    }
  150|    291|    num_bytes = BN_bn2lebinpad(bn, b_out, sizeof(b_out));
  151|    291|    if (num_bytes < 0) {
  ------------------
  |  Branch (151:9): [True: 0, False: 291]
  ------------------
  152|      0|        ERR_raise(ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|    291|    bin48_to_felem(out, b_out);
  156|    291|    return 1;
  157|    291|}
ecp_nistp384.c:bin48_to_felem:
  117|    291|{
  118|    291|    memset(out, 0, 56);
  119|    291|    out[0] = (*((limb *) & in[0])) & bottom56bits;
  120|    291|    out[1] = (*((limb_aX *) & in[7])) & bottom56bits;
  121|    291|    out[2] = (*((limb_aX *) & in[14])) & bottom56bits;
  122|    291|    out[3] = (*((limb_aX *) & in[21])) & bottom56bits;
  123|    291|    out[4] = (*((limb_aX *) & in[28])) & bottom56bits;
  124|    291|    out[5] = (*((limb_aX *) & in[35])) & bottom56bits;
  125|    291|    memmove(&out[6], &in[42], 6);
  126|    291|}
ecp_nistp384.c:felem_inv:
  752|     97|{
  753|     97|    felem ftmp, ftmp2, ftmp3, ftmp4, ftmp5, ftmp6;
  754|     97|    unsigned int i = 0;
  755|       |
  756|     97|    felem_square_reduce(ftmp, in);      /* 2^1 */
  757|     97|    felem_mul_reduce(ftmp, ftmp, in);   /* 2^1 + 2^0 */
  758|     97|    felem_assign(ftmp2, ftmp);
  759|       |
  760|     97|    felem_square_reduce(ftmp, ftmp);    /* 2^2 + 2^1 */
  761|     97|    felem_mul_reduce(ftmp, ftmp, in);   /* 2^2 + 2^1 * 2^0 */
  762|     97|    felem_assign(ftmp3, ftmp);
  763|       |
  764|    388|    for (i = 0; i < 3; i++)
  ------------------
  |  Branch (764:17): [True: 291, False: 97]
  ------------------
  765|    291|        felem_square_reduce(ftmp, ftmp); /* 2^5 + 2^4 + 2^3 */
  766|     97|    felem_mul_reduce(ftmp, ftmp3, ftmp); /* 2^5 + 2^4 + 2^3 + 2^2 + 2^1 + 2^0 */
  767|     97|    felem_assign(ftmp4, ftmp);
  768|       |
  769|    679|    for (i = 0; i < 6; i++)
  ------------------
  |  Branch (769:17): [True: 582, False: 97]
  ------------------
  770|    582|        felem_square_reduce(ftmp, ftmp); /* 2^11 + ... + 2^6 */
  771|     97|    felem_mul_reduce(ftmp, ftmp4, ftmp); /* 2^11 + ... + 2^0 */
  772|       |
  773|    388|    for (i = 0; i < 3; i++)
  ------------------
  |  Branch (773:17): [True: 291, False: 97]
  ------------------
  774|    291|        felem_square_reduce(ftmp, ftmp); /* 2^14 + ... + 2^3 */
  775|     97|    felem_mul_reduce(ftmp, ftmp3, ftmp); /* 2^14 + ... + 2^0 */
  776|     97|    felem_assign(ftmp5, ftmp);
  777|       |
  778|  1.55k|    for (i = 0; i < 15; i++)
  ------------------
  |  Branch (778:17): [True: 1.45k, False: 97]
  ------------------
  779|  1.45k|        felem_square_reduce(ftmp, ftmp); /* 2^29 + ... + 2^15 */
  780|     97|    felem_mul_reduce(ftmp, ftmp5, ftmp); /* 2^29 + ... + 2^0 */
  781|     97|    felem_assign(ftmp6, ftmp);
  782|       |
  783|  3.00k|    for (i = 0; i < 30; i++)
  ------------------
  |  Branch (783:17): [True: 2.91k, False: 97]
  ------------------
  784|  2.91k|        felem_square_reduce(ftmp, ftmp); /* 2^59 + ... + 2^30 */
  785|     97|    felem_mul_reduce(ftmp, ftmp6, ftmp); /* 2^59 + ... + 2^0 */
  786|     97|    felem_assign(ftmp4, ftmp);
  787|       |
  788|  5.91k|    for (i = 0; i < 60; i++)
  ------------------
  |  Branch (788:17): [True: 5.82k, False: 97]
  ------------------
  789|  5.82k|        felem_square_reduce(ftmp, ftmp); /* 2^119 + ... + 2^60 */
  790|     97|    felem_mul_reduce(ftmp, ftmp4, ftmp); /* 2^119 + ... + 2^0 */
  791|     97|    felem_assign(ftmp4, ftmp);
  792|       |
  793|  11.7k|    for (i = 0; i < 120; i++)
  ------------------
  |  Branch (793:17): [True: 11.6k, False: 97]
  ------------------
  794|  11.6k|      felem_square_reduce(ftmp, ftmp);   /* 2^239 + ... + 2^120 */
  795|     97|    felem_mul_reduce(ftmp, ftmp4, ftmp); /* 2^239 + ... + 2^0 */
  796|       |
  797|  1.55k|    for (i = 0; i < 15; i++)
  ------------------
  |  Branch (797:17): [True: 1.45k, False: 97]
  ------------------
  798|  1.45k|        felem_square_reduce(ftmp, ftmp); /* 2^254 + ... + 2^15 */
  799|     97|    felem_mul_reduce(ftmp, ftmp5, ftmp); /* 2^254 + ... + 2^0 */
  800|       |
  801|  3.10k|    for (i = 0; i < 31; i++)
  ------------------
  |  Branch (801:17): [True: 3.00k, False: 97]
  ------------------
  802|  3.00k|        felem_square_reduce(ftmp, ftmp); /* 2^285 + ... + 2^31 */
  803|     97|    felem_mul_reduce(ftmp, ftmp6, ftmp); /* 2^285 + ... + 2^31 + 2^29 + ... + 2^0 */
  804|       |
  805|    291|    for (i = 0; i < 2; i++)
  ------------------
  |  Branch (805:17): [True: 194, False: 97]
  ------------------
  806|    194|        felem_square_reduce(ftmp, ftmp); /* 2^287 + ... + 2^33 + 2^31 + ... + 2^2 */
  807|     97|    felem_mul_reduce(ftmp, ftmp2, ftmp); /* 2^287 + ... + 2^33 + 2^31 + ... + 2^0 */
  808|       |
  809|  9.21k|    for (i = 0; i < 94; i++)
  ------------------
  |  Branch (809:17): [True: 9.11k, False: 97]
  ------------------
  810|  9.11k|        felem_square_reduce(ftmp, ftmp); /* 2^381 + ... + 2^127 + 2^125 + ... + 2^94 */
  811|     97|    felem_mul_reduce(ftmp, ftmp6, ftmp); /* 2^381 + ... + 2^127 + 2^125 + ... + 2^94 + 2^29 + ... + 2^0 */
  812|       |
  813|    291|    for (i = 0; i < 2; i++)
  ------------------
  |  Branch (813:17): [True: 194, False: 97]
  ------------------
  814|    194|        felem_square_reduce(ftmp, ftmp); /* 2^383 + ... + 2^129 + 2^127 + ... + 2^96 + 2^31 + ... + 2^2 */
  815|     97|    felem_mul_reduce(ftmp, in, ftmp);    /* 2^383 + ... + 2^129 + 2^127 + ... + 2^96 + 2^31 + ... + 2^2 + 2^0 */
  816|       |
  817|     97|    memcpy(out, ftmp, sizeof(felem));
  818|     97|}
ecp_nistp384.c:felem_square_reduce:
  728|  41.8k|{
  729|  41.8k|    widefelem tmp;
  730|       |
  731|  41.8k|    felem_square(tmp, in);
  ------------------
  |  |  723|  41.8k|# define felem_square felem_square_ref
  ------------------
  732|  41.8k|    felem_reduce(out, tmp);
  733|  41.8k|}
ecp_nistp384.c:felem_mul_reduce:
  736|  8.41k|{
  737|  8.41k|    widefelem tmp;
  738|       |
  739|  8.41k|    felem_mul(tmp, in1, in2);
  ------------------
  |  |  724|  8.41k|# define felem_mul felem_mul_ref
  ------------------
  740|  8.41k|    felem_reduce(out, tmp);
  741|  8.41k|}
ecp_nistp384.c:felem_assign:
  180|  13.6k|{
  181|  13.6k|    memcpy(out, in, sizeof(felem));
  182|  13.6k|}
ecp_nistp384.c:felem_square_ref:
  374|  46.6k|{
  375|  46.6k|    felem inx2;
  376|  46.6k|    felem_scalar(inx2, in, 2);
  377|       |
  378|  46.6k|    out[0] = ((uint128_t) in[0]) * in[0];
  379|       |
  380|  46.6k|    out[1] = ((uint128_t) in[0]) * inx2[1];
  381|       |
  382|  46.6k|    out[2] = ((uint128_t) in[0]) * inx2[2]
  383|  46.6k|           + ((uint128_t) in[1]) * in[1];
  384|       |
  385|  46.6k|    out[3] = ((uint128_t) in[0]) * inx2[3]
  386|  46.6k|           + ((uint128_t) in[1]) * inx2[2];
  387|       |
  388|  46.6k|    out[4] = ((uint128_t) in[0]) * inx2[4]
  389|  46.6k|           + ((uint128_t) in[1]) * inx2[3]
  390|  46.6k|           + ((uint128_t) in[2]) * in[2];
  391|       |
  392|  46.6k|    out[5] = ((uint128_t) in[0]) * inx2[5]
  393|  46.6k|           + ((uint128_t) in[1]) * inx2[4]
  394|  46.6k|           + ((uint128_t) in[2]) * inx2[3];
  395|       |
  396|  46.6k|    out[6] = ((uint128_t) in[0]) * inx2[6]
  397|  46.6k|           + ((uint128_t) in[1]) * inx2[5]
  398|  46.6k|           + ((uint128_t) in[2]) * inx2[4]
  399|  46.6k|           + ((uint128_t) in[3]) * in[3];
  400|       |
  401|  46.6k|    out[7] = ((uint128_t) in[1]) * inx2[6]
  402|  46.6k|           + ((uint128_t) in[2]) * inx2[5]
  403|  46.6k|           + ((uint128_t) in[3]) * inx2[4];
  404|       |
  405|  46.6k|    out[8] = ((uint128_t) in[2]) * inx2[6]
  406|  46.6k|           + ((uint128_t) in[3]) * inx2[5]
  407|  46.6k|           + ((uint128_t) in[4]) * in[4];
  408|       |
  409|  46.6k|    out[9] = ((uint128_t) in[3]) * inx2[6]
  410|  46.6k|           + ((uint128_t) in[4]) * inx2[5];
  411|       |
  412|  46.6k|    out[10] = ((uint128_t) in[4]) * inx2[6]
  413|  46.6k|            + ((uint128_t) in[5]) * in[5];
  414|       |
  415|  46.6k|    out[11] = ((uint128_t) in[5]) * inx2[6];
  416|       |
  417|  46.6k|    out[12] = ((uint128_t) in[6]) * in[6];
  418|  46.6k|}
ecp_nistp384.c:felem_scalar:
  195|  47.8k|{
  196|  47.8k|    unsigned int i;
  197|       |
  198|   382k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|   382k|#define NLIMBS 7
  ------------------
  |  Branch (198:17): [True: 334k, False: 47.8k]
  ------------------
  199|   334k|        out[i] = in[i] * scalar;
  200|  47.8k|}
ecp_nistp384.c:felem_reduce:
  507|  58.8k|{
  508|       |    /*
  509|       |     * In order to prevent underflow, we add a multiple of p before subtracting.
  510|       |     * Use telescopic sums to represent 2^76 * p redundantly with each limb
  511|       |     * of the form 2^124 + ...
  512|       |     */
  513|  58.8k|    static const widelimb two124m68 = (((widelimb) 1) << 124)
  514|  58.8k|                                    - (((widelimb) 1) << 68);
  515|  58.8k|    static const widelimb two124m116m68 = (((widelimb) 1) << 124)
  516|  58.8k|                                        - (((widelimb) 1) << 116)
  517|  58.8k|                                        - (((widelimb) 1) << 68);
  518|  58.8k|    static const widelimb two124p108m76 = (((widelimb) 1) << 124)
  519|  58.8k|                                        + (((widelimb) 1) << 108)
  520|  58.8k|                                        - (((widelimb) 1) << 76);
  521|  58.8k|    static const widelimb two124m92m68 = (((widelimb) 1) << 124)
  522|  58.8k|                                       - (((widelimb) 1) << 92)
  523|  58.8k|                                       - (((widelimb) 1) << 68);
  524|  58.8k|    widelimb temp, acc[9];
  525|  58.8k|    unsigned int i;
  526|       |
  527|  58.8k|    memcpy(acc, in, sizeof(widelimb) * 9);
  528|       |
  529|  58.8k|    acc[0] += two124p108m76;
  530|  58.8k|    acc[1] += two124m116m68;
  531|  58.8k|    acc[2] += two124m92m68;
  532|  58.8k|    acc[3] += two124m68;
  533|  58.8k|    acc[4] += two124m68;
  534|  58.8k|    acc[5] += two124m68;
  535|  58.8k|    acc[6] += two124m68;
  536|       |
  537|       |    /* [1]: Eliminate in[9], ..., in[12] */
  538|  58.8k|    acc[8] += in[12] >> 32;
  539|  58.8k|    acc[7] += (in[12] & 0xffffffff) << 24;
  540|  58.8k|    acc[7] += in[12] >> 8;
  541|  58.8k|    acc[6] += (in[12] & 0xff) << 48;
  542|  58.8k|    acc[6] -= in[12] >> 16;
  543|  58.8k|    acc[5] -= (in[12] & 0xffff) << 40;
  544|  58.8k|    acc[6] += in[12] >> 48;
  545|  58.8k|    acc[5] += (in[12] & 0xffffffffffff) << 8;
  546|       |
  547|  58.8k|    acc[7] += in[11] >> 32;
  548|  58.8k|    acc[6] += (in[11] & 0xffffffff) << 24;
  549|  58.8k|    acc[6] += in[11] >> 8;
  550|  58.8k|    acc[5] += (in[11] & 0xff) << 48;
  551|  58.8k|    acc[5] -= in[11] >> 16;
  552|  58.8k|    acc[4] -= (in[11] & 0xffff) << 40;
  553|  58.8k|    acc[5] += in[11] >> 48;
  554|  58.8k|    acc[4] += (in[11] & 0xffffffffffff) << 8;
  555|       |
  556|  58.8k|    acc[6] += in[10] >> 32;
  557|  58.8k|    acc[5] += (in[10] & 0xffffffff) << 24;
  558|  58.8k|    acc[5] += in[10] >> 8;
  559|  58.8k|    acc[4] += (in[10] & 0xff) << 48;
  560|  58.8k|    acc[4] -= in[10] >> 16;
  561|  58.8k|    acc[3] -= (in[10] & 0xffff) << 40;
  562|  58.8k|    acc[4] += in[10] >> 48;
  563|  58.8k|    acc[3] += (in[10] & 0xffffffffffff) << 8;
  564|       |
  565|  58.8k|    acc[5] += in[9] >> 32;
  566|  58.8k|    acc[4] += (in[9] & 0xffffffff) << 24;
  567|  58.8k|    acc[4] += in[9] >> 8;
  568|  58.8k|    acc[3] += (in[9] & 0xff) << 48;
  569|  58.8k|    acc[3] -= in[9] >> 16;
  570|  58.8k|    acc[2] -= (in[9] & 0xffff) << 40;
  571|  58.8k|    acc[3] += in[9] >> 48;
  572|  58.8k|    acc[2] += (in[9] & 0xffffffffffff) << 8;
  573|       |
  574|       |    /*
  575|       |     * [2]: Eliminate acc[7], acc[8], that is the 7 and eighth limbs, as
  576|       |     * well as the contributions made from eliminating higher limbs.
  577|       |     * acc[7] < in[7] + 2^120 + 2^56 < in[7] + 2^121
  578|       |     * acc[8] < in[8] + 2^96
  579|       |     */
  580|  58.8k|    acc[4] += acc[8] >> 32;
  581|  58.8k|    acc[3] += (acc[8] & 0xffffffff) << 24;
  582|  58.8k|    acc[3] += acc[8] >> 8;
  583|  58.8k|    acc[2] += (acc[8] & 0xff) << 48;
  584|  58.8k|    acc[2] -= acc[8] >> 16;
  585|  58.8k|    acc[1] -= (acc[8] & 0xffff) << 40;
  586|  58.8k|    acc[2] += acc[8] >> 48;
  587|  58.8k|    acc[1] += (acc[8] & 0xffffffffffff) << 8;
  588|       |
  589|  58.8k|    acc[3] += acc[7] >> 32;
  590|  58.8k|    acc[2] += (acc[7] & 0xffffffff) << 24;
  591|  58.8k|    acc[2] += acc[7] >> 8;
  592|  58.8k|    acc[1] += (acc[7] & 0xff) << 48;
  593|  58.8k|    acc[1] -= acc[7] >> 16;
  594|  58.8k|    acc[0] -= (acc[7] & 0xffff) << 40;
  595|  58.8k|    acc[1] += acc[7] >> 48;
  596|  58.8k|    acc[0] += (acc[7] & 0xffffffffffff) << 8;
  597|       |
  598|       |    /*-
  599|       |     * acc[k] < in[k] + 2^124 + 2^121
  600|       |     *        < in[k] + 2^125
  601|       |     *        < 2^128, for k <= 6
  602|       |     */
  603|       |
  604|       |    /*
  605|       |     * Carry 4 -> 5 -> 6
  606|       |     * This has the effect of ensuring that these more significant limbs
  607|       |     * will be small in value after eliminating high bits from acc[6].
  608|       |     */
  609|  58.8k|    acc[5] += acc[4] >> 56;
  610|  58.8k|    acc[4] &= 0x00ffffffffffffff;
  611|       |
  612|  58.8k|    acc[6] += acc[5] >> 56;
  613|  58.8k|    acc[5] &= 0x00ffffffffffffff;
  614|       |
  615|       |    /*-
  616|       |     * acc[6] < in[6] + 2^124 + 2^121 + 2^72 + 2^16
  617|       |     *        < in[6] + 2^125
  618|       |     *        < 2^128
  619|       |     */
  620|       |
  621|       |    /* [3]: Eliminate high bits of acc[6] */
  622|  58.8k|    temp = acc[6] >> 48;
  623|  58.8k|    acc[6] &= 0x0000ffffffffffff;
  624|       |
  625|       |    /* temp < 2^80 */
  626|       |
  627|  58.8k|    acc[3] += temp >> 40;
  628|  58.8k|    acc[2] += (temp & 0xffffffffff) << 16;
  629|  58.8k|    acc[2] += temp >> 16;
  630|  58.8k|    acc[1] += (temp & 0xffff) << 40;
  631|  58.8k|    acc[1] -= temp >> 24;
  632|  58.8k|    acc[0] -= (temp & 0xffffff) << 32;
  633|  58.8k|    acc[0] += temp;
  634|       |
  635|       |    /*-
  636|       |     * acc[k] < acc_old[k] + 2^64 + 2^56
  637|       |     *        < in[k] + 2^124 + 2^121 + 2^72 + 2^64 + 2^56 + 2^16 , k < 4
  638|       |     */
  639|       |
  640|       |    /* Carry 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 */
  641|  58.8k|    acc[1] += acc[0] >> 56;   /* acc[1] < acc_old[1] + 2^72 */
  642|  58.8k|    acc[0] &= 0x00ffffffffffffff;
  643|       |
  644|  58.8k|    acc[2] += acc[1] >> 56;   /* acc[2] < acc_old[2] + 2^72 + 2^16 */
  645|  58.8k|    acc[1] &= 0x00ffffffffffffff;
  646|       |
  647|  58.8k|    acc[3] += acc[2] >> 56;   /* acc[3] < acc_old[3] + 2^72 + 2^16 */
  648|  58.8k|    acc[2] &= 0x00ffffffffffffff;
  649|       |
  650|       |    /*-
  651|       |     * acc[k] < acc_old[k] + 2^72 + 2^16
  652|       |     *        < in[k] + 2^124 + 2^121 + 2^73 + 2^64 + 2^56 + 2^17
  653|       |     *        < in[k] + 2^125
  654|       |     *        < 2^128 , k < 4
  655|       |     */
  656|       |
  657|  58.8k|    acc[4] += acc[3] >> 56;   /*-
  658|       |                               * acc[4] < acc_old[4] + 2^72 + 2^16
  659|       |                               *        < 2^72 + 2^56 + 2^16
  660|       |                               */
  661|  58.8k|    acc[3] &= 0x00ffffffffffffff;
  662|       |
  663|  58.8k|    acc[5] += acc[4] >> 56;   /*-
  664|       |                               * acc[5] < acc_old[5] + 2^16 + 1
  665|       |                               *        < 2^56 + 2^16 + 1
  666|       |                               */
  667|  58.8k|    acc[4] &= 0x00ffffffffffffff;
  668|       |
  669|  58.8k|    acc[6] += acc[5] >> 56;   /* acc[6] < 2^48 + 1 <= 2^48 */
  670|  58.8k|    acc[5] &= 0x00ffffffffffffff;
  671|       |
  672|   471k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|   471k|#define NLIMBS 7
  ------------------
  |  Branch (672:17): [True: 412k, False: 58.8k]
  ------------------
  673|   412k|        out[i] = acc[i];
  674|  58.8k|}
ecp_nistp384.c:felem_mul_ref:
  421|  14.5k|{
  422|  14.5k|    out[0] = ((uint128_t) in1[0]) * in2[0];
  423|       |
  424|  14.5k|    out[1] = ((uint128_t) in1[0]) * in2[1]
  425|  14.5k|           + ((uint128_t) in1[1]) * in2[0];
  426|       |
  427|  14.5k|    out[2] = ((uint128_t) in1[0]) * in2[2]
  428|  14.5k|           + ((uint128_t) in1[1]) * in2[1]
  429|  14.5k|           + ((uint128_t) in1[2]) * in2[0];
  430|       |
  431|  14.5k|    out[3] = ((uint128_t) in1[0]) * in2[3]
  432|  14.5k|           + ((uint128_t) in1[1]) * in2[2]
  433|  14.5k|           + ((uint128_t) in1[2]) * in2[1]
  434|  14.5k|           + ((uint128_t) in1[3]) * in2[0];
  435|       |
  436|  14.5k|    out[4] = ((uint128_t) in1[0]) * in2[4]
  437|  14.5k|           + ((uint128_t) in1[1]) * in2[3]
  438|  14.5k|           + ((uint128_t) in1[2]) * in2[2]
  439|  14.5k|           + ((uint128_t) in1[3]) * in2[1]
  440|  14.5k|           + ((uint128_t) in1[4]) * in2[0];
  441|       |
  442|  14.5k|    out[5] = ((uint128_t) in1[0]) * in2[5]
  443|  14.5k|           + ((uint128_t) in1[1]) * in2[4]
  444|  14.5k|           + ((uint128_t) in1[2]) * in2[3]
  445|  14.5k|           + ((uint128_t) in1[3]) * in2[2]
  446|  14.5k|           + ((uint128_t) in1[4]) * in2[1]
  447|  14.5k|           + ((uint128_t) in1[5]) * in2[0];
  448|       |
  449|  14.5k|    out[6] = ((uint128_t) in1[0]) * in2[6]
  450|  14.5k|           + ((uint128_t) in1[1]) * in2[5]
  451|  14.5k|           + ((uint128_t) in1[2]) * in2[4]
  452|  14.5k|           + ((uint128_t) in1[3]) * in2[3]
  453|  14.5k|           + ((uint128_t) in1[4]) * in2[2]
  454|  14.5k|           + ((uint128_t) in1[5]) * in2[1]
  455|  14.5k|           + ((uint128_t) in1[6]) * in2[0];
  456|       |
  457|  14.5k|    out[7] = ((uint128_t) in1[1]) * in2[6]
  458|  14.5k|           + ((uint128_t) in1[2]) * in2[5]
  459|  14.5k|           + ((uint128_t) in1[3]) * in2[4]
  460|  14.5k|           + ((uint128_t) in1[4]) * in2[3]
  461|  14.5k|           + ((uint128_t) in1[5]) * in2[2]
  462|  14.5k|           + ((uint128_t) in1[6]) * in2[1];
  463|       |
  464|  14.5k|    out[8] = ((uint128_t) in1[2]) * in2[6]
  465|  14.5k|           + ((uint128_t) in1[3]) * in2[5]
  466|  14.5k|           + ((uint128_t) in1[4]) * in2[4]
  467|  14.5k|           + ((uint128_t) in1[5]) * in2[3]
  468|  14.5k|           + ((uint128_t) in1[6]) * in2[2];
  469|       |
  470|  14.5k|    out[9] = ((uint128_t) in1[3]) * in2[6]
  471|  14.5k|           + ((uint128_t) in1[4]) * in2[5]
  472|  14.5k|           + ((uint128_t) in1[5]) * in2[4]
  473|  14.5k|           + ((uint128_t) in1[6]) * in2[3];
  474|       |
  475|  14.5k|    out[10] = ((uint128_t) in1[4]) * in2[6]
  476|  14.5k|            + ((uint128_t) in1[5]) * in2[5]
  477|  14.5k|            + ((uint128_t) in1[6]) * in2[4];
  478|       |
  479|  14.5k|    out[11] = ((uint128_t) in1[5]) * in2[6]
  480|  14.5k|            + ((uint128_t) in1[6]) * in2[5];
  481|       |
  482|  14.5k|    out[12] = ((uint128_t) in1[6]) * in2[6];
  483|  14.5k|}
ecp_nistp384.c:felem_contract:
  856|    230|{
  857|    230|    static const int64_t two56 = ((limb) 1) << 56;
  858|       |
  859|       |    /*
  860|       |     * We know for a fact that 0 <= |in| < 2*p, for p = 2^384 - 2^128 - 2^96 + 2^32 - 1
  861|       |     * Perform two successive, idempotent subtractions to reduce if |in| >= p.
  862|       |     */
  863|       |
  864|    230|    int64_t tmp[NLIMBS], cond[5], a;
  865|    230|    unsigned int i;
  866|       |
  867|    230|    memcpy(tmp, in, sizeof(felem));
  868|       |
  869|       |    /* Case 1: a = 1 iff |in| >= 2^384 */
  870|    230|    a = (in[6] >> 48);
  871|    230|    tmp[0] += a;
  872|    230|    tmp[0] -= a << 32;
  873|    230|    tmp[1] += a << 40;
  874|    230|    tmp[2] += a << 16;
  875|    230|    tmp[6] &= 0x0000ffffffffffff;
  876|       |
  877|       |    /*
  878|       |     * eliminate negative coefficients: if tmp[0] is negative, tmp[1] must be
  879|       |     * non-zero, so we only need one step
  880|       |     */
  881|       |
  882|    230|    a = tmp[0] >> 63;
  883|    230|    tmp[0] += a & two56;
  884|    230|    tmp[1] -= a & 1;
  885|       |
  886|       |    /* Carry 1 -> 2 -> 3 -> 4 -> 5 -> 6 */
  887|    230|    tmp[2] += tmp[1] >> 56;
  888|    230|    tmp[1] &= 0x00ffffffffffffff;
  889|       |
  890|    230|    tmp[3] += tmp[2] >> 56;
  891|    230|    tmp[2] &= 0x00ffffffffffffff;
  892|       |
  893|    230|    tmp[4] += tmp[3] >> 56;
  894|    230|    tmp[3] &= 0x00ffffffffffffff;
  895|       |
  896|    230|    tmp[5] += tmp[4] >> 56;
  897|    230|    tmp[4] &= 0x00ffffffffffffff;
  898|       |
  899|    230|    tmp[6] += tmp[5] >> 56; /* tmp[6] < 2^48 */
  900|    230|    tmp[5] &= 0x00ffffffffffffff;
  901|       |
  902|       |    /*
  903|       |     * Case 2: a = all ones if p <= |in| < 2^384, 0 otherwise
  904|       |     */
  905|       |
  906|       |    /* 0 iff (2^129..2^383) are all one */
  907|    230|    cond[0] = ((tmp[6] | 0xff000000000000) & tmp[5] & tmp[4] & tmp[3] & (tmp[2] | 0x0000000001ffff)) + 1;
  908|       |    /* 0 iff 2^128 bit is one */
  909|    230|    cond[1] = (tmp[2] | ~0x00000000010000) + 1;
  910|       |    /* 0 iff (2^96..2^127) bits are all one */
  911|    230|    cond[2] = ((tmp[2] | 0xffffffffff0000) & (tmp[1] | 0x0000ffffffffff)) + 1;
  912|       |    /* 0 iff (2^32..2^95) bits are all zero */
  913|    230|    cond[3] = (tmp[1] & ~0xffff0000000000) | (tmp[0] & ~((int64_t) 0x000000ffffffff));
  914|       |    /* 0 iff (2^0..2^31) bits are all one */
  915|    230|    cond[4] = (tmp[0] | 0xffffff00000000) + 1;
  916|       |
  917|       |    /*
  918|       |     * In effect, invert our conditions, so that 0 values become all 1's,
  919|       |     * any non-zero value in the low-order 56 bits becomes all 0's
  920|       |     */
  921|  1.38k|    for (i = 0; i < 5; i++)
  ------------------
  |  Branch (921:17): [True: 1.15k, False: 230]
  ------------------
  922|  1.15k|       cond[i] = ((cond[i] & 0x00ffffffffffffff) - 1) >> 63;
  923|       |
  924|       |    /*
  925|       |     * The condition for determining whether in is greater than our
  926|       |     * prime is given by the following condition.
  927|       |     */
  928|       |
  929|       |    /* First subtract 2^384 - 2^129 cheaply */
  930|    230|    a = cond[0] & (cond[1] | (cond[2] & (~cond[3] | cond[4])));
  931|    230|    tmp[6] &= ~a;
  932|    230|    tmp[5] &= ~a;
  933|    230|    tmp[4] &= ~a;
  934|    230|    tmp[3] &= ~a;
  935|    230|    tmp[2] &= ~a | 0x0000000001ffff;
  936|       |
  937|       |    /*
  938|       |     * Subtract 2^128 - 2^96 by
  939|       |     * means of disjoint cases.
  940|       |     */
  941|       |
  942|       |    /* subtract 2^128 if that bit is present, and add 2^96 */
  943|    230|    a = cond[0] & cond[1];
  944|    230|    tmp[2] &= ~a | 0xfffffffffeffff;
  945|    230|    tmp[1] += a & ((int64_t) 1 << 40);
  946|       |
  947|       |    /* otherwise, clear bits 2^127 .. 2^96  */
  948|    230|    a = cond[0] & ~cond[1] & (cond[2] & (~cond[3] | cond[4]));
  949|    230|    tmp[2] &= ~a | 0xffffffffff0000;
  950|    230|    tmp[1] &= ~a | 0x0000ffffffffff;
  951|       |
  952|       |    /* finally, subtract the last 2^32 - 1 */
  953|    230|    a = cond[0] & (cond[1] | (cond[2] & (~cond[3] | cond[4])));
  954|    230|    tmp[0] += a & (-((int64_t) 1 << 32) + 1);
  955|       |
  956|       |    /*
  957|       |     * eliminate negative coefficients: if tmp[0] is negative, tmp[1] must be
  958|       |     * non-zero, so we only need one step
  959|       |     */
  960|    230|    a = tmp[0] >> 63;
  961|    230|    tmp[0] += a & two56;
  962|    230|    tmp[1] -= a & 1;
  963|       |
  964|       |    /* Carry 1 -> 2 -> 3 -> 4 -> 5 -> 6 */
  965|    230|    tmp[2] += tmp[1] >> 56;
  966|    230|    tmp[1] &= 0x00ffffffffffffff;
  967|       |
  968|    230|    tmp[3] += tmp[2] >> 56;
  969|    230|    tmp[2] &= 0x00ffffffffffffff;
  970|       |
  971|    230|    tmp[4] += tmp[3] >> 56;
  972|    230|    tmp[3] &= 0x00ffffffffffffff;
  973|       |
  974|    230|    tmp[5] += tmp[4] >> 56;
  975|    230|    tmp[4] &= 0x00ffffffffffffff;
  976|       |
  977|    230|    tmp[6] += tmp[5] >> 56;
  978|    230|    tmp[5] &= 0x00ffffffffffffff;
  979|       |
  980|    230|    memcpy(out, tmp, sizeof(felem));
  981|    230|}
ecp_nistp384.c:felem_to_BN:
  161|    266|{
  162|    266|    felem_bytearray b_out;
  163|       |
  164|    266|    felem_to_bin48(b_out, in);
  165|    266|    return BN_lebin2bn(b_out, sizeof(b_out), out);
  166|    266|}
ecp_nistp384.c:felem_to_bin48:
  129|    266|{
  130|    266|    memset(out, 0, 48);
  131|    266|    (*((limb *) & out[0]))     |= (in[0] & bottom56bits);
  132|    266|    (*((limb_aX *) & out[7]))  |= (in[1] & bottom56bits);
  133|    266|    (*((limb_aX *) & out[14])) |= (in[2] & bottom56bits);
  134|    266|    (*((limb_aX *) & out[21])) |= (in[3] & bottom56bits);
  135|    266|    (*((limb_aX *) & out[28])) |= (in[4] & bottom56bits);
  136|    266|    (*((limb_aX *) & out[35])) |= (in[5] & bottom56bits);
  137|    266|    memmove(&out[42], &in[6], 6);
  138|    266|}
ecp_nistp384.c:point_add:
 1075|  1.17k|{
 1076|  1.17k|    felem ftmp, ftmp2, ftmp3, ftmp4, ftmp5, ftmp6, x_out, y_out, z_out;
 1077|  1.17k|    widefelem tmp, tmp2;
 1078|  1.17k|    limb x_equal, y_equal, z1_is_zero, z2_is_zero;
 1079|  1.17k|    limb points_equal;
 1080|       |
 1081|  1.17k|    z1_is_zero = felem_is_zero(z1);
 1082|  1.17k|    z2_is_zero = felem_is_zero(z2);
 1083|       |
 1084|       |    /* ftmp = z1z1 = z1**2 */
 1085|  1.17k|    felem_square_reduce(ftmp, z1);      /* ftmp[i] < 2^56 */
 1086|       |
 1087|  1.17k|    if (!mixed) {
  ------------------
  |  Branch (1087:9): [True: 0, False: 1.17k]
  ------------------
 1088|       |        /* ftmp2 = z2z2 = z2**2 */
 1089|      0|        felem_square_reduce(ftmp2, z2); /* ftmp2[i] < 2^56 */
 1090|       |
 1091|       |        /* u1 = ftmp3 = x1*z2z2 */
 1092|      0|        felem_mul_reduce(ftmp3, x1, ftmp2); /* ftmp3[i] < 2^56 */
 1093|       |
 1094|       |        /* ftmp5 = z1 + z2 */
 1095|      0|        felem_assign(ftmp5, z1);       /* ftmp5[i] < 2^56 */
 1096|      0|        felem_sum64(ftmp5, z2);        /* ftmp5[i] < 2^57 */
 1097|       |
 1098|       |        /* ftmp5 = (z1 + z2)**2 - z1z1 - z2z2 = 2*z1z2 */
 1099|      0|        felem_square(tmp, ftmp5);      /* tmp[i] < 2^117 */
  ------------------
  |  |  723|      0|# define felem_square felem_square_ref
  ------------------
 1100|      0|        felem_diff_128_64(tmp, ftmp);  /* tmp[i] < 2^117 + 2^64 + 2^48 */
 1101|      0|        felem_diff_128_64(tmp, ftmp2); /* tmp[i] < 2^117 + 2^65 + 2^49 */
 1102|      0|        felem_reduce(ftmp5, tmp);      /* ftmp5[i] < 2^56 */
 1103|       |
 1104|       |        /* ftmp2 = z2 * z2z2 */
 1105|      0|        felem_mul_reduce(ftmp2, ftmp2, z2); /* ftmp2[i] < 2^56 */
 1106|       |
 1107|       |        /* s1 = ftmp6 = y1 * z2**3 */
 1108|      0|        felem_mul_reduce(ftmp6, y1, ftmp2); /* ftmp6[i] < 2^56 */
 1109|  1.17k|    } else {
 1110|       |        /*
 1111|       |         * We'll assume z2 = 1 (special case z2 = 0 is handled later)
 1112|       |         */
 1113|       |
 1114|       |        /* u1 = ftmp3 = x1*z2z2 */
 1115|  1.17k|        felem_assign(ftmp3, x1);     /* ftmp3[i] < 2^56 */
 1116|       |
 1117|       |        /* ftmp5 = 2*z1z2 */
 1118|  1.17k|        felem_scalar(ftmp5, z1, 2);  /* ftmp5[i] < 2^57 */
 1119|       |
 1120|       |        /* s1 = ftmp6 = y1 * z2**3 */
 1121|  1.17k|        felem_assign(ftmp6, y1);     /* ftmp6[i] < 2^56 */
 1122|  1.17k|    }
 1123|       |    /* ftmp3[i] < 2^56, ftmp5[i] < 2^57, ftmp6[i] < 2^56 */
 1124|       |
 1125|       |    /* u2 = x2*z1z1 */
 1126|  1.17k|    felem_mul(tmp, x2, ftmp);        /* tmp[i] < 2^115 */
  ------------------
  |  |  724|  1.17k|# define felem_mul felem_mul_ref
  ------------------
 1127|       |
 1128|       |    /* h = ftmp4 = u2 - u1 */
 1129|  1.17k|    felem_diff_128_64(tmp, ftmp3);   /* tmp[i] < 2^115 + 2^64 + 2^48 */
 1130|  1.17k|    felem_reduce(ftmp4, tmp);        /* ftmp[4] < 2^56 */
 1131|       |
 1132|  1.17k|    x_equal = felem_is_zero(ftmp4);
 1133|       |
 1134|       |    /* z_out = ftmp5 * h */
 1135|  1.17k|    felem_mul_reduce(z_out, ftmp5, ftmp4);  /* z_out[i] < 2^56 */
 1136|       |
 1137|       |    /* ftmp = z1 * z1z1 */
 1138|  1.17k|    felem_mul_reduce(ftmp, ftmp, z1);  /* ftmp[i] < 2^56 */
 1139|       |
 1140|       |    /* s2 = tmp = y2 * z1**3 */
 1141|  1.17k|    felem_mul(tmp, y2, ftmp);      /* tmp[i] < 2^115 */
  ------------------
  |  |  724|  1.17k|# define felem_mul felem_mul_ref
  ------------------
 1142|       |
 1143|       |    /* r = ftmp5 = (s2 - s1)*2 */
 1144|  1.17k|    felem_diff_128_64(tmp, ftmp6); /* tmp[i] < 2^115 + 2^64 + 2^48 */
 1145|  1.17k|    felem_reduce(ftmp5, tmp);      /* ftmp5[i] < 2^56 */
 1146|  1.17k|    y_equal = felem_is_zero(ftmp5);
 1147|  1.17k|    felem_scalar64(ftmp5, 2);      /* ftmp5[i] < 2^57 */
 1148|       |
 1149|       |    /*
 1150|       |     * The formulae are incorrect if the points are equal, in affine coordinates
 1151|       |     * (X_1, Y_1) == (X_2, Y_2), so we check for this and do doubling if this
 1152|       |     * happens.
 1153|       |     *
 1154|       |     * We use bitwise operations to avoid potential side-channels introduced by
 1155|       |     * the short-circuiting behaviour of boolean operators.
 1156|       |     *
 1157|       |     * The special case of either point being the point at infinity (z1 and/or
 1158|       |     * z2 are zero), is handled separately later on in this function, so we
 1159|       |     * avoid jumping to point_double here in those special cases.
 1160|       |     *
 1161|       |     * Notice the comment below on the implications of this branching for timing
 1162|       |     * leaks and why it is considered practically irrelevant.
 1163|       |     */
 1164|  1.17k|    points_equal = (x_equal & y_equal & (~z1_is_zero) & (~z2_is_zero));
 1165|       |
 1166|  1.17k|    if (points_equal) {
  ------------------
  |  Branch (1166:9): [True: 0, False: 1.17k]
  ------------------
 1167|       |        /*
 1168|       |         * This is obviously not constant-time but it will almost-never happen
 1169|       |         * for ECDH / ECDSA.
 1170|       |         */
 1171|      0|        point_double(x3, y3, z3, x1, y1, z1);
 1172|      0|        return;
 1173|      0|    }
 1174|       |
 1175|       |    /* I = ftmp = (2h)**2 */
 1176|  1.17k|    felem_assign(ftmp, ftmp4);        /* ftmp[i] < 2^56 */
 1177|  1.17k|    felem_scalar64(ftmp, 2);          /* ftmp[i] < 2^57 */
 1178|  1.17k|    felem_square_reduce(ftmp, ftmp);  /* ftmp[i] < 2^56 */
 1179|       |
 1180|       |    /* J = ftmp2 = h * I */
 1181|  1.17k|    felem_mul_reduce(ftmp2, ftmp4, ftmp); /* ftmp2[i] < 2^56 */
 1182|       |
 1183|       |    /* V = ftmp4 = U1 * I */
 1184|  1.17k|    felem_mul_reduce(ftmp4, ftmp3, ftmp); /* ftmp4[i] < 2^56 */
 1185|       |
 1186|       |    /* x_out = r**2 - J - 2V */
 1187|  1.17k|    felem_square(tmp, ftmp5);      /* tmp[i] < 2^117 */
  ------------------
  |  |  723|  1.17k|# define felem_square felem_square_ref
  ------------------
 1188|  1.17k|    felem_diff_128_64(tmp, ftmp2); /* tmp[i] < 2^117 + 2^64 + 2^48 */
 1189|  1.17k|    felem_assign(ftmp3, ftmp4);    /* ftmp3[i] < 2^56 */
 1190|  1.17k|    felem_scalar64(ftmp4, 2);      /* ftmp4[i] < 2^57 */
 1191|  1.17k|    felem_diff_128_64(tmp, ftmp4); /* tmp[i] < 2^117 + 2^65 + 2^49 */
 1192|  1.17k|    felem_reduce(x_out, tmp);      /* x_out[i] < 2^56 */
 1193|       |
 1194|       |    /* y_out = r(V-x_out) - 2 * s1 * J */
 1195|  1.17k|    felem_diff64(ftmp3, x_out);    /* ftmp3[i] < 2^60 + 2^56 + 2^44 */
 1196|  1.17k|    felem_mul(tmp, ftmp5, ftmp3);  /* tmp[i] < 2^116 */
  ------------------
  |  |  724|  1.17k|# define felem_mul felem_mul_ref
  ------------------
 1197|  1.17k|    felem_mul(tmp2, ftmp6, ftmp2); /* tmp2[i] < 2^115 */
  ------------------
  |  |  724|  1.17k|# define felem_mul felem_mul_ref
  ------------------
 1198|  1.17k|    felem_scalar128(tmp2, 2);      /* tmp2[i] < 2^116 */
 1199|  1.17k|    felem_diff128(tmp, tmp2);      /* tmp[i] < 2^127 + 2^116 + 2^111 */
 1200|  1.17k|    felem_reduce(y_out, tmp);      /* y_out[i] < 2^56 */
 1201|       |
 1202|  1.17k|    copy_conditional(x_out, x2, z1_is_zero);
 1203|  1.17k|    copy_conditional(x_out, x1, z2_is_zero);
 1204|  1.17k|    copy_conditional(y_out, y2, z1_is_zero);
 1205|  1.17k|    copy_conditional(y_out, y1, z2_is_zero);
 1206|  1.17k|    copy_conditional(z_out, z2, z1_is_zero);
 1207|  1.17k|    copy_conditional(z_out, z1, z2_is_zero);
 1208|  1.17k|    felem_assign(x3, x_out);
 1209|  1.17k|    felem_assign(y3, y_out);
 1210|  1.17k|    felem_assign(z3, z_out);
 1211|  1.17k|}
ecp_nistp384.c:felem_is_zero:
  829|  4.70k|{
  830|  4.70k|    limb zero, p384;
  831|       |
  832|  4.70k|    zero = in[0] | in[1] | in[2] | in[3] | in[4] | in[5] | in[6];
  833|  4.70k|    zero = ((int64_t) (zero) - 1) >> 63;
  834|  4.70k|    p384 = (in[0] ^ 0x000000ffffffff) | (in[1] ^ 0xffff0000000000)
  835|  4.70k|         | (in[2] ^ 0xfffffffffeffff) | (in[3] ^ 0xffffffffffffff)
  836|  4.70k|         | (in[4] ^ 0xffffffffffffff) | (in[5] ^ 0xffffffffffffff)
  837|  4.70k|         | (in[6] ^ 0xffffffffffff);
  838|  4.70k|    p384 = ((int64_t) (p384) - 1) >> 63;
  839|       |
  840|  4.70k|    return (zero | p384);
  841|  4.70k|}
ecp_nistp384.c:felem_sum64:
  186|  3.52k|{
  187|  3.52k|    unsigned int i;
  188|       |
  189|  28.2k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|  28.2k|#define NLIMBS 7
  ------------------
  |  Branch (189:17): [True: 24.6k, False: 3.52k]
  ------------------
  190|  24.6k|        out[i] += in[i];
  191|  3.52k|}
ecp_nistp384.c:felem_diff_128_64:
  296|  7.05k|{
  297|       |    /*
  298|       |     * In order to prevent underflow, we add a multiple of p before subtracting.
  299|       |     * Use telescopic sums to represent 2^16 * p redundantly with each limb
  300|       |     * of the form 2^64 + ...
  301|       |     */
  302|       |
  303|  7.05k|    static const widelimb two64m56m8 = (((widelimb) 1) << 64)
  304|  7.05k|                                     - (((widelimb) 1) << 56)
  305|  7.05k|                                     - (((widelimb) 1) << 8);
  306|  7.05k|    static const widelimb two64m32m8 = (((widelimb) 1) << 64)
  307|  7.05k|                                     - (((widelimb) 1) << 32)
  308|  7.05k|                                     - (((widelimb) 1) << 8);
  309|  7.05k|    static const widelimb two64m8 = (((widelimb) 1) << 64)
  310|  7.05k|                                  - (((widelimb) 1) << 8);
  311|  7.05k|    static const widelimb two64p48m16 = (((widelimb) 1) << 64)
  312|  7.05k|                                      + (((widelimb) 1) << 48)
  313|  7.05k|                                      - (((widelimb) 1) << 16);
  314|  7.05k|    unsigned int i;
  315|       |
  316|  7.05k|    out[0] += two64p48m16;
  317|  7.05k|    out[1] += two64m56m8;
  318|  7.05k|    out[2] += two64m32m8;
  319|  7.05k|    out[3] += two64m8;
  320|  7.05k|    out[4] += two64m8;
  321|  7.05k|    out[5] += two64m8;
  322|  7.05k|    out[6] += two64m8;
  323|       |
  324|  56.4k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|  56.4k|#define NLIMBS 7
  ------------------
  |  Branch (324:17): [True: 49.3k, False: 7.05k]
  ------------------
  325|  49.3k|        out[i] -= in[i];
  326|  7.05k|}
ecp_nistp384.c:felem_scalar64:
  204|  7.05k|{
  205|  7.05k|    unsigned int i;
  206|       |
  207|  56.4k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|  56.4k|#define NLIMBS 7
  ------------------
  |  Branch (207:17): [True: 49.3k, False: 7.05k]
  ------------------
  208|  49.3k|        out[i] *= scalar;
  209|  7.05k|}
ecp_nistp384.c:felem_diff64:
  263|  3.52k|{
  264|       |    /*
  265|       |     * In order to prevent underflow, we add a multiple of p before subtracting.
  266|       |     * Use telescopic sums to represent 2^12 * p redundantly with each limb
  267|       |     * of the form 2^60 + ...
  268|       |     */
  269|       |
  270|  3.52k|    static const limb two60m52m4 = (((limb) 1) << 60)
  271|  3.52k|                                 - (((limb) 1) << 52)
  272|  3.52k|                                 - (((limb) 1) << 4);
  273|  3.52k|    static const limb two60p44m12 = (((limb) 1) << 60)
  274|  3.52k|                                  + (((limb) 1) << 44)
  275|  3.52k|                                  - (((limb) 1) << 12);
  276|  3.52k|    static const limb two60m28m4 = (((limb) 1) << 60)
  277|  3.52k|                                 - (((limb) 1) << 28)
  278|  3.52k|                                 - (((limb) 1) << 4);
  279|  3.52k|    static const limb two60m4 = (((limb) 1) << 60)
  280|  3.52k|                              - (((limb) 1) << 4);
  281|       |
  282|  3.52k|    out[0] += two60p44m12 - in[0];
  283|  3.52k|    out[1] += two60m52m4 - in[1];
  284|  3.52k|    out[2] += two60m28m4 - in[2];
  285|  3.52k|    out[3] += two60m4 - in[3];
  286|  3.52k|    out[4] += two60m4 - in[4];
  287|  3.52k|    out[5] += two60m4 - in[5];
  288|  3.52k|    out[6] += two60m4 - in[6];
  289|  3.52k|}
ecp_nistp384.c:felem_scalar128:
  213|  2.35k|{
  214|  2.35k|    unsigned int i;
  215|       |
  216|  32.9k|    for (i = 0; i < 2*NLIMBS-1; i++)
  ------------------
  |  |  105|  32.9k|#define NLIMBS 7
  ------------------
  |  Branch (216:17): [True: 30.5k, False: 2.35k]
  ------------------
  217|  30.5k|        out[i] *= scalar;
  218|  2.35k|}
ecp_nistp384.c:felem_diff128:
  333|  2.35k|{
  334|       |    /*
  335|       |     * In order to prevent underflow, we add a multiple of p before subtracting.
  336|       |     * Use telescopic sums to represent 2^415 * p redundantly with each limb
  337|       |     * of the form 2^127 + ...
  338|       |     */
  339|       |
  340|  2.35k|    static const widelimb two127 = ((widelimb) 1) << 127;
  341|  2.35k|    static const widelimb two127m71 = (((widelimb) 1) << 127)
  342|  2.35k|                                    - (((widelimb) 1) << 71);
  343|  2.35k|    static const widelimb two127p111m79m71 = (((widelimb) 1) << 127)
  344|  2.35k|                                           + (((widelimb) 1) << 111)
  345|  2.35k|                                           - (((widelimb) 1) << 79)
  346|  2.35k|                                           - (((widelimb) 1) << 71);
  347|  2.35k|    static const widelimb two127m119m71 = (((widelimb) 1) << 127)
  348|  2.35k|                                        - (((widelimb) 1) << 119)
  349|  2.35k|                                        - (((widelimb) 1) << 71);
  350|  2.35k|    static const widelimb two127m95m71 = (((widelimb) 1) << 127)
  351|  2.35k|                                       - (((widelimb) 1) << 95)
  352|  2.35k|                                       - (((widelimb) 1) << 71);
  353|  2.35k|    unsigned int i;
  354|       |
  355|  2.35k|    out[0]  += two127;
  356|  2.35k|    out[1]  += two127m71;
  357|  2.35k|    out[2]  += two127m71;
  358|  2.35k|    out[3]  += two127m71;
  359|  2.35k|    out[4]  += two127m71;
  360|  2.35k|    out[5]  += two127m71;
  361|  2.35k|    out[6]  += two127p111m79m71;
  362|  2.35k|    out[7]  += two127m119m71;
  363|  2.35k|    out[8]  += two127m95m71;
  364|  2.35k|    out[9]  += two127m71;
  365|  2.35k|    out[10] += two127m71;
  366|  2.35k|    out[11] += two127m71;
  367|  2.35k|    out[12] += two127m71;
  368|       |
  369|  32.9k|    for (i = 0; i < 2*NLIMBS-1; i++)
  ------------------
  |  |  105|  32.9k|#define NLIMBS 7
  ------------------
  |  Branch (369:17): [True: 30.5k, False: 2.35k]
  ------------------
  370|  30.5k|        out[i] -= in[i];
  371|  2.35k|}
ecp_nistp384.c:copy_conditional:
 1053|  7.05k|{
 1054|  7.05k|    unsigned int i;
 1055|       |
 1056|  56.4k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|  56.4k|#define NLIMBS 7
  ------------------
  |  Branch (1056:17): [True: 49.3k, False: 7.05k]
  ------------------
 1057|  49.3k|        out[i] ^= mask & (in[i] ^ out[i]);
 1058|  7.05k|}
ecp_nistp384.c:point_double:
 1004|  1.17k|{
 1005|  1.17k|    widefelem tmp, tmp2;
 1006|  1.17k|    felem delta, gamma, beta, alpha, ftmp, ftmp2;
 1007|       |
 1008|  1.17k|    felem_assign(ftmp, x_in);
 1009|  1.17k|    felem_assign(ftmp2, x_in);
 1010|       |
 1011|       |    /* delta = z^2 */
 1012|  1.17k|    felem_square_reduce(delta, z_in);     /* delta[i] < 2^56 */
 1013|       |
 1014|       |    /* gamma = y^2 */
 1015|  1.17k|    felem_square_reduce(gamma, y_in);     /* gamma[i] < 2^56 */
 1016|       |
 1017|       |    /* beta = x*gamma */
 1018|  1.17k|    felem_mul_reduce(beta, x_in, gamma);  /* beta[i] < 2^56 */
 1019|       |
 1020|       |    /* alpha = 3*(x-delta)*(x+delta) */
 1021|  1.17k|    felem_diff64(ftmp, delta);            /* ftmp[i] < 2^60 + 2^58 + 2^44 */
 1022|  1.17k|    felem_sum64(ftmp2, delta);            /* ftmp2[i] < 2^59 */
 1023|  1.17k|    felem_scalar64(ftmp2, 3);             /* ftmp2[i] < 2^61 */
 1024|  1.17k|    felem_mul_reduce(alpha, ftmp, ftmp2); /* alpha[i] < 2^56 */
 1025|       |
 1026|       |    /* x' = alpha^2 - 8*beta */
 1027|  1.17k|    felem_square(tmp, alpha);             /* tmp[i] < 2^115 */
  ------------------
  |  |  723|  1.17k|# define felem_square felem_square_ref
  ------------------
 1028|  1.17k|    felem_assign(ftmp, beta);             /* ftmp[i] < 2^56 */
 1029|  1.17k|    felem_scalar64(ftmp, 8);              /* ftmp[i] < 2^59 */
 1030|  1.17k|    felem_diff_128_64(tmp, ftmp);         /* tmp[i] < 2^115 + 2^64 + 2^48 */
 1031|  1.17k|    felem_reduce(x_out, tmp);             /* x_out[i] < 2^56 */
 1032|       |
 1033|       |    /* z' = (y + z)^2 - gamma - delta */
 1034|  1.17k|    felem_sum64(delta, gamma);     /* delta[i] < 2^57 */
 1035|  1.17k|    felem_assign(ftmp, y_in);      /* ftmp[i] < 2^56 */
 1036|  1.17k|    felem_sum64(ftmp, z_in);       /* ftmp[i] < 2^56 */
 1037|  1.17k|    felem_square(tmp, ftmp);       /* tmp[i] < 2^115 */
  ------------------
  |  |  723|  1.17k|# define felem_square felem_square_ref
  ------------------
 1038|  1.17k|    felem_diff_128_64(tmp, delta); /* tmp[i] < 2^115 + 2^64 + 2^48 */
 1039|  1.17k|    felem_reduce(z_out, tmp);      /* z_out[i] < 2^56 */
 1040|       |
 1041|       |    /* y' = alpha*(4*beta - x') - 8*gamma^2 */
 1042|  1.17k|    felem_scalar64(beta, 4);       /* beta[i] < 2^58 */
 1043|  1.17k|    felem_diff64(beta, x_out);     /* beta[i] < 2^60 + 2^58 + 2^44 */
 1044|  1.17k|    felem_mul(tmp, alpha, beta);   /* tmp[i] < 2^119 */
  ------------------
  |  |  724|  1.17k|# define felem_mul felem_mul_ref
  ------------------
 1045|  1.17k|    felem_square(tmp2, gamma);     /* tmp2[i] < 2^115 */
  ------------------
  |  |  723|  1.17k|# define felem_square felem_square_ref
  ------------------
 1046|  1.17k|    felem_scalar128(tmp2, 8);      /* tmp2[i] < 2^118 */
 1047|  1.17k|    felem_diff128(tmp, tmp2);      /* tmp[i] < 2^127 + 2^119 + 2^111 */
 1048|  1.17k|    felem_reduce(y_out, tmp);      /* tmp[i] < 2^56 */
 1049|  1.17k|}
ecp_nistp384.c:batch_mul:
 1378|     12|{
 1379|     12|    int i, skip;
 1380|     12|    unsigned int num, gen_mul = (g_scalar != NULL);
 1381|     12|    felem nq[3], tmp[4];
 1382|     12|    limb bits;
 1383|     12|    u8 sign, digit;
 1384|       |
 1385|       |    /* set nq to the point at infinity */
 1386|     12|    memset(nq, 0, sizeof(nq));
 1387|       |
 1388|       |    /*
 1389|       |     * Loop over all scalars msb-to-lsb, interleaving additions of multiples
 1390|       |     * of the generator (last quarter of rounds) and additions of other
 1391|       |     * points multiples (every 5th round).
 1392|       |     */
 1393|     12|    skip = 1;                   /* save two point operations in the first
 1394|       |                                 * round */
 1395|  1.20k|    for (i = (num_points ? 380 : 98); i >= 0; --i) {
  ------------------
  |  Branch (1395:15): [True: 0, False: 12]
  |  Branch (1395:39): [True: 1.18k, False: 12]
  ------------------
 1396|       |        /* double */
 1397|  1.18k|        if (!skip)
  ------------------
  |  Branch (1397:13): [True: 1.17k, False: 12]
  ------------------
 1398|  1.17k|            point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]);
 1399|       |
 1400|       |        /* add multiples of the generator */
 1401|  1.18k|        if (gen_mul && (i <= 98)) {
  ------------------
  |  Branch (1401:13): [True: 1.18k, False: 0]
  |  Branch (1401:24): [True: 1.18k, False: 0]
  ------------------
 1402|  1.18k|            bits = get_bit(g_scalar, i + 285) << 3;
 1403|  1.18k|            if (i < 95) {
  ------------------
  |  Branch (1403:17): [True: 1.14k, False: 48]
  ------------------
 1404|  1.14k|                bits |= get_bit(g_scalar, i + 190) << 2;
 1405|  1.14k|                bits |= get_bit(g_scalar, i + 95) << 1;
 1406|  1.14k|                bits |= get_bit(g_scalar, i);
 1407|  1.14k|            }
 1408|       |            /* select the point to add, in constant time */
 1409|  1.18k|            select_point(bits, 16, g_pre_comp, tmp);
 1410|  1.18k|            if (!skip) {
  ------------------
  |  Branch (1410:17): [True: 1.17k, False: 12]
  ------------------
 1411|       |                /* The 1 argument below is for "mixed" */
 1412|  1.17k|                point_add(nq[0],  nq[1],  nq[2],
 1413|  1.17k|                          nq[0],  nq[1],  nq[2], 1,
 1414|  1.17k|                          tmp[0], tmp[1], tmp[2]);
 1415|  1.17k|            } else {
 1416|     12|                memcpy(nq, tmp, 3 * sizeof(felem));
 1417|     12|                skip = 0;
 1418|     12|            }
 1419|  1.18k|        }
 1420|       |
 1421|       |        /* do other additions every 5 doublings */
 1422|  1.18k|        if (num_points && (i % 5 == 0)) {
  ------------------
  |  Branch (1422:13): [True: 0, False: 1.18k]
  |  Branch (1422:27): [True: 0, False: 0]
  ------------------
 1423|       |            /* loop over all scalars */
 1424|      0|            for (num = 0; num < num_points; ++num) {
  ------------------
  |  Branch (1424:27): [True: 0, False: 0]
  ------------------
 1425|      0|                bits = get_bit(scalars[num], i + 4) << 5;
 1426|      0|                bits |= get_bit(scalars[num], i + 3) << 4;
 1427|      0|                bits |= get_bit(scalars[num], i + 2) << 3;
 1428|      0|                bits |= get_bit(scalars[num], i + 1) << 2;
 1429|      0|                bits |= get_bit(scalars[num], i) << 1;
 1430|      0|                bits |= get_bit(scalars[num], i - 1);
 1431|      0|                ossl_ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits);
 1432|       |
 1433|       |                /*
 1434|       |                 * select the point to add or subtract, in constant time
 1435|       |                 */
 1436|      0|                select_point(digit, 17, pre_comp[num], tmp);
 1437|      0|                felem_neg(tmp[3], tmp[1]); /* (X, -Y, Z) is the negative
 1438|       |                                            * point */
 1439|      0|                copy_conditional(tmp[1], tmp[3], (-(limb) sign));
 1440|       |
 1441|      0|                if (!skip) {
  ------------------
  |  Branch (1441:21): [True: 0, False: 0]
  ------------------
 1442|      0|                    point_add(nq[0],  nq[1],  nq[2],
 1443|      0|                              nq[0],  nq[1],  nq[2], mixed,
 1444|      0|                              tmp[0], tmp[1], tmp[2]);
 1445|      0|                } else {
 1446|      0|                    memcpy(nq, tmp, 3 * sizeof(felem));
 1447|      0|                    skip = 0;
 1448|      0|                }
 1449|      0|            }
 1450|      0|        }
 1451|  1.18k|    }
 1452|     12|    felem_assign(x_out, nq[0]);
 1453|     12|    felem_assign(y_out, nq[1]);
 1454|     12|    felem_assign(z_out, nq[2]);
 1455|     12|}
ecp_nistp384.c:get_bit:
 1360|  4.60k|{
 1361|  4.60k|    if (i < 0 || i >= 384)
  ------------------
  |  Branch (1361:9): [True: 0, False: 4.60k]
  |  Branch (1361:18): [True: 0, False: 4.60k]
  ------------------
 1362|      0|        return 0;
 1363|  4.60k|    return (in[i >> 3] >> (i & 7)) & 1;
 1364|  4.60k|}
ecp_nistp384.c:select_point:
 1338|  1.18k|{
 1339|  1.18k|    unsigned int i, j;
 1340|  1.18k|    limb *outlimbs = &out[0][0];
 1341|       |
 1342|  1.18k|    memset(out, 0, sizeof(*out) * 3);
 1343|       |
 1344|  20.1k|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (1344:17): [True: 19.0k, False: 1.18k]
  ------------------
 1345|  19.0k|        const limb *inlimbs = &pre_comp[i][0][0];
 1346|  19.0k|        limb mask = i ^ idx;
 1347|       |
 1348|  19.0k|        mask |= mask >> 4;
 1349|  19.0k|        mask |= mask >> 2;
 1350|  19.0k|        mask |= mask >> 1;
 1351|  19.0k|        mask &= 1;
 1352|  19.0k|        mask--;
 1353|   418k|        for (j = 0; j < NLIMBS * 3; j++)
  ------------------
  |  |  105|   418k|#define NLIMBS 7
  ------------------
  |  Branch (1353:21): [True: 399k, False: 19.0k]
  ------------------
 1354|   399k|            outlimbs[j] |= inlimbs[j] & mask;
 1355|  19.0k|    }
 1356|  1.18k|}

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

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

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

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

ossl_ecx_public_from_private:
   29|     12|{
   30|     12|    switch (key->type) {
  ------------------
  |  Branch (30:13): [True: 0, False: 12]
  ------------------
   31|      3|    case ECX_KEY_TYPE_X25519:
  ------------------
  |  Branch (31:5): [True: 3, False: 9]
  ------------------
   32|      3|        ossl_x25519_public_from_private(key->pubkey, key->privkey);
   33|      3|        break;
   34|      4|    case ECX_KEY_TYPE_ED25519:
  ------------------
  |  Branch (34:5): [True: 4, False: 8]
  ------------------
   35|      4|        if (!ossl_ed25519_public_from_private(key->libctx, key->pubkey,
  ------------------
  |  Branch (35:13): [True: 0, False: 4]
  ------------------
   36|      4|                                              key->privkey, key->propq)) {
   37|      0|            ERR_raise(ERR_LIB_EC, EC_R_FAILED_MAKING_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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 0;
   39|      0|        }
   40|      4|        break;
   41|      4|    case ECX_KEY_TYPE_X448:
  ------------------
  |  Branch (41:5): [True: 3, False: 9]
  ------------------
   42|      3|        ossl_x448_public_from_private(key->pubkey, key->privkey);
   43|      3|        break;
   44|      2|    case ECX_KEY_TYPE_ED448:
  ------------------
  |  Branch (44:5): [True: 2, False: 10]
  ------------------
   45|      2|        if (!ossl_ed448_public_from_private(key->libctx, key->pubkey,
  ------------------
  |  Branch (45:13): [True: 0, False: 2]
  ------------------
   46|      2|                                            key->privkey, key->propq)) {
   47|      0|            ERR_raise(ERR_LIB_EC, EC_R_FAILED_MAKING_PUBLIC_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   48|      0|            return 0;
   49|      0|        }
   50|      2|        break;
   51|     12|    }
   52|     12|    return 1;
   53|     12|}
ossl_ecx_key_op:
  158|     46|{
  159|     46|    ECX_KEY *key = NULL;
  160|     46|    unsigned char *privkey, *pubkey;
  161|       |
  162|     46|    if (op != KEY_OP_KEYGEN) {
  ------------------
  |  Branch (162:9): [True: 46, False: 0]
  ------------------
  163|     46|        if (palg != NULL) {
  ------------------
  |  Branch (163:13): [True: 46, False: 0]
  ------------------
  164|     46|            int ptype;
  165|       |
  166|       |            /* Algorithm parameters must be absent */
  167|     46|            X509_ALGOR_get0(NULL, &ptype, NULL, palg);
  168|     46|            if (ptype != V_ASN1_UNDEF) {
  ------------------
  |  |   60|     46|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (168:17): [True: 6, False: 40]
  ------------------
  169|      6|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|      6|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      6|    (ERR_new(),                                                 \
  |  |  |  |  404|      6|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      6|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      6|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      6|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      6|     ERR_set_error)
  |  |  ------------------
  ------------------
  170|      6|                return 0;
  171|      6|            }
  172|     40|            if (id == EVP_PKEY_NONE)
  ------------------
  |  |   59|     40|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|     40|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (172:17): [True: 31, False: 9]
  ------------------
  173|     31|                id = OBJ_obj2nid(palg->algorithm);
  174|      9|            else if (id != OBJ_obj2nid(palg->algorithm)) {
  ------------------
  |  Branch (174:22): [True: 0, False: 9]
  ------------------
  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|     40|        }
  179|       |
  180|     40|        if (p == NULL || id == EVP_PKEY_NONE || plen != KEYLENID(id)) {
  ------------------
  |  |   59|     25|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|     65|#define NID_undef                       0
  |  |  ------------------
  ------------------
                      if (p == NULL || id == EVP_PKEY_NONE || plen != KEYLENID(id)) {
  ------------------
  |  |   12|     25|#define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   11|     25|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|     25|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5496|     50|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|     18|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5504|     18|#define NID_ED25519             1087
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (11:26): [True: 7, False: 18]
  |  |  |  |  |  Branch (11:53): [True: 7, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   26|     14|#  define X25519_KEYLEN         32
  |  |  ------------------
  |  |   13|     25|                                     : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   81|     11|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5500|     11|#define NID_X448                1035
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                                                    : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   27|      7|#  define X448_KEYLEN           56
  |  |  ------------------
  |  |  |  Branch (13:41): [True: 7, False: 4]
  |  |  ------------------
  |  |   14|     11|                                                              : ED448_KEYLEN))
  |  |  ------------------
  |  |  |  |   29|      4|#  define ED448_KEYLEN          57
  |  |  ------------------
  ------------------
  |  Branch (180:13): [True: 15, False: 25]
  |  Branch (180:26): [True: 0, False: 25]
  |  Branch (180:49): [True: 10, False: 15]
  ------------------
  181|     25|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  401|     25|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     25|    (ERR_new(),                                                 \
  |  |  |  |  404|     25|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     25|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     25|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     25|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     25|     ERR_set_error)
  |  |  ------------------
  ------------------
  182|     25|            return 0;
  183|     25|        }
  184|     40|    }
  185|       |
  186|     15|    key = ossl_ecx_key_new(libctx, KEYNID2TYPE(id), 1, propq);
  ------------------
  |  |   16|     15|    (IS25519(id) ? ((id) == EVP_PKEY_X25519 ? ECX_KEY_TYPE_X25519 \
  |  |  ------------------
  |  |  |  |   11|     15|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|     15|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5496|     30|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|     12|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5504|     12|#define NID_ED25519             1087
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (11:26): [True: 3, False: 12]
  |  |  |  |  |  Branch (11:53): [True: 5, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (IS25519(id) ? ((id) == EVP_PKEY_X25519 ? ECX_KEY_TYPE_X25519 \
  |  |  ------------------
  |  |  |  |   79|      8|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  ------------------
  |  |  |  |  |  | 5496|      8|#define NID_X25519              1034
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (16:21): [True: 3, False: 5]
  |  |  ------------------
  |  |   17|      8|                                            : ECX_KEY_TYPE_ED25519) \
  |  |   18|     15|                 : ((id) == EVP_PKEY_X448 ? ECX_KEY_TYPE_X448 \
  |  |  ------------------
  |  |  |  |   81|      7|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5500|      7|#define NID_X448                1035
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (18:21): [True: 4, False: 3]
  |  |  ------------------
  |  |   19|      7|                                          : ECX_KEY_TYPE_ED448))
  ------------------
  187|     15|    if (key == NULL) {
  ------------------
  |  Branch (187:9): [True: 0, False: 15]
  ------------------
  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|     15|    pubkey = key->pubkey;
  192|       |
  193|     15|    if (op == KEY_OP_PUBLIC) {
  ------------------
  |  Branch (193:9): [True: 3, False: 12]
  ------------------
  194|      3|        memcpy(pubkey, p, plen);
  195|     12|    } else {
  196|     12|        privkey = ossl_ecx_key_allocate_privkey(key);
  197|     12|        if (privkey == NULL) {
  ------------------
  |  Branch (197:13): [True: 0, False: 12]
  ------------------
  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|     12|        if (op == KEY_OP_KEYGEN) {
  ------------------
  |  Branch (201:13): [True: 0, False: 12]
  ------------------
  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|     12|        } else {
  215|     12|            memcpy(privkey, p, KEYLENID(id));
  ------------------
  |  |   12|     12|#define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   11|     12|#define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   79|     12|# define EVP_PKEY_X25519 NID_X25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5496|     24|#define NID_X25519              1034
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS25519(id)     ((id) == EVP_PKEY_X25519 || (id) == EVP_PKEY_ED25519)
  |  |  |  |  ------------------
  |  |  |  |  |  |   80|      9|# define EVP_PKEY_ED25519 NID_ED25519
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 5504|      9|#define NID_ED25519             1087
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (11:26): [True: 3, False: 9]
  |  |  |  |  |  Branch (11:53): [True: 4, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define KEYLENID(id)    (IS25519(id) ? X25519_KEYLEN \
  |  |  ------------------
  |  |  |  |   26|      7|#  define X25519_KEYLEN         32
  |  |  ------------------
  |  |   13|     12|                                     : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   81|      5|# define EVP_PKEY_X448 NID_X448
  |  |  |  |  ------------------
  |  |  |  |  |  | 5500|      5|#define NID_X448                1035
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                                                    : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \
  |  |  ------------------
  |  |  |  |   27|      3|#  define X448_KEYLEN           56
  |  |  ------------------
  |  |  |  Branch (13:41): [True: 3, False: 2]
  |  |  ------------------
  |  |   14|      5|                                                              : ED448_KEYLEN))
  |  |  ------------------
  |  |  |  |   29|      2|#  define ED448_KEYLEN          57
  |  |  ------------------
  ------------------
  216|     12|        }
  217|     12|        if (!ossl_ecx_public_from_private(key)) {
  ------------------
  |  Branch (217:13): [True: 0, False: 12]
  ------------------
  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|     12|    }
  222|       |
  223|     15|    return key;
  224|      0| err:
  225|      0|    ossl_ecx_key_free(key);
  226|      0|    return NULL;
  227|     15|}
ossl_ecx_key_from_pkcs8:
  231|     34|{
  232|     34|    ECX_KEY *ecx = NULL;
  233|     34|    const unsigned char *p;
  234|     34|    int plen;
  235|     34|    ASN1_OCTET_STRING *oct = NULL;
  236|     34|    const X509_ALGOR *palg;
  237|       |
  238|     34|    if (!PKCS8_pkey_get0(NULL, &p, &plen, &palg, p8inf))
  ------------------
  |  Branch (238:9): [True: 0, False: 34]
  ------------------
  239|      0|        return 0;
  240|       |
  241|     34|    oct = d2i_ASN1_OCTET_STRING(NULL, &p, plen);
  242|     34|    if (oct == NULL) {
  ------------------
  |  Branch (242:9): [True: 15, False: 19]
  ------------------
  243|     15|        p = NULL;
  244|     15|        plen = 0;
  245|     19|    } else {
  246|     19|        p = ASN1_STRING_get0_data(oct);
  247|     19|        plen = ASN1_STRING_length(oct);
  248|     19|    }
  249|       |
  250|       |    /*
  251|       |     * EVP_PKEY_NONE means that ecx_key_op() has to figure out the key type
  252|       |     * on its own.
  253|       |     */
  254|     34|    ecx = ossl_ecx_key_op(palg, p, plen, EVP_PKEY_NONE, KEY_OP_PRIVATE,
  ------------------
  |  |   59|     34|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|     34|#define NID_undef                       0
  |  |  ------------------
  ------------------
  255|     34|                          libctx, propq);
  256|     34|    ASN1_OCTET_STRING_free(oct);
  257|     34|    return ecx;
  258|     34|}

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

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

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

OSSL_DECODER_up_ref:
   43|   280k|{
   44|   280k|    int ref = 0;
   45|       |
   46|   280k|    CRYPTO_UP_REF(&decoder->base.refcnt, &ref);
   47|   280k|    return 1;
   48|   280k|}
OSSL_DECODER_free:
   51|   280k|{
   52|   280k|    int ref = 0;
   53|       |
   54|   280k|    if (decoder == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 280k]
  ------------------
   55|      0|        return;
   56|       |
   57|   280k|    CRYPTO_DOWN_REF(&decoder->base.refcnt, &ref);
   58|   280k|    if (ref > 0)
  ------------------
  |  Branch (58:9): [True: 280k, False: 40]
  ------------------
   59|   280k|        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_store_cache_flush:
  432|      2|{
  433|      2|    OSSL_METHOD_STORE *store = get_decoder_store(libctx);
  434|       |
  435|      2|    if (store != NULL)
  ------------------
  |  Branch (435:9): [True: 2, False: 0]
  ------------------
  436|      2|        return ossl_method_store_cache_flush_all(store);
  437|      0|    return 1;
  438|      2|}
OSSL_DECODER_get0_provider:
  455|   296k|{
  456|   296k|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|   296k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   296k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (456:9): [True: 0, False: 296k]
  ------------------
  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|   296k|    return decoder->base.prov;
  462|   296k|}
ossl_decoder_parsed_properties:
  476|    180|{
  477|    180|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|    180|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    180|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (477:9): [True: 0, False: 180]
  ------------------
  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|    180|    return decoder->base.parsed_propdef;
  483|    180|}
ossl_decoder_get_number:
  486|  20.1k|{
  487|  20.1k|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|  20.1k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  20.1k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (487:9): [True: 0, False: 20.1k]
  ------------------
  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|  20.1k|    return decoder->base.id;
  493|  20.1k|}
OSSL_DECODER_is_a:
  506|  12.4k|{
  507|  12.4k|    if (decoder->base.prov != NULL) {
  ------------------
  |  Branch (507:9): [True: 12.4k, False: 0]
  ------------------
  508|  12.4k|        OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov);
  509|  12.4k|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  510|       |
  511|  12.4k|        return ossl_namemap_name2num(namemap, name) == decoder->base.id;
  512|  12.4k|    }
  513|      0|    return 0;
  514|  12.4k|}
ossl_decoder_fast_is_a:
  525|  25.2k|{
  526|  25.2k|    int id = *id_cache;
  527|       |
  528|  25.2k|    if (id <= 0)
  ------------------
  |  Branch (528:9): [True: 17.8k, False: 7.41k]
  ------------------
  529|  17.8k|        *id_cache = id = resolve_name(decoder, name);
  530|       |
  531|  25.2k|    return id > 0 && ossl_decoder_get_number(decoder) == id;
  ------------------
  |  Branch (531:12): [True: 20.1k, False: 5.17k]
  |  Branch (531:22): [True: 13.0k, False: 7.03k]
  ------------------
  532|  25.2k|}
OSSL_DECODER_do_all_provided:
  550|    100|{
  551|    100|    struct decoder_data_st methdata;
  552|    100|    struct do_one_data_st data;
  553|       |
  554|    100|    methdata.libctx = libctx;
  555|    100|    methdata.tmp_store = NULL;
  556|    100|    (void)inner_ossl_decoder_fetch(&methdata, NULL, NULL /* properties */);
  557|       |
  558|    100|    data.user_fn = user_fn;
  559|    100|    data.user_arg = user_arg;
  560|    100|    if (methdata.tmp_store != NULL)
  ------------------
  |  Branch (560:9): [True: 0, False: 100]
  ------------------
  561|      0|        ossl_method_store_do_all(methdata.tmp_store, &do_one, &data);
  562|    100|    ossl_method_store_do_all(get_decoder_store(libctx), &do_one, &data);
  563|    100|    dealloc_tmp_decoder_store(methdata.tmp_store);
  564|    100|}
OSSL_DECODER_CTX_new:
  623|  15.8k|{
  624|  15.8k|    OSSL_DECODER_CTX *ctx;
  625|       |
  626|  15.8k|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  15.8k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  15.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  15.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  627|  15.8k|    return ctx;
  628|  15.8k|}
OSSL_DECODER_CTX_free:
  663|  16.4k|{
  664|  16.4k|    if (ctx != NULL) {
  ------------------
  |  Branch (664:9): [True: 15.8k, False: 656]
  ------------------
  665|  15.8k|        if (ctx->cleanup != NULL)
  ------------------
  |  Branch (665:13): [True: 12.1k, False: 3.62k]
  ------------------
  666|  12.1k|            ctx->cleanup(ctx->construct_data);
  667|  15.8k|        sk_OSSL_DECODER_INSTANCE_pop_free(ctx->decoder_insts,
  668|  15.8k|                                          ossl_decoder_instance_free);
  669|  15.8k|        ossl_pw_clear_passphrase_data(&ctx->pwdata);
  670|  15.8k|        OPENSSL_free(ctx);
  ------------------
  |  |  115|  15.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  15.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  15.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  671|  15.8k|    }
  672|  16.4k|}
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|    100|{
  344|    100|    OSSL_METHOD_STORE *store = get_decoder_store(methdata->libctx);
  345|    100|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  346|    100|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (346:31): [True: 0, False: 100]
  ------------------
  347|    100|    void *method = NULL;
  348|    100|    int unsupported, id;
  349|       |
  350|    100|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (350:9): [True: 0, False: 100]
  |  Branch (350:26): [True: 0, False: 100]
  ------------------
  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|    100|    id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (355:10): [True: 0, False: 100]
  ------------------
  356|       |
  357|       |    /*
  358|       |     * If we haven't found the name yet, chances are that the algorithm to
  359|       |     * be fetched is unsupported.
  360|       |     */
  361|    100|    unsupported = id == 0;
  362|       |
  363|    100|    if (id == 0
  ------------------
  |  Branch (363:9): [True: 100, False: 0]
  ------------------
  364|    100|        || !ossl_method_store_cache_get(store, NULL, id, propq, &method)) {
  ------------------
  |  Branch (364:12): [True: 0, False: 0]
  ------------------
  365|    100|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  366|    100|            get_tmp_decoder_store,
  367|    100|            reserve_decoder_store,
  368|    100|            unreserve_decoder_store,
  369|    100|            get_decoder_from_store,
  370|    100|            put_decoder_in_store,
  371|    100|            construct_decoder,
  372|    100|            destruct_decoder
  373|    100|        };
  374|    100|        OSSL_PROVIDER *prov = NULL;
  375|       |
  376|    100|        methdata->id = id;
  377|    100|        methdata->names = name;
  378|    100|        methdata->propquery = propq;
  379|    100|        methdata->flag_construct_error_occurred = 0;
  380|    100|        if ((method = ossl_method_construct(methdata->libctx, OSSL_OP_DECODER,
  ------------------
  |  |  287|    100|# define OSSL_OP_DECODER                            21
  ------------------
  |  Branch (380:13): [True: 0, False: 100]
  ------------------
  381|    100|                                            &prov, 0 /* !force_cache */,
  382|    100|                                            &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|    100|        unsupported = !methdata->flag_construct_error_occurred;
  401|    100|    }
  402|       |
  403|    100|    if ((id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (403:10): [True: 0, False: 100]
  |  Branch (403:21): [True: 0, False: 100]
  |  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|    100|    return method;
  416|    100|}
decoder_meth.c:reserve_decoder_store:
  107|    200|{
  108|    200|    struct decoder_data_st *methdata = data;
  109|       |
  110|    200|    if (store == NULL
  ------------------
  |  Branch (110:9): [True: 200, False: 0]
  ------------------
  111|    200|        && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (111:12): [True: 0, False: 200]
  ------------------
  112|      0|        return 0;
  113|       |
  114|    200|    return ossl_method_lock_store(store);
  115|    200|}
decoder_meth.c:unreserve_decoder_store:
  118|    200|{
  119|    200|    struct decoder_data_st *methdata = data;
  120|       |
  121|    200|    if (store == NULL
  ------------------
  |  Branch (121:9): [True: 200, False: 0]
  ------------------
  122|    200|        && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (122:12): [True: 0, False: 200]
  ------------------
  123|      0|        return 0;
  124|       |
  125|    200|    return ossl_method_unlock_store(store);
  126|    200|}
decoder_meth.c:get_decoder_from_store:
  131|    100|{
  132|    100|    struct decoder_data_st *methdata = data;
  133|    100|    void *method = NULL;
  134|    100|    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|    100|    if ((id = methdata->id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (141:9): [True: 100, False: 0]
  |  Branch (141:37): [True: 0, False: 100]
  ------------------
  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|    100|    if (id == 0)
  ------------------
  |  Branch (152:9): [True: 100, False: 0]
  ------------------
  153|    100|        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|    100|{
   96|    100|    if (store != NULL)
  ------------------
  |  Branch (96:9): [True: 0, False: 100]
  ------------------
   97|      0|        ossl_method_store_free(store);
   98|    100|}
decoder_meth.c:get_decoder_store:
  102|    642|{
  103|    642|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_STORE_INDEX);
  ------------------
  |  |  109|    642|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  104|    642|}
decoder_meth.c:resolve_name:
  517|  17.8k|{
  518|  17.8k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov);
  519|  17.8k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  520|       |
  521|  17.8k|    return ossl_namemap_name2num(namemap, name);
  522|  17.8k|}
decoder_meth.c:do_one:
  540|  4.00k|{
  541|  4.00k|    struct do_one_data_st *data = arg;
  542|       |
  543|  4.00k|    data->user_fn(method, data->user_arg);
  544|  4.00k|}

ossl_decoder_cache_new:
  683|      4|{
  684|      4|    DECODER_CACHE *cache = OPENSSL_malloc(sizeof(*cache));
  ------------------
  |  |  102|      4|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  685|       |
  686|      4|    if (cache == NULL)
  ------------------
  |  Branch (686:9): [True: 0, False: 4]
  ------------------
  687|      0|        return NULL;
  688|       |
  689|      4|    cache->lock = CRYPTO_THREAD_lock_new();
  690|      4|    if (cache->lock == NULL) {
  ------------------
  |  Branch (690:9): [True: 0, False: 4]
  ------------------
  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|      4|    cache->hashtable = lh_DECODER_CACHE_ENTRY_new(decoder_cache_entry_hash,
  695|      4|                                                  decoder_cache_entry_cmp);
  696|      4|    if (cache->hashtable == NULL) {
  ------------------
  |  Branch (696:9): [True: 0, False: 4]
  ------------------
  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|      4|    return cache;
  703|      4|}
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|      5|{
  721|      5|    DECODER_CACHE *cache
  722|      5|        = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_CACHE_INDEX);
  ------------------
  |  |  118|      5|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  723|       |
  724|      5|    if (cache == NULL)
  ------------------
  |  Branch (724:9): [True: 3, False: 2]
  ------------------
  725|      3|        return 0;
  726|       |
  727|       |
  728|      2|    if (!CRYPTO_THREAD_write_lock(cache->lock)) {
  ------------------
  |  Branch (728:9): [True: 0, False: 2]
  ------------------
  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|      2|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  734|      2|    lh_DECODER_CACHE_ENTRY_flush(cache->hashtable);
  735|       |
  736|      2|    CRYPTO_THREAD_unlock(cache->lock);
  737|      2|    return 1;
  738|      2|}
OSSL_DECODER_CTX_new_for_pkey:
  746|  15.7k|{
  747|  15.7k|    OSSL_DECODER_CTX *ctx = NULL;
  748|  15.7k|    OSSL_PARAM decoder_params[] = {
  749|  15.7k|        OSSL_PARAM_END,
  ------------------
  |  |   25|  15.7k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  750|  15.7k|        OSSL_PARAM_END
  ------------------
  |  |   25|  15.7k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  751|  15.7k|    };
  752|  15.7k|    DECODER_CACHE *cache
  753|  15.7k|        = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_CACHE_INDEX);
  ------------------
  |  |  118|  15.7k|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  754|  15.7k|    DECODER_CACHE_ENTRY cacheent, *res, *newcache = NULL;
  755|       |
  756|  15.7k|    if (cache == NULL) {
  ------------------
  |  Branch (756:9): [True: 0, False: 15.7k]
  ------------------
  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|  15.7k|    if (propquery != NULL)
  ------------------
  |  Branch (760:9): [True: 0, False: 15.7k]
  ------------------
  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|  15.7k|    cacheent.input_type = (char *)input_type;
  766|  15.7k|    cacheent.input_structure = (char *)input_structure;
  767|  15.7k|    cacheent.keytype = (char *)keytype;
  768|  15.7k|    cacheent.selection = selection;
  769|  15.7k|    cacheent.propquery = (char *)propquery;
  770|       |
  771|  15.7k|    if (!CRYPTO_THREAD_read_lock(cache->lock)) {
  ------------------
  |  Branch (771:9): [True: 0, False: 15.7k]
  ------------------
  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|  15.7k|    res = lh_DECODER_CACHE_ENTRY_retrieve(cache->hashtable, &cacheent);
  778|       |
  779|  15.7k|    if (res == NULL) {
  ------------------
  |  Branch (779:9): [True: 79, False: 15.6k]
  ------------------
  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|     79|        CRYPTO_THREAD_unlock(cache->lock);
  786|       |
  787|     79|        if ((ctx = OSSL_DECODER_CTX_new()) == NULL) {
  ------------------
  |  Branch (787:13): [True: 0, False: 79]
  ------------------
  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|     79|        OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|     79|    do {                                        \
  |  |  220|     79|        BIO *trc_out = NULL;                    \
  |  |  221|     79|        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|     79|        } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|     79|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  799|       |
  800|     79|        if (OSSL_DECODER_CTX_set_input_type(ctx, input_type)
  ------------------
  |  Branch (800:13): [True: 79, False: 0]
  ------------------
  801|     79|            && OSSL_DECODER_CTX_set_input_structure(ctx, input_structure)
  ------------------
  |  Branch (801:16): [True: 79, False: 0]
  ------------------
  802|     79|            && OSSL_DECODER_CTX_set_selection(ctx, selection)
  ------------------
  |  Branch (802:16): [True: 79, False: 0]
  ------------------
  803|     79|            && ossl_decoder_ctx_setup_for_pkey(ctx, keytype, libctx, propquery)
  ------------------
  |  Branch (803:16): [True: 79, False: 0]
  ------------------
  804|     79|            && OSSL_DECODER_CTX_add_extra(ctx, libctx, propquery)
  ------------------
  |  Branch (804:16): [True: 79, False: 0]
  ------------------
  805|     79|            && (propquery == NULL
  ------------------
  |  Branch (805:17): [True: 79, False: 0]
  ------------------
  806|     79|                || OSSL_DECODER_CTX_set_params(ctx, decoder_params))) {
  ------------------
  |  Branch (806:20): [True: 0, False: 0]
  ------------------
  807|     79|            OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|     79|    do {                                        \
  |  |  220|     79|        BIO *trc_out = NULL;                    \
  |  |  221|     79|        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|     79|            } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|     79|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  811|     79|        } 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|     79|        newcache = OPENSSL_zalloc(sizeof(*newcache));
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  818|     79|        if (newcache == NULL) {
  ------------------
  |  Branch (818:13): [True: 0, False: 79]
  ------------------
  819|      0|            OSSL_DECODER_CTX_free(ctx);
  820|      0|            return NULL;
  821|      0|        }
  822|       |
  823|     79|        if (input_type != NULL) {
  ------------------
  |  Branch (823:13): [True: 79, False: 0]
  ------------------
  824|     79|            newcache->input_type = OPENSSL_strdup(input_type);
  ------------------
  |  |  119|     79|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  825|     79|            if (newcache->input_type == NULL)
  ------------------
  |  Branch (825:17): [True: 0, False: 79]
  ------------------
  826|      0|                goto err;
  827|     79|        }
  828|     79|        if (input_structure != NULL) {
  ------------------
  |  Branch (828:13): [True: 79, False: 0]
  ------------------
  829|     79|            newcache->input_structure = OPENSSL_strdup(input_structure);
  ------------------
  |  |  119|     79|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  830|     79|            if (newcache->input_structure == NULL)
  ------------------
  |  Branch (830:17): [True: 0, False: 79]
  ------------------
  831|      0|                goto err;
  832|     79|        }
  833|     79|        if (keytype != NULL) {
  ------------------
  |  Branch (833:13): [True: 78, False: 1]
  ------------------
  834|     78|            newcache->keytype = OPENSSL_strdup(keytype);
  ------------------
  |  |  119|     78|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     78|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     78|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  835|     78|            if (newcache->keytype == NULL)
  ------------------
  |  Branch (835:17): [True: 0, False: 78]
  ------------------
  836|      0|                goto err;
  837|     78|        }
  838|     79|        if (propquery != NULL) {
  ------------------
  |  Branch (838:13): [True: 0, False: 79]
  ------------------
  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|     79|        newcache->selection = selection;
  844|     79|        newcache->template = ctx;
  845|       |
  846|     79|        if (!CRYPTO_THREAD_write_lock(cache->lock)) {
  ------------------
  |  Branch (846:13): [True: 0, False: 79]
  ------------------
  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|     79|        res = lh_DECODER_CACHE_ENTRY_retrieve(cache->hashtable, &cacheent);
  852|     79|        if (res == NULL) {
  ------------------
  |  Branch (852:13): [True: 79, False: 0]
  ------------------
  853|     79|            (void)lh_DECODER_CACHE_ENTRY_insert(cache->hashtable, newcache);
  854|     79|            if (lh_DECODER_CACHE_ENTRY_error(cache->hashtable)) {
  ------------------
  |  Branch (854:17): [True: 0, False: 79]
  ------------------
  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|     79|        } 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|  15.6k|    } else {
  868|  15.6k|        ctx = res->template;
  869|  15.6k|    }
  870|       |
  871|  15.7k|    ctx = ossl_decoder_ctx_for_pkey_dup(ctx, pkey, input_type, input_structure);
  872|  15.7k|    CRYPTO_THREAD_unlock(cache->lock);
  873|       |
  874|  15.7k|    return ctx;
  875|      0| err:
  876|      0|    decoder_cache_entry_free(newcache);
  877|      0|    OSSL_DECODER_CTX_free(ctx);
  878|      0|    return NULL;
  879|  15.7k|}
decoder_pkey.c:decoder_cache_entry_hash:
  617|  15.8k|{
  618|  15.8k|    unsigned long hash = 17;
  619|       |
  620|  15.8k|    hash = (hash * 23)
  621|  15.8k|           + (cache->propquery == NULL
  ------------------
  |  Branch (621:15): [True: 15.8k, False: 0]
  ------------------
  622|  15.8k|              ? 0 : ossl_lh_strcasehash(cache->propquery));
  623|  15.8k|    hash = (hash * 23)
  624|  15.8k|           + (cache->input_structure == NULL
  ------------------
  |  Branch (624:15): [True: 0, False: 15.8k]
  ------------------
  625|  15.8k|              ? 0  : ossl_lh_strcasehash(cache->input_structure));
  626|  15.8k|    hash = (hash * 23)
  627|  15.8k|           + (cache->input_type == NULL
  ------------------
  |  Branch (627:15): [True: 0, False: 15.8k]
  ------------------
  628|  15.8k|              ? 0  : ossl_lh_strcasehash(cache->input_type));
  629|  15.8k|    hash = (hash * 23)
  630|  15.8k|           + (cache->keytype == NULL
  ------------------
  |  Branch (630:15): [True: 10.8k, False: 5.03k]
  ------------------
  631|  15.8k|              ? 0  : ossl_lh_strcasehash(cache->keytype));
  632|       |
  633|  15.8k|    hash ^= cache->selection;
  634|       |
  635|  15.8k|    return hash;
  636|  15.8k|}
decoder_pkey.c:decoder_cache_entry_cmp:
  659|  15.6k|{
  660|  15.6k|    int cmp;
  661|       |
  662|  15.6k|    if (a->selection != b->selection)
  ------------------
  |  Branch (662:9): [True: 0, False: 15.6k]
  ------------------
  663|      0|        return (a->selection < b->selection) ? -1 : 1;
  ------------------
  |  Branch (663:16): [True: 0, False: 0]
  ------------------
  664|       |
  665|  15.6k|    cmp = nullstrcmp(a->keytype, b->keytype, 1);
  666|  15.6k|    if (cmp != 0)
  ------------------
  |  Branch (666:9): [True: 0, False: 15.6k]
  ------------------
  667|      0|        return cmp;
  668|       |
  669|  15.6k|    cmp = nullstrcmp(a->input_type, b->input_type, 1);
  670|  15.6k|    if (cmp != 0)
  ------------------
  |  Branch (670:9): [True: 0, False: 15.6k]
  ------------------
  671|      0|        return cmp;
  672|       |
  673|  15.6k|    cmp = nullstrcmp(a->input_structure, b->input_structure, 1);
  674|  15.6k|    if (cmp != 0)
  ------------------
  |  Branch (674:9): [True: 0, False: 15.6k]
  ------------------
  675|      0|        return cmp;
  676|       |
  677|  15.6k|    cmp = nullstrcmp(a->propquery, b->propquery, 0);
  678|       |
  679|  15.6k|    return cmp;
  680|  15.6k|}
decoder_pkey.c:nullstrcmp:
  639|  62.6k|{
  640|  62.6k|    if (a == NULL || b == NULL) {
  ------------------
  |  Branch (640:9): [True: 26.4k, False: 36.1k]
  |  Branch (640:22): [True: 0, False: 36.1k]
  ------------------
  641|  26.4k|        if (a == NULL) {
  ------------------
  |  Branch (641:13): [True: 26.4k, False: 0]
  ------------------
  642|  26.4k|            if (b == NULL)
  ------------------
  |  Branch (642:17): [True: 26.4k, False: 0]
  ------------------
  643|  26.4k|                return 0;
  644|      0|            else
  645|      0|                return 1;
  646|  26.4k|        } else {
  647|      0|            return -1;
  648|      0|        }
  649|  36.1k|    } else {
  650|  36.1k|        if (casecmp)
  ------------------
  |  Branch (650:13): [True: 36.1k, False: 0]
  ------------------
  651|  36.1k|            return OPENSSL_strcasecmp(a, b);
  652|      0|        else
  653|      0|            return strcmp(a, b);
  654|  36.1k|    }
  655|  62.6k|}
decoder_pkey.c:decoder_cache_entry_free:
  605|     79|{
  606|     79|    if (entry == NULL)
  ------------------
  |  Branch (606:9): [True: 0, False: 79]
  ------------------
  607|      0|        return;
  608|     79|    OPENSSL_free(entry->input_type);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  609|     79|    OPENSSL_free(entry->input_structure);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  610|     79|    OPENSSL_free(entry->keytype);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  611|     79|    OPENSSL_free(entry->propquery);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  612|     79|    OSSL_DECODER_CTX_free(entry->template);
  613|     79|    OPENSSL_free(entry);
  ------------------
  |  |  115|     79|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  614|     79|}
decoder_pkey.c:ossl_decoder_ctx_setup_for_pkey:
  382|     79|{
  383|     79|    int ok = 0;
  384|     79|    struct decoder_pkey_data_st *process_data = NULL;
  385|     79|    struct collect_data_st collect_data = { NULL };
  386|     79|    STACK_OF(EVP_KEYMGMT) *keymgmts = NULL;
  ------------------
  |  |   31|     79|# define STACK_OF(type) struct stack_st_##type
  ------------------
  387|       |
  388|     79|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|     79|    do {                                        \
  |  |  220|     79|        BIO *trc_out = NULL;                    \
  |  |  221|     79|        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|     79|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|     79|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  402|       |
  403|       |    /* Allocate data. */
  404|     79|    if ((process_data = OPENSSL_zalloc(sizeof(*process_data))) == NULL)
  ------------------
  |  |  104|     79|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     79|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     79|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (404:9): [True: 0, False: 79]
  ------------------
  405|      0|        goto err;
  406|     79|    if ((propquery != NULL
  ------------------
  |  Branch (406:10): [True: 0, False: 79]
  ------------------
  407|     79|            && (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|     79|    keymgmts = sk_EVP_KEYMGMT_new_null();
  412|     79|    if (keymgmts == NULL) {
  ------------------
  |  Branch (412:9): [True: 0, False: 79]
  ------------------
  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|     79|    process_data->object    = NULL;
  418|     79|    process_data->libctx    = libctx;
  419|     79|    process_data->selection = ctx->selection;
  420|     79|    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|     79|    collect_data.ctx        = ctx;
  438|     79|    collect_data.libctx     = libctx;
  439|     79|    collect_data.keymgmts   = keymgmts;
  440|     79|    collect_data.keytype    = keytype;
  441|     79|    EVP_KEYMGMT_do_all_provided(libctx, collect_keymgmt, &collect_data);
  442|       |
  443|     79|    if (collect_data.error_occurred)
  ------------------
  |  Branch (443:9): [True: 0, False: 79]
  ------------------
  444|      0|        goto err;
  445|       |
  446|       |    /* Enumerate all matching decoders. */
  447|     79|    OSSL_DECODER_do_all_provided(libctx, collect_decoder, &collect_data);
  448|       |
  449|     79|    if (collect_data.error_occurred)
  ------------------
  |  Branch (449:9): [True: 0, False: 79]
  ------------------
  450|      0|        goto err;
  451|       |
  452|     79|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|     79|    do {                                        \
  |  |  220|     79|        BIO *trc_out = NULL;                    \
  |  |  221|     79|        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|     79|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|     79|    } 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|     79|    if (OSSL_DECODER_CTX_get_num_decoders(ctx) != 0) {
  ------------------
  |  Branch (463:9): [True: 21, False: 58]
  ------------------
  464|     21|        if (!OSSL_DECODER_CTX_set_construct(ctx, decoder_construct_pkey)
  ------------------
  |  Branch (464:13): [True: 0, False: 21]
  ------------------
  465|     21|            || !OSSL_DECODER_CTX_set_construct_data(ctx, process_data)
  ------------------
  |  Branch (465:16): [True: 0, False: 21]
  ------------------
  466|     21|            || !OSSL_DECODER_CTX_set_cleanup(ctx,
  ------------------
  |  Branch (466:16): [True: 0, False: 21]
  ------------------
  467|     21|                                             decoder_clean_pkey_construct_arg))
  468|      0|            goto err;
  469|       |
  470|     21|        process_data = NULL; /* Avoid it being freed */
  471|     21|    }
  472|       |
  473|     79|    ok = 1;
  474|     79| err:
  475|     79|    decoder_clean_pkey_construct_arg(process_data);
  476|     79|    return ok;
  477|     79|}
decoder_pkey.c:collect_keymgmt:
  351|  1.42k|{
  352|  1.42k|    struct collect_data_st *data = arg;
  353|       |
  354|  1.42k|    if (!check_keymgmt(keymgmt, data))
  ------------------
  |  Branch (354:9): [True: 1.38k, False: 41]
  ------------------
  355|  1.38k|        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|     41|    if (!EVP_KEYMGMT_up_ref(keymgmt))
  ------------------
  |  Branch (364:9): [True: 0, False: 41]
  ------------------
  365|      0|        return;
  366|       |
  367|     41|    if (sk_EVP_KEYMGMT_push(data->keymgmts, keymgmt) <= 0) {
  ------------------
  |  Branch (367:9): [True: 0, False: 41]
  ------------------
  368|      0|        EVP_KEYMGMT_free(keymgmt);
  369|      0|        data->error_occurred = 1;
  370|      0|    }
  371|     41|}
decoder_pkey.c:check_keymgmt:
  312|  1.42k|{
  313|       |    /* If no keytype was specified, everything matches. */
  314|  1.42k|    if (data->keytype == NULL)
  ------------------
  |  Branch (314:9): [True: 18, False: 1.40k]
  ------------------
  315|     18|        return 1;
  316|       |
  317|  1.40k|    if (!data->keytype_resolved) {
  ------------------
  |  Branch (317:9): [True: 78, False: 1.32k]
  ------------------
  318|       |        /* We haven't cached the IDs from the keytype string yet. */
  319|     78|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(data->libctx);
  320|     78|        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|     78|        if (data->keytype_id != 0
  ------------------
  |  Branch (326:13): [True: 24, False: 54]
  ------------------
  327|     78|            && (strcmp(data->keytype, "id-ecPublicKey") == 0
  ------------------
  |  Branch (327:17): [True: 2, False: 22]
  ------------------
  328|     24|                || strcmp(data->keytype, "1.2.840.10045.2.1") == 0))
  ------------------
  |  Branch (328:20): [True: 0, False: 22]
  ------------------
  329|      2|            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|     78|        data->keytype_resolved = 1;
  336|     78|    }
  337|       |
  338|       |    /* Specified keytype could not be resolved, so nothing matches. */
  339|  1.40k|    if (data->keytype_id == 0)
  ------------------
  |  Branch (339:9): [True: 972, False: 432]
  ------------------
  340|    972|        return 0;
  341|       |
  342|       |    /* Does not match the keytype specified, so skip. */
  343|    432|    if (keymgmt->name_id != data->keytype_id
  ------------------
  |  Branch (343:9): [True: 411, False: 21]
  ------------------
  344|    432|        && keymgmt->name_id != data->sm2_id)
  ------------------
  |  Branch (344:12): [True: 409, False: 2]
  ------------------
  345|    409|        return 0;
  346|       |
  347|     23|    return 1;
  348|    432|}
decoder_pkey.c:collect_decoder:
  265|  3.16k|{
  266|  3.16k|    struct collect_data_st *data = arg;
  267|  3.16k|    STACK_OF(EVP_KEYMGMT) *keymgmts = data->keymgmts;
  ------------------
  |  |   31|  3.16k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  268|  3.16k|    int i, end_i;
  269|  3.16k|    EVP_KEYMGMT *keymgmt;
  270|  3.16k|    const OSSL_PROVIDER *prov;
  271|  3.16k|    void *provctx;
  272|       |
  273|  3.16k|    if (data->error_occurred)
  ------------------
  |  Branch (273:9): [True: 0, False: 3.16k]
  ------------------
  274|      0|        return;
  275|       |
  276|  3.16k|    prov = OSSL_DECODER_get0_provider(decoder);
  277|  3.16k|    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|  3.16k|    if (decoder->does_selection != NULL
  ------------------
  |  Branch (284:9): [True: 2.92k, False: 237]
  ------------------
  285|  3.16k|            && !decoder->does_selection(provctx, data->ctx->selection))
  ------------------
  |  Branch (285:16): [True: 1.45k, False: 1.46k]
  ------------------
  286|  1.45k|        return;
  287|       |
  288|  1.70k|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|  1.70k|    do {                                        \
  |  |  220|  1.70k|        BIO *trc_out = NULL;                    \
  |  |  221|  1.70k|        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|  1.70k|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|  1.70k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  296|       |
  297|  1.70k|    end_i = sk_EVP_KEYMGMT_num(keymgmts);
  298|  2.67k|    for (i = 0; i < end_i; ++i) {
  ------------------
  |  Branch (298:17): [True: 965, False: 1.70k]
  ------------------
  299|    965|        keymgmt = sk_EVP_KEYMGMT_value(keymgmts, i);
  300|       |
  301|    965|        collect_decoder_keymgmt(keymgmt, decoder, provctx, data);
  302|    965|        if (data->error_occurred)
  ------------------
  |  Branch (302:13): [True: 0, False: 965]
  ------------------
  303|      0|            return;
  304|    965|    }
  305|  1.70k|}
decoder_pkey.c:collect_decoder_keymgmt:
  222|    965|{
  223|    965|    void *decoderctx = NULL;
  224|    965|    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|    965|    if (keymgmt->name_id != decoder->base.id)
  ------------------
  |  Branch (231:9): [True: 901, False: 64]
  ------------------
  232|       |        /* Mismatch is not an error, continue. */
  233|    901|        return;
  234|       |
  235|     64|    if ((decoderctx = decoder->newctx(provctx)) == NULL) {
  ------------------
  |  Branch (235:9): [True: 0, False: 64]
  ------------------
  236|      0|        data->error_occurred = 1;
  237|      0|        return;
  238|      0|    }
  239|       |
  240|     64|    if ((di = ossl_decoder_instance_new(decoder, decoderctx)) == NULL) {
  ------------------
  |  Branch (240:9): [True: 0, False: 64]
  ------------------
  241|      0|        decoder->freectx(decoderctx);
  242|      0|        data->error_occurred = 1;
  243|      0|        return;
  244|      0|    }
  245|       |
  246|     64|    OSSL_TRACE_BEGIN(DECODER) {
  ------------------
  |  |  219|     64|    do {                                        \
  |  |  220|     64|        BIO *trc_out = NULL;                    \
  |  |  221|     64|        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|     64|    } OSSL_TRACE_END(DECODER);
  ------------------
  |  |  224|     64|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  254|       |
  255|     64|    if (!ossl_decoder_ctx_add_decoder_inst(data->ctx, di)) {
  ------------------
  |  Branch (255:9): [True: 0, False: 64]
  ------------------
  256|      0|        ossl_decoder_instance_free(di);
  257|      0|        data->error_occurred = 1;
  258|      0|        return;
  259|      0|    }
  260|       |
  261|     64|    ++data->total;
  262|     64|}
decoder_pkey.c:decoder_construct_pkey:
   73|  3.18k|{
   74|  3.18k|    struct decoder_pkey_data_st *data = construct_data;
   75|  3.18k|    OSSL_DECODER *decoder = OSSL_DECODER_INSTANCE_get_decoder(decoder_inst);
   76|  3.18k|    void *decoderctx = OSSL_DECODER_INSTANCE_get_decoder_ctx(decoder_inst);
   77|  3.18k|    const OSSL_PROVIDER *decoder_prov = OSSL_DECODER_get0_provider(decoder);
   78|  3.18k|    EVP_KEYMGMT *keymgmt = NULL;
   79|  3.18k|    const OSSL_PROVIDER *keymgmt_prov = NULL;
   80|  3.18k|    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|  3.18k|    void *object_ref = NULL;
   90|  3.18k|    size_t object_ref_sz = 0;
   91|  3.18k|    const OSSL_PARAM *p;
   92|       |
   93|  3.18k|    p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_TYPE);
  ------------------
  |  |  328|  3.18k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
   94|  3.18k|    if (p != NULL) {
  ------------------
  |  Branch (94:9): [True: 3.18k, False: 0]
  ------------------
   95|  3.18k|        char *object_type = NULL;
   96|       |
   97|  3.18k|        if (!OSSL_PARAM_get_utf8_string(p, &object_type, 0))
  ------------------
  |  Branch (97:13): [True: 0, False: 3.18k]
  ------------------
   98|      0|            return 0;
   99|  3.18k|        OPENSSL_free(data->object_type);
  ------------------
  |  |  115|  3.18k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.18k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.18k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  100|  3.18k|        data->object_type = object_type;
  101|  3.18k|    }
  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|  3.18k|    p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_REFERENCE);
  ------------------
  |  |  330|  3.18k|# define OSSL_OBJECT_PARAM_REFERENCE "reference"
  ------------------
  109|  3.18k|    if (p == NULL || p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|  1.90k|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (109:9): [True: 1.27k, False: 1.90k]
  |  Branch (109:22): [True: 0, False: 1.90k]
  ------------------
  110|  1.27k|        return 0;
  111|  1.90k|    object_ref = p->data;
  112|  1.90k|    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|  1.90k|    end = sk_EVP_KEYMGMT_num(data->keymgmts);
  119|  3.91k|    for (i = 0; i < end; i++) {
  ------------------
  |  Branch (119:17): [True: 3.91k, False: 0]
  ------------------
  120|  3.91k|        keymgmt = sk_EVP_KEYMGMT_value(data->keymgmts, i);
  121|  3.91k|        keymgmt_prov = EVP_KEYMGMT_get0_provider(keymgmt);
  122|       |
  123|  3.91k|        if (keymgmt_prov == decoder_prov
  ------------------
  |  Branch (123:13): [True: 3.91k, False: 0]
  ------------------
  124|  3.91k|            && evp_keymgmt_has_load(keymgmt)
  ------------------
  |  Branch (124:16): [True: 3.91k, False: 0]
  ------------------
  125|  3.91k|            && EVP_KEYMGMT_is_a(keymgmt, data->object_type))
  ------------------
  |  Branch (125:16): [True: 1.90k, False: 2.00k]
  ------------------
  126|  1.90k|            break;
  127|  3.91k|    }
  128|  1.90k|    if (i < end) {
  ------------------
  |  Branch (128:9): [True: 1.90k, False: 0]
  ------------------
  129|       |        /* To allow it to be freed further down */
  130|  1.90k|        if (!EVP_KEYMGMT_up_ref(keymgmt))
  ------------------
  |  Branch (130:13): [True: 0, False: 1.90k]
  ------------------
  131|      0|            return 0;
  132|  1.90k|    } 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|  1.90k|    if (keymgmt != NULL) {
  ------------------
  |  Branch (138:9): [True: 1.90k, False: 0]
  ------------------
  139|  1.90k|        EVP_PKEY *pkey = NULL;
  140|  1.90k|        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|  1.90k|        if (keymgmt_prov == decoder_prov) {
  ------------------
  |  Branch (150:13): [True: 1.90k, False: 0]
  ------------------
  151|  1.90k|            keydata = evp_keymgmt_load(keymgmt, object_ref, object_ref_sz);
  152|  1.90k|        } 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|  1.90k|        if (keydata != NULL
  ------------------
  |  Branch (175:13): [True: 1.90k, False: 0]
  ------------------
  176|  1.90k|            && (pkey = evp_keymgmt_util_make_pkey(keymgmt, keydata)) == NULL)
  ------------------
  |  Branch (176:16): [True: 0, False: 1.90k]
  ------------------
  177|      0|            evp_keymgmt_freedata(keymgmt, keydata);
  178|       |
  179|  1.90k|        *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|  1.90k|        EVP_KEYMGMT_free(keymgmt);
  186|  1.90k|    }
  187|       |    /*
  188|       |     * We successfully looked through, |*ctx->object| determines if we
  189|       |     * actually found something.
  190|       |     */
  191|  1.90k|    return (*data->object != NULL);
  192|  1.90k|}
decoder_pkey.c:decoder_clean_pkey_construct_arg:
  195|  12.2k|{
  196|  12.2k|    struct decoder_pkey_data_st *data = construct_data;
  197|       |
  198|  12.2k|    if (data != NULL) {
  ------------------
  |  Branch (198:9): [True: 12.2k, False: 21]
  ------------------
  199|  12.2k|        sk_EVP_KEYMGMT_pop_free(data->keymgmts, EVP_KEYMGMT_free);
  200|  12.2k|        OPENSSL_free(data->propq);
  ------------------
  |  |  115|  12.2k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  12.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  12.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  201|  12.2k|        OPENSSL_free(data->object_type);
  ------------------
  |  |  115|  12.2k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  12.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  12.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  202|  12.2k|        OPENSSL_free(data);
  ------------------
  |  |  115|  12.2k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  12.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  12.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  203|  12.2k|    }
  204|  12.2k|}
decoder_pkey.c:ossl_decoder_ctx_for_pkey_dup:
  499|  15.7k|{
  500|  15.7k|    OSSL_DECODER_CTX *dest;
  501|  15.7k|    struct decoder_pkey_data_st *process_data_src, *process_data_dest = NULL;
  502|       |
  503|  15.7k|    if (src == NULL)
  ------------------
  |  Branch (503:9): [True: 0, False: 15.7k]
  ------------------
  504|      0|        return NULL;
  505|       |
  506|  15.7k|    if ((dest = OSSL_DECODER_CTX_new()) == NULL) {
  ------------------
  |  Branch (506:9): [True: 0, False: 15.7k]
  ------------------
  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|  15.7k|    if (!OSSL_DECODER_CTX_set_input_type(dest, input_type)
  ------------------
  |  Branch (511:9): [True: 0, False: 15.7k]
  ------------------
  512|  15.7k|            || !OSSL_DECODER_CTX_set_input_structure(dest, input_structure)) {
  ------------------
  |  Branch (512:16): [True: 0, False: 15.7k]
  ------------------
  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|  15.7k|    dest->selection = src->selection;
  517|       |
  518|  15.7k|    if (src->decoder_insts != NULL) {
  ------------------
  |  Branch (518:9): [True: 12.1k, False: 3.56k]
  ------------------
  519|  12.1k|        dest->decoder_insts
  520|  12.1k|            = sk_OSSL_DECODER_INSTANCE_deep_copy(src->decoder_insts,
  521|  12.1k|                                                 ossl_decoder_instance_dup,
  522|  12.1k|                                                 ossl_decoder_instance_free);
  523|  12.1k|        if (dest->decoder_insts == NULL) {
  ------------------
  |  Branch (523:13): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|    }
  528|       |
  529|  15.7k|    if (!OSSL_DECODER_CTX_set_construct(dest,
  ------------------
  |  Branch (529:9): [True: 0, False: 15.7k]
  ------------------
  530|  15.7k|                                        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|  15.7k|    process_data_src = OSSL_DECODER_CTX_get_construct_data(src);
  536|  15.7k|    if (process_data_src != NULL) {
  ------------------
  |  Branch (536:9): [True: 12.1k, False: 3.56k]
  ------------------
  537|  12.1k|        process_data_dest = OPENSSL_zalloc(sizeof(*process_data_dest));
  ------------------
  |  |  104|  12.1k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  12.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  12.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  538|  12.1k|        if (process_data_dest == NULL) {
  ------------------
  |  Branch (538:13): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|        if (process_data_src->propq != NULL) {
  ------------------
  |  Branch (542:13): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|        if (process_data_src->keymgmts != NULL) {
  ------------------
  |  Branch (550:13): [True: 12.1k, False: 0]
  ------------------
  551|  12.1k|            process_data_dest->keymgmts
  552|  12.1k|                = sk_EVP_KEYMGMT_deep_copy(process_data_src->keymgmts,
  553|  12.1k|                                           keymgmt_dup,
  554|  12.1k|                                           EVP_KEYMGMT_free);
  555|  12.1k|            if (process_data_dest->keymgmts == NULL) {
  ------------------
  |  Branch (555:17): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|        }
  560|       |
  561|  12.1k|        process_data_dest->object    = (void **)pkey;
  562|  12.1k|        process_data_dest->libctx    = process_data_src->libctx;
  563|  12.1k|        process_data_dest->selection = process_data_src->selection;
  564|  12.1k|        if (!OSSL_DECODER_CTX_set_construct_data(dest, process_data_dest)) {
  ------------------
  |  Branch (564:13): [True: 0, False: 12.1k]
  ------------------
  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|  12.1k|        process_data_dest = NULL;
  569|  12.1k|    }
  570|       |
  571|  15.7k|    if (!OSSL_DECODER_CTX_set_cleanup(dest,
  ------------------
  |  Branch (571:9): [True: 0, False: 15.7k]
  ------------------
  572|  15.7k|                                      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|  15.7k|    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|  15.7k|}
decoder_pkey.c:keymgmt_dup:
  481|   197k|{
  482|   197k|    if (!EVP_KEYMGMT_up_ref((EVP_KEYMGMT *)keymgmt))
  ------------------
  |  Branch (482:9): [True: 0, False: 197k]
  ------------------
  483|      0|        return NULL;
  484|       |
  485|   197k|    return (EVP_KEYMGMT *)keymgmt;
  486|   197k|}

OSSL_ENCODER_to_bio:
   46|  3.39k|{
   47|  3.39k|    struct encoder_process_data_st data;
   48|       |
   49|  3.39k|    memset(&data, 0, sizeof(data));
   50|  3.39k|    data.ctx = ctx;
   51|  3.39k|    data.bio = out;
   52|  3.39k|    data.current_encoder_inst_index = OSSL_ENCODER_CTX_get_num_encoders(ctx);
   53|       |
   54|  3.39k|    if (data.current_encoder_inst_index == 0) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.39k]
  ------------------
   55|      0|        ERR_raise_data(ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_ENCODER_NOT_FOUND,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   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_ENCODER, OSSL_ENCODER_R_ENCODER_NOT_FOUND,
  ------------------
  |  |  120|      0|# define ERR_LIB_OSSL_ENCODER    59
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_ENCODER_NOT_FOUND,
  ------------------
  |  |   24|      0|# define OSSL_ENCODER_R_ENCODER_NOT_FOUND                 101
  ------------------
   56|      0|                       "No encoders were found. For standard encoders you need "
   57|      0|                       "at least one of the default or base providers "
   58|      0|                       "available. Did you forget to load them?");
   59|      0|        return 0;
   60|      0|    }
   61|       |
   62|  3.39k|    if (ctx->cleanup == NULL || ctx->construct == NULL) {
  ------------------
  |  Branch (62:9): [True: 0, False: 3.39k]
  |  Branch (62:33): [True: 0, False: 3.39k]
  ------------------
   63|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   64|      0|        return 0;
   65|      0|    }
   66|       |
   67|  3.39k|    return encoder_process(&data) > 0;
   68|  3.39k|}
OSSL_ENCODER_to_data:
   98|  1.77k|{
   99|  1.77k|    BIO *out;
  100|  1.77k|    BUF_MEM *buf = NULL;
  101|  1.77k|    int ret = 0;
  102|       |
  103|  1.77k|    if (pdata_len == NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 1.77k]
  ------------------
  104|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|  1.77k|    out = BIO_new(BIO_s_mem());
  109|       |
  110|  1.77k|    if (out != NULL
  ------------------
  |  Branch (110:9): [True: 1.77k, False: 0]
  ------------------
  111|  1.77k|        && OSSL_ENCODER_to_bio(ctx, out)
  ------------------
  |  Branch (111:12): [True: 1.50k, False: 269]
  ------------------
  112|  1.77k|        && BIO_get_mem_ptr(out, &buf) > 0) {
  ------------------
  |  |  613|  1.50k|# define BIO_get_mem_ptr(b,pp)   BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0, \
  |  |  ------------------
  |  |  |  |  445|  1.50k|# define BIO_C_GET_BUF_MEM_PTR                   115
  |  |  ------------------
  |  |  614|  1.50k|                                          (char *)(pp))
  ------------------
  |  Branch (112:12): [True: 1.50k, False: 0]
  ------------------
  113|  1.50k|        ret = 1; /* Hope for the best. A too small buffer will clear this */
  114|       |
  115|  1.50k|        if (pdata != NULL && *pdata != NULL) {
  ------------------
  |  Branch (115:13): [True: 1.50k, False: 0]
  |  Branch (115:30): [True: 0, False: 1.50k]
  ------------------
  116|      0|            if (*pdata_len < buf->length)
  ------------------
  |  Branch (116:17): [True: 0, False: 0]
  ------------------
  117|       |                /*
  118|       |                 * It's tempting to do |*pdata_len = (size_t)buf->length|
  119|       |                 * However, it's believed to be confusing more than helpful,
  120|       |                 * so we don't.
  121|       |                 */
  122|      0|                ret = 0;
  123|      0|            else
  124|      0|                *pdata_len -= buf->length;
  125|  1.50k|        } else {
  126|       |            /* The buffer with the right size is already allocated for us */
  127|  1.50k|            *pdata_len = (size_t)buf->length;
  128|  1.50k|        }
  129|       |
  130|  1.50k|        if (ret) {
  ------------------
  |  Branch (130:13): [True: 1.50k, False: 0]
  ------------------
  131|  1.50k|            if (pdata != NULL) {
  ------------------
  |  Branch (131:17): [True: 1.50k, False: 0]
  ------------------
  132|  1.50k|                if (*pdata != NULL) {
  ------------------
  |  Branch (132:21): [True: 0, False: 1.50k]
  ------------------
  133|      0|                    memcpy(*pdata, buf->data, buf->length);
  134|      0|                    *pdata += buf->length;
  135|  1.50k|                } else {
  136|       |                    /* In this case, we steal the data from BIO_s_mem() */
  137|  1.50k|                    *pdata = (unsigned char *)buf->data;
  138|  1.50k|                    buf->data = NULL;
  139|  1.50k|                }
  140|  1.50k|            }
  141|  1.50k|        }
  142|  1.50k|    }
  143|  1.77k|    BIO_free(out);
  144|  1.77k|    return ret;
  145|  1.77k|}
OSSL_ENCODER_CTX_set_selection:
  148|  3.45k|{
  149|  3.45k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  3.45k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.45k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (149:9): [True: 0, False: 3.45k]
  ------------------
  150|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  151|      0|        return 0;
  152|      0|    }
  153|       |
  154|  3.45k|    if (!ossl_assert(selection != 0)) {
  ------------------
  |  |   52|  3.45k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.45k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (154:9): [True: 0, False: 3.45k]
  ------------------
  155|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|  3.45k|    ctx->selection = selection;
  160|  3.45k|    return 1;
  161|  3.45k|}
OSSL_ENCODER_CTX_set_output_type:
  165|  3.45k|{
  166|  3.45k|    if (!ossl_assert(ctx != NULL) || !ossl_assert(output_type != NULL)) {
  ------------------
  |  |   52|  6.90k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  6.90k|                                         __FILE__, __LINE__)
  ------------------
                  if (!ossl_assert(ctx != NULL) || !ossl_assert(output_type != NULL)) {
  ------------------
  |  |   52|  3.45k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.45k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (166:9): [True: 0, False: 3.45k]
  |  Branch (166:38): [True: 0, False: 3.45k]
  ------------------
  167|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  168|      0|        return 0;
  169|      0|    }
  170|       |
  171|  3.45k|    ctx->output_type = output_type;
  172|  3.45k|    return 1;
  173|  3.45k|}
OSSL_ENCODER_CTX_set_output_structure:
  177|  1.77k|{
  178|  1.77k|    if (!ossl_assert(ctx != NULL) || !ossl_assert(output_structure != NULL)) {
  ------------------
  |  |   52|  3.54k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.54k|                                         __FILE__, __LINE__)
  ------------------
                  if (!ossl_assert(ctx != NULL) || !ossl_assert(output_structure != NULL)) {
  ------------------
  |  |   52|  1.77k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  1.77k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (178:9): [True: 0, False: 1.77k]
  |  Branch (178:38): [True: 0, False: 1.77k]
  ------------------
  179|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|       |
  183|  1.77k|    ctx->output_structure = output_structure;
  184|  1.77k|    return 1;
  185|  1.77k|}
ossl_encoder_instance_free:
  246|  38.0k|{
  247|  38.0k|    if (encoder_inst != NULL) {
  ------------------
  |  Branch (247:9): [True: 38.0k, False: 0]
  ------------------
  248|  38.0k|        if (encoder_inst->encoder != NULL)
  ------------------
  |  Branch (248:13): [True: 38.0k, False: 0]
  ------------------
  249|  38.0k|            encoder_inst->encoder->freectx(encoder_inst->encoderctx);
  250|  38.0k|        encoder_inst->encoderctx = NULL;
  251|  38.0k|        OSSL_ENCODER_free(encoder_inst->encoder);
  252|  38.0k|        encoder_inst->encoder = NULL;
  253|  38.0k|        OPENSSL_free(encoder_inst);
  ------------------
  |  |  115|  38.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  38.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  38.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  254|  38.0k|    }
  255|  38.0k|}
OSSL_ENCODER_CTX_add_encoder:
  284|  38.0k|{
  285|  38.0k|    OSSL_ENCODER_INSTANCE *encoder_inst = NULL;
  286|  38.0k|    const OSSL_PROVIDER *prov = NULL;
  287|  38.0k|    void *encoderctx = NULL;
  288|  38.0k|    void *provctx = NULL;
  289|       |
  290|  38.0k|    if (!ossl_assert(ctx != NULL) || !ossl_assert(encoder != NULL)) {
  ------------------
  |  |   52|  76.1k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  76.1k|                                         __FILE__, __LINE__)
  ------------------
                  if (!ossl_assert(ctx != NULL) || !ossl_assert(encoder != NULL)) {
  ------------------
  |  |   52|  38.0k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  38.0k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (290:9): [True: 0, False: 38.0k]
  |  Branch (290:38): [True: 0, False: 38.0k]
  ------------------
  291|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  292|      0|        return 0;
  293|      0|    }
  294|       |
  295|  38.0k|    prov = OSSL_ENCODER_get0_provider(encoder);
  296|  38.0k|    provctx = OSSL_PROVIDER_get0_provider_ctx(prov);
  297|       |
  298|  38.0k|    if ((encoderctx = encoder->newctx(provctx)) == NULL
  ------------------
  |  Branch (298:9): [True: 0, False: 38.0k]
  ------------------
  299|  38.0k|        || (encoder_inst =
  ------------------
  |  Branch (299:12): [True: 0, False: 38.0k]
  ------------------
  300|  38.0k|            ossl_encoder_instance_new(encoder, encoderctx)) == NULL)
  301|      0|        goto err;
  302|       |    /* Avoid double free of encoderctx on further errors */
  303|  38.0k|    encoderctx = NULL;
  304|       |
  305|  38.0k|    if (!ossl_encoder_ctx_add_encoder_inst(ctx, encoder_inst))
  ------------------
  |  Branch (305:9): [True: 0, False: 38.0k]
  ------------------
  306|      0|        goto err;
  307|       |
  308|  38.0k|    return 1;
  309|      0| err:
  310|      0|    ossl_encoder_instance_free(encoder_inst);
  311|      0|    if (encoderctx != NULL)
  ------------------
  |  Branch (311:9): [True: 0, False: 0]
  ------------------
  312|      0|        encoder->freectx(encoderctx);
  313|      0|    return 0;
  314|  38.0k|}
OSSL_ENCODER_CTX_add_extra:
  318|  3.45k|{
  319|  3.45k|    return 1;
  320|  3.45k|}
OSSL_ENCODER_CTX_get_num_encoders:
  323|  11.8k|{
  324|  11.8k|    if (ctx == NULL || ctx->encoder_insts == NULL)
  ------------------
  |  Branch (324:9): [True: 0, False: 11.8k]
  |  Branch (324:24): [True: 62, False: 11.7k]
  ------------------
  325|     62|        return 0;
  326|  11.7k|    return sk_OSSL_ENCODER_INSTANCE_num(ctx->encoder_insts);
  327|  11.8k|}
OSSL_ENCODER_CTX_set_construct:
  331|  3.39k|{
  332|  3.39k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  3.39k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.39k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (332:9): [True: 0, False: 3.39k]
  ------------------
  333|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  334|      0|        return 0;
  335|      0|    }
  336|  3.39k|    ctx->construct = construct;
  337|  3.39k|    return 1;
  338|  3.39k|}
OSSL_ENCODER_CTX_set_construct_data:
  342|  3.39k|{
  343|  3.39k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  3.39k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.39k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (343:9): [True: 0, False: 3.39k]
  ------------------
  344|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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 0;
  346|      0|    }
  347|  3.39k|    ctx->construct_data = construct_data;
  348|  3.39k|    return 1;
  349|  3.39k|}
OSSL_ENCODER_CTX_set_cleanup:
  353|  3.39k|{
  354|  3.39k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  3.39k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.39k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (354:9): [True: 0, False: 3.39k]
  ------------------
  355|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  356|      0|        return 0;
  357|      0|    }
  358|  3.39k|    ctx->cleanup = cleanup;
  359|  3.39k|    return 1;
  360|  3.39k|}
OSSL_ENCODER_INSTANCE_get_encoder:
  364|  81.8k|{
  365|  81.8k|    if (encoder_inst == NULL)
  ------------------
  |  Branch (365:9): [True: 0, False: 81.8k]
  ------------------
  366|      0|        return NULL;
  367|  81.8k|    return encoder_inst->encoder;
  368|  81.8k|}
OSSL_ENCODER_INSTANCE_get_encoder_ctx:
  372|  76.1k|{
  373|  76.1k|    if (encoder_inst == NULL)
  ------------------
  |  Branch (373:9): [True: 0, False: 76.1k]
  ------------------
  374|      0|        return NULL;
  375|  76.1k|    return encoder_inst->encoderctx;
  376|  76.1k|}
OSSL_ENCODER_INSTANCE_get_output_type:
  380|  38.0k|{
  381|  38.0k|    if (encoder_inst == NULL)
  ------------------
  |  Branch (381:9): [True: 0, False: 38.0k]
  ------------------
  382|      0|        return NULL;
  383|  38.0k|    return encoder_inst->output_type;
  384|  38.0k|}
OSSL_ENCODER_INSTANCE_get_output_structure:
  388|  38.0k|{
  389|  38.0k|    if (encoder_inst == NULL)
  ------------------
  |  Branch (389:9): [True: 0, False: 38.0k]
  ------------------
  390|      0|        return NULL;
  391|  38.0k|    return encoder_inst->output_structure;
  392|  38.0k|}
encoder_lib.c:ossl_encoder_instance_new:
  189|  38.0k|{
  190|  38.0k|    OSSL_ENCODER_INSTANCE *encoder_inst = NULL;
  191|  38.0k|    const OSSL_PROVIDER *prov;
  192|  38.0k|    OSSL_LIB_CTX *libctx;
  193|  38.0k|    const OSSL_PROPERTY_LIST *props;
  194|  38.0k|    const OSSL_PROPERTY_DEFINITION *prop;
  195|       |
  196|  38.0k|    if (!ossl_assert(encoder != NULL)) {
  ------------------
  |  |   52|  38.0k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  38.0k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (196:9): [True: 0, False: 38.0k]
  ------------------
  197|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  198|      0|        return 0;
  199|      0|    }
  200|       |
  201|  38.0k|    if ((encoder_inst = OPENSSL_zalloc(sizeof(*encoder_inst))) == NULL)
  ------------------
  |  |  104|  38.0k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  38.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  38.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (201:9): [True: 0, False: 38.0k]
  ------------------
  202|      0|        return 0;
  203|       |
  204|  38.0k|    if (!OSSL_ENCODER_up_ref(encoder)) {
  ------------------
  |  Branch (204:9): [True: 0, False: 38.0k]
  ------------------
  205|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  206|      0|        goto err;
  207|      0|    }
  208|       |
  209|  38.0k|    prov = OSSL_ENCODER_get0_provider(encoder);
  210|  38.0k|    libctx = ossl_provider_libctx(prov);
  211|  38.0k|    props = ossl_encoder_parsed_properties(encoder);
  212|  38.0k|    if (props == NULL) {
  ------------------
  |  Branch (212:9): [True: 0, False: 38.0k]
  ------------------
  213|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|      0|                       "there are no property definitions with encoder %s",
  215|      0|                       OSSL_ENCODER_get0_name(encoder));
  216|      0|        goto err;
  217|      0|    }
  218|       |
  219|       |    /* The "output" property is mandatory */
  220|  38.0k|    prop = ossl_property_find_property(props, libctx, "output");
  221|  38.0k|    encoder_inst->output_type = ossl_property_get_string_value(libctx, prop);
  222|  38.0k|    if (encoder_inst->output_type == NULL) {
  ------------------
  |  Branch (222:9): [True: 0, False: 38.0k]
  ------------------
  223|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|      0|                       "the mandatory 'output' property is missing "
  225|      0|                       "for encoder %s (properties: %s)",
  226|      0|                       OSSL_ENCODER_get0_name(encoder),
  227|      0|                       OSSL_ENCODER_get0_properties(encoder));
  228|      0|        goto err;
  229|      0|    }
  230|       |
  231|       |    /* The "structure" property is optional */
  232|  38.0k|    prop = ossl_property_find_property(props, libctx, "structure");
  233|  38.0k|    if (prop != NULL)
  ------------------
  |  Branch (233:9): [True: 30.8k, False: 7.24k]
  ------------------
  234|  30.8k|        encoder_inst->output_structure
  235|  30.8k|            = ossl_property_get_string_value(libctx, prop);
  236|       |
  237|  38.0k|    encoder_inst->encoder = encoder;
  238|  38.0k|    encoder_inst->encoderctx = encoderctx;
  239|  38.0k|    return encoder_inst;
  240|      0| err:
  241|      0|    ossl_encoder_instance_free(encoder_inst);
  242|      0|    return NULL;
  243|  38.0k|}
encoder_lib.c:ossl_encoder_ctx_add_encoder_inst:
  259|  38.0k|{
  260|  38.0k|    int ok;
  261|       |
  262|  38.0k|    if (ctx->encoder_insts == NULL
  ------------------
  |  Branch (262:9): [True: 3.39k, False: 34.6k]
  ------------------
  263|  38.0k|        && (ctx->encoder_insts =
  ------------------
  |  Branch (263:12): [True: 0, False: 3.39k]
  ------------------
  264|  3.39k|            sk_OSSL_ENCODER_INSTANCE_new_null()) == NULL) {
  265|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|  38.0k|    ok = (sk_OSSL_ENCODER_INSTANCE_push(ctx->encoder_insts, ei) > 0);
  270|  38.0k|    if (ok) {
  ------------------
  |  Branch (270:9): [True: 38.0k, False: 0]
  ------------------
  271|  38.0k|        OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  219|  38.0k|    do {                                        \
  |  |  220|  38.0k|        BIO *trc_out = NULL;                    \
  |  |  221|  38.0k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  272|      0|            BIO_printf(trc_out,
  273|      0|                       "(ctx %p) Added encoder instance %p (encoder %p):\n"
  274|      0|                       "    %s with %s\n",
  275|      0|                       (void *)ctx, (void *)ei, (void *)ei->encoder,
  276|      0|                       OSSL_ENCODER_get0_name(ei->encoder),
  277|      0|                       OSSL_ENCODER_get0_properties(ei->encoder));
  278|  38.0k|        } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  224|  38.0k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  279|  38.0k|    }
  280|  38.0k|    return ok;
  281|  38.0k|}
encoder_lib.c:encoder_process:
  395|  6.74k|{
  396|  6.74k|    OSSL_ENCODER_INSTANCE *current_encoder_inst = NULL;
  397|  6.74k|    OSSL_ENCODER *current_encoder = NULL;
  398|  6.74k|    OSSL_ENCODER_CTX *current_encoder_ctx = NULL;
  399|  6.74k|    BIO *allocated_out = NULL;
  400|  6.74k|    const void *original_data = NULL;
  401|  6.74k|    OSSL_PARAM abstract[10];
  402|  6.74k|    const OSSL_PARAM *current_abstract = NULL;
  403|  6.74k|    int i;
  404|  6.74k|    int ok = -1;  /* -1 signifies that the lookup loop gave nothing */
  405|  6.74k|    int top = 0;
  406|       |
  407|  6.74k|    if (data->next_encoder_inst == NULL) {
  ------------------
  |  Branch (407:9): [True: 3.39k, False: 3.35k]
  ------------------
  408|       |        /* First iteration, where we prepare for what is to come */
  409|       |
  410|  3.39k|        data->count_output_structure =
  411|  3.39k|            data->ctx->output_structure == NULL ? -1 : 0;
  ------------------
  |  Branch (411:13): [True: 1.62k, False: 1.77k]
  ------------------
  412|  3.39k|        top = 1;
  413|  3.39k|    }
  414|       |
  415|  41.4k|    for (i = data->current_encoder_inst_index; i-- > 0;) {
  ------------------
  |  Branch (415:48): [True: 38.0k, False: 3.39k]
  ------------------
  416|  38.0k|        OSSL_ENCODER *next_encoder = NULL;
  417|  38.0k|        const char *current_output_type;
  418|  38.0k|        const char *current_output_structure;
  419|  38.0k|        struct encoder_process_data_st new_data;
  420|       |
  421|  38.0k|        if (!top)
  ------------------
  |  Branch (421:13): [True: 2.27k, False: 35.8k]
  ------------------
  422|  2.27k|            next_encoder =
  423|  2.27k|                OSSL_ENCODER_INSTANCE_get_encoder(data->next_encoder_inst);
  424|       |
  425|  38.0k|        current_encoder_inst =
  426|  38.0k|            sk_OSSL_ENCODER_INSTANCE_value(data->ctx->encoder_insts, i);
  427|  38.0k|        current_encoder =
  428|  38.0k|            OSSL_ENCODER_INSTANCE_get_encoder(current_encoder_inst);
  429|  38.0k|        current_encoder_ctx =
  430|  38.0k|            OSSL_ENCODER_INSTANCE_get_encoder_ctx(current_encoder_inst);
  431|  38.0k|        current_output_type =
  432|  38.0k|            OSSL_ENCODER_INSTANCE_get_output_type(current_encoder_inst);
  433|  38.0k|        current_output_structure =
  434|  38.0k|            OSSL_ENCODER_INSTANCE_get_output_structure(current_encoder_inst);
  435|  38.0k|        memset(&new_data, 0, sizeof(new_data));
  436|  38.0k|        new_data.ctx = data->ctx;
  437|  38.0k|        new_data.current_encoder_inst_index = i;
  438|  38.0k|        new_data.next_encoder_inst = current_encoder_inst;
  439|  38.0k|        new_data.count_output_structure = data->count_output_structure;
  440|  38.0k|        new_data.level = data->level + 1;
  441|       |
  442|  38.0k|        OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  219|  38.0k|    do {                                        \
  |  |  220|  38.0k|        BIO *trc_out = NULL;                    \
  |  |  221|  38.0k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  443|      0|            BIO_printf(trc_out,
  444|      0|                       "[%d] (ctx %p) Considering encoder instance %p (encoder %p)\n",
  445|      0|                       data->level, (void *)data->ctx,
  446|      0|                       (void *)current_encoder_inst, (void *)current_encoder);
  447|  38.0k|        } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  224|  38.0k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  448|       |
  449|       |        /*
  450|       |         * If this is the top call, we check if the output type of the current
  451|       |         * encoder matches the desired output type.
  452|       |         * If this isn't the top call, i.e. this is deeper in the recursion,
  453|       |         * we instead check if the output type of the current encoder matches
  454|       |         * the name of the next encoder (the one found by the parent call).
  455|       |         */
  456|  38.0k|        if (top) {
  ------------------
  |  Branch (456:13): [True: 35.8k, False: 2.27k]
  ------------------
  457|  35.8k|            if (data->ctx->output_type != NULL
  ------------------
  |  Branch (457:17): [True: 35.8k, False: 0]
  ------------------
  458|  35.8k|                && OPENSSL_strcasecmp(current_output_type,
  ------------------
  |  Branch (458:20): [True: 26.4k, False: 9.38k]
  ------------------
  459|  35.8k|                                      data->ctx->output_type) != 0) {
  460|  26.4k|                OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  219|  26.4k|    do {                                        \
  |  |  220|  26.4k|        BIO *trc_out = NULL;                    \
  |  |  221|  26.4k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  461|      0|                    BIO_printf(trc_out,
  462|      0|                               "[%d]    Skipping because current encoder output type (%s) != desired output type (%s)\n",
  463|      0|                               data->level,
  464|      0|                               current_output_type, data->ctx->output_type);
  465|  26.4k|                } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  224|  26.4k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  466|  26.4k|                continue;
  467|  26.4k|            }
  468|  35.8k|        } else {
  469|  2.27k|            if (!OSSL_ENCODER_is_a(next_encoder, current_output_type)) {
  ------------------
  |  Branch (469:17): [True: 2.27k, False: 0]
  ------------------
  470|  2.27k|                OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  219|  2.27k|    do {                                        \
  |  |  220|  2.27k|        BIO *trc_out = NULL;                    \
  |  |  221|  2.27k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  471|      0|                    BIO_printf(trc_out,
  472|      0|                               "[%d]    Skipping because current encoder output type (%s) != name of encoder %p\n",
  473|      0|                               data->level,
  474|      0|                               current_output_type, (void *)next_encoder);
  475|  2.27k|                } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  224|  2.27k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  476|  2.27k|                continue;
  477|  2.27k|            }
  478|  2.27k|        }
  479|       |
  480|       |        /*
  481|       |         * If the caller and the current encoder specify an output structure,
  482|       |         * Check if they match.  If they do, count the match, otherwise skip
  483|       |         * the current encoder.
  484|       |         */
  485|  9.38k|        if (data->ctx->output_structure != NULL
  ------------------
  |  Branch (485:13): [True: 7.76k, False: 1.62k]
  ------------------
  486|  9.38k|            && current_output_structure != NULL) {
  ------------------
  |  Branch (486:16): [True: 7.76k, False: 0]
  ------------------
  487|  7.76k|            if (OPENSSL_strcasecmp(data->ctx->output_structure,
  ------------------
  |  Branch (487:17): [True: 6.03k, False: 1.73k]
  ------------------
  488|  7.76k|                                   current_output_structure) != 0) {
  489|  6.03k|                OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  219|  6.03k|    do {                                        \
  |  |  220|  6.03k|        BIO *trc_out = NULL;                    \
  |  |  221|  6.03k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  490|      0|                    BIO_printf(trc_out,
  491|      0|                               "[%d]    Skipping because current encoder output structure (%s) != ctx output structure (%s)\n",
  492|      0|                               data->level,
  493|      0|                               current_output_structure,
  494|      0|                               data->ctx->output_structure);
  495|  6.03k|                } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  224|  6.03k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  496|  6.03k|                continue;
  497|  6.03k|            }
  498|       |
  499|  1.73k|            data->count_output_structure++;
  500|  1.73k|        }
  501|       |
  502|       |        /*
  503|       |         * Recurse to process the encoder implementations before the current
  504|       |         * one.
  505|       |         */
  506|  3.35k|        ok = encoder_process(&new_data);
  507|       |
  508|  3.35k|        data->prev_encoder_inst = new_data.prev_encoder_inst;
  509|  3.35k|        data->running_output = new_data.running_output;
  510|  3.35k|        data->running_output_length = new_data.running_output_length;
  511|       |
  512|       |        /*
  513|       |         * ok == -1     means that the recursion call above gave no further
  514|       |         *              encoders, and that the one we're currently at should
  515|       |         *              be tried.
  516|       |         * ok == 0      means that something failed in the recursion call
  517|       |         *              above, making the result unsuitable for a chain.
  518|       |         *              In this case, we simply continue to try finding a
  519|       |         *              suitable encoder at this recursion level.
  520|       |         * ok == 1      means that the recursion call was successful, and we
  521|       |         *              try to use the result at this recursion level.
  522|       |         */
  523|  3.35k|        if (ok != 0)
  ------------------
  |  Branch (523:13): [True: 3.35k, False: 0]
  ------------------
  524|  3.35k|            break;
  525|       |
  526|      0|        OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  219|      0|    do {                                        \
  |  |  220|      0|        BIO *trc_out = NULL;                    \
  |  |  221|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  527|      0|            BIO_printf(trc_out,
  528|      0|                       "[%d]    Skipping because recursion level %d failed\n",
  529|      0|                       data->level, new_data.level);
  530|      0|        } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  224|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  531|      0|    }
  532|       |
  533|       |    /*
  534|       |     * If |i < 0|, we didn't find any useful encoder in this recursion, so
  535|       |     * we do the rest of the process only if |i >= 0|.
  536|       |     */
  537|  6.74k|    if (i < 0) {
  ------------------
  |  Branch (537:9): [True: 3.39k, False: 3.35k]
  ------------------
  538|  3.39k|        ok = -1;
  539|       |
  540|  3.39k|        OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  219|  3.39k|    do {                                        \
  |  |  220|  3.39k|        BIO *trc_out = NULL;                    \
  |  |  221|  3.39k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  541|      0|            BIO_printf(trc_out,
  542|      0|                       "[%d] (ctx %p) No suitable encoder found\n",
  543|      0|                       data->level, (void *)data->ctx);
  544|  3.39k|        } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  224|  3.39k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  545|  3.39k|    } else {
  546|       |        /* Preparations */
  547|       |
  548|  3.35k|        switch (ok) {
  ------------------
  |  Branch (548:17): [True: 0, False: 3.35k]
  ------------------
  549|      0|        case 0:
  ------------------
  |  Branch (549:9): [True: 0, False: 3.35k]
  ------------------
  550|      0|            break;
  551|  3.35k|        case -1:
  ------------------
  |  Branch (551:9): [True: 3.35k, False: 0]
  ------------------
  552|       |            /*
  553|       |             * We have reached the beginning of the encoder instance sequence,
  554|       |             * so we prepare the object to be encoded.
  555|       |             */
  556|       |
  557|       |            /*
  558|       |             * |data->count_output_structure| is one of these values:
  559|       |             *
  560|       |             * -1       There is no desired output structure
  561|       |             *  0       There is a desired output structure, and it wasn't
  562|       |             *          matched by any of the encoder instances that were
  563|       |             *          considered
  564|       |             * >0       There is a desired output structure, and at least one
  565|       |             *          of the encoder instances matched it
  566|       |             */
  567|  3.35k|            if (data->count_output_structure == 0)
  ------------------
  |  Branch (567:17): [True: 0, False: 3.35k]
  ------------------
  568|      0|                return 0;
  569|       |
  570|  3.35k|            original_data =
  571|  3.35k|                data->ctx->construct(current_encoder_inst,
  572|  3.35k|                                     data->ctx->construct_data);
  573|       |
  574|       |            /* Also set the data type, using the encoder implementation name */
  575|  3.35k|            data->data_type = OSSL_ENCODER_get0_name(current_encoder);
  576|       |
  577|       |            /* Assume that the constructor recorded an error */
  578|  3.35k|            if (original_data != NULL)
  ------------------
  |  Branch (578:17): [True: 3.35k, False: 0]
  ------------------
  579|  3.35k|                ok = 1;
  580|      0|            else
  581|      0|                ok = 0;
  582|  3.35k|            break;
  583|      0|        case 1:
  ------------------
  |  Branch (583:9): [True: 0, False: 3.35k]
  ------------------
  584|      0|            if (!ossl_assert(data->running_output != NULL)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (584:17): [True: 0, False: 0]
  ------------------
  585|      0|                ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  586|      0|                ok = 0;
  587|      0|                break;
  588|      0|            }
  589|       |
  590|      0|            {
  591|       |                /*
  592|       |                 * Create an object abstraction from the latest output, which
  593|       |                 * was stolen from the previous round.
  594|       |                 */
  595|       |
  596|      0|                OSSL_PARAM *abstract_p = abstract;
  597|      0|                const char *prev_output_structure =
  598|      0|                    OSSL_ENCODER_INSTANCE_get_output_structure(data->prev_encoder_inst);
  599|       |
  600|      0|                *abstract_p++ =
  601|      0|                    OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  328|      0|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  602|      0|                                                     (char *)data->data_type, 0);
  603|      0|                if (prev_output_structure != NULL)
  ------------------
  |  Branch (603:21): [True: 0, False: 0]
  ------------------
  604|      0|                    *abstract_p++ =
  605|      0|                        OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_STRUCTURE,
  ------------------
  |  |  327|      0|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  606|      0|                                                         (char *)prev_output_structure,
  607|      0|                                                         0);
  608|      0|                *abstract_p++ =
  609|      0|                    OSSL_PARAM_construct_octet_string(OSSL_OBJECT_PARAM_DATA,
  ------------------
  |  |  326|      0|# define OSSL_OBJECT_PARAM_DATA "data"
  ------------------
  610|      0|                                                      data->running_output,
  611|      0|                                                      data->running_output_length);
  612|      0|                *abstract_p = OSSL_PARAM_construct_end();
  613|      0|                current_abstract = abstract;
  614|      0|            }
  615|      0|            break;
  616|  3.35k|        }
  617|       |
  618|       |        /* Calling the encoder implementation */
  619|       |
  620|  3.35k|        if (ok) {
  ------------------
  |  Branch (620:13): [True: 3.35k, False: 0]
  ------------------
  621|  3.35k|            OSSL_CORE_BIO *cbio = NULL;
  622|  3.35k|            BIO *current_out = NULL;
  623|       |
  624|       |            /*
  625|       |             * If we're at the last encoder instance to use, we're setting up
  626|       |             * final output.  Otherwise, set up an intermediary memory output.
  627|       |             */
  628|  3.35k|            if (top)
  ------------------
  |  Branch (628:17): [True: 3.35k, False: 0]
  ------------------
  629|  3.35k|                current_out = data->bio;
  630|      0|            else if ((current_out = allocated_out = BIO_new(BIO_s_mem()))
  ------------------
  |  Branch (630:22): [True: 0, False: 0]
  ------------------
  631|      0|                     == NULL)
  632|      0|                ok = 0;     /* Assume BIO_new() recorded an error */
  633|       |
  634|  3.35k|            if (ok)
  ------------------
  |  Branch (634:17): [True: 3.35k, False: 0]
  ------------------
  635|  3.35k|                ok = (cbio = ossl_core_bio_new_from_bio(current_out)) != NULL;
  636|  3.35k|            if (ok) {
  ------------------
  |  Branch (636:17): [True: 3.35k, False: 0]
  ------------------
  637|  3.35k|                ok = current_encoder->encode(current_encoder_ctx, cbio,
  638|  3.35k|                                             original_data, current_abstract,
  639|  3.35k|                                             data->ctx->selection,
  640|  3.35k|                                             ossl_pw_passphrase_callback_enc,
  641|  3.35k|                                             &data->ctx->pwdata);
  642|  3.35k|                OSSL_TRACE_BEGIN(ENCODER) {
  ------------------
  |  |  219|  3.35k|    do {                                        \
  |  |  220|  3.35k|        BIO *trc_out = NULL;                    \
  |  |  221|  3.35k|        if (0)
  |  |  ------------------
  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  643|      0|                    BIO_printf(trc_out,
  644|      0|                               "[%d] (ctx %p) Running encoder instance %p => %d\n",
  645|      0|                               data->level, (void *)data->ctx,
  646|      0|                               (void *)current_encoder_inst, ok);
  647|  3.35k|                } OSSL_TRACE_END(ENCODER);
  ------------------
  |  |  224|  3.35k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  648|  3.35k|            }
  649|       |
  650|  3.35k|            ossl_core_bio_free(cbio);
  651|  3.35k|            data->prev_encoder_inst = current_encoder_inst;
  652|  3.35k|        }
  653|  3.35k|    }
  654|       |
  655|       |    /* Cleanup and collecting the result */
  656|       |
  657|  6.74k|    OPENSSL_free(data->running_output);
  ------------------
  |  |  115|  6.74k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  6.74k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  6.74k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  658|  6.74k|    data->running_output = NULL;
  659|       |
  660|       |    /*
  661|       |     * Steal the output from the BIO_s_mem, if we did allocate one.
  662|       |     * That'll be the data for an object abstraction in the next round.
  663|       |     */
  664|  6.74k|    if (allocated_out != NULL) {
  ------------------
  |  Branch (664:9): [True: 0, False: 6.74k]
  ------------------
  665|      0|        BUF_MEM *buf;
  666|       |
  667|      0|        BIO_get_mem_ptr(allocated_out, &buf);
  ------------------
  |  |  613|      0|# define BIO_get_mem_ptr(b,pp)   BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0, \
  |  |  ------------------
  |  |  |  |  445|      0|# define BIO_C_GET_BUF_MEM_PTR                   115
  |  |  ------------------
  |  |  614|      0|                                          (char *)(pp))
  ------------------
  668|      0|        data->running_output = (unsigned char *)buf->data;
  669|      0|        data->running_output_length = buf->length;
  670|      0|        memset(buf, 0, sizeof(*buf));
  671|      0|    }
  672|       |
  673|  6.74k|    BIO_free(allocated_out);
  674|  6.74k|    if (original_data != NULL)
  ------------------
  |  Branch (674:9): [True: 3.35k, False: 3.39k]
  ------------------
  675|  3.35k|        data->ctx->cleanup(data->ctx->construct_data);
  676|  6.74k|    return ok;
  677|  6.74k|}

OSSL_ENCODER_up_ref:
   43|  38.2k|{
   44|  38.2k|    int ref = 0;
   45|       |
   46|  38.2k|    CRYPTO_UP_REF(&encoder->base.refcnt, &ref);
   47|  38.2k|    return 1;
   48|  38.2k|}
OSSL_ENCODER_free:
   51|  38.3k|{
   52|  38.3k|    int ref = 0;
   53|       |
   54|  38.3k|    if (encoder == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 38.3k]
  ------------------
   55|      0|        return;
   56|       |
   57|  38.3k|    CRYPTO_DOWN_REF(&encoder->base.refcnt, &ref);
   58|  38.3k|    if (ref > 0)
  ------------------
  |  Branch (58:9): [True: 38.2k, False: 115]
  ------------------
   59|  38.2k|        return;
   60|    115|    OPENSSL_free(encoder->base.name);
  ------------------
  |  |  115|    115|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    115|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    115|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|    115|    ossl_property_free(encoder->base.parsed_propdef);
   62|    115|    ossl_provider_free(encoder->base.prov);
   63|    115|    CRYPTO_FREE_REF(&encoder->base.refcnt);
   64|    115|    OPENSSL_free(encoder);
  ------------------
  |  |  115|    115|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    115|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    115|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   65|    115|}
ossl_encoder_store_cache_flush:
  441|      2|{
  442|      2|    OSSL_METHOD_STORE *store = get_encoder_store(libctx);
  443|       |
  444|      2|    if (store != NULL)
  ------------------
  |  Branch (444:9): [True: 2, False: 0]
  ------------------
  445|      2|        return ossl_method_store_cache_flush_all(store);
  446|      0|    return 1;
  447|      2|}
OSSL_ENCODER_get0_provider:
  464|   859k|{
  465|   859k|    if (!ossl_assert(encoder != NULL)) {
  ------------------
  |  |   52|   859k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   859k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (465:9): [True: 0, False: 859k]
  ------------------
  466|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|      0|    }
  469|       |
  470|   859k|    return encoder->base.prov;
  471|   859k|}
ossl_encoder_parsed_properties:
  485|  38.0k|{
  486|  38.0k|    if (!ossl_assert(encoder != NULL)) {
  ------------------
  |  |   52|  38.0k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  38.0k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (486:9): [True: 0, False: 38.0k]
  ------------------
  487|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  488|      0|        return 0;
  489|      0|    }
  490|       |
  491|  38.0k|    return encoder->base.parsed_propdef;
  492|  38.0k|}
OSSL_ENCODER_get0_name:
  505|  3.35k|{
  506|  3.35k|    return encoder->base.name;
  507|  3.35k|}
OSSL_ENCODER_is_a:
  515|  2.27k|{
  516|  2.27k|    if (encoder->base.prov != NULL) {
  ------------------
  |  Branch (516:9): [True: 2.27k, False: 0]
  ------------------
  517|  2.27k|        OSSL_LIB_CTX *libctx = ossl_provider_libctx(encoder->base.prov);
  518|  2.27k|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  519|       |
  520|  2.27k|        return ossl_namemap_name2num(namemap, name) == encoder->base.id;
  521|  2.27k|    }
  522|      0|    return 0;
  523|  2.27k|}
OSSL_ENCODER_do_all_provided:
  541|  6.78k|{
  542|  6.78k|    struct encoder_data_st methdata;
  543|  6.78k|    struct do_one_data_st data;
  544|       |
  545|  6.78k|    methdata.libctx = libctx;
  546|  6.78k|    methdata.tmp_store = NULL;
  547|  6.78k|    (void)inner_ossl_encoder_fetch(&methdata, NULL, NULL /* properties */);
  548|       |
  549|  6.78k|    data.user_fn = user_fn;
  550|  6.78k|    data.user_arg = user_arg;
  551|  6.78k|    if (methdata.tmp_store != NULL)
  ------------------
  |  Branch (551:9): [True: 0, False: 6.78k]
  ------------------
  552|      0|        ossl_method_store_do_all(methdata.tmp_store, &do_one, &data);
  553|  6.78k|    ossl_method_store_do_all(get_encoder_store(libctx), &do_one, &data);
  554|  6.78k|    dealloc_tmp_encoder_store(methdata.tmp_store);
  555|  6.78k|}
OSSL_ENCODER_CTX_new:
  607|  3.45k|{
  608|  3.45k|    OSSL_ENCODER_CTX *ctx;
  609|       |
  610|  3.45k|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  3.45k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.45k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.45k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  611|  3.45k|    return ctx;
  612|  3.45k|}
OSSL_ENCODER_CTX_set_params:
  616|  3.45k|{
  617|  3.45k|    int ok = 1;
  618|  3.45k|    size_t i;
  619|  3.45k|    size_t l;
  620|       |
  621|  3.45k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|  3.45k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.45k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (621:9): [True: 0, False: 3.45k]
  ------------------
  622|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  623|      0|        return 0;
  624|      0|    }
  625|       |
  626|  3.45k|    if (ctx->encoder_insts == NULL)
  ------------------
  |  Branch (626:9): [True: 62, False: 3.39k]
  ------------------
  627|     62|        return 1;
  628|       |
  629|  3.39k|    l = OSSL_ENCODER_CTX_get_num_encoders(ctx);
  630|  41.4k|    for (i = 0; i < l; i++) {
  ------------------
  |  Branch (630:17): [True: 38.0k, False: 3.39k]
  ------------------
  631|  38.0k|        OSSL_ENCODER_INSTANCE *encoder_inst =
  632|  38.0k|            sk_OSSL_ENCODER_INSTANCE_value(ctx->encoder_insts, i);
  633|  38.0k|        OSSL_ENCODER *encoder = OSSL_ENCODER_INSTANCE_get_encoder(encoder_inst);
  634|  38.0k|        void *encoderctx = OSSL_ENCODER_INSTANCE_get_encoder_ctx(encoder_inst);
  635|       |
  636|  38.0k|        if (encoderctx == NULL || encoder->set_ctx_params == NULL)
  ------------------
  |  Branch (636:13): [True: 0, False: 38.0k]
  |  Branch (636:35): [True: 5.31k, False: 32.7k]
  ------------------
  637|  5.31k|            continue;
  638|  32.7k|        if (!encoder->set_ctx_params(encoderctx, params))
  ------------------
  |  Branch (638:13): [True: 0, False: 32.7k]
  ------------------
  639|      0|            ok = 0;
  640|  32.7k|    }
  641|  3.39k|    return ok;
  642|  3.45k|}
OSSL_ENCODER_CTX_free:
  645|  3.45k|{
  646|  3.45k|    if (ctx != NULL) {
  ------------------
  |  Branch (646:9): [True: 3.45k, False: 4]
  ------------------
  647|  3.45k|        sk_OSSL_ENCODER_INSTANCE_pop_free(ctx->encoder_insts,
  648|  3.45k|                                          ossl_encoder_instance_free);
  649|  3.45k|        OPENSSL_free(ctx->construct_data);
  ------------------
  |  |  115|  3.45k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.45k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.45k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  650|  3.45k|        ossl_pw_clear_passphrase_data(&ctx->pwdata);
  651|  3.45k|        OPENSSL_free(ctx);
  ------------------
  |  |  115|  3.45k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.45k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.45k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  652|  3.45k|    }
  653|  3.45k|}
encoder_meth.c:inner_ossl_encoder_fetch:
  353|  6.78k|{
  354|  6.78k|    OSSL_METHOD_STORE *store = get_encoder_store(methdata->libctx);
  355|  6.78k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  356|  6.78k|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (356:31): [True: 0, False: 6.78k]
  ------------------
  357|  6.78k|    void *method = NULL;
  358|  6.78k|    int unsupported, id;
  359|       |
  360|  6.78k|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (360:9): [True: 0, False: 6.78k]
  |  Branch (360:26): [True: 0, False: 6.78k]
  ------------------
  361|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  362|      0|        return NULL;
  363|      0|    }
  364|       |
  365|  6.78k|    id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (365:10): [True: 0, False: 6.78k]
  ------------------
  366|       |
  367|       |    /*
  368|       |     * If we haven't found the name yet, chances are that the algorithm to
  369|       |     * be fetched is unsupported.
  370|       |     */
  371|  6.78k|    unsupported = id == 0;
  372|       |
  373|  6.78k|    if (id == 0
  ------------------
  |  Branch (373:9): [True: 6.78k, False: 0]
  ------------------
  374|  6.78k|        || !ossl_method_store_cache_get(store, NULL, id, propq, &method)) {
  ------------------
  |  Branch (374:12): [True: 0, False: 0]
  ------------------
  375|  6.78k|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  376|  6.78k|            get_tmp_encoder_store,
  377|  6.78k|            reserve_encoder_store,
  378|  6.78k|            unreserve_encoder_store,
  379|  6.78k|            get_encoder_from_store,
  380|  6.78k|            put_encoder_in_store,
  381|  6.78k|            construct_encoder,
  382|  6.78k|            destruct_encoder
  383|  6.78k|        };
  384|  6.78k|        OSSL_PROVIDER *prov = NULL;
  385|       |
  386|  6.78k|        methdata->id = id;
  387|  6.78k|        methdata->names = name;
  388|  6.78k|        methdata->propquery = propq;
  389|  6.78k|        methdata->flag_construct_error_occurred = 0;
  390|  6.78k|        if ((method = ossl_method_construct(methdata->libctx, OSSL_OP_ENCODER,
  ------------------
  |  |  286|  6.78k|# define OSSL_OP_ENCODER                            20
  ------------------
  |  Branch (390:13): [True: 0, False: 6.78k]
  ------------------
  391|  6.78k|                                            &prov, 0 /* !force_cache */,
  392|  6.78k|                                            &mcm, methdata)) != NULL) {
  393|       |            /*
  394|       |             * If construction did create a method for us, we know that
  395|       |             * there is a correct name_id and meth_id, since those have
  396|       |             * already been calculated in get_encoder_from_store() and
  397|       |             * put_encoder_in_store() above.
  398|       |             */
  399|      0|            if (id == 0)
  ------------------
  |  Branch (399:17): [True: 0, False: 0]
  ------------------
  400|      0|                id = ossl_namemap_name2num(namemap, name);
  401|      0|            ossl_method_store_cache_set(store, prov, id, propq, method,
  402|      0|                                        up_ref_encoder, free_encoder);
  403|      0|        }
  404|       |
  405|       |        /*
  406|       |         * If we never were in the constructor, the algorithm to be fetched
  407|       |         * is unsupported.
  408|       |         */
  409|  6.78k|        unsupported = !methdata->flag_construct_error_occurred;
  410|  6.78k|    }
  411|       |
  412|  6.78k|    if ((id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (412:10): [True: 0, False: 6.78k]
  |  Branch (412:21): [True: 0, False: 6.78k]
  |  Branch (412:38): [True: 0, False: 0]
  ------------------
  413|      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 (413:20): [True: 0, False: 0]
  ------------------
  414|       |
  415|      0|        if (name == NULL)
  ------------------
  |  Branch (415:13): [True: 0, False: 0]
  ------------------
  416|      0|            name = ossl_namemap_num2name(namemap, id, 0);
  417|      0|        ERR_raise_data(ERR_LIB_OSSL_ENCODER, 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_ENCODER, code,
  ------------------
  |  |  120|      0|# define ERR_LIB_OSSL_ENCODER    59
  ------------------
  418|      0|                       "%s, Name (%s : %d), Properties (%s)",
  419|      0|                       ossl_lib_ctx_get_descriptor(methdata->libctx),
  420|      0|                       name == NULL ? "<null>" : name, id,
  ------------------
  |  Branch (420:24): [True: 0, False: 0]
  ------------------
  421|      0|                       properties == NULL ? "<null>" : properties);
  ------------------
  |  Branch (421:24): [True: 0, False: 0]
  ------------------
  422|      0|    }
  423|       |
  424|  6.78k|    return method;
  425|  6.78k|}
encoder_meth.c:reserve_encoder_store:
  107|  13.5k|{
  108|  13.5k|    struct encoder_data_st *methdata = data;
  109|       |
  110|  13.5k|    if (store == NULL
  ------------------
  |  Branch (110:9): [True: 13.5k, False: 0]
  ------------------
  111|  13.5k|        && (store = get_encoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (111:12): [True: 0, False: 13.5k]
  ------------------
  112|      0|        return 0;
  113|       |
  114|  13.5k|    return ossl_method_lock_store(store);
  115|  13.5k|}
encoder_meth.c:unreserve_encoder_store:
  118|  13.5k|{
  119|  13.5k|    struct encoder_data_st *methdata = data;
  120|       |
  121|  13.5k|    if (store == NULL
  ------------------
  |  Branch (121:9): [True: 13.5k, False: 0]
  ------------------
  122|  13.5k|        && (store = get_encoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (122:12): [True: 0, False: 13.5k]
  ------------------
  123|      0|        return 0;
  124|       |
  125|  13.5k|    return ossl_method_unlock_store(store);
  126|  13.5k|}
encoder_meth.c:get_encoder_from_store:
  131|  6.78k|{
  132|  6.78k|    struct encoder_data_st *methdata = data;
  133|  6.78k|    void *method = NULL;
  134|  6.78k|    int id;
  135|       |
  136|       |    /*
  137|       |     * get_encoder_from_store() is only called to try and get the method
  138|       |     * that OSSL_ENCODER_fetch() is asking for, and the name or name id are
  139|       |     * passed via methdata.
  140|       |     */
  141|  6.78k|    if ((id = methdata->id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (141:9): [True: 6.78k, False: 0]
  |  Branch (141:37): [True: 0, False: 6.78k]
  ------------------
  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, methdata->names, l);
  150|      0|    }
  151|       |
  152|  6.78k|    if (id == 0)
  ------------------
  |  Branch (152:9): [True: 6.78k, False: 0]
  ------------------
  153|  6.78k|        return NULL;
  154|       |
  155|      0|    if (store == NULL
  ------------------
  |  Branch (155:9): [True: 0, False: 0]
  ------------------
  156|      0|        && (store = get_encoder_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|}
encoder_meth.c:put_encoder_in_store:
  168|    115|{
  169|    115|    struct encoder_data_st *methdata = data;
  170|    115|    OSSL_NAMEMAP *namemap;
  171|    115|    int id;
  172|    115|    size_t l = 0;
  173|       |
  174|       |    /*
  175|       |     * put_encoder_in_store() is only called with an OSSL_ENCODER method that
  176|       |     * was successfully created by construct_encoder() 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|    115|    if (names != NULL) {
  ------------------
  |  Branch (180:9): [True: 115, False: 0]
  ------------------
  181|    115|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   25|    115|#define NAME_SEPARATOR ':'
  ------------------
  182|       |
  183|    115|        l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (183:14): [True: 115, False: 0]
  ------------------
  184|    115|    }
  185|       |
  186|    115|    if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
  ------------------
  |  Branch (186:9): [True: 0, False: 115]
  ------------------
  187|    115|        || (id = ossl_namemap_name2num_n(namemap, names, l)) == 0)
  ------------------
  |  Branch (187:12): [True: 0, False: 115]
  ------------------
  188|      0|        return 0;
  189|       |
  190|    115|    if (store == NULL && (store = get_encoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (190:9): [True: 115, False: 0]
  |  Branch (190:26): [True: 0, False: 115]
  ------------------
  191|      0|        return 0;
  192|       |
  193|    115|    return ossl_method_store_add(store, prov, id, propdef, method,
  194|    115|                                 (int (*)(void *))OSSL_ENCODER_up_ref,
  195|    115|                                 (void (*)(void *))OSSL_ENCODER_free);
  196|    115|}
encoder_meth.c:construct_encoder:
  305|    115|{
  306|       |    /*
  307|       |     * This function is only called if get_encoder_from_store() returned
  308|       |     * NULL, so it's safe to say that of all the spots to create a new
  309|       |     * namemap entry, this is it.  Should the name already exist there, we
  310|       |     * know that ossl_namemap_add() will return its corresponding number.
  311|       |     */
  312|    115|    struct encoder_data_st *methdata = data;
  313|    115|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  314|    115|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  315|    115|    const char *names = algodef->algorithm_names;
  316|    115|    int id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
  ------------------
  |  |   25|    115|#define NAME_SEPARATOR ':'
  ------------------
  317|    115|    void *method = NULL;
  318|       |
  319|    115|    if (id != 0)
  ------------------
  |  Branch (319:9): [True: 115, False: 0]
  ------------------
  320|    115|        method = encoder_from_algorithm(id, algodef, prov);
  321|       |
  322|       |    /*
  323|       |     * Flag to indicate that there was actual construction errors.  This
  324|       |     * helps inner_evp_generic_fetch() determine what error it should
  325|       |     * record on inaccessible algorithms.
  326|       |     */
  327|    115|    if (method == NULL)
  ------------------
  |  Branch (327:9): [True: 0, False: 115]
  ------------------
  328|      0|        methdata->flag_construct_error_occurred = 1;
  329|       |
  330|    115|    return method;
  331|    115|}
encoder_meth.c:encoder_from_algorithm:
  201|    115|{
  202|    115|    OSSL_ENCODER *encoder = NULL;
  203|    115|    const OSSL_DISPATCH *fns = algodef->implementation;
  204|    115|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  205|       |
  206|    115|    if ((encoder = ossl_encoder_new()) == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 115]
  ------------------
  207|      0|        return NULL;
  208|    115|    encoder->base.id = id;
  209|    115|    if ((encoder->base.name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (209:9): [True: 0, False: 115]
  ------------------
  210|      0|        OSSL_ENCODER_free(encoder);
  211|      0|        return NULL;
  212|      0|    }
  213|    115|    encoder->base.algodef = algodef;
  214|    115|    if ((encoder->base.parsed_propdef
  ------------------
  |  Branch (214:9): [True: 0, False: 115]
  ------------------
  215|    115|         = ossl_parse_property(libctx, algodef->property_definition)) == NULL) {
  216|      0|        OSSL_ENCODER_free(encoder);
  217|      0|        return NULL;
  218|      0|    }
  219|       |
  220|    994|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (220:12): [True: 879, False: 115]
  ------------------
  221|    879|        switch (fns->function_id) {
  ------------------
  |  Branch (221:17): [True: 0, False: 879]
  ------------------
  222|    115|        case OSSL_FUNC_ENCODER_NEWCTX:
  ------------------
  |  |  884|    115|# define OSSL_FUNC_ENCODER_NEWCTX                      1
  ------------------
  |  Branch (222:9): [True: 115, False: 764]
  ------------------
  223|    115|            if (encoder->newctx == NULL)
  ------------------
  |  Branch (223:17): [True: 115, False: 0]
  ------------------
  224|    115|                encoder->newctx =
  225|    115|                    OSSL_FUNC_encoder_newctx(fns);
  226|    115|            break;
  227|    115|        case OSSL_FUNC_ENCODER_FREECTX:
  ------------------
  |  |  885|    115|# define OSSL_FUNC_ENCODER_FREECTX                     2
  ------------------
  |  Branch (227:9): [True: 115, False: 764]
  ------------------
  228|    115|            if (encoder->freectx == NULL)
  ------------------
  |  Branch (228:17): [True: 115, False: 0]
  ------------------
  229|    115|                encoder->freectx =
  230|    115|                    OSSL_FUNC_encoder_freectx(fns);
  231|    115|            break;
  232|      0|        case OSSL_FUNC_ENCODER_GET_PARAMS:
  ------------------
  |  |  886|      0|# define OSSL_FUNC_ENCODER_GET_PARAMS                  3
  ------------------
  |  Branch (232:9): [True: 0, False: 879]
  ------------------
  233|      0|            if (encoder->get_params == NULL)
  ------------------
  |  Branch (233:17): [True: 0, False: 0]
  ------------------
  234|      0|                encoder->get_params =
  235|      0|                    OSSL_FUNC_encoder_get_params(fns);
  236|      0|            break;
  237|      0|        case OSSL_FUNC_ENCODER_GETTABLE_PARAMS:
  ------------------
  |  |  887|      0|# define OSSL_FUNC_ENCODER_GETTABLE_PARAMS             4
  ------------------
  |  Branch (237:9): [True: 0, False: 879]
  ------------------
  238|      0|            if (encoder->gettable_params == NULL)
  ------------------
  |  Branch (238:17): [True: 0, False: 0]
  ------------------
  239|      0|                encoder->gettable_params =
  240|      0|                    OSSL_FUNC_encoder_gettable_params(fns);
  241|      0|            break;
  242|    100|        case OSSL_FUNC_ENCODER_SET_CTX_PARAMS:
  ------------------
  |  |  888|    100|# define OSSL_FUNC_ENCODER_SET_CTX_PARAMS              5
  ------------------
  |  Branch (242:9): [True: 100, False: 779]
  ------------------
  243|    100|            if (encoder->set_ctx_params == NULL)
  ------------------
  |  Branch (243:17): [True: 100, False: 0]
  ------------------
  244|    100|                encoder->set_ctx_params =
  245|    100|                    OSSL_FUNC_encoder_set_ctx_params(fns);
  246|    100|            break;
  247|    100|        case OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  889|    100|# define OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS         6
  ------------------
  |  Branch (247:9): [True: 100, False: 779]
  ------------------
  248|    100|            if (encoder->settable_ctx_params == NULL)
  ------------------
  |  Branch (248:17): [True: 100, False: 0]
  ------------------
  249|    100|                encoder->settable_ctx_params =
  250|    100|                    OSSL_FUNC_encoder_settable_ctx_params(fns);
  251|    100|            break;
  252|    104|        case OSSL_FUNC_ENCODER_DOES_SELECTION:
  ------------------
  |  |  890|    104|# define OSSL_FUNC_ENCODER_DOES_SELECTION             10
  ------------------
  |  Branch (252:9): [True: 104, False: 775]
  ------------------
  253|    104|            if (encoder->does_selection == NULL)
  ------------------
  |  Branch (253:17): [True: 104, False: 0]
  ------------------
  254|    104|                encoder->does_selection =
  255|    104|                    OSSL_FUNC_encoder_does_selection(fns);
  256|    104|            break;
  257|    115|        case OSSL_FUNC_ENCODER_ENCODE:
  ------------------
  |  |  891|    115|# define OSSL_FUNC_ENCODER_ENCODE                     11
  ------------------
  |  Branch (257:9): [True: 115, False: 764]
  ------------------
  258|    115|            if (encoder->encode == NULL)
  ------------------
  |  Branch (258:17): [True: 115, False: 0]
  ------------------
  259|    115|                encoder->encode = OSSL_FUNC_encoder_encode(fns);
  260|    115|            break;
  261|    115|        case OSSL_FUNC_ENCODER_IMPORT_OBJECT:
  ------------------
  |  |  892|    115|# define OSSL_FUNC_ENCODER_IMPORT_OBJECT              20
  ------------------
  |  Branch (261:9): [True: 115, False: 764]
  ------------------
  262|    115|            if (encoder->import_object == NULL)
  ------------------
  |  Branch (262:17): [True: 115, False: 0]
  ------------------
  263|    115|                encoder->import_object =
  264|    115|                    OSSL_FUNC_encoder_import_object(fns);
  265|    115|            break;
  266|    115|        case OSSL_FUNC_ENCODER_FREE_OBJECT:
  ------------------
  |  |  893|    115|# define OSSL_FUNC_ENCODER_FREE_OBJECT                21
  ------------------
  |  Branch (266:9): [True: 115, False: 764]
  ------------------
  267|    115|            if (encoder->free_object == NULL)
  ------------------
  |  Branch (267:17): [True: 115, False: 0]
  ------------------
  268|    115|                encoder->free_object =
  269|    115|                    OSSL_FUNC_encoder_free_object(fns);
  270|    115|            break;
  271|    879|        }
  272|    879|    }
  273|       |    /*
  274|       |     * Try to check that the method is sensible.
  275|       |     * If you have a constructor, you must have a destructor and vice versa.
  276|       |     * You must have the encoding driver functions.
  277|       |     */
  278|    115|    if (!((encoder->newctx == NULL && encoder->freectx == NULL)
  ------------------
  |  Branch (278:12): [True: 0, False: 115]
  |  Branch (278:39): [True: 0, False: 0]
  ------------------
  279|    115|          || (encoder->newctx != NULL && encoder->freectx != NULL)
  ------------------
  |  Branch (279:15): [True: 115, False: 0]
  |  Branch (279:42): [True: 115, False: 0]
  ------------------
  280|    115|          || (encoder->import_object != NULL && encoder->free_object != NULL)
  ------------------
  |  Branch (280:15): [True: 0, False: 0]
  |  Branch (280:49): [True: 0, False: 0]
  ------------------
  281|    115|          || (encoder->import_object == NULL && encoder->free_object == NULL))
  ------------------
  |  Branch (281:15): [True: 0, False: 0]
  |  Branch (281:49): [True: 0, False: 0]
  ------------------
  282|    115|        || encoder->encode == NULL) {
  ------------------
  |  Branch (282:12): [True: 0, False: 115]
  ------------------
  283|      0|        OSSL_ENCODER_free(encoder);
  284|      0|        ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  285|      0|        return NULL;
  286|      0|    }
  287|       |
  288|    115|    if (prov != NULL && !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (288:9): [True: 115, False: 0]
  |  Branch (288:25): [True: 0, False: 115]
  ------------------
  289|      0|        OSSL_ENCODER_free(encoder);
  290|      0|        return NULL;
  291|      0|    }
  292|       |
  293|    115|    encoder->base.prov = prov;
  294|    115|    return encoder;
  295|    115|}
encoder_meth.c:ossl_encoder_new:
   29|    115|{
   30|    115|    OSSL_ENCODER *encoder = NULL;
   31|       |
   32|    115|    if ((encoder = OPENSSL_zalloc(sizeof(*encoder))) == NULL)
  ------------------
  |  |  104|    115|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    115|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    115|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (32:9): [True: 0, False: 115]
  ------------------
   33|      0|        return NULL;
   34|    115|    if (!CRYPTO_NEW_REF(&encoder->base.refcnt, 1)) {
  ------------------
  |  Branch (34:9): [True: 0, False: 115]
  ------------------
   35|      0|        OSSL_ENCODER_free(encoder);
   36|      0|        return NULL;
   37|      0|    }
   38|       |
   39|    115|    return encoder;
   40|    115|}
encoder_meth.c:destruct_encoder:
  335|    115|{
  336|    115|    OSSL_ENCODER_free(method);
  337|    115|}
encoder_meth.c:dealloc_tmp_encoder_store:
   95|  6.78k|{
   96|  6.78k|    if (store != NULL)
  ------------------
  |  Branch (96:9): [True: 0, False: 6.78k]
  ------------------
   97|      0|        ossl_method_store_free(store);
   98|  6.78k|}
encoder_meth.c:get_encoder_store:
  102|  40.8k|{
  103|  40.8k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_ENCODER_STORE_INDEX);
  ------------------
  |  |  108|  40.8k|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  104|  40.8k|}
encoder_meth.c:do_one:
  531|   779k|{
  532|   779k|    struct do_one_data_st *data = arg;
  533|       |
  534|   779k|    data->user_fn(method, data->user_arg);
  535|   779k|}

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

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|   205k|{
  108|   205k|    int to_return = 1;
  109|       |
  110|   205k|    if (e == NULL)
  ------------------
  |  Branch (110:9): [True: 205k, False: 0]
  ------------------
  111|   205k|        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|   151k|{
  203|   151k|    ENGINE *ret = NULL;
  204|   151k|    ENGINE_PILE tmplate, *fnd = NULL;
  205|   151k|    int initres, loop = 0;
  206|       |
  207|   151k|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
  208|       |    /* Load the config before trying to check if engines are available */
  209|   151k|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  468|   151k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  210|   151k|#endif
  211|       |
  212|   151k|    if (!(*table)) {
  ------------------
  |  Branch (212:9): [True: 151k, False: 0]
  ------------------
  213|   151k|        OSSL_TRACE3(ENGINE_TABLE,
  ------------------
  |  |  294|   151k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  ------------------
  |  |  |  |  282|   151k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  214|   151k|                   "%s:%d, nid=%d, nothing registered!\n",
  215|   151k|                   f, l, nid);
  216|   151k|        return NULL;
  217|   151k|    }
  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|  9.81k|{
  311|  9.81k|    ENGINE_PILE_DOALL dall;
  312|  9.81k|    dall.cb = cb;
  313|  9.81k|    dall.arg = arg;
  314|  9.81k|    if (table)
  ------------------
  |  Branch (314:9): [True: 0, False: 9.81k]
  ------------------
  315|      0|        lh_ENGINE_PILE_doall_ENGINE_PILE_DOALL(&table->piles, int_dall, &dall);
  316|  9.81k|}

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

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

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

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

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

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

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|  42.4k|{
   61|  42.4k|    return ossl_engine_table_select(&rsa_table, dummy_nid,
   62|  42.4k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  291|  42.4k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  292|  42.4k|#   define OPENSSL_LINE __LINE__
  ------------------
   63|  42.4k|}

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|     72|{
  273|     72|#ifndef OPENSSL_NO_ERR
  274|     72|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|     72|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 72, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (274:9): [True: 0, False: 72]
  ------------------
  275|      0|        return 0;
  276|       |
  277|     72|    err_load_strings(ERR_str_libraries);
  278|     72|    err_load_strings(ERR_str_reasons);
  279|     72|#endif
  280|     72|    return 1;
  281|     72|}
ERR_load_strings_const:
  297|     70|{
  298|     70|#ifndef OPENSSL_NO_ERR
  299|     70|    if (ossl_err_load_ERR_strings() == 0)
  ------------------
  |  Branch (299:9): [True: 0, False: 70]
  ------------------
  300|      0|        return 0;
  301|     70|    err_load_strings(str);
  302|     70|#endif
  303|       |
  304|     70|    return 1;
  305|     70|}
ERR_clear_error:
  335|  11.5k|{
  336|  11.5k|    int i;
  337|  11.5k|    ERR_STATE *es;
  338|       |
  339|  11.5k|    es = ossl_err_get_state_int();
  340|  11.5k|    if (es == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 11.5k]
  ------------------
  341|      0|        return;
  342|       |
  343|   195k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|   195k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (343:17): [True: 184k, False: 11.5k]
  ------------------
  344|   184k|        err_clear(es, i, 0);
  345|   184k|    }
  346|  11.5k|    es->top = es->bottom = 0;
  347|  11.5k|}
ERR_peek_error:
  375|  2.88k|{
  376|  2.88k|    return get_error_values(EV_PEEK, NULL, NULL, NULL, NULL, NULL);
  377|  2.88k|}
ERR_peek_last_error:
  410|  3.73M|{
  411|  3.73M|    return get_error_values(EV_PEEK_LAST, NULL, NULL, NULL, NULL, NULL);
  412|  3.73M|}
ERR_reason_error_string:
  613|     70|{
  614|     70|#ifndef OPENSSL_NO_ERR
  615|     70|    ERR_STRING_DATA d, *p = NULL;
  616|     70|    unsigned long l, r;
  617|       |
  618|     70|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|     70|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 70, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (618:9): [True: 0, False: 70]
  ------------------
  619|      0|        return NULL;
  620|      0|    }
  621|       |
  622|       |    /*
  623|       |     * ERR_reason_error_string() can't safely return system error strings,
  624|       |     * since openssl_strerror_r() needs a buffer for thread safety, and we
  625|       |     * haven't got one that would serve any sensible purpose.
  626|       |     */
  627|     70|    if (ERR_SYSTEM_ERROR(e))
  ------------------
  |  |  239|     70|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|     70|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 70]
  |  |  ------------------
  ------------------
  628|      0|        return NULL;
  629|       |
  630|     70|    l = ERR_GET_LIB(e);
  631|     70|    r = ERR_GET_REASON(e);
  632|     70|    d.error = ERR_PACK(l, 0, r);
  ------------------
  |  |  279|     70|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     70|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     70|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     70|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     70|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  633|     70|    p = int_err_get_item(&d);
  634|     70|    if (p == NULL) {
  ------------------
  |  Branch (634:9): [True: 70, False: 0]
  ------------------
  635|     70|        d.error = ERR_PACK(0, 0, r);
  ------------------
  |  |  279|     70|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     70|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     70|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     70|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     70|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  636|     70|        p = int_err_get_item(&d);
  637|     70|    }
  638|     70|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (638:13): [True: 70, False: 0]
  ------------------
  639|       |#else
  640|       |    return NULL;
  641|       |#endif
  642|     70|}
ossl_err_get_state_int:
  673|  39.3M|{
  674|  39.3M|    ERR_STATE *state;
  675|  39.3M|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  39.3M|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|  39.3M|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  39.3M|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 0, False: 39.3M]
  ------------------
  678|      0|        return NULL;
  679|       |
  680|  39.3M|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|  39.3M|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 39.3M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 39.3M]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|  39.3M|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|  39.3M|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 39.3M]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|  39.3M|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 2, False: 39.3M]
  ------------------
  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|  39.3M|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  39.3M|# define set_sys_error(e)        errno=(e)
  ------------------
  709|  39.3M|    return state;
  710|  39.3M|}
err_shelve_state:
  725|      2|{
  726|      2|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|      2|# define get_last_sys_error()    errno
  ------------------
  727|       |
  728|       |    /*
  729|       |     * Note, at present our only caller is OPENSSL_init_crypto(), indirectly
  730|       |     * via ossl_init_load_crypto_nodelete(), by which point the requested
  731|       |     * "base" initialization has already been performed, so the below call is a
  732|       |     * NOOP, that re-enters OPENSSL_init_crypto() only to quickly return.
  733|       |     *
  734|       |     * If are no other valid callers of this function, the call below can be
  735|       |     * removed, avoiding the re-entry into OPENSSL_init_crypto().  If there are
  736|       |     * potential uses that are not from inside OPENSSL_init_crypto(), then this
  737|       |     * call is needed, but some care is required to make sure that the re-entry
  738|       |     * remains a NOOP.
  739|       |     */
  740|      2|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (740:9): [True: 0, False: 2]
  ------------------
  741|      0|        return 0;
  742|       |
  743|      2|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (743:9): [True: 0, False: 2]
  ------------------
  744|      0|        return 0;
  745|       |
  746|      2|    *state = CRYPTO_THREAD_get_local(&err_thread_local);
  747|      2|    if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (747:9): [True: 0, False: 2]
  ------------------
  748|      0|        return 0;
  749|       |
  750|      2|    set_sys_error(saveerrno);
  ------------------
  |  |   32|      2|# define set_sys_error(e)        errno=(e)
  ------------------
  751|      2|    return 1;
  752|      2|}
err_unshelve_state:
  759|      2|{
  760|      2|    if (state != (void*)-1)
  ------------------
  |  Branch (760:9): [True: 2, False: 0]
  ------------------
  761|      2|        CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)state);
  762|      2|}
ERR_get_next_error_library:
  765|      3|{
  766|      3|    int ret;
  767|       |
  768|      3|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|      3|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (768:9): [True: 0, False: 3]
  ------------------
  769|      0|        return 0;
  770|       |
  771|      3|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (771:9): [True: 0, False: 3]
  ------------------
  772|      0|        return 0;
  773|      3|    ret = int_err_library_number++;
  774|      3|    CRYPTO_THREAD_unlock(err_string_lock);
  775|      3|    return ret;
  776|      3|}
ERR_add_error_data:
  813|  1.97M|{
  814|  1.97M|    va_list args;
  815|  1.97M|    va_start(args, num);
  816|  1.97M|    ERR_add_error_vdata(num, args);
  817|  1.97M|    va_end(args);
  818|  1.97M|}
ERR_add_error_vdata:
  821|  1.97M|{
  822|  1.97M|    int i, len, size;
  823|  1.97M|    int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   48|  1.97M|# define ERR_TXT_MALLOCED        0x01
  ------------------
                  int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   49|  1.97M|# define ERR_TXT_STRING          0x02
  ------------------
  824|  1.97M|    char *str, *arg;
  825|  1.97M|    ERR_STATE *es;
  826|       |
  827|       |    /* Get the current error data; if an allocated string get it. */
  828|  1.97M|    es = ossl_err_get_state_int();
  829|  1.97M|    if (es == NULL)
  ------------------
  |  Branch (829:9): [True: 0, False: 1.97M]
  ------------------
  830|      0|        return;
  831|  1.97M|    i = es->top;
  832|       |
  833|       |    /*
  834|       |     * If err_data is allocated already, reuse the space.
  835|       |     * Otherwise, allocate a small new buffer.
  836|       |     */
  837|  1.97M|    if ((es->err_data_flags[i] & flags) == flags
  ------------------
  |  Branch (837:9): [True: 0, False: 1.97M]
  ------------------
  838|  1.97M|            && 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|  1.97M|    } else if ((str = OPENSSL_malloc(size = 81)) == NULL) {
  ------------------
  |  |  102|  1.97M|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.97M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.97M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (851:16): [True: 0, False: 1.97M]
  ------------------
  852|      0|        return;
  853|  1.97M|    } else {
  854|  1.97M|        str[0] = '\0';
  855|  1.97M|    }
  856|  1.97M|    len = strlen(str);
  857|       |
  858|  8.35M|    while (--num >= 0) {
  ------------------
  |  Branch (858:12): [True: 6.37M, False: 1.97M]
  ------------------
  859|  6.37M|        arg = va_arg(args, char *);
  860|  6.37M|        if (arg == NULL)
  ------------------
  |  Branch (860:13): [True: 0, False: 6.37M]
  ------------------
  861|      0|            arg = "<NULL>";
  862|  6.37M|        len += strlen(arg);
  863|  6.37M|        if (len >= size) {
  ------------------
  |  Branch (863:13): [True: 0, False: 6.37M]
  ------------------
  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|  6.37M|        OPENSSL_strlcat(str, arg, (size_t)size);
  875|  6.37M|    }
  876|  1.97M|    if (!err_set_error_data_int(str, size, flags, 0))
  ------------------
  |  Branch (876:9): [True: 0, False: 1.97M]
  ------------------
  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|  1.97M|}
err.c:do_err_strings_init:
  214|      2|{
  215|      2|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (215:9): [True: 0, False: 2]
  ------------------
  216|      0|        return 0;
  217|      2|    err_string_lock = CRYPTO_THREAD_lock_new();
  218|      2|    if (err_string_lock == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 2]
  ------------------
  219|      0|        return 0;
  220|      2|#ifndef OPENSSL_NO_ERR
  221|      2|    int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
  ------------------
  |  |  375|      2|#define lh_ERR_STRING_DATA_new(hfn, cmp) ((LHASH_OF(ERR_STRING_DATA) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)), lh_ERR_STRING_DATA_hash_thunk, lh_ERR_STRING_DATA_comp_thunk, lh_ERR_STRING_DATA_doall_thunk, lh_ERR_STRING_DATA_doall_arg_thunk))
  ------------------
  222|      2|                                            err_string_data_cmp);
  223|      2|    if (int_error_hash == NULL) {
  ------------------
  |  Branch (223:9): [True: 0, False: 2]
  ------------------
  224|      0|        CRYPTO_THREAD_lock_free(err_string_lock);
  225|      0|        err_string_lock = NULL;
  226|      0|        return 0;
  227|      0|    }
  228|      2|#endif
  229|      2|    return 1;
  230|      2|}
err.c:err_string_data_hash:
  172|  9.54k|{
  173|  9.54k|    unsigned long ret, l;
  174|       |
  175|  9.54k|    l = a->error;
  176|  9.54k|    ret = l ^ ERR_GET_LIB(l);
  177|  9.54k|    return (ret ^ ret % 19 * 13);
  178|  9.54k|}
err.c:err_string_data_cmp:
  182|  6.15k|{
  183|  6.15k|    if (a->error == b->error)
  ------------------
  |  Branch (183:9): [True: 5.74k, False: 408]
  ------------------
  184|  5.74k|        return 0;
  185|    408|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (185:12): [True: 222, False: 186]
  ------------------
  186|  6.15k|}
err.c:err_load_strings:
  260|    214|{
  261|    214|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (261:9): [True: 0, False: 214]
  ------------------
  262|      0|        return 0;
  263|  9.62k|    for (; str->error; str++)
  ------------------
  |  Branch (263:12): [True: 9.40k, False: 214]
  ------------------
  264|  9.40k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  378|  9.62k|#define lh_ERR_STRING_DATA_insert(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_insert(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  265|    214|                                       (ERR_STRING_DATA *)str);
  266|    214|    CRYPTO_THREAD_unlock(err_string_lock);
  267|    214|    return 1;
  268|    214|}
err.c:get_error_values:
  448|  3.73M|{
  449|  3.73M|    int i = 0;
  450|  3.73M|    ERR_STATE *es;
  451|  3.73M|    unsigned long ret;
  452|       |
  453|  3.73M|    es = ossl_err_get_state_int();
  454|  3.73M|    if (es == NULL)
  ------------------
  |  Branch (454:9): [True: 0, False: 3.73M]
  ------------------
  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|  3.73M|    while (es->bottom != es->top) {
  ------------------
  |  Branch (461:12): [True: 3.73M, False: 5.71k]
  ------------------
  462|  3.73M|        if (es->err_flags[es->top] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|  3.73M|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (462:13): [True: 0, False: 3.73M]
  ------------------
  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|  3.73M|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|  3.73M|#  define ERR_NUM_ERRORS  16
  ------------------
  468|  3.73M|        if (es->err_flags[i] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|  3.73M|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (468:13): [True: 0, False: 3.73M]
  ------------------
  469|      0|            es->bottom = i;
  470|      0|            err_clear(es, es->bottom, 0);
  471|      0|            continue;
  472|      0|        }
  473|  3.73M|        break;
  474|  3.73M|    }
  475|       |
  476|       |    /* If everything has been cleared, the stack is empty. */
  477|  3.73M|    if (es->bottom == es->top)
  ------------------
  |  Branch (477:9): [True: 5.71k, False: 3.73M]
  ------------------
  478|  5.71k|        return 0;
  479|       |
  480|       |    /* Which error, the top of stack (latest one) or the first one? */
  481|  3.73M|    if (g == EV_PEEK_LAST)
  ------------------
  |  Branch (481:9): [True: 3.73M, False: 27]
  ------------------
  482|  3.73M|        i = es->top;
  483|     27|    else
  484|     27|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|     27|#  define ERR_NUM_ERRORS  16
  ------------------
  485|       |
  486|  3.73M|    ret = es->err_buffer[i];
  487|  3.73M|    if (g == EV_POP) {
  ------------------
  |  Branch (487:9): [True: 0, False: 3.73M]
  ------------------
  488|      0|        es->bottom = i;
  489|      0|        es->err_buffer[i] = 0;
  490|      0|    }
  491|       |
  492|  3.73M|    if (file != NULL) {
  ------------------
  |  Branch (492:9): [True: 0, False: 3.73M]
  ------------------
  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|  3.73M|    if (line != NULL)
  ------------------
  |  Branch (497:9): [True: 0, False: 3.73M]
  ------------------
  498|      0|        *line = es->err_line[i];
  499|  3.73M|    if (func != NULL) {
  ------------------
  |  Branch (499:9): [True: 0, False: 3.73M]
  ------------------
  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|  3.73M|    if (flags != NULL)
  ------------------
  |  Branch (504:9): [True: 0, False: 3.73M]
  ------------------
  505|      0|        *flags = es->err_data_flags[i];
  506|  3.73M|    if (data == NULL) {
  ------------------
  |  Branch (506:9): [True: 3.73M, False: 0]
  ------------------
  507|  3.73M|        if (g == EV_POP) {
  ------------------
  |  Branch (507:13): [True: 0, False: 3.73M]
  ------------------
  508|      0|            err_clear_data(es, i, 0);
  509|      0|        }
  510|  3.73M|    } 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|  3.73M|    return ret;
  519|  3.73M|}
err.c:int_err_get_item:
  189|    140|{
  190|    140|    ERR_STRING_DATA *p = NULL;
  191|       |
  192|    140|    if (!CRYPTO_THREAD_read_lock(err_string_lock))
  ------------------
  |  Branch (192:9): [True: 0, False: 140]
  ------------------
  193|      0|        return NULL;
  194|    140|    p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
  ------------------
  |  |  380|    140|#define lh_ERR_STRING_DATA_retrieve(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_retrieve(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  195|    140|    CRYPTO_THREAD_unlock(err_string_lock);
  196|       |
  197|    140|    return p;
  198|    140|}
err.c:err_do_init:
  667|      2|{
  668|      2|    set_err_thread_local = 1;
  669|      2|    return CRYPTO_THREAD_init_local(&err_thread_local, NULL);
  670|      2|}
err.c:err_delete_thread_state:
  645|      2|{
  646|      2|    ERR_STATE *state = CRYPTO_THREAD_get_local(&err_thread_local);
  647|      2|    if (state == NULL)
  ------------------
  |  Branch (647:9): [True: 0, False: 2]
  ------------------
  648|      0|        return;
  649|       |
  650|      2|    CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  651|      2|    OSSL_ERR_STATE_free(state);
  652|      2|}
err.c:err_set_error_data_int:
  780|  1.97M|{
  781|  1.97M|    ERR_STATE *es;
  782|       |
  783|  1.97M|    es = ossl_err_get_state_int();
  784|  1.97M|    if (es == NULL)
  ------------------
  |  Branch (784:9): [True: 0, False: 1.97M]
  ------------------
  785|      0|        return 0;
  786|       |
  787|  1.97M|    err_clear_data(es, es->top, deallocate);
  788|  1.97M|    err_set_data(es, es->top, data, size, flags);
  789|       |
  790|  1.97M|    return 1;
  791|  1.97M|}

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

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

ERR_set_mark:
   16|   564k|{
   17|   564k|    ERR_STATE *es;
   18|       |
   19|   564k|    es = ossl_err_get_state_int();
   20|   564k|    if (es == NULL)
  ------------------
  |  Branch (20:9): [True: 0, False: 564k]
  ------------------
   21|      0|        return 0;
   22|       |
   23|   564k|    if (es->bottom == es->top)
  ------------------
  |  Branch (23:9): [True: 149k, False: 414k]
  ------------------
   24|   149k|        return 0;
   25|   414k|    es->err_marks[es->top]++;
   26|   414k|    return 1;
   27|   564k|}
ERR_pop_to_mark:
   43|  3.91M|{
   44|  3.91M|    ERR_STATE *es;
   45|       |
   46|  3.91M|    es = ossl_err_get_state_int();
   47|  3.91M|    if (es == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 3.91M]
  ------------------
   48|      0|        return 0;
   49|       |
   50|  8.11M|    while (es->bottom != es->top
  ------------------
  |  Branch (50:12): [True: 4.42M, False: 3.68M]
  ------------------
   51|  8.11M|           && es->err_marks[es->top] == 0) {
  ------------------
  |  Branch (51:15): [True: 4.19M, False: 228k]
  ------------------
   52|  4.19M|        err_clear(es, es->top, 0);
   53|  4.19M|        es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|  70.6k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (53:19): [True: 4.12M, False: 70.6k]
  ------------------
   54|  4.19M|    }
   55|       |
   56|  3.91M|    if (es->bottom == es->top)
  ------------------
  |  Branch (56:9): [True: 3.68M, False: 228k]
  ------------------
   57|  3.68M|        return 0;
   58|   228k|    es->err_marks[es->top]--;
   59|   228k|    return 1;
   60|  3.91M|}
ERR_clear_last_mark:
   82|   192k|{
   83|   192k|    ERR_STATE *es;
   84|   192k|    int top;
   85|       |
   86|   192k|    es = ossl_err_get_state_int();
   87|   192k|    if (es == NULL)
  ------------------
  |  Branch (87:9): [True: 0, False: 192k]
  ------------------
   88|      0|        return 0;
   89|       |
   90|   192k|    top = es->top;
   91|   637k|    while (es->bottom != top
  ------------------
  |  Branch (91:12): [True: 580k, False: 56.8k]
  ------------------
   92|   637k|           && es->err_marks[top] == 0) {
  ------------------
  |  Branch (92:15): [True: 444k, False: 135k]
  ------------------
   93|   444k|        top = top > 0 ? top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|  17.1k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (93:15): [True: 427k, False: 17.1k]
  ------------------
   94|   444k|    }
   95|       |
   96|   192k|    if (es->bottom == top)
  ------------------
  |  Branch (96:9): [True: 56.8k, False: 135k]
  ------------------
   97|  56.8k|        return 0;
   98|   135k|    es->err_marks[top]--;
   99|   135k|    return 1;
  100|   192k|}

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

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

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

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

evp_md_ctx_clear_digest:
   44|  5.72k|{
   45|  5.72k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (45:9): [True: 5.72k, False: 0]
  ------------------
   46|  5.72k|        if (ctx->digest != NULL && ctx->digest->freectx != NULL)
  ------------------
  |  Branch (46:13): [True: 5.72k, False: 0]
  |  Branch (46:36): [True: 5.72k, False: 0]
  ------------------
   47|  5.72k|            ctx->digest->freectx(ctx->algctx);
   48|  5.72k|        ctx->algctx = NULL;
   49|  5.72k|        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  202|  5.72k|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
   50|  5.72k|    }
   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|  5.72k|    cleanup_old_md_data(ctx, force);
   59|  5.72k|    if (force)
  ------------------
  |  Branch (59:9): [True: 0, False: 5.72k]
  ------------------
   60|      0|        ctx->digest = NULL;
   61|       |
   62|  5.72k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   63|  5.72k|    ENGINE_finish(ctx->engine);
   64|  5.72k|    ctx->engine = NULL;
   65|  5.72k|#endif
   66|       |
   67|       |    /* Non legacy code, this has to be later than the ctx->digest cleaning */
   68|  5.72k|    if (!keep_fetched) {
  ------------------
  |  Branch (68:9): [True: 5.72k, False: 0]
  ------------------
   69|  5.72k|        EVP_MD_free(ctx->fetched_digest);
   70|  5.72k|        ctx->fetched_digest = NULL;
   71|  5.72k|        ctx->reqdigest = NULL;
   72|  5.72k|    }
   73|  5.72k|}
EVP_MD_CTX_reset:
  100|  5.72k|{
  101|  5.72k|    return evp_md_ctx_reset_ex(ctx, 0);
  102|  5.72k|}
EVP_MD_CTX_new:
  131|  5.72k|{
  132|  5.72k|    return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  ------------------
  |  |  104|  5.72k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.72k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.72k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  133|  5.72k|}
EVP_MD_CTX_free:
  136|  7.69k|{
  137|  7.69k|    if (ctx == NULL)
  ------------------
  |  Branch (137:9): [True: 1.97k, False: 5.72k]
  ------------------
  138|  1.97k|        return;
  139|       |
  140|  5.72k|    EVP_MD_CTX_reset(ctx);
  141|  5.72k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  5.72k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.72k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.72k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  142|  5.72k|}
evp_md_ctx_free_algctx:
  145|  5.72k|{
  146|  5.72k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (146:9): [True: 0, False: 5.72k]
  ------------------
  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|  5.72k|    return 1;
  156|  5.72k|}
EVP_DigestInit_ex:
  382|  5.72k|{
  383|  5.72k|    return evp_md_init_internal(ctx, type, NULL, impl);
  384|  5.72k|}
EVP_DigestUpdate:
  387|  5.72k|{
  388|  5.72k|    if (count == 0)
  ------------------
  |  Branch (388:9): [True: 0, False: 5.72k]
  ------------------
  389|      0|        return 1;
  390|       |
  391|  5.72k|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|  5.72k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (391:9): [True: 0, False: 5.72k]
  ------------------
  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|  5.72k|    if (ctx->pctx != NULL
  ------------------
  |  Branch (396:9): [True: 0, False: 5.72k]
  ------------------
  397|  5.72k|            && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  732|  5.72k|    (((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|  5.72k|            && 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|  5.72k|    if (ctx->digest == NULL
  ------------------
  |  Branch (415:9): [True: 0, False: 5.72k]
  ------------------
  416|  5.72k|            || ctx->digest->prov == NULL
  ------------------
  |  Branch (416:16): [True: 0, False: 5.72k]
  ------------------
  417|  5.72k|            || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0)
  ------------------
  |  |  224|  5.72k|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (417:16): [True: 0, False: 5.72k]
  ------------------
  418|      0|        goto legacy;
  419|       |
  420|  5.72k|    if (ctx->digest->dupdate == NULL) {
  ------------------
  |  Branch (420:9): [True: 0, False: 5.72k]
  ------------------
  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|  5.72k|    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|  5.72k|}
EVP_DigestFinal_ex:
  442|  5.71k|{
  443|  5.71k|    int ret, sz;
  444|  5.71k|    size_t size = 0;
  445|  5.71k|    size_t mdsize = 0;
  446|       |
  447|  5.71k|    if (ctx->digest == NULL)
  ------------------
  |  Branch (447:9): [True: 0, False: 5.71k]
  ------------------
  448|      0|        return 0;
  449|       |
  450|  5.71k|    sz = EVP_MD_get_size(ctx->digest);
  451|  5.71k|    if (sz < 0)
  ------------------
  |  Branch (451:9): [True: 0, False: 5.71k]
  ------------------
  452|      0|        return 0;
  453|  5.71k|    mdsize = sz;
  454|  5.71k|    if (ctx->digest->prov == NULL)
  ------------------
  |  Branch (454:9): [True: 0, False: 5.71k]
  ------------------
  455|      0|        goto legacy;
  456|       |
  457|  5.71k|    if (sz == 0) /* Assuming a xoflen must have been set. */
  ------------------
  |  Branch (457:9): [True: 0, False: 5.71k]
  ------------------
  458|      0|        mdsize = SIZE_MAX;
  459|  5.71k|    if (ctx->digest->gettable_ctx_params != NULL) {
  ------------------
  |  Branch (459:9): [True: 0, False: 5.71k]
  ------------------
  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|  5.71k|    if (ctx->digest->dfinal == NULL) {
  ------------------
  |  Branch (468:9): [True: 0, False: 5.71k]
  ------------------
  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|  5.71k|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|  5.71k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (473:9): [True: 0, False: 5.71k]
  ------------------
  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|  5.71k|    ret = ctx->digest->dfinal(ctx->algctx, md, &size, mdsize);
  479|       |
  480|  5.71k|    ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|  5.71k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  481|       |
  482|  5.71k|    if (isize != NULL) {
  ------------------
  |  Branch (482:9): [True: 0, False: 5.71k]
  ------------------
  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|  5.71k|    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|  5.71k|}
EVP_DigestFinalXOF:
  509|      2|{
  510|      2|    int ret = 0;
  511|      2|    OSSL_PARAM params[2];
  512|      2|    size_t i = 0;
  513|       |
  514|      2|    if (ctx->digest == NULL) {
  ------------------
  |  Branch (514:9): [True: 0, False: 2]
  ------------------
  515|      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)
  |  |  ------------------
  ------------------
  516|      0|        return 0;
  517|      0|    }
  518|       |
  519|      2|    if (ctx->digest->prov == NULL)
  ------------------
  |  Branch (519:9): [True: 0, False: 2]
  ------------------
  520|      0|        goto legacy;
  521|       |
  522|      2|    if (ctx->digest->dfinal == NULL) {
  ------------------
  |  Branch (522:9): [True: 0, False: 2]
  ------------------
  523|      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)
  |  |  ------------------
  ------------------
  524|      0|        return 0;
  525|      0|    }
  526|       |
  527|      2|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|      2|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (527:9): [True: 0, False: 2]
  ------------------
  528|      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)
  |  |  ------------------
  ------------------
  529|      0|        return 0;
  530|      0|    }
  531|       |
  532|       |    /*
  533|       |     * For backward compatibility we pass the XOFLEN via a param here so that
  534|       |     * older providers can use the supplied value. Ideally we should have just
  535|       |     * used the size passed into ctx->digest->dfinal().
  536|       |     */
  537|      2|    params[i++] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_XOFLEN, &size);
  ------------------
  |  |  206|      2|# define OSSL_DIGEST_PARAM_XOFLEN "xoflen"
  ------------------
  538|      2|    params[i++] = OSSL_PARAM_construct_end();
  539|       |
  540|      2|    if (EVP_MD_CTX_set_params(ctx, params) >= 0)
  ------------------
  |  Branch (540:9): [True: 2, False: 0]
  ------------------
  541|      2|        ret = ctx->digest->dfinal(ctx->algctx, md, &size, size);
  542|       |
  543|      2|    ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|      2|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  544|       |
  545|      2|    return ret;
  546|       |
  547|      0|legacy:
  548|      0|    if (ctx->digest->flags & EVP_MD_FLAG_XOF
  ------------------
  |  |  164|      0|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
  |  Branch (548:9): [True: 0, False: 0]
  ------------------
  549|      0|        && size <= INT_MAX
  ------------------
  |  Branch (549:12): [True: 0, False: 0]
  ------------------
  550|      0|        && ctx->digest->md_ctrl(ctx, EVP_MD_CTRL_XOF_LEN, (int)size, NULL)) {
  ------------------
  |  |  189|      0|#  define EVP_MD_CTRL_XOF_LEN                     0x3
  ------------------
  |  Branch (550:12): [True: 0, False: 0]
  ------------------
  551|      0|        ret = ctx->digest->final(ctx, md);
  552|      0|        if (ctx->digest->cleanup != NULL) {
  ------------------
  |  Branch (552:13): [True: 0, False: 0]
  ------------------
  553|      0|            ctx->digest->cleanup(ctx);
  554|      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
  ------------------
  555|      0|        }
  556|      0|        OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
  557|      0|    } else {
  558|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NOT_XOF_OR_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)
  |  |  ------------------
  ------------------
  559|      0|    }
  560|       |
  561|      0|    return ret;
  562|      2|}
EVP_Digest:
  726|  5.71k|{
  727|  5.71k|    EVP_MD_CTX *ctx = EVP_MD_CTX_new();
  728|  5.71k|    int ret;
  729|       |
  730|  5.71k|    if (ctx == NULL)
  ------------------
  |  Branch (730:9): [True: 0, False: 5.71k]
  ------------------
  731|      0|        return 0;
  732|  5.71k|    EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT);
  ------------------
  |  |  200|  5.71k|# define EVP_MD_CTX_FLAG_ONESHOT         0x0001/* digest update will be
  ------------------
  733|  5.71k|    ret = EVP_DigestInit_ex(ctx, type, impl)
  ------------------
  |  Branch (733:11): [True: 5.71k, False: 0]
  ------------------
  734|  5.71k|        && EVP_DigestUpdate(ctx, data, count)
  ------------------
  |  Branch (734:12): [True: 5.71k, False: 0]
  ------------------
  735|  5.71k|        && EVP_DigestFinal_ex(ctx, md, size);
  ------------------
  |  Branch (735:12): [True: 5.71k, False: 0]
  ------------------
  736|  5.71k|    EVP_MD_CTX_free(ctx);
  737|       |
  738|  5.71k|    return ret;
  739|  5.71k|}
EVP_MD_CTX_set_params:
  774|      2|{
  775|      2|    EVP_PKEY_CTX *pctx = ctx->pctx;
  776|       |
  777|       |    /* If we have a pctx then we should try that first */
  778|      2|    if (pctx != NULL
  ------------------
  |  Branch (778:9): [True: 0, False: 2]
  ------------------
  779|      2|            && (pctx->operation == EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1700|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (779:17): [True: 0, False: 0]
  ------------------
  780|      0|                || pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1699|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  ------------------
  |  Branch (780:20): [True: 0, False: 0]
  ------------------
  781|      2|            && pctx->op.sig.algctx != NULL
  ------------------
  |  Branch (781:16): [True: 0, False: 0]
  ------------------
  782|      2|            && pctx->op.sig.signature->set_ctx_md_params != NULL)
  ------------------
  |  Branch (782:16): [True: 0, False: 0]
  ------------------
  783|      0|        return pctx->op.sig.signature->set_ctx_md_params(pctx->op.sig.algctx,
  784|      0|                                                         params);
  785|       |
  786|      2|    if (ctx->digest != NULL && ctx->digest->set_ctx_params != NULL)
  ------------------
  |  Branch (786:9): [True: 2, False: 0]
  |  Branch (786:32): [True: 2, False: 0]
  ------------------
  787|      2|        return ctx->digest->set_ctx_params(ctx->algctx, params);
  788|       |
  789|      0|    return 0;
  790|      2|}
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|  5.72k|{
 1151|  5.72k|    EVP_MD *md =
 1152|  5.72k|        evp_generic_fetch(ctx, OSSL_OP_DIGEST, algorithm, properties,
  ------------------
  |  |  275|  5.72k|# define OSSL_OP_DIGEST                              1
  ------------------
 1153|  5.72k|                          evp_md_from_algorithm, evp_md_up_ref, evp_md_free);
 1154|       |
 1155|  5.72k|    return md;
 1156|  5.72k|}
EVP_MD_up_ref:
 1159|  11.4k|{
 1160|  11.4k|    int ref = 0;
 1161|       |
 1162|  11.4k|    if (md->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  251|  11.4k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1162:9): [True: 11.4k, False: 0]
  ------------------
 1163|  11.4k|        CRYPTO_UP_REF(&md->refcnt, &ref);
 1164|  11.4k|    return 1;
 1165|  11.4k|}
EVP_MD_free:
 1168|  17.2k|{
 1169|  17.2k|    int i;
 1170|       |
 1171|  17.2k|    if (md == NULL || md->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  251|  11.4k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1171:9): [True: 5.72k, False: 11.4k]
  |  Branch (1171:23): [True: 0, False: 11.4k]
  ------------------
 1172|  5.72k|        return;
 1173|       |
 1174|  11.4k|    CRYPTO_DOWN_REF(&md->refcnt, &i);
 1175|  11.4k|    if (i > 0)
  ------------------
  |  Branch (1175:9): [True: 11.4k, False: 27]
  ------------------
 1176|  11.4k|        return;
 1177|     27|    evp_md_free_int(md);
 1178|     27|}
digest.c:cleanup_old_md_data:
   29|  11.4k|{
   30|  11.4k|    if (ctx->digest != NULL) {
  ------------------
  |  Branch (30:9): [True: 5.72k, False: 5.72k]
  ------------------
   31|  5.72k|        if (ctx->digest->cleanup != NULL
  ------------------
  |  Branch (31:13): [True: 0, False: 5.72k]
  ------------------
   32|  5.72k|                && !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|  5.72k|        if (ctx->md_data != NULL && ctx->digest->ctx_size > 0
  ------------------
  |  Branch (34:13): [True: 0, False: 5.72k]
  |  Branch (34:37): [True: 0, False: 0]
  ------------------
   35|  5.72k|                && (!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|  5.72k|    }
   41|  11.4k|}
digest.c:evp_md_ctx_reset_ex:
   76|  5.72k|{
   77|  5.72k|    if (ctx == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 5.72k]
  ------------------
   78|      0|        return 1;
   79|       |
   80|  5.72k|#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|  5.72k|    if (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX)) {
  ------------------
  |  |   32|  5.72k|#define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX   0x0400
  ------------------
  |  Branch (85:9): [True: 5.72k, False: 0]
  ------------------
   86|  5.72k|        EVP_PKEY_CTX_free(ctx->pctx);
   87|  5.72k|        ctx->pctx = NULL;
   88|  5.72k|    }
   89|  5.72k|#endif
   90|       |
   91|  5.72k|    evp_md_ctx_clear_digest(ctx, 0, keep_fetched);
   92|  5.72k|    if (!keep_fetched)
  ------------------
  |  Branch (92:9): [True: 5.72k, False: 0]
  ------------------
   93|  5.72k|        OPENSSL_cleanse(ctx, sizeof(*ctx));
   94|       |
   95|  5.72k|    return 1;
   96|  5.72k|}
digest.c:evp_md_init_internal:
  160|  5.72k|{
  161|  5.72k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  162|  5.72k|    ENGINE *tmpimpl = NULL;
  163|  5.72k|#endif
  164|       |
  165|  5.72k|#if !defined(FIPS_MODULE)
  166|  5.72k|    if (ctx->pctx != NULL
  ------------------
  |  Branch (166:9): [True: 0, False: 5.72k]
  ------------------
  167|  5.72k|            && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  732|  5.72k|    (((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|  5.72k|            && 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|  5.72k|#endif
  183|       |
  184|  5.72k|    EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED
  ------------------
  |  |  202|  5.72k|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  185|  5.72k|                                | EVP_MD_CTX_FLAG_FINALISED);
  ------------------
  |  |   33|  5.72k|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  186|       |
  187|  5.72k|    if (type != NULL) {
  ------------------
  |  Branch (187:9): [True: 5.72k, False: 0]
  ------------------
  188|  5.72k|        ctx->reqdigest = type;
  189|  5.72k|    } 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|  5.72k|#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|  5.72k|    if (ctx->engine != NULL
  ------------------
  |  Branch (205:9): [True: 0, False: 5.72k]
  ------------------
  206|  5.72k|            && ctx->digest != NULL
  ------------------
  |  Branch (206:16): [True: 0, False: 0]
  ------------------
  207|  5.72k|            && 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|  5.72k|    ENGINE_finish(ctx->engine);
  216|  5.72k|    ctx->engine = NULL;
  217|       |
  218|  5.72k|    if (impl == NULL)
  ------------------
  |  Branch (218:9): [True: 5.72k, False: 0]
  ------------------
  219|  5.72k|        tmpimpl = ENGINE_get_digest_engine(type->type);
  220|  5.72k|#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|  5.72k|    if (impl != NULL
  ------------------
  |  Branch (226:9): [True: 0, False: 5.72k]
  ------------------
  227|  5.72k|#if !defined(OPENSSL_NO_ENGINE)
  228|  5.72k|            || ctx->engine != NULL
  ------------------
  |  Branch (228:16): [True: 0, False: 5.72k]
  ------------------
  229|  5.72k|# if !defined(FIPS_MODULE)
  230|  5.72k|            || tmpimpl != NULL
  ------------------
  |  Branch (230:16): [True: 0, False: 5.72k]
  ------------------
  231|  5.72k|# endif
  232|  5.72k|#endif
  233|  5.72k|            || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0
  ------------------
  |  |  224|  5.72k|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (233:16): [True: 0, False: 5.72k]
  ------------------
  234|  5.72k|            || (type != NULL && type->origin == EVP_ORIG_METH)
  ------------------
  |  |  253|  5.72k|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (234:17): [True: 5.72k, False: 0]
  |  Branch (234:33): [True: 0, False: 5.72k]
  ------------------
  235|  5.72k|            || (type == NULL && ctx->digest != NULL
  ------------------
  |  Branch (235:17): [True: 0, False: 5.72k]
  |  Branch (235:33): [True: 0, False: 0]
  ------------------
  236|  5.72k|                             && 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|  5.72k|    cleanup_old_md_data(ctx, 1);
  248|       |
  249|       |    /* Start of non-legacy code below */
  250|  5.72k|    if (ctx->digest == type) {
  ------------------
  |  Branch (250:9): [True: 0, False: 5.72k]
  ------------------
  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|  5.72k|    } else {
  256|  5.72k|        if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (256:13): [True: 0, False: 5.72k]
  ------------------
  257|      0|            return 0;
  258|  5.72k|    }
  259|       |
  260|  5.72k|    if (type->prov == NULL) {
  ------------------
  |  Branch (260:9): [True: 0, False: 5.72k]
  ------------------
  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|  5.72k|    if (type->prov != NULL && ctx->fetched_digest != type) {
  ------------------
  |  Branch (281:9): [True: 5.72k, False: 0]
  |  Branch (281:31): [True: 5.72k, False: 0]
  ------------------
  282|  5.72k|        if (!EVP_MD_up_ref((EVP_MD *)type)) {
  ------------------
  |  Branch (282:13): [True: 0, False: 5.72k]
  ------------------
  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|  5.72k|        EVP_MD_free(ctx->fetched_digest);
  287|  5.72k|        ctx->fetched_digest = (EVP_MD *)type;
  288|  5.72k|    }
  289|  5.72k|    ctx->digest = type;
  290|  5.72k|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (290:9): [True: 5.72k, False: 0]
  ------------------
  291|  5.72k|        ctx->algctx = ctx->digest->newctx(ossl_provider_ctx(type->prov));
  292|  5.72k|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (292:13): [True: 0, False: 5.72k]
  ------------------
  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|  5.72k|    }
  297|       |
  298|  5.72k|    if (ctx->digest->dinit == NULL) {
  ------------------
  |  Branch (298:9): [True: 0, False: 5.72k]
  ------------------
  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|  5.72k|    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|  5.75k|{
 1140|  5.75k|    return EVP_MD_up_ref(md);
 1141|  5.75k|}
digest.c:evp_md_free:
 1144|     57|{
 1145|     57|    EVP_MD_free(md);
 1146|     57|}

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

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

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

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

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

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

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

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

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

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

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

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

OSSL_EC_curve_nid2name:
  119|    710|{
  120|    710|    size_t i;
  121|       |
  122|    710|    if (nid <= 0)
  ------------------
  |  Branch (122:9): [True: 0, False: 710]
  ------------------
  123|      0|        return NULL;
  124|       |
  125|  17.6k|    for (i = 0; i < OSSL_NELEM(curve_list); i++) {
  ------------------
  |  |   14|  17.6k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (125:17): [True: 17.6k, False: 0]
  ------------------
  126|  17.6k|        if (curve_list[i].nid == nid)
  ------------------
  |  Branch (126:13): [True: 710, False: 16.9k]
  ------------------
  127|    710|            return curve_list[i].name;
  128|  17.6k|    }
  129|      0|    return NULL;
  130|    710|}
ossl_ec_curve_nid2nist_int:
  171|  1.05k|{
  172|  1.05k|    size_t i;
  173|  14.0k|    for (i = 0; i < OSSL_NELEM(nist_curves); i++) {
  ------------------
  |  |   14|  14.0k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (173:17): [True: 13.4k, False: 533]
  ------------------
  174|  13.4k|        if (nist_curves[i].nid == nid)
  ------------------
  |  Branch (174:13): [True: 520, False: 12.9k]
  ------------------
  175|    520|            return nist_curves[i].name;
  176|  13.4k|    }
  177|    533|    return NULL;
  178|  1.05k|}

EVP_CIPHER_CTX_reset:
   34|  1.62k|{
   35|  1.62k|    if (ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 1.62k]
  ------------------
   36|      0|        return 1;
   37|       |
   38|  1.62k|    if (ctx->cipher == NULL || ctx->cipher->prov == NULL)
  ------------------
  |  Branch (38:9): [True: 1.62k, False: 0]
  |  Branch (38:32): [True: 0, False: 0]
  ------------------
   39|  1.62k|        goto legacy;
   40|       |
   41|      0|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 0]
  ------------------
   42|      0|        if (ctx->cipher->freectx != NULL)
  ------------------
  |  Branch (42:13): [True: 0, False: 0]
  ------------------
   43|      0|            ctx->cipher->freectx(ctx->algctx);
   44|      0|        ctx->algctx = NULL;
   45|      0|    }
   46|      0|    if (ctx->fetched_cipher != NULL)
  ------------------
  |  Branch (46:9): [True: 0, False: 0]
  ------------------
   47|      0|        EVP_CIPHER_free(ctx->fetched_cipher);
   48|      0|    memset(ctx, 0, sizeof(*ctx));
   49|      0|    ctx->iv_len = -1;
   50|       |
   51|      0|    return 1;
   52|       |
   53|       |    /* Remove legacy code below when legacy support is removed. */
   54|  1.62k| legacy:
   55|       |
   56|  1.62k|    if (ctx->cipher != NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 1.62k]
  ------------------
   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.62k|    OPENSSL_free(ctx->cipher_data);
  ------------------
  |  |  115|  1.62k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.62k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.62k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|  1.62k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   65|  1.62k|    ENGINE_finish(ctx->engine);
   66|  1.62k|#endif
   67|  1.62k|    memset(ctx, 0, sizeof(*ctx));
   68|  1.62k|    ctx->iv_len = -1;
   69|  1.62k|    return 1;
   70|  1.62k|}
EVP_CIPHER_CTX_new:
   73|  1.62k|{
   74|  1.62k|    EVP_CIPHER_CTX *ctx;
   75|       |
   76|  1.62k|    ctx = OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
  ------------------
  |  |  104|  1.62k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.62k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.62k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|  1.62k|    if (ctx == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 1.62k]
  ------------------
   78|      0|        return NULL;
   79|       |
   80|  1.62k|    ctx->iv_len = -1;
   81|  1.62k|    return ctx;
   82|  1.62k|}
EVP_CIPHER_CTX_free:
   85|  1.62k|{
   86|  1.62k|    if (ctx == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 1.62k]
  ------------------
   87|      0|        return;
   88|  1.62k|    EVP_CIPHER_CTX_reset(ctx);
   89|  1.62k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  1.62k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.62k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.62k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   90|  1.62k|}
EVP_CIPHER_free:
 1741|  30.8k|{
 1742|  30.8k|    int i;
 1743|       |
 1744|  30.8k|    if (cipher == NULL || cipher->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  251|      0|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1744:9): [True: 30.8k, False: 0]
  |  Branch (1744:27): [True: 0, False: 0]
  ------------------
 1745|  30.8k|        return;
 1746|       |
 1747|      0|    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
 1748|      0|    if (i > 0)
  ------------------
  |  Branch (1748:9): [True: 0, False: 0]
  ------------------
 1749|      0|        return;
 1750|      0|    evp_cipher_free_int(cipher);
 1751|      0|}

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|  5.72k|{
  373|  5.72k|    struct evp_method_data_st methdata;
  374|  5.72k|    void *method;
  375|       |
  376|  5.72k|    methdata.libctx = libctx;
  377|  5.72k|    methdata.tmp_store = NULL;
  378|  5.72k|    method = inner_evp_generic_fetch(&methdata, NULL, operation_id,
  379|  5.72k|                                     name, properties,
  380|  5.72k|                                     new_method, up_ref_method, free_method);
  381|  5.72k|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  382|  5.72k|    return method;
  383|  5.72k|}
evp_method_store_cache_flush:
  412|      2|{
  413|      2|    OSSL_METHOD_STORE *store = get_evp_method_store(libctx);
  414|       |
  415|      2|    if (store != NULL)
  ------------------
  |  Branch (415:9): [True: 2, False: 0]
  ------------------
  416|      2|        return ossl_method_store_cache_flush_all(store);
  417|      0|    return 1;
  418|      2|}
evp_generic_do_all:
  606|     79|{
  607|     79|    struct evp_method_data_st methdata;
  608|     79|    struct filter_data_st data;
  609|       |
  610|     79|    methdata.libctx = libctx;
  611|     79|    methdata.tmp_store = NULL;
  612|     79|    (void)inner_evp_generic_fetch(&methdata, NULL, operation_id, NULL, NULL,
  613|     79|                                  new_method, up_ref_method, free_method);
  614|       |
  615|     79|    data.operation_id = operation_id;
  616|     79|    data.user_fn = user_fn;
  617|     79|    data.user_arg = user_arg;
  618|     79|    if (methdata.tmp_store != NULL)
  ------------------
  |  Branch (618:9): [True: 0, False: 79]
  ------------------
  619|      0|        ossl_method_store_do_all(methdata.tmp_store, &filter_on_operation_id,
  620|      0|                                 &data);
  621|     79|    ossl_method_store_do_all(get_evp_method_store(libctx),
  622|     79|                             &filter_on_operation_id, &data);
  623|     79|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  624|     79|}
evp_is_a:
  628|  9.62k|{
  629|       |    /*
  630|       |     * For a |prov| that is NULL, the library context will be NULL
  631|       |     */
  632|  9.62k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  633|  9.62k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  634|       |
  635|  9.62k|    if (prov == NULL)
  ------------------
  |  Branch (635:9): [True: 5.71k, False: 3.91k]
  ------------------
  636|  5.71k|        number = ossl_namemap_name2num(namemap, legacy_name);
  637|  9.62k|    return ossl_namemap_name2num(namemap, name) == number;
  638|  9.62k|}
evp_names_do_all:
  643|  5.34k|{
  644|  5.34k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  645|  5.34k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  646|       |
  647|  5.34k|    return ossl_namemap_doall_names(namemap, number, fn, data);
  648|  5.34k|}
evp_fetch.c:inner_evp_generic_fetch:
  249|  5.80k|{
  250|  5.80k|    OSSL_METHOD_STORE *store = get_evp_method_store(methdata->libctx);
  251|  5.80k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  252|  5.80k|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (252:31): [True: 4, False: 5.79k]
  ------------------
  253|  5.80k|    uint32_t meth_id = 0;
  254|  5.80k|    void *method = NULL;
  255|  5.80k|    int unsupported, name_id;
  256|       |
  257|  5.80k|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (257:9): [True: 0, False: 5.80k]
  |  Branch (257:26): [True: 0, False: 5.80k]
  ------------------
  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|  5.80k|    if (!ossl_assert(operation_id > 0)) {
  ------------------
  |  |   52|  5.80k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  5.80k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (266:9): [True: 0, False: 5.80k]
  ------------------
  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|  5.80k|    name_id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (272:15): [True: 5.72k, False: 79]
  ------------------
  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|  5.80k|    if (name_id != 0 && (meth_id = evp_method_id(name_id, operation_id)) == 0) {
  ------------------
  |  Branch (282:9): [True: 5.72k, False: 80]
  |  Branch (282:25): [True: 0, False: 5.72k]
  ------------------
  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|  5.80k|    unsupported = name_id == 0;
  292|       |
  293|  5.80k|    if (meth_id == 0
  ------------------
  |  Branch (293:9): [True: 80, False: 5.72k]
  ------------------
  294|  5.80k|        || !ossl_method_store_cache_get(store, prov, meth_id, propq, &method)) {
  ------------------
  |  Branch (294:12): [True: 4, False: 5.71k]
  ------------------
  295|     84|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  296|     84|            get_tmp_evp_method_store,
  297|     84|            reserve_evp_method_store,
  298|     84|            unreserve_evp_method_store,
  299|     84|            get_evp_method_from_store,
  300|     84|            put_evp_method_in_store,
  301|     84|            construct_evp_method,
  302|     84|            destruct_evp_method
  303|     84|        };
  304|       |
  305|     84|        methdata->operation_id = operation_id;
  306|     84|        methdata->name_id = name_id;
  307|     84|        methdata->names = name;
  308|     84|        methdata->propquery = propq;
  309|     84|        methdata->method_from_algorithm = new_method;
  310|     84|        methdata->refcnt_up_method = up_ref_method;
  311|     84|        methdata->destruct_method = free_method;
  312|     84|        methdata->flag_construct_error_occurred = 0;
  313|     84|        if ((method = ossl_method_construct(methdata->libctx, operation_id,
  ------------------
  |  Branch (313:13): [True: 5, False: 79]
  ------------------
  314|     84|                                            &prov, 0 /* !force_cache */,
  315|     84|                                            &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: 1, False: 4]
  ------------------
  329|      1|                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|     84|        unsupported = !methdata->flag_construct_error_occurred;
  348|     84|    }
  349|       |
  350|  5.80k|    if ((name_id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (350:10): [True: 5.72k, False: 79]
  |  Branch (350:26): [True: 0, False: 79]
  |  Branch (350:43): [True: 0, False: 5.72k]
  ------------------
  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|  5.80k|    return method;
  363|  5.80k|}
evp_fetch.c:evp_method_id:
  112|  5.78k|{
  113|  5.78k|    if (!ossl_assert(name_id > 0 && name_id <= METHOD_ID_NAME_MAX)
  ------------------
  |  |   52|  11.5k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 5.78k, False: 0]
  |  |  |  Branch (52:43): [True: 5.78k, False: 0]
  |  |  ------------------
  |  |   53|  11.5k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (113:9): [True: 0, False: 5.78k]
  ------------------
  114|  5.78k|        || !ossl_assert(operation_id > 0
  ------------------
  |  |   52|  11.5k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 5.78k, False: 0]
  |  |  |  Branch (52:43): [True: 5.78k, False: 0]
  |  |  ------------------
  |  |   53|  5.78k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (114:12): [True: 0, False: 5.78k]
  ------------------
  115|  5.78k|                        && operation_id <= METHOD_ID_OPERATION_MAX))
  116|      0|        return 0;
  117|  5.78k|    return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  109|  5.78k|#define METHOD_ID_NAME_OFFSET           8
  ------------------
                  return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  108|  5.78k|#define METHOD_ID_NAME_MASK             0x7FFFFF00
  ------------------
  118|  5.78k|            | (operation_id & METHOD_ID_OPERATION_MASK));
  ------------------
  |  |  106|  5.78k|#define METHOD_ID_OPERATION_MASK        0x000000FF
  ------------------
  119|  5.78k|}
evp_fetch.c:reserve_evp_method_store:
   68|    168|{
   69|    168|    struct evp_method_data_st *methdata = data;
   70|       |
   71|    168|    if (store == NULL
  ------------------
  |  Branch (71:9): [True: 168, False: 0]
  ------------------
   72|    168|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (72:12): [True: 0, False: 168]
  ------------------
   73|      0|        return 0;
   74|       |
   75|    168|    return ossl_method_lock_store(store);
   76|    168|}
evp_fetch.c:unreserve_evp_method_store:
   79|    168|{
   80|    168|    struct evp_method_data_st *methdata = data;
   81|       |
   82|    168|    if (store == NULL
  ------------------
  |  Branch (82:9): [True: 168, False: 0]
  ------------------
   83|    168|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (83:12): [True: 0, False: 168]
  ------------------
   84|      0|        return 0;
   85|       |
   86|    168|    return ossl_method_unlock_store(store);
   87|    168|}
evp_fetch.c:get_evp_method_from_store:
  123|     84|{
  124|     84|    struct evp_method_data_st *methdata = data;
  125|     84|    void *method = NULL;
  126|     84|    int name_id;
  127|     84|    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|     84|    if ((name_id = methdata->name_id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (134:9): [True: 80, False: 4]
  |  Branch (134:47): [True: 1, False: 79]
  ------------------
  135|      1|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  136|      1|        const char *names = methdata->names;
  137|      1|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|      1|#define NAME_SEPARATOR ':'
  ------------------
  138|      1|        size_t l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (138:21): [True: 1, False: 0]
  ------------------
  139|       |
  140|      1|        if (namemap == 0)
  ------------------
  |  Branch (140:13): [True: 0, False: 1]
  ------------------
  141|      0|            return NULL;
  142|      1|        name_id = ossl_namemap_name2num_n(namemap, names, l);
  143|      1|    }
  144|       |
  145|     84|    if (name_id == 0
  ------------------
  |  Branch (145:9): [True: 79, False: 5]
  ------------------
  146|     84|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (146:12): [True: 0, False: 5]
  ------------------
  147|     79|        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|     51|{
  164|     51|    struct evp_method_data_st *methdata = data;
  165|     51|    OSSL_NAMEMAP *namemap;
  166|     51|    int name_id;
  167|     51|    uint32_t meth_id;
  168|     51|    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|     51|    if (names != NULL) {
  ------------------
  |  Branch (176:9): [True: 51, False: 0]
  ------------------
  177|     51|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|     51|#define NAME_SEPARATOR ':'
  ------------------
  178|       |
  179|     51|        l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (179:14): [True: 18, False: 33]
  ------------------
  180|     51|    }
  181|       |
  182|     51|    if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
  ------------------
  |  Branch (182:9): [True: 0, False: 51]
  ------------------
  183|     51|        || (name_id = ossl_namemap_name2num_n(namemap, names, l)) == 0
  ------------------
  |  Branch (183:12): [True: 0, False: 51]
  ------------------
  184|     51|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (184:12): [True: 0, False: 51]
  ------------------
  185|      0|        return 0;
  186|       |
  187|     51|    if (store == NULL
  ------------------
  |  Branch (187:9): [True: 51, False: 0]
  ------------------
  188|     51|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (188:12): [True: 0, False: 51]
  ------------------
  189|      0|        return 0;
  190|       |
  191|     51|    return ossl_method_store_add(store, prov, meth_id, propdef, method,
  192|     51|                                 methdata->refcnt_up_method,
  193|     51|                                 methdata->destruct_method);
  194|     51|}
evp_fetch.c:construct_evp_method:
  202|     51|{
  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|     51|    struct evp_method_data_st *methdata = data;
  211|     51|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  212|     51|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  213|     51|    const char *names = algodef->algorithm_names;
  214|     51|    int name_id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
  ------------------
  |  |   24|     51|#define NAME_SEPARATOR ':'
  ------------------
  215|     51|    void *method;
  216|       |
  217|     51|    if (name_id == 0)
  ------------------
  |  Branch (217:9): [True: 0, False: 51]
  ------------------
  218|      0|        return NULL;
  219|       |
  220|     51|    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|     51|    if (method == NULL)
  ------------------
  |  Branch (227:9): [True: 0, False: 51]
  ------------------
  228|      0|        methdata->flag_construct_error_occurred = 1;
  229|       |
  230|     51|    return method;
  231|     51|}
evp_fetch.c:destruct_evp_method:
  234|     51|{
  235|     51|    struct evp_method_data_st *methdata = data;
  236|       |
  237|     51|    methdata->destruct_method(method);
  238|     51|}
evp_fetch.c:dealloc_tmp_evp_method_store:
   57|  5.80k|{
   58|  5.80k|    if (store != NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 5.80k]
  ------------------
   59|      0|        ossl_method_store_free(store);
   60|  5.80k|}
evp_fetch.c:get_evp_method_store:
   63|  6.27k|{
   64|  6.27k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX);
  ------------------
  |  |   96|  6.27k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
   65|  6.27k|}
evp_fetch.c:filter_on_operation_id:
  591|  2.41k|{
  592|  2.41k|    struct filter_data_st *data = arg;
  593|       |
  594|  2.41k|    if ((id & METHOD_ID_OPERATION_MASK) == data->operation_id)
  ------------------
  |  |  106|  2.41k|#define METHOD_ID_OPERATION_MASK        0x000000FF
  ------------------
  |  Branch (594:9): [True: 1.42k, False: 990]
  ------------------
  595|  1.42k|        data->user_fn(method, data->user_arg);
  596|  2.41k|}

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_get_nid:
  701|    183|{
  702|    183|    return (cipher == NULL) ? NID_undef : cipher->nid;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (702:12): [True: 0, False: 183]
  ------------------
  703|    183|}
EVP_MD_is_a:
  767|  5.71k|{
  768|  5.71k|    if (md == NULL)
  ------------------
  |  Branch (768:9): [True: 0, False: 5.71k]
  ------------------
  769|      0|        return 0;
  770|  5.71k|    if (md->prov != NULL)
  ------------------
  |  Branch (770:9): [True: 0, False: 5.71k]
  ------------------
  771|      0|        return evp_is_a(md->prov, md->name_id, NULL, name);
  772|  5.71k|    return evp_is_a(NULL, 0, EVP_MD_get0_name(md), name);
  773|  5.71k|}
EVP_MD_get0_name:
  792|  11.4k|{
  793|  11.4k|    if (md == NULL)
  ------------------
  |  Branch (793:9): [True: 0, False: 11.4k]
  ------------------
  794|      0|        return NULL;
  795|  11.4k|    if (md->type_name != NULL)
  ------------------
  |  Branch (795:9): [True: 0, False: 11.4k]
  ------------------
  796|      0|        return md->type_name;
  797|  11.4k|#ifndef FIPS_MODULE
  798|  11.4k|    return OBJ_nid2sn(EVP_MD_nid(md));
  ------------------
  |  |  538|  11.4k|# define EVP_MD_nid EVP_MD_get_type
  ------------------
  799|       |#else
  800|       |    return NULL;
  801|       |#endif
  802|  11.4k|}
EVP_MD_get0_provider:
  815|  5.71k|{
  816|  5.71k|    return md->prov;
  817|  5.71k|}
EVP_MD_get_type:
  820|  17.2k|{
  821|  17.2k|    return md->type;
  822|  17.2k|}
EVP_MD_get_size:
  839|  5.71k|{
  840|  5.71k|    if (md == NULL) {
  ------------------
  |  Branch (840:9): [True: 0, False: 5.71k]
  ------------------
  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|  5.71k|    return md->md_size;
  845|  5.71k|}
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|  11.4k|{
 1107|  11.4k|    ctx->flags |= flags;
 1108|  11.4k|}
EVP_MD_CTX_clear_flags:
 1111|  5.72k|{
 1112|  5.72k|    ctx->flags &= ~flags;
 1113|  5.72k|}
EVP_MD_CTX_test_flags:
 1116|  5.72k|{
 1117|  5.72k|    return (ctx->flags & flags);
 1118|  5.72k|}
EVP_CIPHER_CTX_set_flags:
 1130|  1.62k|{
 1131|  1.62k|    int oldflags = ctx->flags;
 1132|       |
 1133|  1.62k|    ctx->flags |= flags;
 1134|  1.62k|    if (((oldflags ^ ctx->flags) & EVP_CIPH_FLAG_LENGTH_BITS) != 0)
  ------------------
  |  |  337|  1.62k|# define         EVP_CIPH_FLAG_LENGTH_BITS       0x2000
  ------------------
  |  Branch (1134:9): [True: 0, False: 1.62k]
  ------------------
 1135|      0|        evp_cipher_ctx_enable_use_bits(ctx, 1);
 1136|  1.62k|}

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

EVP_RAND_enable_locking:
   95|      1|{
   96|      1|    if (rand->meth->enable_locking != NULL)
  ------------------
  |  Branch (96:9): [True: 1, False: 0]
  ------------------
   97|      1|        return rand->meth->enable_locking(rand->algctx);
   98|      1|    ERR_raise(ERR_LIB_EVP, EVP_R_LOCKING_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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_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: 2, False: 0]
  ------------------
  488|      2|        return NULL;
  489|      0|    provctx = ossl_provider_ctx(EVP_RAND_get0_provider(ctx->meth));
  490|      0|    return ctx->meth->settable_ctx_params(ctx->algctx, provctx);
  491|      2|}
EVP_RAND_instantiate:
  525|      3|{
  526|      3|    int res;
  527|       |
  528|      3|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (528:9): [True: 0, False: 3]
  ------------------
  529|      0|        return 0;
  530|      3|    res = evp_rand_instantiate_locked(ctx, strength, prediction_resistance,
  531|      3|                                      pstr, pstr_len, params);
  532|      3|    evp_rand_unlock(ctx);
  533|      3|    return res;
  534|      3|}
EVP_RAND_generate:
  587|  4.08k|{
  588|  4.08k|    int res;
  589|       |
  590|  4.08k|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (590:9): [True: 0, False: 4.08k]
  ------------------
  591|      0|        return 0;
  592|  4.08k|    res = evp_rand_generate_locked(ctx, out, outlen, strength,
  593|  4.08k|                                   prediction_resistance, addin, addin_len);
  594|  4.08k|    evp_rand_unlock(ctx);
  595|  4.08k|    return res;
  596|  4.08k|}
evp_rand.c:evp_rand_from_algorithm:
  120|      6|{
  121|      6|    const OSSL_DISPATCH *fns = algodef->implementation;
  122|      6|    EVP_RAND *rand = NULL;
  123|      6|    int fnrandcnt = 0, fnctxcnt = 0, fnlockcnt = 0, fnenablelockcnt = 0;
  124|       |#ifdef FIPS_MODULE
  125|       |    int fnzeroizecnt = 0;
  126|       |#endif
  127|       |
  128|      6|    if ((rand = evp_rand_new()) == NULL) {
  ------------------
  |  Branch (128:9): [True: 0, False: 6]
  ------------------
  129|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|      6|    rand->name_id = name_id;
  133|      6|    if ((rand->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 6]
  ------------------
  134|      0|        evp_rand_free(rand);
  135|      0|        return NULL;
  136|      0|    }
  137|      6|    rand->description = algodef->algorithm_description;
  138|      6|    rand->dispatch = fns;
  139|     92|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (139:12): [True: 86, False: 6]
  ------------------
  140|     86|        switch (fns->function_id) {
  ------------------
  |  Branch (140:17): [True: 0, False: 86]
  ------------------
  141|      6|        case OSSL_FUNC_RAND_NEWCTX:
  ------------------
  |  |  462|      6|# define OSSL_FUNC_RAND_NEWCTX                        1
  ------------------
  |  Branch (141:9): [True: 6, False: 80]
  ------------------
  142|      6|            if (rand->newctx != NULL)
  ------------------
  |  Branch (142:17): [True: 0, False: 6]
  ------------------
  143|      0|                break;
  144|      6|            rand->newctx = OSSL_FUNC_rand_newctx(fns);
  145|      6|            fnctxcnt++;
  146|      6|            break;
  147|      6|        case OSSL_FUNC_RAND_FREECTX:
  ------------------
  |  |  463|      6|# define OSSL_FUNC_RAND_FREECTX                       2
  ------------------
  |  Branch (147:9): [True: 6, False: 80]
  ------------------
  148|      6|            if (rand->freectx != NULL)
  ------------------
  |  Branch (148:17): [True: 0, False: 6]
  ------------------
  149|      0|                break;
  150|      6|            rand->freectx = OSSL_FUNC_rand_freectx(fns);
  151|      6|            fnctxcnt++;
  152|      6|            break;
  153|      6|        case OSSL_FUNC_RAND_INSTANTIATE:
  ------------------
  |  |  464|      6|# define OSSL_FUNC_RAND_INSTANTIATE                   3
  ------------------
  |  Branch (153:9): [True: 6, False: 80]
  ------------------
  154|      6|            if (rand->instantiate != NULL)
  ------------------
  |  Branch (154:17): [True: 0, False: 6]
  ------------------
  155|      0|                break;
  156|      6|            rand->instantiate = OSSL_FUNC_rand_instantiate(fns);
  157|      6|            fnrandcnt++;
  158|      6|            break;
  159|      6|        case OSSL_FUNC_RAND_UNINSTANTIATE:
  ------------------
  |  |  465|      6|# define OSSL_FUNC_RAND_UNINSTANTIATE                 4
  ------------------
  |  Branch (159:9): [True: 6, False: 80]
  ------------------
  160|      6|             if (rand->uninstantiate != NULL)
  ------------------
  |  Branch (160:18): [True: 0, False: 6]
  ------------------
  161|      0|                break;
  162|      6|            rand->uninstantiate = OSSL_FUNC_rand_uninstantiate(fns);
  163|      6|            fnrandcnt++;
  164|      6|            break;
  165|      6|        case OSSL_FUNC_RAND_GENERATE:
  ------------------
  |  |  466|      6|# define OSSL_FUNC_RAND_GENERATE                      5
  ------------------
  |  Branch (165:9): [True: 6, False: 80]
  ------------------
  166|      6|            if (rand->generate != NULL)
  ------------------
  |  Branch (166:17): [True: 0, False: 6]
  ------------------
  167|      0|                break;
  168|      6|            rand->generate = OSSL_FUNC_rand_generate(fns);
  169|      6|            fnrandcnt++;
  170|      6|            break;
  171|      5|        case OSSL_FUNC_RAND_RESEED:
  ------------------
  |  |  467|      5|# define OSSL_FUNC_RAND_RESEED                        6
  ------------------
  |  Branch (171:9): [True: 5, False: 81]
  ------------------
  172|      5|            if (rand->reseed != NULL)
  ------------------
  |  Branch (172:17): [True: 0, False: 5]
  ------------------
  173|      0|                break;
  174|      5|            rand->reseed = OSSL_FUNC_rand_reseed(fns);
  175|      5|            break;
  176|      1|        case OSSL_FUNC_RAND_NONCE:
  ------------------
  |  |  468|      1|# define OSSL_FUNC_RAND_NONCE                         7
  ------------------
  |  Branch (176:9): [True: 1, False: 85]
  ------------------
  177|      1|            if (rand->nonce != NULL)
  ------------------
  |  Branch (177:17): [True: 0, False: 1]
  ------------------
  178|      0|                break;
  179|      1|            rand->nonce = OSSL_FUNC_rand_nonce(fns);
  180|      1|            break;
  181|      6|        case OSSL_FUNC_RAND_ENABLE_LOCKING:
  ------------------
  |  |  469|      6|# define OSSL_FUNC_RAND_ENABLE_LOCKING                8
  ------------------
  |  Branch (181:9): [True: 6, False: 80]
  ------------------
  182|      6|            if (rand->enable_locking != NULL)
  ------------------
  |  Branch (182:17): [True: 0, False: 6]
  ------------------
  183|      0|                break;
  184|      6|            rand->enable_locking = OSSL_FUNC_rand_enable_locking(fns);
  185|      6|            fnenablelockcnt++;
  186|      6|            break;
  187|      5|        case OSSL_FUNC_RAND_LOCK:
  ------------------
  |  |  470|      5|# define OSSL_FUNC_RAND_LOCK                          9
  ------------------
  |  Branch (187:9): [True: 5, False: 81]
  ------------------
  188|      5|            if (rand->lock != NULL)
  ------------------
  |  Branch (188:17): [True: 0, False: 5]
  ------------------
  189|      0|                break;
  190|      5|            rand->lock = OSSL_FUNC_rand_lock(fns);
  191|      5|            fnlockcnt++;
  192|      5|            break;
  193|      5|        case OSSL_FUNC_RAND_UNLOCK:
  ------------------
  |  |  471|      5|# define OSSL_FUNC_RAND_UNLOCK                       10
  ------------------
  |  Branch (193:9): [True: 5, False: 81]
  ------------------
  194|      5|            if (rand->unlock != NULL)
  ------------------
  |  Branch (194:17): [True: 0, False: 5]
  ------------------
  195|      0|                break;
  196|      5|            rand->unlock = OSSL_FUNC_rand_unlock(fns);
  197|      5|            fnlockcnt++;
  198|      5|            break;
  199|      0|        case OSSL_FUNC_RAND_GETTABLE_PARAMS:
  ------------------
  |  |  472|      0|# define OSSL_FUNC_RAND_GETTABLE_PARAMS              11
  ------------------
  |  Branch (199:9): [True: 0, False: 86]
  ------------------
  200|      0|            if (rand->gettable_params != NULL)
  ------------------
  |  Branch (200:17): [True: 0, False: 0]
  ------------------
  201|      0|                break;
  202|      0|            rand->gettable_params =
  203|      0|                OSSL_FUNC_rand_gettable_params(fns);
  204|      0|            break;
  205|      6|        case OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  473|      6|# define OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS          12
  ------------------
  |  Branch (205:9): [True: 6, False: 80]
  ------------------
  206|      6|            if (rand->gettable_ctx_params != NULL)
  ------------------
  |  Branch (206:17): [True: 0, False: 6]
  ------------------
  207|      0|                break;
  208|      6|            rand->gettable_ctx_params =
  209|      6|                OSSL_FUNC_rand_gettable_ctx_params(fns);
  210|      6|            break;
  211|      4|        case OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  474|      4|# define OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS          13
  ------------------
  |  Branch (211:9): [True: 4, False: 82]
  ------------------
  212|      4|            if (rand->settable_ctx_params != NULL)
  ------------------
  |  Branch (212:17): [True: 0, False: 4]
  ------------------
  213|      0|                break;
  214|      4|            rand->settable_ctx_params =
  215|      4|                OSSL_FUNC_rand_settable_ctx_params(fns);
  216|      4|            break;
  217|      0|        case OSSL_FUNC_RAND_GET_PARAMS:
  ------------------
  |  |  475|      0|# define OSSL_FUNC_RAND_GET_PARAMS                   14
  ------------------
  |  Branch (217:9): [True: 0, False: 86]
  ------------------
  218|      0|            if (rand->get_params != NULL)
  ------------------
  |  Branch (218:17): [True: 0, False: 0]
  ------------------
  219|      0|                break;
  220|      0|            rand->get_params = OSSL_FUNC_rand_get_params(fns);
  221|      0|            break;
  222|      6|        case OSSL_FUNC_RAND_GET_CTX_PARAMS:
  ------------------
  |  |  476|      6|# define OSSL_FUNC_RAND_GET_CTX_PARAMS               15
  ------------------
  |  Branch (222:9): [True: 6, False: 80]
  ------------------
  223|      6|            if (rand->get_ctx_params != NULL)
  ------------------
  |  Branch (223:17): [True: 0, False: 6]
  ------------------
  224|      0|                break;
  225|      6|            rand->get_ctx_params = OSSL_FUNC_rand_get_ctx_params(fns);
  226|      6|            fnctxcnt++;
  227|      6|            break;
  228|      4|        case OSSL_FUNC_RAND_SET_CTX_PARAMS:
  ------------------
  |  |  477|      4|# define OSSL_FUNC_RAND_SET_CTX_PARAMS               16
  ------------------
  |  Branch (228:9): [True: 4, False: 82]
  ------------------
  229|      4|            if (rand->set_ctx_params != NULL)
  ------------------
  |  Branch (229:17): [True: 0, False: 4]
  ------------------
  230|      0|                break;
  231|      4|            rand->set_ctx_params = OSSL_FUNC_rand_set_ctx_params(fns);
  232|      4|            break;
  233|      5|        case OSSL_FUNC_RAND_VERIFY_ZEROIZATION:
  ------------------
  |  |  478|      5|# define OSSL_FUNC_RAND_VERIFY_ZEROIZATION           17
  ------------------
  |  Branch (233:9): [True: 5, False: 81]
  ------------------
  234|      5|            if (rand->verify_zeroization != NULL)
  ------------------
  |  Branch (234:17): [True: 0, False: 5]
  ------------------
  235|      0|                break;
  236|      5|            rand->verify_zeroization = OSSL_FUNC_rand_verify_zeroization(fns);
  237|       |#ifdef FIPS_MODULE
  238|       |            fnzeroizecnt++;
  239|       |#endif
  240|      5|            break;
  241|      5|        case OSSL_FUNC_RAND_GET_SEED:
  ------------------
  |  |  479|      5|# define OSSL_FUNC_RAND_GET_SEED                     18
  ------------------
  |  Branch (241:9): [True: 5, False: 81]
  ------------------
  242|      5|            if (rand->get_seed != NULL)
  ------------------
  |  Branch (242:17): [True: 0, False: 5]
  ------------------
  243|      0|                break;
  244|      5|            rand->get_seed = OSSL_FUNC_rand_get_seed(fns);
  245|      5|            break;
  246|      4|        case OSSL_FUNC_RAND_CLEAR_SEED:
  ------------------
  |  |  480|      4|# define OSSL_FUNC_RAND_CLEAR_SEED                   19
  ------------------
  |  Branch (246:9): [True: 4, False: 82]
  ------------------
  247|      4|            if (rand->clear_seed != NULL)
  ------------------
  |  Branch (247:17): [True: 0, False: 4]
  ------------------
  248|      0|                break;
  249|      4|            rand->clear_seed = OSSL_FUNC_rand_clear_seed(fns);
  250|      4|            break;
  251|     86|        }
  252|     86|    }
  253|       |    /*
  254|       |     * In order to be a consistent set of functions we must have at least
  255|       |     * a complete set of "rand" functions and a complete set of context
  256|       |     * management functions.  In FIPS mode, we also require the zeroization
  257|       |     * verification function.
  258|       |     *
  259|       |     * In addition, if locking can be enabled, we need a complete set of
  260|       |     * locking functions.
  261|       |     */
  262|      6|    if (fnrandcnt != 3
  ------------------
  |  Branch (262:9): [True: 0, False: 6]
  ------------------
  263|      6|            || fnctxcnt != 3
  ------------------
  |  Branch (263:16): [True: 0, False: 6]
  ------------------
  264|      6|            || (fnenablelockcnt != 0 && fnenablelockcnt != 1)
  ------------------
  |  Branch (264:17): [True: 6, False: 0]
  |  Branch (264:41): [True: 0, False: 6]
  ------------------
  265|      6|            || (fnlockcnt != 0 && fnlockcnt != 2)
  ------------------
  |  Branch (265:17): [True: 5, False: 1]
  |  Branch (265:35): [True: 0, False: 5]
  ------------------
  266|       |#ifdef FIPS_MODULE
  267|       |            || fnzeroizecnt != 1
  268|       |#endif
  269|      6|       ) {
  270|      0|        evp_rand_free(rand);
  271|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|      6|    if (prov != NULL && !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (275:9): [True: 6, False: 0]
  |  Branch (275:25): [True: 0, False: 6]
  ------------------
  276|      0|        evp_rand_free(rand);
  277|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|      6|    rand->prov = prov;
  281|       |
  282|      6|    return rand;
  283|      6|}
evp_rand.c:evp_rand_new:
   80|      6|{
   81|      6|    EVP_RAND *rand = OPENSSL_zalloc(sizeof(*rand));
  ------------------
  |  |  104|      6|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|       |
   83|      6|    if (rand == NULL)
  ------------------
  |  Branch (83:9): [True: 0, False: 6]
  ------------------
   84|      0|        return NULL;
   85|       |
   86|      6|    if (!CRYPTO_NEW_REF(&rand->refcnt, 1)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 6]
  ------------------
   87|      0|        OPENSSL_free(rand);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|      6|    return rand;
   91|      6|}
evp_rand.c:evp_rand_up_ref:
   54|     14|{
   55|     14|    EVP_RAND *rand = (EVP_RAND *)vrand;
   56|     14|    int ref = 0;
   57|       |
   58|     14|    if (rand != NULL)
  ------------------
  |  Branch (58:9): [True: 14, False: 0]
  ------------------
   59|     14|        return CRYPTO_UP_REF(&rand->refcnt, &ref);
   60|      0|    return 1;
   61|     14|}
evp_rand.c:evp_rand_free:
   64|     20|{
   65|     20|    EVP_RAND *rand = (EVP_RAND *)vrand;
   66|     20|    int ref = 0;
   67|       |
   68|     20|    if (rand == NULL)
  ------------------
  |  Branch (68:9): [True: 0, False: 20]
  ------------------
   69|      0|        return;
   70|     20|    CRYPTO_DOWN_REF(&rand->refcnt, &ref);
   71|     20|    if (ref > 0)
  ------------------
  |  Branch (71:9): [True: 14, False: 6]
  ------------------
   72|     14|        return;
   73|      6|    OPENSSL_free(rand->type_name);
  ------------------
  |  |  115|      6|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|      6|    ossl_provider_free(rand->prov);
   75|      6|    CRYPTO_FREE_REF(&rand->refcnt);
   76|      6|    OPENSSL_free(rand);
  ------------------
  |  |  115|      6|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|      6|}
evp_rand.c:evp_rand_lock:
  104|  4.08k|{
  105|  4.08k|    if (rand->meth->lock != NULL)
  ------------------
  |  Branch (105:9): [True: 1, False: 4.08k]
  ------------------
  106|      1|        return rand->meth->lock(rand->algctx);
  107|  4.08k|    return 1;
  108|  4.08k|}
evp_rand.c:evp_rand_get_ctx_params_locked:
  412|  4.08k|{
  413|  4.08k|    return ctx->meth->get_ctx_params(ctx->algctx, params);
  414|  4.08k|}
evp_rand.c:evp_rand_unlock:
  112|  4.08k|{
  113|  4.08k|    if (rand->meth->unlock != NULL)
  ------------------
  |  Branch (113:9): [True: 1, False: 4.08k]
  ------------------
  114|      1|        rand->meth->unlock(rand->algctx);
  115|  4.08k|}
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|  4.08k|{
  558|  4.08k|    size_t chunk, max_request = 0;
  559|  4.08k|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  4.08k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  4.08k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  560|       |
  561|  4.08k|    params[0] = OSSL_PARAM_construct_size_t(OSSL_RAND_PARAM_MAX_REQUEST,
  ------------------
  |  |  474|  4.08k|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  562|  4.08k|                                            &max_request);
  563|  4.08k|    if (!evp_rand_get_ctx_params_locked(ctx, params)
  ------------------
  |  Branch (563:9): [True: 0, False: 4.08k]
  ------------------
  564|  4.08k|            || max_request == 0) {
  ------------------
  |  Branch (564:16): [True: 0, False: 4.08k]
  ------------------
  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|  8.16k|    for (; outlen > 0; outlen -= chunk, out += chunk) {
  ------------------
  |  Branch (568:12): [True: 4.08k, False: 4.08k]
  ------------------
  569|  4.08k|        chunk = outlen > max_request ? max_request : outlen;
  ------------------
  |  Branch (569:17): [True: 0, False: 4.08k]
  ------------------
  570|  4.08k|        if (!ctx->meth->generate(ctx->algctx, out, chunk, strength,
  ------------------
  |  Branch (570:13): [True: 0, False: 4.08k]
  ------------------
  571|  4.08k|                                 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|  4.08k|        prediction_resistance = 0;
  580|  4.08k|    }
  581|  4.08k|    return 1;
  582|  4.08k|}

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|  1.90k|{
   63|  1.90k|    if (pkey == NULL || keymgmt == NULL || keydata == NULL
  ------------------
  |  Branch (63:9): [True: 0, False: 1.90k]
  |  Branch (63:25): [True: 0, False: 1.90k]
  |  Branch (63:44): [True: 0, False: 1.90k]
  ------------------
   64|  1.90k|        || !EVP_PKEY_set_type_by_keymgmt(pkey, keymgmt)) {
  ------------------
  |  Branch (64:12): [True: 0, False: 1.90k]
  ------------------
   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|  1.90k|    pkey->keydata = keydata;
   69|  1.90k|    evp_keymgmt_util_cache_keyinfo(pkey);
   70|  1.90k|    return 1;
   71|  1.90k|}
evp_keymgmt_util_make_pkey:
   74|  1.90k|{
   75|  1.90k|    EVP_PKEY *pkey = NULL;
   76|       |
   77|  1.90k|    if (keymgmt == NULL
  ------------------
  |  Branch (77:9): [True: 0, False: 1.90k]
  ------------------
   78|  1.90k|        || keydata == NULL
  ------------------
  |  Branch (78:12): [True: 0, False: 1.90k]
  ------------------
   79|  1.90k|        || (pkey = EVP_PKEY_new()) == NULL
  ------------------
  |  Branch (79:12): [True: 0, False: 1.90k]
  ------------------
   80|  1.90k|        || !evp_keymgmt_util_assign_pkey(pkey, keymgmt, keydata)) {
  ------------------
  |  Branch (80:12): [True: 0, False: 1.90k]
  ------------------
   81|      0|        EVP_PKEY_free(pkey);
   82|      0|        return NULL;
   83|      0|    }
   84|  1.90k|    return pkey;
   85|  1.90k|}
evp_keymgmt_util_clear_operation_cache:
  223|  11.6k|{
  224|  11.6k|    if (pk != NULL) {
  ------------------
  |  Branch (224:9): [True: 11.6k, False: 0]
  ------------------
  225|  11.6k|        sk_OP_CACHE_ELEM_pop_free(pk->operation_cache, op_cache_free);
  226|  11.6k|        pk->operation_cache = NULL;
  227|  11.6k|    }
  228|       |
  229|  11.6k|    return 1;
  230|  11.6k|}
evp_keymgmt_util_cache_keyinfo:
  290|  1.90k|{
  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|  1.90k|    if (pk->keydata != NULL) {
  ------------------
  |  Branch (296:9): [True: 1.90k, False: 0]
  ------------------
  297|  1.90k|        int bits = 0;
  298|  1.90k|        int security_bits = 0;
  299|  1.90k|        int size = 0;
  300|  1.90k|        OSSL_PARAM params[4];
  301|       |
  302|  1.90k|        params[0] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_BITS, &bits);
  ------------------
  |  |  333|  1.90k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  303|  1.90k|        params[1] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_BITS,
  ------------------
  |  |  447|  1.90k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  304|  1.90k|                                             &security_bits);
  305|  1.90k|        params[2] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_MAX_SIZE, &size);
  ------------------
  |  |  387|  1.90k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  306|  1.90k|        params[3] = OSSL_PARAM_construct_end();
  307|  1.90k|        if (evp_keymgmt_get_params(pk->keymgmt, pk->keydata, params)) {
  ------------------
  |  Branch (307:13): [True: 1.90k, False: 0]
  ------------------
  308|  1.90k|            pk->cache.size = size;
  309|  1.90k|            pk->cache.bits = bits;
  310|  1.90k|            pk->cache.security_bits = security_bits;
  311|  1.90k|        }
  312|  1.90k|    }
  313|  1.90k|}
evp_keymgmt_util_has:
  330|  1.62k|{
  331|       |    /* Check if key is even assigned */
  332|  1.62k|    if (pk->keymgmt == NULL)
  ------------------
  |  Branch (332:9): [True: 0, False: 1.62k]
  ------------------
  333|      0|        return 0;
  334|       |
  335|  1.62k|    return evp_keymgmt_has(pk->keymgmt, pk->keydata, selection);
  336|  1.62k|}

EVP_KEYMGMT_up_ref:
  269|   201k|{
  270|   201k|    int ref = 0;
  271|       |
  272|   201k|    CRYPTO_UP_REF(&keymgmt->refcnt, &ref);
  273|   201k|    return 1;
  274|   201k|}
EVP_KEYMGMT_free:
  277|   201k|{
  278|   201k|    int ref = 0;
  279|       |
  280|   201k|    if (keymgmt == NULL)
  ------------------
  |  Branch (280:9): [True: 0, False: 201k]
  ------------------
  281|      0|        return;
  282|       |
  283|   201k|    CRYPTO_DOWN_REF(&keymgmt->refcnt, &ref);
  284|   201k|    if (ref > 0)
  ------------------
  |  Branch (284:9): [True: 201k, False: 18]
  ------------------
  285|   201k|        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|  14.0k|{
  294|  14.0k|    return keymgmt->prov;
  295|  14.0k|}
EVP_KEYMGMT_is_a:
  318|  3.91k|{
  319|  3.91k|    return keymgmt != NULL
  ------------------
  |  Branch (319:12): [True: 3.91k, False: 0]
  ------------------
  320|  3.91k|           && evp_is_a(keymgmt->prov, keymgmt->name_id, NULL, name);
  ------------------
  |  Branch (320:15): [True: 1.90k, False: 2.00k]
  ------------------
  321|  3.91k|}
EVP_KEYMGMT_do_all_provided:
  326|     79|{
  327|     79|    evp_generic_do_all(libctx, OSSL_OP_KEYMGMT,
  ------------------
  |  |  280|     79|# define OSSL_OP_KEYMGMT                            10
  ------------------
  328|     79|                       (void (*)(void *, void *))fn, arg,
  329|     79|                       keymgmt_from_algorithm,
  330|     79|                       (int (*)(void *))EVP_KEYMGMT_up_ref,
  331|     79|                       (void (*)(void *))EVP_KEYMGMT_free);
  332|     79|}
EVP_KEYMGMT_names_do_all:
  337|  5.31k|{
  338|  5.31k|    if (keymgmt->prov != NULL)
  ------------------
  |  Branch (338:9): [True: 5.31k, False: 0]
  ------------------
  339|  5.31k|        return evp_names_do_all(keymgmt->prov, keymgmt->name_id, fn, data);
  340|       |
  341|      0|    return 1;
  342|  5.31k|}
evp_keymgmt_freedata:
  362|  1.90k|{
  363|       |    /* This is mandatory, no need to check for its presence */
  364|  1.90k|    keymgmt->free(keydata);
  365|  1.90k|}
evp_keymgmt_has_load:
  423|  5.82k|{
  424|  5.82k|    return keymgmt != NULL && keymgmt->load != NULL;
  ------------------
  |  Branch (424:12): [True: 5.82k, False: 0]
  |  Branch (424:31): [True: 5.82k, False: 0]
  ------------------
  425|  5.82k|}
evp_keymgmt_load:
  429|  1.90k|{
  430|  1.90k|    if (evp_keymgmt_has_load(keymgmt))
  ------------------
  |  Branch (430:9): [True: 1.90k, False: 0]
  ------------------
  431|  1.90k|        return keymgmt->load(objref, objref_sz);
  432|      0|    return NULL;
  433|  1.90k|}
evp_keymgmt_get_params:
  437|  1.90k|{
  438|  1.90k|    if (keymgmt->get_params == NULL)
  ------------------
  |  Branch (438:9): [True: 0, False: 1.90k]
  ------------------
  439|      0|        return 1;
  440|  1.90k|    return keymgmt->get_params(keydata, params);
  441|  1.90k|}
evp_keymgmt_has:
  470|  1.62k|{
  471|       |    /* This is mandatory, no need to check for its presence */
  472|  1.62k|    return keymgmt->has(keydata, selection);
  473|  1.62k|}
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: 24, False: 19]
  ------------------
   40|     24|        *type = evp_pkey_name2type(keytype);
   41|     43|}

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

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

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

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

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

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

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

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

EVP_add_cipher:
   20|    288|{
   21|    288|    int r;
   22|       |
   23|    288|    if (c == NULL)
  ------------------
  |  Branch (23:9): [True: 0, False: 288]
  ------------------
   24|      0|        return 0;
   25|       |
   26|    288|    r = OBJ_NAME_add(OBJ_nid2sn(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    288|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   27|    288|                     (const char *)c);
   28|    288|    if (r == 0)
  ------------------
  |  Branch (28:9): [True: 0, False: 288]
  ------------------
   29|      0|        return 0;
   30|    288|    r = OBJ_NAME_add(OBJ_nid2ln(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    288|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   31|    288|                     (const char *)c);
   32|    288|    return r;
   33|    288|}
EVP_add_digest:
   36|     44|{
   37|     44|    int r;
   38|     44|    const char *name;
   39|       |
   40|     44|    name = OBJ_nid2sn(md->type);
   41|     44|    r = OBJ_NAME_add(name, OBJ_NAME_TYPE_MD_METH, (const char *)md);
  ------------------
  |  |   25|     44|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   42|     44|    if (r == 0)
  ------------------
  |  Branch (42:9): [True: 0, False: 44]
  ------------------
   43|      0|        return 0;
   44|     44|    r = OBJ_NAME_add(OBJ_nid2ln(md->type), OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|     44|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   45|     44|                     (const char *)md);
   46|     44|    if (r == 0)
  ------------------
  |  Branch (46:9): [True: 0, False: 44]
  ------------------
   47|      0|        return 0;
   48|       |
   49|     44|    if (md->pkey_type && md->type != md->pkey_type) {
  ------------------
  |  Branch (49:9): [True: 34, False: 10]
  |  Branch (49:26): [True: 32, False: 2]
  ------------------
   50|     32|        r = OBJ_NAME_add(OBJ_nid2sn(md->pkey_type),
   51|     32|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     32|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     32|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   52|     32|        if (r == 0)
  ------------------
  |  Branch (52:13): [True: 0, False: 32]
  ------------------
   53|      0|            return 0;
   54|     32|        r = OBJ_NAME_add(OBJ_nid2ln(md->pkey_type),
   55|     32|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     32|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     32|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   56|     32|    }
   57|     44|    return r;
   58|     44|}
evp_cleanup_int:
  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|     13|{
   36|     13|    if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA_PSS) {
  ------------------
  |  |   60|     13|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|     26|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
                  if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA_PSS) {
  ------------------
  |  |   62|      2|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      2|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (36:9): [True: 2, False: 11]
  |  Branch (36:39): [True: 0, False: 2]
  ------------------
   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|     13|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
   41|     13|}
EVP_PKEY_get1_RSA:
   49|     13|{
   50|     13|    RSA *ret = evp_pkey_get0_RSA_int(pkey);
   51|       |
   52|     13|    if (ret != NULL)
  ------------------
  |  Branch (52:9): [True: 13, False: 0]
  ------------------
   53|     13|        RSA_up_ref(ret);
   54|     13|    return ret;
   55|     13|}
evp_pkey_get0_EC_KEY_int:
   70|    197|{
   71|    197|    if (EVP_PKEY_get_base_id(pkey) != EVP_PKEY_EC) {
  ------------------
  |  |   70|    197|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|    197|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (71:9): [True: 0, False: 197]
  ------------------
   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|    197|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
   76|    197|}
EVP_PKEY_get1_EC_KEY:
   84|    197|{
   85|    197|    EC_KEY *ret = evp_pkey_get0_EC_KEY_int(pkey);
   86|       |
   87|    197|    if (ret != NULL && !EC_KEY_up_ref(ret))
  ------------------
  |  Branch (87:9): [True: 197, False: 0]
  |  Branch (87:24): [True: 0, False: 197]
  ------------------
   88|      0|        ret = NULL;
   89|    197|    return ret;
   90|    197|}

EVP_PKEY_set_type:
  688|  10.1k|{
  689|  10.1k|    return pkey_set_type(pkey, NULL, type, NULL, -1, NULL);
  690|  10.1k|}
EVP_PKEY_assign:
  758|    351|{
  759|    351|#  ifndef OPENSSL_NO_EC
  760|    351|    int pktype;
  761|       |
  762|    351|    pktype = EVP_PKEY_type(type);
  763|    351|    if ((key != NULL) && (pktype == EVP_PKEY_EC || pktype == EVP_PKEY_SM2)) {
  ------------------
  |  |   70|    351|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|    702|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
                  if ((key != NULL) && (pktype == EVP_PKEY_EC || pktype == EVP_PKEY_SM2)) {
  ------------------
  |  |   71|    148|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|    148|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (763:9): [True: 351, False: 0]
  |  Branch (763:27): [True: 203, False: 148]
  |  Branch (763:52): [True: 0, False: 148]
  ------------------
  764|    203|        const EC_GROUP *group = EC_KEY_get0_group(key);
  765|       |
  766|    203|        if (group != NULL) {
  ------------------
  |  Branch (766:13): [True: 203, False: 0]
  ------------------
  767|    203|            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|    203|            if (curve == NID_sm2 && pktype == EVP_PKEY_EC)
  ------------------
  |  | 1232|    406|#define NID_sm2         1172
  ------------------
                          if (curve == NID_sm2 && pktype == EVP_PKEY_EC)
  ------------------
  |  |   70|      1|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|      1|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (773:17): [True: 1, False: 202]
  |  Branch (773:37): [True: 1, False: 0]
  ------------------
  774|      1|                type = EVP_PKEY_SM2;
  ------------------
  |  |   71|      1|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  775|    202|            else if(curve != NID_sm2 && pktype == EVP_PKEY_SM2)
  ------------------
  |  | 1232|    404|#define NID_sm2         1172
  ------------------
                          else if(curve != NID_sm2 && pktype == EVP_PKEY_SM2)
  ------------------
  |  |   71|    202|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|    202|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (775:21): [True: 202, False: 0]
  |  Branch (775:41): [True: 0, False: 202]
  ------------------
  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|    203|        }
  778|    203|    }
  779|    351|#  endif
  780|       |
  781|    351|    if (pkey == NULL || !EVP_PKEY_set_type(pkey, type))
  ------------------
  |  Branch (781:9): [True: 0, False: 351]
  |  Branch (781:25): [True: 0, False: 351]
  ------------------
  782|      0|        return 0;
  783|       |
  784|    351|    pkey->pkey.ptr = key;
  785|    351|    detect_foreign_key(pkey);
  786|       |
  787|    351|    return (key != NULL);
  788|    351|}
EVP_PKEY_get1_DSA:
  875|      2|{
  876|      2|    DSA *ret = evp_pkey_get0_DSA_int(pkey);
  877|       |
  878|      2|    if (ret != NULL)
  ------------------
  |  Branch (878:9): [True: 2, False: 0]
  ------------------
  879|      2|        DSA_up_ref(ret);
  880|      2|    return ret;
  881|      2|}
ossl_evp_pkey_get1_X448:
  905|      1|    {                                                                   \
  906|      1|        return evp_pkey_get1_ECX_KEY(pkey, EVP_PKEY_##NAME);            \
  907|      1|    }
ossl_evp_pkey_get1_ED25519:
  905|      1|    {                                                                   \
  906|      1|        return evp_pkey_get1_ECX_KEY(pkey, EVP_PKEY_##NAME);            \
  907|      1|    }
ossl_evp_pkey_get1_ED448:
  905|      1|    {                                                                   \
  906|      1|        return evp_pkey_get1_ECX_KEY(pkey, EVP_PKEY_##NAME);            \
  907|      1|    }
evp_pkey_get0_DH_int:
  953|     73|{
  954|     73|    if (pkey->type != EVP_PKEY_DH && pkey->type != EVP_PKEY_DHX) {
  ------------------
  |  |   68|     73|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|    146|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
                  if (pkey->type != EVP_PKEY_DH && pkey->type != EVP_PKEY_DHX) {
  ------------------
  |  |   69|      1|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5299|      1|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (954:9): [True: 1, False: 72]
  |  Branch (954:38): [True: 0, False: 1]
  ------------------
  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|     73|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
  959|     73|}
EVP_PKEY_get1_DH:
  967|     73|{
  968|     73|    DH *ret = evp_pkey_get0_DH_int(pkey);
  969|       |
  970|     73|    if (ret != NULL)
  ------------------
  |  Branch (970:9): [True: 73, False: 0]
  ------------------
  971|     73|        DH_up_ref(ret);
  972|     73|    return ret;
  973|     73|}
EVP_PKEY_type:
  977|    585|{
  978|    585|    int ret;
  979|    585|    const EVP_PKEY_ASN1_METHOD *ameth;
  980|    585|    ENGINE *e;
  981|    585|    ameth = EVP_PKEY_asn1_find(&e, type);
  982|    585|    if (ameth)
  ------------------
  |  Branch (982:9): [True: 558, False: 27]
  ------------------
  983|    558|        ret = ameth->pkey_id;
  984|     27|    else
  985|     27|        ret = NID_undef;
  ------------------
  |  |   18|     27|#define NID_undef                       0
  ------------------
  986|    585|# ifndef OPENSSL_NO_ENGINE
  987|    585|    ENGINE_finish(e);
  988|    585|# endif
  989|    585|    return ret;
  990|    585|}
EVP_PKEY_get_id:
  993|    272|{
  994|    272|    return pkey->type;
  995|    272|}
EVP_PKEY_get_base_id:
  998|    202|{
  999|    202|    return EVP_PKEY_type(pkey->type);
 1000|    202|}
evp_pkey_name2type:
 1030|     24|{
 1031|     24|    int type;
 1032|     24|    size_t i;
 1033|       |
 1034|    261|    for (i = 0; i < OSSL_NELEM(standard_name2type); i++) {
  ------------------
  |  |   14|    261|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1034:17): [True: 245, False: 16]
  ------------------
 1035|    245|        if (OPENSSL_strcasecmp(name, standard_name2type[i].ptr) == 0)
  ------------------
  |  Branch (1035:13): [True: 8, False: 237]
  ------------------
 1036|      8|            return (int)standard_name2type[i].id;
 1037|    245|    }
 1038|       |
 1039|     16|    if ((type = EVP_PKEY_type(OBJ_sn2nid(name))) != NID_undef)
  ------------------
  |  |   18|     16|#define NID_undef                       0
  ------------------
  |  Branch (1039:9): [True: 2, False: 14]
  ------------------
 1040|      2|        return type;
 1041|     14|    return EVP_PKEY_type(OBJ_ln2nid(name));
 1042|     16|}
EVP_PKEY_print_private:
 1210|  1.68k|{
 1211|  1.68k|    return print_pkey(pkey, out, indent, EVP_PKEY_PRIVATE_KEY, NULL,
  ------------------
  |  |   90|  1.68k|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |   88|  1.68k|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  ------------------
  |  |  |  |  |  |  574|  1.68k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  569|  1.68k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  1.68k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  570|  1.68k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  567|  1.68k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  ------------------
 1212|  1.68k|                      (pkey->ameth != NULL ? pkey->ameth->priv_print : NULL),
  ------------------
  |  Branch (1212:24): [True: 62, False: 1.62k]
  ------------------
 1213|  1.68k|                      pctx);
 1214|  1.68k|}
EVP_PKEY_new:
 1453|  11.6k|{
 1454|  11.6k|    EVP_PKEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  11.6k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  11.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  11.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1455|       |
 1456|  11.6k|    if (ret == NULL)
  ------------------
  |  Branch (1456:9): [True: 0, False: 11.6k]
  ------------------
 1457|      0|        return NULL;
 1458|       |
 1459|  11.6k|    ret->type = EVP_PKEY_NONE;
  ------------------
  |  |   59|  11.6k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  11.6k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1460|  11.6k|    ret->save_type = EVP_PKEY_NONE;
  ------------------
  |  |   59|  11.6k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  11.6k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1461|       |
 1462|  11.6k|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (1462:9): [True: 0, False: 11.6k]
  ------------------
 1463|      0|        goto err;
 1464|       |
 1465|  11.6k|    ret->lock = CRYPTO_THREAD_lock_new();
 1466|  11.6k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (1466:9): [True: 0, False: 11.6k]
  ------------------
 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|  11.6k|#ifndef FIPS_MODULE
 1472|  11.6k|    ret->save_parameters = 1;
 1473|  11.6k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, ret, &ret->ex_data)) {
  ------------------
  |  |  246|  11.6k|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
  |  Branch (1473:9): [True: 0, False: 11.6k]
  ------------------
 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|  11.6k|#endif
 1478|  11.6k|    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|  11.6k|}
EVP_PKEY_set_type_by_keymgmt:
 1639|  1.90k|{
 1640|  1.90k|#ifndef FIPS_MODULE
 1641|  1.90k|# define EVP_PKEY_TYPE_STR str[0]
 1642|  1.90k|# 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|  1.90k|    const char *str[2] = { NULL, NULL };
 1649|       |
 1650|  1.90k|    if (!EVP_KEYMGMT_names_do_all(keymgmt, find_ameth, &str)
  ------------------
  |  Branch (1650:9): [True: 0, False: 1.90k]
  ------------------
 1651|  1.90k|            || str[1] != NULL) {
  ------------------
  |  Branch (1651:16): [True: 0, False: 1.90k]
  ------------------
 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|  1.90k|    return pkey_set_type(pkey, NULL, EVP_PKEY_NONE,
  ------------------
  |  |   59|  1.90k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  1.90k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1660|  1.90k|                         EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1641|  1.90k|# define EVP_PKEY_TYPE_STR str[0]
  ------------------
                                       EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1642|  1.90k|# define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
  |  |  ------------------
  |  |  |  Branch (1642:32): [True: 9, False: 1.89k]
  |  |  ------------------
  ------------------
 1661|  1.90k|                         keymgmt);
 1662|       |
 1663|  1.90k|#undef EVP_PKEY_TYPE_STR
 1664|  1.90k|#undef EVP_PKEY_TYPE_STRLEN
 1665|  1.90k|}
EVP_PKEY_up_ref:
 1668|    288|{
 1669|    288|    int i;
 1670|       |
 1671|    288|    if (CRYPTO_UP_REF(&pkey->references, &i) <= 0)
  ------------------
  |  Branch (1671:9): [True: 0, False: 288]
  ------------------
 1672|      0|        return 0;
 1673|       |
 1674|    288|    REF_PRINT_COUNT("EVP_PKEY", pkey);
  ------------------
  |  |  289|    288|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|    288|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|    288|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|    288|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1675|    288|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|    288|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 288]
  |  |  ------------------
  ------------------
 1676|    288|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (1676:13): [True: 288, False: 0]
  ------------------
 1677|    288|}
evp_pkey_free_legacy:
 1735|  11.6k|{
 1736|  11.6k|    const EVP_PKEY_ASN1_METHOD *ameth = x->ameth;
 1737|  11.6k|    ENGINE *tmpe = NULL;
 1738|       |
 1739|  11.6k|    if (ameth == NULL && x->legacy_cache_pkey.ptr != NULL)
  ------------------
  |  Branch (1739:9): [True: 1.92k, False: 9.73k]
  |  Branch (1739:26): [True: 0, False: 1.92k]
  ------------------
 1740|      0|        ameth = EVP_PKEY_asn1_find(&tmpe, x->type);
 1741|       |
 1742|  11.6k|    if (ameth != NULL) {
  ------------------
  |  Branch (1742:9): [True: 9.73k, False: 1.92k]
  ------------------
 1743|  9.73k|        if (x->legacy_cache_pkey.ptr != NULL) {
  ------------------
  |  Branch (1743:13): [True: 0, False: 9.73k]
  ------------------
 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|  9.73k|        if (ameth->pkey_free != NULL)
  ------------------
  |  Branch (1756:13): [True: 9.73k, False: 0]
  ------------------
 1757|  9.73k|            ameth->pkey_free(x);
 1758|  9.73k|        x->pkey.ptr = NULL;
 1759|  9.73k|    }
 1760|  11.6k|# ifndef OPENSSL_NO_ENGINE
 1761|  11.6k|    ENGINE_finish(tmpe);
 1762|  11.6k|    ENGINE_finish(x->engine);
 1763|  11.6k|    x->engine = NULL;
 1764|  11.6k|    ENGINE_finish(x->pmeth_engine);
 1765|  11.6k|    x->pmeth_engine = NULL;
 1766|  11.6k|# endif
 1767|  11.6k|}
EVP_PKEY_free:
 1788|  87.6k|{
 1789|  87.6k|    int i;
 1790|       |
 1791|  87.6k|    if (x == NULL)
  ------------------
  |  Branch (1791:9): [True: 75.7k, False: 11.9k]
  ------------------
 1792|  75.7k|        return;
 1793|       |
 1794|  11.9k|    CRYPTO_DOWN_REF(&x->references, &i);
 1795|  11.9k|    REF_PRINT_COUNT("EVP_PKEY", x);
  ------------------
  |  |  289|  11.9k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  11.9k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  11.9k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  11.9k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1796|  11.9k|    if (i > 0)
  ------------------
  |  Branch (1796:9): [True: 288, False: 11.6k]
  ------------------
 1797|    288|        return;
 1798|  11.6k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|  11.6k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 11.6k]
  |  |  ------------------
  ------------------
 1799|  11.6k|    evp_pkey_free_it(x);
 1800|  11.6k|#ifndef FIPS_MODULE
 1801|  11.6k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, x, &x->ex_data);
  ------------------
  |  |  246|  11.6k|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
 1802|  11.6k|#endif
 1803|  11.6k|    CRYPTO_THREAD_lock_free(x->lock);
 1804|  11.6k|    CRYPTO_FREE_REF(&x->references);
 1805|  11.6k|#ifndef FIPS_MODULE
 1806|  11.6k|    sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
  ------------------
  |  |  278|  11.6k|#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|  11.6k|#endif
 1808|  11.6k|    OPENSSL_free(x);
  ------------------
  |  |  115|  11.6k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  11.6k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  11.6k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1809|  11.6k|}
evp_pkey_get_legacy:
 2114|    288|{
 2115|    288|    EVP_PKEY *tmp_copy = NULL;
 2116|    288|    void *ret = NULL;
 2117|       |
 2118|    288|    if (!ossl_assert(pk != NULL))
  ------------------
  |  |   52|    288|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    288|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (2118:9): [True: 0, False: 288]
  ------------------
 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|    288|    if (!evp_pkey_is_assigned(pk))
  ------------------
  |  |  633|    288|    ((pk)->pkey.ptr != NULL || (pk)->keydata != NULL)
  |  |  ------------------
  |  |  |  Branch (633:6): [True: 288, False: 0]
  |  |  |  Branch (633:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2126|      0|        return NULL;
 2127|    288|    if (!evp_pkey_is_provided(pk))
  ------------------
  |  |  641|    288|    ((pk)->keymgmt != NULL)
  ------------------
  |  Branch (2127:9): [True: 288, False: 0]
  ------------------
 2128|    288|        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|    351|{
  725|    351|    switch (pkey->type) {
  726|     59|    case EVP_PKEY_RSA:
  ------------------
  |  |   60|     59|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|     59|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (726:5): [True: 59, False: 292]
  ------------------
  727|     61|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   62|     61|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|     61|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (727:5): [True: 2, False: 349]
  ------------------
  728|     61|        pkey->foreign = pkey->pkey.rsa != NULL
  ------------------
  |  Branch (728:25): [True: 61, False: 0]
  ------------------
  729|     61|                        && ossl_rsa_is_foreign(pkey->pkey.rsa);
  ------------------
  |  Branch (729:28): [True: 0, False: 61]
  ------------------
  730|     61|        break;
  731|      0|#  ifndef OPENSSL_NO_EC
  732|      1|    case EVP_PKEY_SM2:
  ------------------
  |  |   71|      1|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (732:5): [True: 1, False: 350]
  ------------------
  733|      1|        break;
  734|    202|    case EVP_PKEY_EC:
  ------------------
  |  |   70|    202|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|    202|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (734:5): [True: 202, False: 149]
  ------------------
  735|    202|        pkey->foreign = pkey->pkey.ec != NULL
  ------------------
  |  Branch (735:25): [True: 202, False: 0]
  ------------------
  736|    202|                        && ossl_ec_key_is_foreign(pkey->pkey.ec);
  ------------------
  |  Branch (736:28): [True: 0, False: 202]
  ------------------
  737|    202|        break;
  738|      0|#  endif
  739|      0|#  ifndef OPENSSL_NO_DSA
  740|      6|    case EVP_PKEY_DSA:
  ------------------
  |  |   63|      6|# define EVP_PKEY_DSA    NID_dsa
  |  |  ------------------
  |  |  |  |  136|      6|#define NID_dsa         116
  |  |  ------------------
  ------------------
  |  Branch (740:5): [True: 6, False: 345]
  ------------------
  741|      6|        pkey->foreign = pkey->pkey.dsa != NULL
  ------------------
  |  Branch (741:25): [True: 6, False: 0]
  ------------------
  742|      6|                        && ossl_dsa_is_foreign(pkey->pkey.dsa);
  ------------------
  |  Branch (742:28): [True: 0, False: 6]
  ------------------
  743|      6|        break;
  744|      0|#endif
  745|      0|#  ifndef OPENSSL_NO_DH
  746|     72|    case EVP_PKEY_DH:
  ------------------
  |  |   68|     72|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|     72|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
  |  Branch (746:5): [True: 72, False: 279]
  ------------------
  747|     72|        pkey->foreign = pkey->pkey.dh != NULL
  ------------------
  |  Branch (747:25): [True: 72, False: 0]
  ------------------
  748|     72|                        && ossl_dh_is_foreign(pkey->pkey.dh);
  ------------------
  |  Branch (748:28): [True: 0, False: 72]
  ------------------
  749|     72|        break;
  750|      0|#endif
  751|      9|    default:
  ------------------
  |  Branch (751:5): [True: 9, False: 342]
  ------------------
  752|      9|        pkey->foreign = 0;
  753|      9|        break;
  754|    351|    }
  755|    351|}
p_lib.c:evp_pkey_get0_DSA_int:
  854|      2|{
  855|      2|    if (pkey->type != EVP_PKEY_DSA) {
  ------------------
  |  |   63|      2|# define EVP_PKEY_DSA    NID_dsa
  |  |  ------------------
  |  |  |  |  136|      2|#define NID_dsa         116
  |  |  ------------------
  ------------------
  |  Branch (855:9): [True: 0, False: 2]
  ------------------
  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|      2|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
  860|      2|}
p_lib.c:evp_pkey_get1_ECX_KEY:
  895|      3|{
  896|      3|    ECX_KEY *ret = (ECX_KEY *)evp_pkey_get0_ECX_KEY(pkey, type);
  897|       |
  898|      3|    if (ret != NULL && !ossl_ecx_key_up_ref(ret))
  ------------------
  |  Branch (898:9): [True: 3, False: 0]
  |  Branch (898:24): [True: 0, False: 3]
  ------------------
  899|      0|        ret = NULL;
  900|      3|    return ret;
  901|      3|}
p_lib.c:evp_pkey_get0_ECX_KEY:
  886|      3|{
  887|      3|    if (EVP_PKEY_get_base_id(pkey) != type) {
  ------------------
  |  Branch (887:9): [True: 0, False: 3]
  ------------------
  888|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_EXPECTING_A_ECX_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  889|      0|        return NULL;
  890|      0|    }
  891|      3|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
  892|      3|}
p_lib.c:print_pkey:
 1171|  1.68k|{
 1172|  1.68k|    int pop_f_prefix;
 1173|  1.68k|    long saved_indent;
 1174|  1.68k|    OSSL_ENCODER_CTX *ctx = NULL;
 1175|  1.68k|    int ret = -2;                /* default to unsupported */
 1176|       |
 1177|  1.68k|    if (!print_set_indent(&out, &pop_f_prefix, &saved_indent, indent))
  ------------------
  |  Branch (1177:9): [True: 0, False: 1.68k]
  ------------------
 1178|      0|        return 0;
 1179|       |
 1180|  1.68k|    ctx = OSSL_ENCODER_CTX_new_for_pkey(pkey, selection, "TEXT", NULL,
 1181|  1.68k|                                        propquery);
 1182|  1.68k|    if (OSSL_ENCODER_CTX_get_num_encoders(ctx) != 0)
  ------------------
  |  Branch (1182:9): [True: 1.62k, False: 62]
  ------------------
 1183|  1.62k|        ret = OSSL_ENCODER_to_bio(ctx, out);
 1184|  1.68k|    OSSL_ENCODER_CTX_free(ctx);
 1185|       |
 1186|  1.68k|    if (ret != -2)
  ------------------
  |  Branch (1186:9): [True: 1.62k, False: 62]
  ------------------
 1187|  1.62k|        goto end;
 1188|       |
 1189|       |    /* legacy fallback */
 1190|     62|    if (legacy_print != NULL)
  ------------------
  |  Branch (1190:9): [True: 62, False: 0]
  ------------------
 1191|     62|        ret = legacy_print(out, pkey, 0, legacy_pctx);
 1192|      0|    else
 1193|      0|        ret = unsup_alg(out, pkey, 0, "Public Key");
 1194|       |
 1195|  1.68k| end:
 1196|  1.68k|    print_reset_indent(&out, pop_f_prefix, saved_indent);
 1197|  1.68k|    return ret;
 1198|     62|}
p_lib.c:print_set_indent:
 1134|  1.68k|{
 1135|  1.68k|    *pop_f_prefix = 0;
 1136|  1.68k|    *saved_indent = 0;
 1137|  1.68k|    if (indent > 0) {
  ------------------
  |  Branch (1137:9): [True: 0, False: 1.68k]
  ------------------
 1138|      0|        long i = BIO_get_indent(*out);
  ------------------
  |  |  700|      0|# define BIO_get_indent(b) BIO_ctrl((b), BIO_CTRL_GET_INDENT, 0, NULL)
  |  |  ------------------
  |  |  |  |  177|      0|# define BIO_CTRL_GET_INDENT                    81
  |  |  ------------------
  ------------------
 1139|       |
 1140|      0|        *saved_indent =  (i < 0 ? 0 : i);
  ------------------
  |  Branch (1140:27): [True: 0, False: 0]
  ------------------
 1141|      0|        if (BIO_set_indent(*out, indent) <= 0) {
  ------------------
  |  |  699|      0|# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
  |  |  ------------------
  |  |  |  |  176|      0|# define BIO_CTRL_SET_INDENT                    80
  |  |  ------------------
  ------------------
  |  Branch (1141:13): [True: 0, False: 0]
  ------------------
 1142|      0|            BIO *prefbio = BIO_new(BIO_f_prefix());
 1143|       |
 1144|      0|            if (prefbio == NULL)
  ------------------
  |  Branch (1144:17): [True: 0, False: 0]
  ------------------
 1145|      0|                return 0;
 1146|      0|            *out = BIO_push(prefbio, *out);
 1147|      0|            *pop_f_prefix = 1;
 1148|      0|        }
 1149|      0|        if (BIO_set_indent(*out, indent) <= 0) {
  ------------------
  |  |  699|      0|# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
  |  |  ------------------
  |  |  |  |  176|      0|# define BIO_CTRL_SET_INDENT                    80
  |  |  ------------------
  ------------------
  |  Branch (1149:13): [True: 0, False: 0]
  ------------------
 1150|      0|            print_reset_indent(out, *pop_f_prefix, *saved_indent);
 1151|      0|            return 0;
 1152|      0|        }
 1153|      0|    }
 1154|  1.68k|    return 1;
 1155|  1.68k|}
p_lib.c:print_reset_indent:
 1121|  1.68k|{
 1122|  1.68k|    BIO_set_indent(*out, saved_indent);
  ------------------
  |  |  699|  1.68k|# define BIO_set_indent(b,i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
  |  |  ------------------
  |  |  |  |  176|  1.68k|# define BIO_CTRL_SET_INDENT                    80
  |  |  ------------------
  ------------------
 1123|  1.68k|    if (pop_f_prefix) {
  ------------------
  |  Branch (1123:9): [True: 0, False: 1.68k]
  ------------------
 1124|      0|        BIO *next = BIO_pop(*out);
 1125|       |
 1126|      0|        BIO_free(*out);
 1127|      0|        *out = next;
 1128|      0|    }
 1129|  1.68k|    return 1;
 1130|  1.68k|}
p_lib.c:pkey_set_type:
 1502|  19.9k|{
 1503|  19.9k|#ifndef FIPS_MODULE
 1504|  19.9k|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
 1505|  19.9k|    ENGINE **eptr = (e == NULL) ? &e :  NULL;
  ------------------
  |  Branch (1505:21): [True: 19.9k, False: 0]
  ------------------
 1506|  19.9k|#endif
 1507|       |
 1508|       |    /*
 1509|       |     * The setups can't set both legacy and provider side methods.
 1510|       |     * It is forbidden
 1511|       |     */
 1512|  19.9k|    if (!ossl_assert(type == EVP_PKEY_NONE || keymgmt == NULL)
  ------------------
  |  |   52|  39.8k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 9.83k, False: 10.0k]
  |  |  |  Branch (52:43): [True: 10.0k, False: 0]
  |  |  ------------------
  |  |   53|  39.8k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1512:9): [True: 0, False: 19.9k]
  ------------------
 1513|  19.9k|        || !ossl_assert(e == NULL || keymgmt == NULL)) {
  ------------------
  |  |   52|  19.9k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 19.9k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  19.9k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1513:12): [True: 0, False: 19.9k]
  ------------------
 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|  19.9k|    if (pkey != NULL) {
  ------------------
  |  Branch (1518:9): [True: 12.0k, False: 7.91k]
  ------------------
 1519|  12.0k|        int free_it = 0;
 1520|       |
 1521|  12.0k|#ifndef FIPS_MODULE
 1522|  12.0k|        free_it = free_it || pkey->pkey.ptr != NULL;
  ------------------
  |  Branch (1522:19): [True: 0, False: 12.0k]
  |  Branch (1522:30): [True: 0, False: 12.0k]
  ------------------
 1523|  12.0k|#endif
 1524|  12.0k|        free_it = free_it || pkey->keydata != NULL;
  ------------------
  |  Branch (1524:19): [True: 0, False: 12.0k]
  |  Branch (1524:30): [True: 0, False: 12.0k]
  ------------------
 1525|  12.0k|        if (free_it)
  ------------------
  |  Branch (1525:13): [True: 0, False: 12.0k]
  ------------------
 1526|      0|            evp_pkey_free_it(pkey);
 1527|  12.0k|#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|  12.0k|        if (pkey->type != EVP_PKEY_NONE
  ------------------
  |  |   59|  12.0k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  24.0k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1532:13): [True: 351, False: 11.6k]
  ------------------
 1533|  12.0k|            && type == pkey->save_type
  ------------------
  |  Branch (1533:16): [True: 349, False: 2]
  ------------------
 1534|  12.0k|            && pkey->ameth != NULL)
  ------------------
  |  Branch (1534:16): [True: 349, False: 0]
  ------------------
 1535|    349|            return 1;
 1536|  11.6k|# ifndef OPENSSL_NO_ENGINE
 1537|       |        /* If we have ENGINEs release them */
 1538|  11.6k|        ENGINE_finish(pkey->engine);
 1539|  11.6k|        pkey->engine = NULL;
 1540|  11.6k|        ENGINE_finish(pkey->pmeth_engine);
 1541|  11.6k|        pkey->pmeth_engine = NULL;
 1542|  11.6k|# endif
 1543|  11.6k|#endif
 1544|  11.6k|    }
 1545|  19.5k|#ifndef FIPS_MODULE
 1546|  19.5k|    if (str != NULL)
  ------------------
  |  Branch (1546:9): [True: 9.81k, False: 9.76k]
  ------------------
 1547|  9.81k|        ameth = EVP_PKEY_asn1_find_str(eptr, str, len);
 1548|  9.76k|    else if (type != EVP_PKEY_NONE)
  ------------------
  |  |   59|  9.76k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  9.76k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1548:14): [True: 9.74k, False: 19]
  ------------------
 1549|  9.74k|        ameth = EVP_PKEY_asn1_find(eptr, type);
 1550|  19.5k|# ifndef OPENSSL_NO_ENGINE
 1551|  19.5k|    if (pkey == NULL && eptr != NULL)
  ------------------
  |  Branch (1551:9): [True: 7.91k, False: 11.6k]
  |  Branch (1551:25): [True: 7.91k, False: 0]
  ------------------
 1552|  7.91k|        ENGINE_finish(e);
 1553|  19.5k|# endif
 1554|  19.5k|#endif
 1555|       |
 1556|       |
 1557|  19.5k|    {
 1558|  19.5k|        int check = 1;
 1559|       |
 1560|  19.5k|#ifndef FIPS_MODULE
 1561|  19.5k|        check = check && ameth == NULL;
  ------------------
  |  Branch (1561:17): [True: 19.5k, False: 0]
  |  Branch (1561:26): [True: 6.04k, False: 13.5k]
  ------------------
 1562|  19.5k|#endif
 1563|  19.5k|        check = check && keymgmt == NULL;
  ------------------
  |  Branch (1563:17): [True: 6.04k, False: 13.5k]
  |  Branch (1563:26): [True: 6.03k, False: 9]
  ------------------
 1564|  19.5k|        if (check) {
  ------------------
  |  Branch (1564:13): [True: 6.03k, False: 13.5k]
  ------------------
 1565|  6.03k|            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|  6.03k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  6.03k|    (ERR_new(),                                                 \
  |  |  |  |  404|  6.03k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|  6.03k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|  6.03k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|  6.03k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  6.03k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1566|  6.03k|            return 0;
 1567|  6.03k|        }
 1568|  19.5k|    }
 1569|  13.5k|    if (pkey != NULL) {
  ------------------
  |  Branch (1569:9): [True: 11.6k, False: 1.89k]
  ------------------
 1570|  11.6k|        if (keymgmt != NULL && !EVP_KEYMGMT_up_ref(keymgmt)) {
  ------------------
  |  Branch (1570:13): [True: 1.90k, False: 9.73k]
  |  Branch (1570:32): [True: 0, False: 1.90k]
  ------------------
 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|  11.6k|        pkey->keymgmt = keymgmt;
 1576|       |
 1577|  11.6k|        pkey->save_type = type;
 1578|  11.6k|        pkey->type = type;
 1579|       |
 1580|  11.6k|#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|  11.6k|        if (keymgmt == NULL)
  ------------------
  |  Branch (1586:13): [True: 9.73k, False: 1.90k]
  ------------------
 1587|  9.73k|            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|  11.6k|        if (ameth != NULL) {
  ------------------
  |  Branch (1597:13): [True: 11.6k, False: 9]
  ------------------
 1598|  11.6k|            if (type == EVP_PKEY_NONE)
  ------------------
  |  |   59|  11.6k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  11.6k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1598:17): [True: 1.89k, False: 9.73k]
  ------------------
 1599|  1.89k|                pkey->type = ameth->pkey_id;
 1600|  11.6k|        } else {
 1601|      9|            pkey->type = EVP_PKEY_KEYMGMT;
  ------------------
  |  |   84|      9|# define EVP_PKEY_KEYMGMT -1
  ------------------
 1602|      9|        }
 1603|  11.6k|# ifndef OPENSSL_NO_ENGINE
 1604|  11.6k|        if (eptr == NULL && e != NULL && !ENGINE_init(e)) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 11.6k]
  |  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|  11.6k|# endif
 1609|  11.6k|        pkey->engine = e;
 1610|  11.6k|#endif
 1611|  11.6k|    }
 1612|  13.5k|    return 1;
 1613|  13.5k|}
p_lib.c:find_ameth:
 1617|  7.91k|{
 1618|  7.91k|    const char **str = data;
 1619|       |
 1620|       |    /*
 1621|       |     * The error messages from pkey_set_type() are uninteresting here,
 1622|       |     * and misleading.
 1623|       |     */
 1624|  7.91k|    ERR_set_mark();
 1625|       |
 1626|  7.91k|    if (pkey_set_type(NULL, NULL, EVP_PKEY_NONE, name, strlen(name),
  ------------------
  |  |   59|  7.91k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  7.91k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1626:9): [True: 1.89k, False: 6.01k]
  ------------------
 1627|  7.91k|                      NULL)) {
 1628|  1.89k|        if (str[0] == NULL)
  ------------------
  |  Branch (1628:13): [True: 1.89k, False: 0]
  ------------------
 1629|  1.89k|            str[0] = name;
 1630|      0|        else if (str[1] == NULL)
  ------------------
  |  Branch (1630:18): [True: 0, False: 0]
  ------------------
 1631|      0|            str[1] = name;
 1632|  1.89k|    }
 1633|       |
 1634|  7.91k|    ERR_pop_to_mark();
 1635|  7.91k|}
p_lib.c:evp_pkey_free_it:
 1771|  11.6k|{
 1772|       |    /* internal function; x is never NULL */
 1773|  11.6k|    evp_keymgmt_util_clear_operation_cache(x);
 1774|  11.6k|#ifndef FIPS_MODULE
 1775|  11.6k|    evp_pkey_free_legacy(x);
 1776|  11.6k|#endif
 1777|       |
 1778|  11.6k|    if (x->keymgmt != NULL) {
  ------------------
  |  Branch (1778:9): [True: 1.90k, False: 9.74k]
  ------------------
 1779|  1.90k|        evp_keymgmt_freedata(x->keymgmt, x->keydata);
 1780|  1.90k|        EVP_KEYMGMT_free(x->keymgmt);
 1781|  1.90k|        x->keymgmt = NULL;
 1782|  1.90k|        x->keydata = NULL;
 1783|  1.90k|    }
 1784|  11.6k|    x->type = EVP_PKEY_NONE;
  ------------------
  |  |   59|  11.6k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  11.6k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1785|  11.6k|}

EVP_PKEY_CTX_free:
  388|  9.59k|{
  389|  9.59k|    if (ctx == NULL)
  ------------------
  |  Branch (389:9): [True: 9.59k, False: 0]
  ------------------
  390|  9.59k|        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|      4|{
   16|      4|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   17|       |
   18|      4|    if (global == NULL)
  ------------------
  |  Branch (18:9): [True: 0, False: 4]
  ------------------
   19|      0|        return 0;
   20|       |
   21|      4|    global->ex_data_lock = CRYPTO_THREAD_lock_new();
   22|      4|    return global->ex_data_lock != NULL;
   23|      4|}
ossl_crypto_cleanup_all_ex_data_int:
   73|      2|{
   74|      2|    int i;
   75|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   76|       |
   77|      2|    if (global == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 2]
  ------------------
   78|      0|        return;
   79|       |
   80|     38|    for (i = 0; i < CRYPTO_EX_INDEX__COUNT; ++i) {
  ------------------
  |  |  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|  1.79M|{
  222|  1.79M|    int mx, i;
  223|  1.79M|    void *ptr;
  224|  1.79M|    EX_CALLBACK **storage = NULL;
  225|  1.79M|    EX_CALLBACK *stack[10];
  226|  1.79M|    EX_CALLBACKS *ip;
  227|  1.79M|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  228|       |
  229|  1.79M|    if (global == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 1.79M]
  ------------------
  230|      0|        return 0;
  231|       |
  232|  1.79M|    ip = get_and_lock(global, class_index, 1);
  233|  1.79M|    if (ip == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 1.79M]
  ------------------
  234|      0|        return 0;
  235|       |
  236|  1.79M|    ad->ctx = ctx;
  237|  1.79M|    ad->sk = NULL;
  238|  1.79M|    mx = sk_EX_CALLBACK_num(ip->meth);
  239|  1.79M|    if (mx > 0) {
  ------------------
  |  Branch (239:9): [True: 0, False: 1.79M]
  ------------------
  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|  1.79M|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  249|       |
  250|  1.79M|    if (mx > 0 && storage == NULL)
  ------------------
  |  Branch (250:9): [True: 0, False: 1.79M]
  |  Branch (250:19): [True: 0, False: 0]
  ------------------
  251|      0|        return 0;
  252|  1.79M|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (252:17): [True: 0, False: 1.79M]
  ------------------
  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|  1.79M|    if (storage != stack)
  ------------------
  |  Branch (259:9): [True: 1.79M, False: 0]
  ------------------
  260|  1.79M|        OPENSSL_free(storage);
  ------------------
  |  |  115|  1.79M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.79M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.79M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|  1.79M|    return 1;
  262|  1.79M|}
CRYPTO_new_ex_data:
  265|  1.75M|{
  266|  1.75M|    return ossl_crypto_new_ex_data_ex(NULL, class_index, obj, ad);
  267|  1.75M|}
CRYPTO_free_ex_data:
  368|  1.79M|{
  369|  1.79M|    int mx, i;
  370|  1.79M|    EX_CALLBACKS *ip;
  371|  1.79M|    void *ptr;
  372|  1.79M|    const EX_CALLBACK *f;
  373|  1.79M|    struct ex_callback_entry stack[10];
  374|  1.79M|    struct ex_callback_entry *storage = NULL;
  375|  1.79M|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
  376|       |
  377|  1.79M|    if (global == NULL)
  ------------------
  |  Branch (377:9): [True: 0, False: 1.79M]
  ------------------
  378|      0|        goto err;
  379|       |
  380|  1.79M|    ip = get_and_lock(global, class_index, 1);
  381|  1.79M|    if (ip == NULL)
  ------------------
  |  Branch (381:9): [True: 0, False: 1.79M]
  ------------------
  382|      0|        goto err;
  383|       |
  384|  1.79M|    mx = sk_EX_CALLBACK_num(ip->meth);
  385|  1.79M|    if (mx > 0) {
  ------------------
  |  Branch (385:9): [True: 0, False: 1.79M]
  ------------------
  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|  1.79M|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  397|       |
  398|  1.79M|    if (storage != NULL) {
  ------------------
  |  Branch (398:9): [True: 0, False: 1.79M]
  ------------------
  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|  1.79M|    if (storage != stack)
  ------------------
  |  Branch (411:9): [True: 1.79M, False: 0]
  ------------------
  412|  1.79M|        OPENSSL_free(storage);
  ------------------
  |  |  115|  1.79M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.79M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.79M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  413|  1.79M| err:
  414|  1.79M|    sk_void_free(ad->sk);
  ------------------
  |  |  203|  1.79M|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
  415|  1.79M|    ad->sk = NULL;
  416|  1.79M|    ad->ctx = NULL;
  417|  1.79M|}
ex_data.c:get_and_lock:
   33|  3.58M|{
   34|  3.58M|    EX_CALLBACKS *ip;
   35|       |
   36|  3.58M|    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
  ------------------
  |  |  247|  3.58M|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (36:9): [True: 0, False: 3.58M]
  |  Branch (36:28): [True: 0, False: 3.58M]
  ------------------
   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|  3.58M|    if (global->ex_data_lock == NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 3.58M]
  ------------------
   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|  3.58M|    if (read) {
  ------------------
  |  Branch (49:9): [True: 3.58M, False: 2]
  ------------------
   50|  3.58M|        if (!CRYPTO_THREAD_read_lock(global->ex_data_lock))
  ------------------
  |  Branch (50:13): [True: 0, False: 3.58M]
  ------------------
   51|      0|            return NULL;
   52|  3.58M|    } 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|  3.58M|    ip = &global->ex_data[class_index];
   58|  3.58M|    return ip;
   59|  3.58M|}

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

ossl_ffc_params_init:
   21|   136k|{
   22|   136k|    memset(params, 0, sizeof(*params));
   23|   136k|    params->pcounter = -1;
   24|   136k|    params->gindex = FFC_UNVERIFIABLE_GINDEX;
  ------------------
  |  |   23|   136k|# define FFC_UNVERIFIABLE_GINDEX -1
  ------------------
   25|   136k|    params->flags = FFC_PARAM_FLAG_VALIDATE_PQG;
  ------------------
  |  |   46|   136k|    (FFC_PARAM_FLAG_VALIDATE_PQ | FFC_PARAM_FLAG_VALIDATE_G)
  |  |  ------------------
  |  |  |  |   43|   136k|# define FFC_PARAM_FLAG_VALIDATE_PQ    0x01
  |  |  ------------------
  |  |                   (FFC_PARAM_FLAG_VALIDATE_PQ | FFC_PARAM_FLAG_VALIDATE_G)
  |  |  ------------------
  |  |  |  |   44|   136k|# define FFC_PARAM_FLAG_VALIDATE_G     0x02
  |  |  ------------------
  ------------------
   26|   136k|}
ossl_ffc_params_cleanup:
   29|  68.4k|{
   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|  68.4k|    BN_free(params->p);
   38|  68.4k|    BN_free(params->q);
   39|  68.4k|    BN_free(params->g);
   40|  68.4k|    BN_free(params->j);
   41|  68.4k|    OPENSSL_free(params->seed);
  ------------------
  |  |  115|  68.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  68.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  68.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   42|  68.4k|#endif
   43|  68.4k|    ossl_ffc_params_init(params);
   44|  68.4k|}
ossl_ffc_params_set0_pqg:
   47|     99|{
   48|     99|    if (p != NULL && p != d->p) {
  ------------------
  |  Branch (48:9): [True: 99, False: 0]
  |  Branch (48:22): [True: 99, False: 0]
  ------------------
   49|     99|        BN_free(d->p);
   50|     99|        d->p = p;
   51|     99|    }
   52|     99|    if (q != NULL && q != d->q) {
  ------------------
  |  Branch (52:9): [True: 99, False: 0]
  |  Branch (52:22): [True: 99, False: 0]
  ------------------
   53|     99|        BN_free(d->q);
   54|     99|        d->q = q;
   55|     99|    }
   56|     99|    if (g != NULL && g != d->g) {
  ------------------
  |  Branch (56:9): [True: 99, False: 0]
  |  Branch (56:22): [True: 99, False: 0]
  ------------------
   57|     99|        BN_free(d->g);
   58|     99|        d->g = g;
   59|     99|    }
   60|     99|}
ossl_ffc_params_get0_pqg:
   64|     93|{
   65|     93|    if (p != NULL)
  ------------------
  |  Branch (65:9): [True: 93, False: 0]
  ------------------
   66|     93|        *p = d->p;
   67|     93|    if (q != NULL)
  ------------------
  |  Branch (67:9): [True: 93, False: 0]
  ------------------
   68|     93|        *q = d->q;
   69|     93|    if (g != NULL)
  ------------------
  |  Branch (69:9): [True: 93, False: 0]
  ------------------
   70|     93|        *g = d->g;
   71|     93|}
ossl_ffc_params_set0_j:
   76|     99|{
   77|     99|    BN_free(d->j);
   78|     99|    d->j = NULL;
   79|     99|    if (j != NULL)
  ------------------
  |  Branch (79:9): [True: 27, False: 72]
  ------------------
   80|     27|        d->j = j;
   81|     99|}
ossl_ffc_params_set_seed:
   85|     42|{
   86|     42|    if (params->seed != NULL) {
  ------------------
  |  Branch (86:9): [True: 0, False: 42]
  ------------------
   87|      0|        if (params->seed == seed)
  ------------------
  |  Branch (87:13): [True: 0, False: 0]
  ------------------
   88|      0|            return 1;
   89|      0|        OPENSSL_free(params->seed);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   90|      0|    }
   91|       |
   92|     42|    if (seed != NULL && seedlen > 0) {
  ------------------
  |  Branch (92:9): [True: 37, False: 5]
  |  Branch (92:25): [True: 37, False: 0]
  ------------------
   93|     37|        params->seed = OPENSSL_memdup(seed, seedlen);
  ------------------
  |  |  117|     37|        CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     37|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     37|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|     37|        if (params->seed == NULL)
  ------------------
  |  Branch (94:13): [True: 0, False: 37]
  ------------------
   95|      0|            return 0;
   96|     37|        params->seedlen = seedlen;
   97|     37|    } else {
   98|      5|        params->seed = NULL;
   99|      5|        params->seedlen = 0;
  100|      5|    }
  101|     42|    return 1;
  102|     42|}
ossl_ffc_params_set_validate_params:
  142|     42|{
  143|     42|    if (!ossl_ffc_params_set_seed(params, seed, seedlen))
  ------------------
  |  Branch (143:9): [True: 0, False: 42]
  ------------------
  144|      0|        return 0;
  145|     42|    params->pcounter = counter;
  146|     42|    return 1;
  147|     42|}
ossl_ffc_params_get_validate_params:
  152|     91|{
  153|     91|    if (seed != NULL)
  ------------------
  |  Branch (153:9): [True: 91, False: 0]
  ------------------
  154|     91|        *seed = params->seed;
  155|     91|    if (seedlen != NULL)
  ------------------
  |  Branch (155:9): [True: 91, False: 0]
  ------------------
  156|     91|        *seedlen = params->seedlen;
  157|     91|    if (pcounter != NULL)
  ------------------
  |  Branch (157:9): [True: 91, False: 0]
  ------------------
  158|     91|        *pcounter = params->pcounter;
  159|     91|}
ossl_ffc_params_todata:
  218|    703|{
  219|    703|    int test_flags;
  220|       |
  221|    703|    if (ffc->p != NULL
  ------------------
  |  Branch (221:9): [True: 703, False: 0]
  ------------------
  222|    703|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_P, ffc->p))
  ------------------
  |  |  371|    703|# define OSSL_PKEY_PARAM_FFC_P "p"
  ------------------
  |  Branch (222:12): [True: 0, False: 703]
  ------------------
  223|      0|        return 0;
  224|    703|    if (ffc->q != NULL
  ------------------
  |  Branch (224:9): [True: 631, False: 72]
  ------------------
  225|    703|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_Q, ffc->q))
  ------------------
  |  |  374|    631|# define OSSL_PKEY_PARAM_FFC_Q "q"
  ------------------
  |  Branch (225:12): [True: 0, False: 631]
  ------------------
  226|      0|        return 0;
  227|    703|    if (ffc->g != NULL
  ------------------
  |  Branch (227:9): [True: 703, False: 0]
  ------------------
  228|    703|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_G, ffc->g))
  ------------------
  |  |  368|    703|# define OSSL_PKEY_PARAM_FFC_G "g"
  ------------------
  |  Branch (228:12): [True: 0, False: 703]
  ------------------
  229|      0|        return 0;
  230|    703|    if (ffc->j != NULL
  ------------------
  |  Branch (230:9): [True: 16, False: 687]
  ------------------
  231|    703|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_COFACTOR,
  ------------------
  |  |  365|     16|# define OSSL_PKEY_PARAM_FFC_COFACTOR "j"
  ------------------
  |  Branch (231:12): [True: 0, False: 16]
  ------------------
  232|     16|                                    ffc->j))
  233|      0|        return 0;
  234|    703|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_GINDEX,
  ------------------
  |  |  369|    703|# define OSSL_PKEY_PARAM_FFC_GINDEX "gindex"
  ------------------
  |  Branch (234:9): [True: 0, False: 703]
  ------------------
  235|    703|                                  ffc->gindex))
  236|      0|        return 0;
  237|    703|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_PCOUNTER,
  ------------------
  |  |  373|    703|# define OSSL_PKEY_PARAM_FFC_PCOUNTER "pcounter"
  ------------------
  |  Branch (237:9): [True: 0, False: 703]
  ------------------
  238|    703|                                  ffc->pcounter))
  239|      0|        return 0;
  240|    703|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_H, ffc->h))
  ------------------
  |  |  370|    703|# define OSSL_PKEY_PARAM_FFC_H "hindex"
  ------------------
  |  Branch (240:9): [True: 0, False: 703]
  ------------------
  241|      0|        return 0;
  242|    703|    if (ffc->seed != NULL
  ------------------
  |  Branch (242:9): [True: 0, False: 703]
  ------------------
  243|    703|        && !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|    703|    if (ffc->nid != NID_undef) {
  ------------------
  |  |   18|    703|#define NID_undef                       0
  ------------------
  |  Branch (247:9): [True: 0, False: 703]
  ------------------
  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|    703|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_PQ) != 0);
  ------------------
  |  |   43|    703|# define FFC_PARAM_FLAG_VALIDATE_PQ    0x01
  ------------------
  258|    703|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (258:9): [True: 0, False: 703]
  ------------------
  259|    703|                                  OSSL_PKEY_PARAM_FFC_VALIDATE_PQ, test_flags))
  ------------------
  |  |  380|    703|# define OSSL_PKEY_PARAM_FFC_VALIDATE_PQ "validate-pq"
  ------------------
  260|      0|        return 0;
  261|    703|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_G) != 0);
  ------------------
  |  |   44|    703|# define FFC_PARAM_FLAG_VALIDATE_G     0x02
  ------------------
  262|    703|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (262:9): [True: 0, False: 703]
  ------------------
  263|    703|                                  OSSL_PKEY_PARAM_FFC_VALIDATE_G, test_flags))
  ------------------
  |  |  378|    703|# define OSSL_PKEY_PARAM_FFC_VALIDATE_G "validate-g"
  ------------------
  264|      0|        return 0;
  265|    703|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_LEGACY) != 0);
  ------------------
  |  |   47|    703|#define FFC_PARAM_FLAG_VALIDATE_LEGACY 0x04
  ------------------
  266|    703|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (266:9): [True: 0, False: 703]
  ------------------
  267|    703|                                  OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY,
  ------------------
  |  |  379|    703|# define OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY "validate-legacy"
  ------------------
  268|    703|                                  test_flags))
  269|      0|        return 0;
  270|       |
  271|    703|    if (ffc->mdname != NULL
  ------------------
  |  Branch (271:9): [True: 0, False: 703]
  ------------------
  272|    703|        && !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|    703|    if (ffc->mdprops != NULL
  ------------------
  |  Branch (276:9): [True: 0, False: 703]
  ------------------
  277|    703|        && !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|    703|    return 1;
  282|    703|}
ossl_ffc_params_print:
  286|      4|{
  287|      4|    if (!ASN1_bn_print(bp, "prime P:", ffc->p, NULL, indent))
  ------------------
  |  Branch (287:9): [True: 0, False: 4]
  ------------------
  288|      0|        goto err;
  289|      4|    if (!ASN1_bn_print(bp, "generator G:", ffc->g, NULL, indent))
  ------------------
  |  Branch (289:9): [True: 0, False: 4]
  ------------------
  290|      0|        goto err;
  291|      4|    if (ffc->q != NULL
  ------------------
  |  Branch (291:9): [True: 4, False: 0]
  ------------------
  292|      4|        && !ASN1_bn_print(bp, "subgroup order Q:", ffc->q, NULL, indent))
  ------------------
  |  Branch (292:12): [True: 0, False: 4]
  ------------------
  293|      0|        goto err;
  294|      4|    if (ffc->j != NULL
  ------------------
  |  Branch (294:9): [True: 0, False: 4]
  ------------------
  295|      4|        && !ASN1_bn_print(bp, "subgroup factor:", ffc->j, NULL, indent))
  ------------------
  |  Branch (295:12): [True: 0, False: 0]
  ------------------
  296|      0|        goto err;
  297|      4|    if (ffc->seed != NULL) {
  ------------------
  |  Branch (297:9): [True: 0, False: 4]
  ------------------
  298|      0|        size_t i;
  299|       |
  300|      0|        if (!BIO_indent(bp, indent, 128)
  ------------------
  |  Branch (300:13): [True: 0, False: 0]
  ------------------
  301|      0|            || BIO_puts(bp, "seed:") <= 0)
  ------------------
  |  Branch (301:16): [True: 0, False: 0]
  ------------------
  302|      0|            goto err;
  303|      0|        for (i = 0; i < ffc->seedlen; i++) {
  ------------------
  |  Branch (303:21): [True: 0, False: 0]
  ------------------
  304|      0|            if ((i % 15) == 0) {
  ------------------
  |  Branch (304:17): [True: 0, False: 0]
  ------------------
  305|      0|                if (BIO_puts(bp, "\n") <= 0
  ------------------
  |  Branch (305:21): [True: 0, False: 0]
  ------------------
  306|      0|                    || !BIO_indent(bp, indent + 4, 128))
  ------------------
  |  Branch (306:24): [True: 0, False: 0]
  ------------------
  307|      0|                    goto err;
  308|      0|            }
  309|      0|            if (BIO_printf(bp, "%02x%s", ffc->seed[i],
  ------------------
  |  Branch (309:17): [True: 0, False: 0]
  ------------------
  310|      0|                           ((i + 1) == ffc->seedlen) ? "" : ":") <= 0)
  ------------------
  |  Branch (310:28): [True: 0, False: 0]
  ------------------
  311|      0|                goto err;
  312|      0|        }
  313|      0|        if (BIO_write(bp, "\n", 1) <= 0)
  ------------------
  |  Branch (313:13): [True: 0, False: 0]
  ------------------
  314|      0|            return 0;
  315|      0|    }
  316|      4|    if (ffc->pcounter != -1) {
  ------------------
  |  Branch (316:9): [True: 0, False: 4]
  ------------------
  317|      0|        if (!BIO_indent(bp, indent, 128)
  ------------------
  |  Branch (317:13): [True: 0, False: 0]
  ------------------
  318|      0|            || BIO_printf(bp, "counter: %d\n", ffc->pcounter) <= 0)
  ------------------
  |  Branch (318:16): [True: 0, False: 0]
  ------------------
  319|      0|            goto err;
  320|      0|    }
  321|      4|    return 1;
  322|      0|err:
  323|      0|    return 0;
  324|      4|}

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

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

ossl_indicator_set_callback_new:
   22|      4|{
   23|      4|    INDICATOR_CB *cb;
   24|       |
   25|      4|    cb = OPENSSL_zalloc(sizeof(*cb));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      4|    return cb;
   27|      4|}
ossl_indicator_set_callback_free:
   30|      2|{
   31|      2|    OPENSSL_free(cb);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|  40.0M|{
  477|  40.0M|    uint64_t tmp;
  478|  40.0M|    int aloaddone = 0;
  479|       |
  480|       |   /* Applications depend on 0 being returned when cleanup was already done */
  481|  40.0M|    if (stopped) {
  ------------------
  |  Branch (481:9): [True: 0, False: 40.0M]
  ------------------
  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|  40.0M|    if (CRYPTO_atomic_load(&optsdone, &tmp, NULL)) {
  ------------------
  |  Branch (500:9): [True: 40.0M, False: 0]
  ------------------
  501|  40.0M|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (501:13): [True: 664k, False: 39.3M]
  ------------------
  502|   664k|            return 1;
  503|  39.3M|        aloaddone = 1;
  504|  39.3M|    }
  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|  39.3M|    if (!RUN_ONCE(&base, ossl_init_base))
  ------------------
  |  |  130|  39.3M|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 39.3M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (520:9): [True: 0, False: 39.3M]
  ------------------
  521|      0|        return 0;
  522|       |
  523|  39.3M|    if (opts & OPENSSL_INIT_BASE_ONLY)
  ------------------
  |  |   31|  39.3M|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (523:9): [True: 39.3M, False: 6]
  ------------------
  524|  39.3M|        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|      6|    if (!aloaddone) {
  ------------------
  |  Branch (531:9): [True: 0, False: 6]
  ------------------
  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|      6|    if ((opts & OPENSSL_INIT_NO_ATEXIT) != 0) {
  ------------------
  |  |  481|      6|# define OPENSSL_INIT_NO_ATEXIT              0x00080000L
  ------------------
  |  Branch (544:9): [True: 0, False: 6]
  ------------------
  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|      6|    } else if (!RUN_ONCE(&register_atexit, ossl_init_register_atexit)) {
  ------------------
  |  |  130|      6|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 6, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (548:16): [True: 0, False: 6]
  ------------------
  549|      0|        return 0;
  550|      0|    }
  551|       |
  552|      6|    if (!RUN_ONCE(&load_crypto_nodelete, ossl_init_load_crypto_nodelete))
  ------------------
  |  |  130|      6|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 6, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (552:9): [True: 0, False: 6]
  ------------------
  553|      0|        return 0;
  554|       |
  555|      6|    if ((opts & OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  462|      6|# define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
  ------------------
  |  Branch (555:9): [True: 0, False: 6]
  ------------------
  556|      6|            && !RUN_ONCE_ALT(&load_crypto_strings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (556:16): [True: 0, False: 0]
  ------------------
  557|      6|                             ossl_init_no_load_crypto_strings,
  558|      6|                             ossl_init_load_crypto_strings))
  559|      0|        return 0;
  560|       |
  561|      6|    if ((opts & OPENSSL_INIT_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  463|      6|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  |  Branch (561:9): [True: 2, False: 4]
  ------------------
  562|      6|            && !RUN_ONCE(&load_crypto_strings, ossl_init_load_crypto_strings))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (562:16): [True: 0, False: 2]
  ------------------
  563|      0|        return 0;
  564|       |
  565|      6|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_CIPHERS)
  ------------------
  |  |  466|      6|# define OPENSSL_INIT_NO_ADD_ALL_CIPHERS     0x00000010L
  ------------------
  |  Branch (565:9): [True: 0, False: 6]
  ------------------
  566|      6|            && !RUN_ONCE_ALT(&add_all_ciphers, ossl_init_no_add_all_ciphers,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (566:16): [True: 0, False: 0]
  ------------------
  567|      6|                             ossl_init_add_all_ciphers))
  568|      0|        return 0;
  569|       |
  570|      6|    if ((opts & OPENSSL_INIT_ADD_ALL_CIPHERS)
  ------------------
  |  |  464|      6|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
  |  Branch (570:9): [True: 2, False: 4]
  ------------------
  571|      6|            && !RUN_ONCE(&add_all_ciphers, ossl_init_add_all_ciphers))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (571:16): [True: 0, False: 2]
  ------------------
  572|      0|        return 0;
  573|       |
  574|      6|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_DIGESTS)
  ------------------
  |  |  467|      6|# define OPENSSL_INIT_NO_ADD_ALL_DIGESTS     0x00000020L
  ------------------
  |  Branch (574:9): [True: 0, False: 6]
  ------------------
  575|      6|            && !RUN_ONCE_ALT(&add_all_digests, ossl_init_no_add_all_digests,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (575:16): [True: 0, False: 0]
  ------------------
  576|      6|                             ossl_init_add_all_digests))
  577|      0|        return 0;
  578|       |
  579|      6|    if ((opts & OPENSSL_INIT_ADD_ALL_DIGESTS)
  ------------------
  |  |  465|      6|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
  |  Branch (579:9): [True: 2, False: 4]
  ------------------
  580|      6|            && !RUN_ONCE(&add_all_digests, ossl_init_add_all_digests))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (580:16): [True: 0, False: 2]
  ------------------
  581|      0|        return 0;
  582|       |
  583|      6|    if ((opts & OPENSSL_INIT_ATFORK)
  ------------------
  |  |  479|      6|# define OPENSSL_INIT_ATFORK                 0x00020000L
  ------------------
  |  Branch (583:9): [True: 0, False: 6]
  ------------------
  584|      6|            && !openssl_init_fork_handlers())
  ------------------
  |  Branch (584:16): [True: 0, False: 0]
  ------------------
  585|      0|        return 0;
  586|       |
  587|      6|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG)
  ------------------
  |  |  469|      6|# define OPENSSL_INIT_NO_LOAD_CONFIG         0x00000080L
  ------------------
  |  Branch (587:9): [True: 0, False: 6]
  ------------------
  588|      6|            && !RUN_ONCE_ALT(&config, ossl_init_no_config, ossl_init_config))
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (588:16): [True: 0, False: 0]
  ------------------
  589|      0|        return 0;
  590|       |
  591|      6|    if (opts & OPENSSL_INIT_LOAD_CONFIG) {
  ------------------
  |  |  468|      6|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (591:9): [True: 4, False: 2]
  ------------------
  592|      4|        int loading = CRYPTO_THREAD_get_local(&in_init_config_local) != NULL;
  593|       |
  594|       |        /* If called recursively from OBJ_ calls, just skip it. */
  595|      4|        if (!loading) {
  ------------------
  |  Branch (595:13): [True: 2, False: 2]
  ------------------
  596|      2|            int ret;
  597|       |
  598|      2|            if (!CRYPTO_THREAD_set_local(&in_init_config_local, (void *)-1))
  ------------------
  |  Branch (598:17): [True: 0, False: 2]
  ------------------
  599|      0|                return 0;
  600|      2|            if (settings == NULL) {
  ------------------
  |  Branch (600:17): [True: 2, False: 0]
  ------------------
  601|      2|                ret = RUN_ONCE(&config, ossl_init_config);
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  602|      2|            } 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|      2|            if (ret <= 0)
  ------------------
  |  Branch (612:17): [True: 0, False: 2]
  ------------------
  613|      0|                return 0;
  614|      2|        }
  615|      4|    }
  616|       |
  617|      6|    if ((opts & OPENSSL_INIT_ASYNC)
  ------------------
  |  |  470|      6|# define OPENSSL_INIT_ASYNC                  0x00000100L
  ------------------
  |  Branch (617:9): [True: 0, False: 6]
  ------------------
  618|      6|            && !RUN_ONCE(&async, ossl_init_async))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (618:16): [True: 0, False: 0]
  ------------------
  619|      0|        return 0;
  620|       |
  621|      6|#ifndef OPENSSL_NO_ENGINE
  622|      6|    if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
  ------------------
  |  |  473|      6|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  |  Branch (622:9): [True: 0, False: 6]
  ------------------
  623|      6|            && !RUN_ONCE(&engine_openssl, ossl_init_engine_openssl))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (623:16): [True: 0, False: 0]
  ------------------
  624|      0|        return 0;
  625|      6|# ifndef OPENSSL_NO_RDRAND
  626|      6|    if ((opts & OPENSSL_INIT_ENGINE_RDRAND)
  ------------------
  |  |  471|      6|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  ------------------
  |  Branch (626:9): [True: 0, False: 6]
  ------------------
  627|      6|            && !RUN_ONCE(&engine_rdrand, ossl_init_engine_rdrand))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (627:16): [True: 0, False: 0]
  ------------------
  628|      0|        return 0;
  629|      6|# endif
  630|      6|    if ((opts & OPENSSL_INIT_ENGINE_DYNAMIC)
  ------------------
  |  |  472|      6|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  ------------------
  |  Branch (630:9): [True: 0, False: 6]
  ------------------
  631|      6|            && !RUN_ONCE(&engine_dynamic, ossl_init_engine_dynamic))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (631:16): [True: 0, False: 0]
  ------------------
  632|      0|        return 0;
  633|      6|# 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|      6|#  if !defined(OPENSSL_NO_PADLOCKENG)
  640|      6|    if ((opts & OPENSSL_INIT_ENGINE_PADLOCK)
  ------------------
  |  |  476|      6|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  ------------------
  |  Branch (640:9): [True: 0, False: 6]
  ------------------
  641|      6|            && !RUN_ONCE(&engine_padlock, ossl_init_engine_padlock))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (641:16): [True: 0, False: 0]
  ------------------
  642|      0|        return 0;
  643|      6|#  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|      6|#  if !defined(OPENSSL_NO_AFALGENG)
  650|      6|    if ((opts & OPENSSL_INIT_ENGINE_AFALG)
  ------------------
  |  |  477|      6|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  |  Branch (650:9): [True: 0, False: 6]
  ------------------
  651|      6|            && !RUN_ONCE(&engine_afalg, ossl_init_engine_afalg))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (651:16): [True: 0, False: 0]
  ------------------
  652|      0|        return 0;
  653|      6|#  endif
  654|      6|# endif
  655|      6|    if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN
  ------------------
  |  |  493|      6|    (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  471|      6|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  |  |  ------------------
  |  |                   (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  472|      6|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  |  |  ------------------
  |  |  494|      6|    | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  474|      6|# define OPENSSL_INIT_ENGINE_CRYPTODEV       0x00001000L
  |  |  ------------------
  |  |                   | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  475|      6|# define OPENSSL_INIT_ENGINE_CAPI            0x00002000L
  |  |  ------------------
  |  |  495|      6|    OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  476|      6|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  |  |  ------------------
  ------------------
  |  Branch (655:9): [True: 0, False: 6]
  ------------------
  656|      6|                | OPENSSL_INIT_ENGINE_OPENSSL
  ------------------
  |  |  473|      6|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  657|      6|                | OPENSSL_INIT_ENGINE_AFALG)) {
  ------------------
  |  |  477|      6|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  658|      0|        ENGINE_register_all_complete();
  659|      0|    }
  660|      6|#endif
  661|       |
  662|      6|    if (!CRYPTO_atomic_or(&optsdone, opts, &tmp, optsdone_lock))
  ------------------
  |  Branch (662:9): [True: 0, False: 6]
  ------------------
  663|      0|        return 0;
  664|       |
  665|      6|    return 1;
  666|      6|}
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|      2|{
  214|       |    /*
  215|       |     * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time
  216|       |     * pulling in all the ciphers during static linking
  217|       |     */
  218|      2|#ifndef OPENSSL_NO_AUTOALGINIT
  219|      2|    OSSL_TRACE(INIT, "openssl_add_all_ciphers_int()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  220|      2|    openssl_add_all_ciphers_int();
  221|      2|#endif
  222|      2|    return 1;
  223|      2|}
init.c:ossl_init_add_all_digests:
  234|      2|{
  235|       |    /*
  236|       |     * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time
  237|       |     * pulling in all the ciphers during static linking
  238|       |     */
  239|      2|#ifndef OPENSSL_NO_AUTOALGINIT
  240|      2|    OSSL_TRACE(INIT, "openssl_add_all_digests()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  241|      2|    openssl_add_all_digests_int();
  242|      2|#endif
  243|      2|    return 1;
  244|      2|}
init.c:ossl_init_config:
  257|      2|{
  258|      2|    int ret = ossl_config_int(NULL);
  259|       |
  260|      2|    config_inited = 1;
  261|      2|    return ret;
  262|      2|}

ossl_init_thread:
  203|      2|{
  204|      2|    if (!CRYPTO_THREAD_init_local(&destructor_key.value,
  ------------------
  |  Branch (204:9): [True: 0, False: 2]
  ------------------
  205|      2|                                  init_thread_destructor))
  206|      0|        return 0;
  207|       |
  208|      2|    return 1;
  209|      2|}
ossl_cleanup_thread:
  212|      2|{
  213|      2|    init_thread_deregister(NULL, 1);
  214|      2|    CRYPTO_THREAD_cleanup_local(&destructor_key.value);
  215|      2|    destructor_key.sane = -1;
  216|      2|}
OPENSSL_thread_stop:
  230|      2|{
  231|      2|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (231:9): [True: 2, False: 0]
  ------------------
  232|      2|        THREAD_EVENT_HANDLER **hands
  233|      2|            = init_get_thread_local(&destructor_key.value, 0, 0);
  234|      2|        init_thread_stop(NULL, hands);
  235|       |
  236|      2|        init_thread_remove_handlers(hands);
  237|      2|        OPENSSL_free(hands);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|     98|{
   53|       |
   54|     98|    if (lh == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 98]
  ------------------
   55|      0|        return NULL;
   56|     98|    lh->compw = cw;
   57|     98|    lh->hashw = hw;
   58|     98|    lh->daw = daw;
   59|     98|    lh->daaw = daaw;
   60|     98|    return lh;
   61|     98|}
OPENSSL_LH_new:
   64|     98|{
   65|     98|    OPENSSL_LHASH *ret;
   66|       |
   67|     98|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|     98|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     98|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     98|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (67:9): [True: 0, False: 98]
  ------------------
   68|      0|        return NULL;
   69|     98|    if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
  ------------------
  |  |  104|     98|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     98|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     98|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 98]
  ------------------
   70|      0|        goto err;
   71|     98|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (71:18): [True: 0, False: 98]
  ------------------
   72|     98|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (72:18): [True: 0, False: 98]
  ------------------
   73|     98|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|     98|#define MIN_NODES       16
  ------------------
   74|     98|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|     98|#define MIN_NODES       16
  ------------------
   75|     98|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|     98|#define MIN_NODES       16
  ------------------
   76|     98|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|     98|#define UP_LOAD         (2*LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   85|     98|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   77|     98|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|     98|#define DOWN_LOAD       (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   85|     98|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   78|     98|    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|     98|}
OPENSSL_LH_free:
   87|     90|{
   88|     90|    if (lh == NULL)
  ------------------
  |  Branch (88:9): [True: 2, False: 88]
  ------------------
   89|      2|        return;
   90|       |
   91|     88|    OPENSSL_LH_flush(lh);
   92|     88|    OPENSSL_free(lh->b);
  ------------------
  |  |  115|     88|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     88|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     88|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|     88|    OPENSSL_free(lh);
  ------------------
  |  |  115|     88|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     88|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     88|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|     88|}
OPENSSL_LH_flush:
   97|    222|{
   98|    222|    unsigned int i;
   99|    222|    OPENSSL_LH_NODE *n, *nn;
  100|       |
  101|    222|    if (lh == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 222]
  ------------------
  102|      0|        return;
  103|       |
  104|  4.24k|    for (i = 0; i < lh->num_nodes; i++) {
  ------------------
  |  Branch (104:17): [True: 4.02k, False: 222]
  ------------------
  105|  4.02k|        n = lh->b[i];
  106|  8.17k|        while (n != NULL) {
  ------------------
  |  Branch (106:16): [True: 4.15k, False: 4.02k]
  ------------------
  107|  4.15k|            nn = n->next;
  108|  4.15k|            OPENSSL_free(n);
  ------------------
  |  |  115|  4.15k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.15k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.15k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  109|  4.15k|            n = nn;
  110|  4.15k|        }
  111|  4.02k|        lh->b[i] = NULL;
  112|  4.02k|    }
  113|       |
  114|    222|    lh->num_items = 0;
  115|    222|}
OPENSSL_LH_insert:
  118|  10.7k|{
  119|  10.7k|    unsigned long hash;
  120|  10.7k|    OPENSSL_LH_NODE *nn, **rn;
  121|  10.7k|    void *ret;
  122|       |
  123|  10.7k|    lh->error = 0;
  124|  10.7k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   85|  10.7k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (124:9): [True: 2.25k, False: 8.50k]
  |  Branch (124:76): [True: 0, False: 2.25k]
  ------------------
  125|      0|        return NULL;        /* 'lh->error++' already done in 'expand' */
  126|       |
  127|  10.7k|    rn = getrn(lh, data, &hash);
  128|       |
  129|  10.7k|    if (*rn == NULL) {
  ------------------
  |  Branch (129:9): [True: 4.65k, False: 6.10k]
  ------------------
  130|  4.65k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |  102|  4.65k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.65k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.65k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (130:13): [True: 0, False: 4.65k]
  ------------------
  131|      0|            lh->error++;
  132|      0|            return NULL;
  133|      0|        }
  134|  4.65k|        nn->data = data;
  135|  4.65k|        nn->next = NULL;
  136|  4.65k|        nn->hash = hash;
  137|  4.65k|        *rn = nn;
  138|  4.65k|        ret = NULL;
  139|  4.65k|        lh->num_items++;
  140|  6.10k|    } else {                    /* replace same key */
  141|  6.10k|        ret = (*rn)->data;
  142|  6.10k|        (*rn)->data = data;
  143|  6.10k|    }
  144|  10.7k|    return ret;
  145|  10.7k|}
OPENSSL_LH_delete:
  148|    484|{
  149|    484|    unsigned long hash;
  150|    484|    OPENSSL_LH_NODE *nn, **rn;
  151|    484|    void *ret;
  152|       |
  153|    484|    lh->error = 0;
  154|    484|    rn = getrn(lh, data, &hash);
  155|       |
  156|    484|    if (*rn == NULL) {
  ------------------
  |  Branch (156:9): [True: 0, False: 484]
  ------------------
  157|      0|        return NULL;
  158|    484|    } else {
  159|    484|        nn = *rn;
  160|    484|        *rn = nn->next;
  161|    484|        ret = nn->data;
  162|    484|        OPENSSL_free(nn);
  ------------------
  |  |  115|    484|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    484|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    484|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|    484|    }
  164|       |
  165|    484|    lh->num_items--;
  166|    484|    if ((lh->num_nodes > MIN_NODES) &&
  ------------------
  |  |   39|    484|#define MIN_NODES       16
  ------------------
  |  Branch (166:9): [True: 484, False: 0]
  ------------------
  167|    484|        (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
  ------------------
  |  |   85|    484|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (167:9): [True: 2, False: 482]
  ------------------
  168|      2|        contract(lh);
  169|       |
  170|    484|    return ret;
  171|    484|}
OPENSSL_LH_retrieve:
  174|   170k|{
  175|   170k|    unsigned long hash;
  176|   170k|    OPENSSL_LH_NODE **rn;
  177|       |
  178|   170k|    if (lh->error != 0)
  ------------------
  |  Branch (178:9): [True: 0, False: 170k]
  ------------------
  179|      0|        lh->error = 0;
  180|       |
  181|   170k|    rn = getrn(lh, data, &hash);
  182|       |
  183|   170k|    return *rn == NULL ? NULL : (*rn)->data;
  ------------------
  |  Branch (183:12): [True: 8.81k, False: 161k]
  ------------------
  184|   170k|}
OPENSSL_LH_doall:
  217|    226|{
  218|    226|    if (lh == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 226]
  ------------------
  219|      0|        return;
  220|       |
  221|    226|    doall_util_fn(lh, 0, lh->daw, func, (OPENSSL_LH_DOALL_FUNCARG)NULL,
  222|    226|                  (OPENSSL_LH_DOALL_FUNCARG_THUNK)NULL, NULL);
  223|    226|}
OPENSSL_LH_doall_arg_thunk:
  238|  5.34k|{
  239|  5.34k|    doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC_THUNK)NULL,
  240|  5.34k|                  (OPENSSL_LH_DOALL_FUNC)NULL, fn, daaw, arg);
  241|  5.34k|}
OPENSSL_LH_strhash:
  362|  84.3k|{
  363|  84.3k|    unsigned long ret = 0;
  364|  84.3k|    long n;
  365|  84.3k|    unsigned long v;
  366|  84.3k|    int r;
  367|       |
  368|  84.3k|    if ((c == NULL) || (*c == '\0'))
  ------------------
  |  Branch (368:9): [True: 0, False: 84.3k]
  |  Branch (368:24): [True: 5.72k, False: 78.6k]
  ------------------
  369|  5.72k|        return ret;
  370|       |
  371|  78.6k|    n = 0x100;
  372|   679k|    while (*c) {
  ------------------
  |  Branch (372:12): [True: 600k, False: 78.6k]
  ------------------
  373|   600k|        v = n | (*c);
  374|   600k|        n += 0x100;
  375|   600k|        r = (int)((v >> 2) ^ v) & 0x0f;
  376|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  377|   600k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  378|   600k|        ret &= 0xFFFFFFFFL;
  379|   600k|        ret ^= v * v;
  380|   600k|        c++;
  381|   600k|    }
  382|  78.6k|    return (ret >> 16) ^ ret;
  383|  84.3k|}
ossl_lh_strcasehash:
  400|   108k|{
  401|   108k|    unsigned long ret = 0;
  402|   108k|    long n;
  403|   108k|    unsigned long v;
  404|   108k|    int r;
  405|       |#if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
  406|       |    const long int case_adjust = ~0x40;
  407|       |#else
  408|   108k|    const long int case_adjust = ~0x20;
  409|   108k|#endif
  410|       |
  411|   108k|    if (c == NULL || *c == '\0')
  ------------------
  |  Branch (411:9): [True: 0, False: 108k]
  |  Branch (411:22): [True: 0, False: 108k]
  ------------------
  412|      0|        return ret;
  413|       |
  414|   944k|    for (n = 0x100; *c != '\0'; n += 0x100) {
  ------------------
  |  Branch (414:21): [True: 836k, False: 108k]
  ------------------
  415|   836k|        v = n | (case_adjust & *c);
  416|   836k|        r = (int)((v >> 2) ^ v) & 0x0f;
  417|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  418|   836k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  419|   836k|        ret &= 0xFFFFFFFFL;
  420|   836k|        ret ^= v * v;
  421|   836k|        c++;
  422|   836k|    }
  423|   108k|    return (ret >> 16) ^ ret;
  424|   108k|}
OPENSSL_LH_num_items:
  427|  5.47k|{
  428|  5.47k|    return lh ? lh->num_items : 0;
  ------------------
  |  Branch (428:12): [True: 5.47k, False: 0]
  ------------------
  429|  5.47k|}
OPENSSL_LH_get_down_load:
  432|      8|{
  433|      8|    return lh->down_load;
  434|      8|}
OPENSSL_LH_set_down_load:
  437|     14|{
  438|     14|    lh->down_load = down_load;
  439|     14|}
OPENSSL_LH_error:
  442|    987|{
  443|    987|    return lh->error;
  444|    987|}
lhash.c:doall_util_fn:
  192|  5.57k|{
  193|  5.57k|    int i;
  194|  5.57k|    OPENSSL_LH_NODE *a, *n;
  195|       |
  196|  5.57k|    if (lh == NULL)
  ------------------
  |  Branch (196:9): [True: 0, False: 5.57k]
  ------------------
  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|   813k|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (203:33): [True: 808k, False: 5.57k]
  ------------------
  204|   808k|        a = lh->b[i];
  205|  2.41M|        while (a != NULL) {
  ------------------
  |  Branch (205:16): [True: 1.60M, False: 808k]
  ------------------
  206|  1.60M|            n = a->next;
  207|  1.60M|            if (use_arg)
  ------------------
  |  Branch (207:17): [True: 1.60M, False: 1.57k]
  ------------------
  208|  1.60M|                wfunc_arg(a->data, arg, func_arg);
  209|  1.57k|            else
  210|  1.57k|                wfunc(a->data, func);
  211|  1.60M|            a = n;
  212|  1.60M|        }
  213|   808k|    }
  214|  5.57k|}
lhash.c:expand:
  244|  2.25k|{
  245|  2.25k|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  246|  2.25k|    unsigned int p, pmax, nni, j;
  247|  2.25k|    unsigned long hash;
  248|       |
  249|  2.25k|    nni = lh->num_alloc_nodes;
  250|  2.25k|    p = lh->p;
  251|  2.25k|    pmax = lh->pmax;
  252|  2.25k|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (252:9): [True: 25, False: 2.22k]
  ------------------
  253|     25|        j = nni * 2;
  254|     25|        n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j);
  ------------------
  |  |  109|     25|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     25|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     25|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  255|     25|        if (n == NULL) {
  ------------------
  |  Branch (255:13): [True: 0, False: 25]
  ------------------
  256|      0|            lh->error++;
  257|      0|            return 0;
  258|      0|        }
  259|     25|        lh->b = n;
  260|     25|        memset(n + nni, 0, sizeof(*n) * (j - nni));
  261|     25|        lh->pmax = nni;
  262|     25|        lh->num_alloc_nodes = j;
  263|     25|        lh->p = 0;
  264|  2.22k|    } else {
  265|  2.22k|        lh->p++;
  266|  2.22k|    }
  267|       |
  268|  2.25k|    lh->num_nodes++;
  269|  2.25k|    n1 = &(lh->b[p]);
  270|  2.25k|    n2 = &(lh->b[p + pmax]);
  271|  2.25k|    *n2 = NULL;
  272|       |
  273|  9.21k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (273:20): [True: 6.96k, False: 2.25k]
  ------------------
  274|  6.96k|        hash = np->hash;
  275|  6.96k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (275:13): [True: 1.39k, False: 5.56k]
  ------------------
  276|  1.39k|            *n1 = (*n1)->next;
  277|  1.39k|            np->next = *n2;
  278|  1.39k|            *n2 = np;
  279|  1.39k|        } else
  280|  5.56k|            n1 = &((*n1)->next);
  281|  6.96k|        np = *n1;
  282|  6.96k|    }
  283|       |
  284|  2.25k|    return 1;
  285|  2.25k|}
lhash.c:contract:
  288|      2|{
  289|      2|    OPENSSL_LH_NODE **n, *n1, *np;
  290|       |
  291|      2|    np = lh->b[lh->p + lh->pmax - 1];
  292|      2|    lh->b[lh->p + lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */
  293|      2|    if (lh->p == 0) {
  ------------------
  |  Branch (293:9): [True: 0, False: 2]
  ------------------
  294|      0|        n = OPENSSL_realloc(lh->b,
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|      2|        lh->p--;
  307|       |
  308|      2|    lh->num_nodes--;
  309|       |
  310|      2|    n1 = lh->b[(int)lh->p];
  311|      2|    if (n1 == NULL)
  ------------------
  |  Branch (311:9): [True: 2, False: 0]
  ------------------
  312|      2|        lh->b[(int)lh->p] = np;
  313|      0|    else {
  314|      0|        while (n1->next != NULL)
  ------------------
  |  Branch (314:16): [True: 0, False: 0]
  ------------------
  315|      0|            n1 = n1->next;
  316|      0|        n1->next = np;
  317|      0|    }
  318|      2|}
lhash.c:getrn:
  322|   181k|{
  323|   181k|    OPENSSL_LH_NODE **ret, *n1;
  324|   181k|    unsigned long hash, nn;
  325|       |
  326|   181k|    if (lh->hashw != NULL)
  ------------------
  |  Branch (326:9): [True: 181k, False: 0]
  ------------------
  327|   181k|        hash = lh->hashw(data, lh->hash);
  328|      0|    else
  329|      0|        hash = lh->hash(data);
  330|       |
  331|   181k|    *rhash = hash;
  332|       |
  333|   181k|    nn = hash % lh->pmax;
  334|   181k|    if (nn < lh->p)
  ------------------
  |  Branch (334:9): [True: 16.2k, False: 165k]
  ------------------
  335|  16.2k|        nn = hash % lh->num_alloc_nodes;
  336|       |
  337|   181k|    ret = &(lh->b[(int)nn]);
  338|   333k|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (338:21): [True: 320k, False: 13.4k]
  ------------------
  339|   320k|        if (n1->hash != hash) {
  ------------------
  |  Branch (339:13): [True: 151k, False: 168k]
  ------------------
  340|   151k|            ret = &(n1->next);
  341|   151k|            continue;
  342|   151k|        }
  343|       |
  344|   168k|        if (lh->compw != NULL) {
  ------------------
  |  Branch (344:13): [True: 168k, False: 0]
  ------------------
  345|   168k|            if (lh->compw(n1->data, data, lh->comp) == 0)
  ------------------
  |  Branch (345:17): [True: 168k, False: 427]
  ------------------
  346|   168k|                break;
  347|   168k|        } else {
  348|      0|            if (lh->comp(n1->data, data) == 0)
  ------------------
  |  Branch (348:17): [True: 0, False: 0]
  ------------------
  349|      0|                break;
  350|      0|        }
  351|    427|        ret = &(n1->next);
  352|    427|    }
  353|   181k|    return ret;
  354|   181k|}

CRYPTO_malloc:
  178|  50.7M|{
  179|  50.7M|    void *ptr;
  180|       |
  181|  50.7M|    INCREMENT(malloc_count);
  182|  50.7M|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (182:9): [True: 0, False: 50.7M]
  ------------------
  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|  50.7M|    if (num == 0)
  ------------------
  |  Branch (189:9): [True: 0, False: 50.7M]
  ------------------
  190|      0|        return NULL;
  191|       |
  192|  50.7M|    FAILTEST();
  193|  50.7M|    if (allow_customize) {
  ------------------
  |  Branch (193:9): [True: 2, False: 50.7M]
  ------------------
  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|  50.7M|    ptr = malloc(num);
  203|  50.7M|    if (ptr != NULL)
  ------------------
  |  Branch (203:9): [True: 50.7M, False: 0]
  ------------------
  204|  50.7M|        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|  50.7M|}
CRYPTO_zalloc:
  219|  19.4M|{
  220|  19.4M|    void *ret;
  221|       |
  222|  19.4M|    ret = CRYPTO_malloc(num, file, line);
  223|  19.4M|    if (ret != NULL)
  ------------------
  |  Branch (223:9): [True: 19.4M, False: 0]
  ------------------
  224|  19.4M|        memset(ret, 0, num);
  225|       |
  226|  19.4M|    return ret;
  227|  19.4M|}
CRYPTO_realloc:
  289|  5.11M|{
  290|  5.11M|    INCREMENT(realloc_count);
  291|  5.11M|    if (realloc_impl != CRYPTO_realloc)
  ------------------
  |  Branch (291:9): [True: 0, False: 5.11M]
  ------------------
  292|      0|        return realloc_impl(str, num, file, line);
  293|       |
  294|  5.11M|    if (str == NULL)
  ------------------
  |  Branch (294:9): [True: 5.02M, False: 98.3k]
  ------------------
  295|  5.02M|        return CRYPTO_malloc(num, file, line);
  296|       |
  297|  98.3k|    if (num == 0) {
  ------------------
  |  Branch (297:9): [True: 0, False: 98.3k]
  ------------------
  298|      0|        CRYPTO_free(str, file, line);
  299|      0|        return NULL;
  300|      0|    }
  301|       |
  302|  98.3k|    FAILTEST();
  303|  98.3k|    return realloc(str, num);
  304|  98.3k|}
CRYPTO_clear_realloc:
  308|   978k|{
  309|   978k|    void *ret = NULL;
  310|       |
  311|   978k|    if (str == NULL)
  ------------------
  |  Branch (311:9): [True: 239k, False: 738k]
  ------------------
  312|   239k|        return CRYPTO_malloc(num, file, line);
  313|       |
  314|   738k|    if (num == 0) {
  ------------------
  |  Branch (314:9): [True: 0, False: 738k]
  ------------------
  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|   738k|    if (num < old_len) {
  ------------------
  |  Branch (320:9): [True: 0, False: 738k]
  ------------------
  321|      0|        OPENSSL_cleanse((char*)str + num, old_len - num);
  322|      0|        return str;
  323|      0|    }
  324|       |
  325|   738k|    ret = CRYPTO_malloc(num, file, line);
  326|   738k|    if (ret != NULL) {
  ------------------
  |  Branch (326:9): [True: 738k, False: 0]
  ------------------
  327|   738k|        memcpy(ret, str, old_len);
  328|   738k|        CRYPTO_clear_free(str, old_len, file, line);
  329|   738k|    }
  330|   738k|    return ret;
  331|   738k|}
CRYPTO_free:
  334|  88.5M|{
  335|  88.5M|    INCREMENT(free_count);
  336|  88.5M|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (336:9): [True: 0, False: 88.5M]
  ------------------
  337|      0|        free_impl(str, file, line);
  338|      0|        return;
  339|      0|    }
  340|       |
  341|  88.5M|    free(str);
  342|  88.5M|}
CRYPTO_clear_free:
  345|  1.20M|{
  346|  1.20M|    if (str == NULL)
  ------------------
  |  Branch (346:9): [True: 75.7k, False: 1.12M]
  ------------------
  347|  75.7k|        return;
  348|  1.12M|    if (num)
  ------------------
  |  Branch (348:9): [True: 1.12M, False: 0]
  ------------------
  349|  1.12M|        OPENSSL_cleanse(str, num);
  350|  1.12M|    CRYPTO_free(str, file, line);
  351|  1.12M|}

CRYPTO_secure_malloc_done:
  132|      2|{
  133|      2|#ifndef OPENSSL_NO_SECURE_MEMORY
  134|      2|    if (secure_mem_used == 0) {
  ------------------
  |  Branch (134:9): [True: 2, False: 0]
  ------------------
  135|      2|        sh_done();
  136|      2|        secure_mem_initialized = 0;
  137|      2|        CRYPTO_THREAD_lock_free(sec_malloc_lock);
  138|      2|        sec_malloc_lock = NULL;
  139|      2|        return 1;
  140|      2|    }
  141|      0|#endif /* OPENSSL_NO_SECURE_MEMORY */
  142|      0|    return 0;
  143|      2|}
CRYPTO_secure_zalloc:
  185|   171k|{
  186|   171k|#ifndef OPENSSL_NO_SECURE_MEMORY
  187|   171k|    if (secure_mem_initialized)
  ------------------
  |  Branch (187:9): [True: 0, False: 171k]
  ------------------
  188|       |        /* CRYPTO_secure_malloc() zeroes allocations when it is implemented */
  189|      0|        return CRYPTO_secure_malloc(num, file, line);
  190|   171k|#endif
  191|   171k|    return CRYPTO_zalloc(num, file, line);
  192|   171k|}
CRYPTO_secure_clear_free:
  219|   171k|{
  220|   171k|#ifndef OPENSSL_NO_SECURE_MEMORY
  221|   171k|    size_t actual_size;
  222|       |
  223|   171k|    if (ptr == NULL)
  ------------------
  |  Branch (223:9): [True: 5, False: 171k]
  ------------------
  224|      5|        return;
  225|   171k|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (225:9): [True: 171k, False: 0]
  ------------------
  226|   171k|        OPENSSL_cleanse(ptr, num);
  227|   171k|        CRYPTO_free(ptr, file, line);
  228|   171k|        return;
  229|   171k|    }
  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|   171k|{
  247|   171k|#ifndef OPENSSL_NO_SECURE_MEMORY
  248|   171k|    if (!secure_mem_initialized)
  ------------------
  |  Branch (248:9): [True: 171k, False: 0]
  ------------------
  249|   171k|        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|   171k|}
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|}

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

CRYPTO_strdup:
   22|  1.37M|{
   23|  1.37M|    char *ret;
   24|       |
   25|  1.37M|    if (str == NULL)
  ------------------
  |  Branch (25:9): [True: 0, False: 1.37M]
  ------------------
   26|      0|        return NULL;
   27|  1.37M|    ret = CRYPTO_malloc(strlen(str) + 1, file, line);
   28|  1.37M|    if (ret != NULL)
  ------------------
  |  Branch (28:9): [True: 1.37M, False: 0]
  ------------------
   29|  1.37M|        strcpy(ret, str);
   30|  1.37M|    return ret;
   31|  1.37M|}
CRYPTO_strndup:
   34|  4.85k|{
   35|  4.85k|    size_t maxlen;
   36|  4.85k|    char *ret;
   37|       |
   38|  4.85k|    if (str == NULL)
  ------------------
  |  Branch (38:9): [True: 0, False: 4.85k]
  ------------------
   39|      0|        return NULL;
   40|       |
   41|  4.85k|    maxlen = OPENSSL_strnlen(str, s);
   42|       |
   43|  4.85k|    ret = CRYPTO_malloc(maxlen + 1, file, line);
   44|  4.85k|    if (ret) {
  ------------------
  |  Branch (44:9): [True: 4.85k, False: 0]
  ------------------
   45|  4.85k|        memcpy(ret, str, maxlen);
   46|  4.85k|        ret[maxlen] = CH_ZERO;
  ------------------
  |  |   19|  4.85k|#define CH_ZERO '\0'
  ------------------
   47|  4.85k|    }
   48|  4.85k|    return ret;
   49|  4.85k|}
CRYPTO_memdup:
   52|   107k|{
   53|   107k|    void *ret;
   54|       |
   55|   107k|    if (data == NULL || siz >= INT_MAX)
  ------------------
  |  Branch (55:9): [True: 0, False: 107k]
  |  Branch (55:25): [True: 0, False: 107k]
  ------------------
   56|      0|        return NULL;
   57|       |
   58|   107k|    ret = CRYPTO_malloc(siz, file, line);
   59|   107k|    if (ret == NULL)
  ------------------
  |  Branch (59:9): [True: 0, False: 107k]
  ------------------
   60|      0|        return NULL;
   61|   107k|    return memcpy(ret, data, siz);
   62|   107k|}
OPENSSL_strnlen:
   65|  6.44M|{
   66|  6.44M|    const char *p;
   67|       |
   68|  37.9M|    for (p = str; maxlen-- != 0 && *p != CH_ZERO; ++p) ;
  ------------------
  |  |   19|  37.9M|#define CH_ZERO '\0'
  ------------------
  |  Branch (68:19): [True: 37.9M, False: 6.51k]
  |  Branch (68:36): [True: 31.5M, False: 6.44M]
  ------------------
   69|       |
   70|  6.44M|    return p - str;
   71|  6.44M|}
OPENSSL_strlcpy:
   74|  6.83M|{
   75|  6.83M|    size_t l = 0;
   76|  66.5M|    for (; size > 1 && *src; size--) {
  ------------------
  |  Branch (76:12): [True: 66.5M, False: 4.90k]
  |  Branch (76:24): [True: 59.7M, False: 6.82M]
  ------------------
   77|  59.7M|        *dst++ = *src++;
   78|  59.7M|        l++;
   79|  59.7M|    }
   80|  6.83M|    if (size)
  ------------------
  |  Branch (80:9): [True: 6.83M, False: 441]
  ------------------
   81|  6.83M|        *dst = CH_ZERO;
  ------------------
  |  |   19|  6.83M|#define CH_ZERO '\0'
  ------------------
   82|  6.83M|    return l + strlen(src);
   83|  6.83M|}
OPENSSL_strlcat:
   86|  6.38M|{
   87|  6.38M|    size_t l = 0;
   88|  60.6M|    for (; size > 0 && *dst; size--, dst++)
  ------------------
  |  Branch (88:12): [True: 60.6M, False: 0]
  |  Branch (88:24): [True: 54.2M, False: 6.38M]
  ------------------
   89|  54.2M|        l++;
   90|  6.38M|    return l + OPENSSL_strlcpy(dst, src, size);
   91|  6.38M|}
ossl_buf2hexstr_sep:
  333|    790|{
  334|    790|    char *tmp;
  335|    790|    size_t tmp_n;
  336|       |
  337|    790|    if (buflen == 0)
  ------------------
  |  Branch (337:9): [True: 200, False: 590]
  ------------------
  338|    200|        return OPENSSL_zalloc(1);
  ------------------
  |  |  104|    200|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    200|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    200|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  339|       |
  340|    590|    tmp_n = (sep != CH_ZERO) ? buflen * 3 : 1 + buflen * 2;
  ------------------
  |  |   19|    590|#define CH_ZERO '\0'
  ------------------
  |  Branch (340:13): [True: 590, False: 0]
  ------------------
  341|    590|    if ((tmp = OPENSSL_malloc(tmp_n)) == NULL)
  ------------------
  |  |  102|    590|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    590|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    590|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (341:9): [True: 0, False: 590]
  ------------------
  342|      0|        return NULL;
  343|       |
  344|    590|    if (buf2hexstr_sep(tmp, tmp_n, NULL, buf, buflen, sep))
  ------------------
  |  Branch (344:9): [True: 590, False: 0]
  ------------------
  345|    590|        return tmp;
  346|      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__
  |  |  ------------------
  ------------------
  347|      0|    return NULL;
  348|    590|}
OPENSSL_buf2hexstr:
  357|    790|{
  358|    790|    return ossl_buf2hexstr_sep(buf, buflen, DEFAULT_SEPARATOR);
  ------------------
  |  |   18|    790|#define DEFAULT_SEPARATOR ':'
  ------------------
  359|    790|}
OPENSSL_strcasecmp:
  410|   413k|{
  411|   413k|    int t;
  412|       |
  413|  1.86M|    while ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) == 0)
  ------------------
  |  Branch (413:12): [True: 1.76M, False: 99.4k]
  ------------------
  414|  1.76M|        if (*s1++ == '\0')
  ------------------
  |  Branch (414:13): [True: 314k, False: 1.45M]
  ------------------
  415|   314k|            return 0;
  416|  99.4k|    return t;
  417|   413k|}
OPENSSL_strncasecmp:
  420|  5.96k|{
  421|  5.96k|    int t;
  422|  5.96k|    size_t i;
  423|       |
  424|  15.9k|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (424:17): [True: 12.1k, False: 3.79k]
  ------------------
  425|  12.1k|        if ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) != 0)
  ------------------
  |  Branch (425:13): [True: 2.17k, False: 9.98k]
  ------------------
  426|  2.17k|            return t;
  427|  9.98k|        else if (*s1++ == '\0')
  ------------------
  |  Branch (427:18): [True: 0, False: 9.98k]
  ------------------
  428|      0|            return 0;
  429|  3.79k|    return 0;
  430|  5.96k|}
o_str.c:buf2hexstr_sep:
  288|    590|{
  289|    590|    static const char hexdig[] = "0123456789ABCDEF";
  290|    590|    const unsigned char *p;
  291|    590|    char *q;
  292|    590|    size_t i;
  293|    590|    int has_sep = (sep != CH_ZERO);
  ------------------
  |  |   19|    590|#define CH_ZERO '\0'
  ------------------
  294|    590|    size_t len = has_sep ? buflen * 3 : 1 + buflen * 2;
  ------------------
  |  Branch (294:18): [True: 590, False: 0]
  ------------------
  295|       |
  296|    590|    if (len == 0)
  ------------------
  |  Branch (296:9): [True: 0, False: 590]
  ------------------
  297|      0|        ++len;
  298|    590|    if (strlength != NULL)
  ------------------
  |  Branch (298:9): [True: 0, False: 590]
  ------------------
  299|      0|        *strlength = len;
  300|    590|    if (str == NULL)
  ------------------
  |  Branch (300:9): [True: 0, False: 590]
  ------------------
  301|      0|        return 1;
  302|       |
  303|    590|    if (str_n < len) {
  ------------------
  |  Branch (303:9): [True: 0, False: 590]
  ------------------
  304|      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)
  |  |  ------------------
  ------------------
  305|      0|        return 0;
  306|      0|    }
  307|       |
  308|    590|    q = str;
  309|  1.56k|    for (i = 0, p = buf; i < buflen; i++, p++) {
  ------------------
  |  Branch (309:26): [True: 978, False: 590]
  ------------------
  310|    978|        *q++ = hexdig[(*p >> 4) & 0xf];
  311|    978|        *q++ = hexdig[*p & 0xf];
  312|    978|        if (has_sep)
  ------------------
  |  Branch (312:13): [True: 978, False: 0]
  ------------------
  313|    978|            *q++ = sep;
  314|    978|    }
  315|    590|    if (has_sep && buflen > 0)
  ------------------
  |  Branch (315:9): [True: 590, False: 0]
  |  Branch (315:20): [True: 590, False: 0]
  ------------------
  316|    590|        --q;
  317|    590|    *q = CH_ZERO;
  ------------------
  |  |   19|    590|#define CH_ZERO '\0'
  ------------------
  318|       |
  319|       |#ifdef CHARSET_EBCDIC
  320|       |    ebcdic2ascii(str, str, q - str);
  321|       |#endif
  322|    590|    return 1;
  323|    590|}

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

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

ossl_obj_cleanup_int:
  212|      2|{
  213|      2|    if (added != NULL) {
  ------------------
  |  Branch (213:9): [True: 0, False: 2]
  ------------------
  214|      0|        lh_ADDED_OBJ_set_down_load(added, 0);
  215|      0|        lh_ADDED_OBJ_doall(added, cleanup1_doall); /* zero counters */
  216|      0|        lh_ADDED_OBJ_doall(added, cleanup2_doall); /* set counters */
  217|      0|        lh_ADDED_OBJ_doall(added, cleanup3_doall); /* free objects */
  218|      0|        lh_ADDED_OBJ_free(added);
  219|      0|        added = NULL;
  220|      0|    }
  221|      2|    objs_free_locks();
  222|      2|}
OBJ_nid2obj:
  319|  1.75M|{
  320|  1.75M|    ADDED_OBJ ad, *adp = NULL;
  321|  1.75M|    ASN1_OBJECT ob;
  322|       |
  323|  1.75M|    if (n == NID_undef
  ------------------
  |  |   18|  3.50M|#define NID_undef                       0
  ------------------
  |  Branch (323:9): [True: 1.20M, False: 542k]
  ------------------
  324|  1.75M|        || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  | 1188|  1.08M|#define NUM_NID 1321
  ------------------
                      || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  |   18|   542k|#define NID_undef                       0
  ------------------
  |  Branch (324:13): [True: 542k, False: 41]
  |  Branch (324:22): [True: 542k, False: 0]
  |  Branch (324:37): [True: 542k, False: 0]
  ------------------
  325|  1.75M|        return (ASN1_OBJECT *)&(nid_objs[n]);
  326|       |
  327|     41|    ad.type = ADDED_NID;
  ------------------
  |  |   33|     41|#define ADDED_NID       3
  ------------------
  328|     41|    ad.obj = &ob;
  329|     41|    ob.nid = n;
  330|     41|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (330:9): [True: 0, False: 41]
  ------------------
  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|     41|    if (added != NULL)
  ------------------
  |  Branch (334:9): [True: 0, False: 41]
  ------------------
  335|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  336|     41|    ossl_obj_unlock(1);
  337|     41|    if (adp != NULL)
  ------------------
  |  Branch (337:9): [True: 0, False: 41]
  ------------------
  338|      0|        return adp->obj;
  339|       |
  340|     41|    ERR_raise(ERR_LIB_OBJ, OBJ_R_UNKNOWN_NID);
  ------------------
  |  |  401|     41|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     41|    (ERR_new(),                                                 \
  |  |  |  |  404|     41|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     41|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     41|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     41|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     41|     ERR_set_error)
  |  |  ------------------
  ------------------
  341|     41|    return NULL;
  342|     41|}
OBJ_nid2sn:
  345|  14.9k|{
  346|  14.9k|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  347|       |
  348|  14.9k|    return ob == NULL ? NULL : ob->sn;
  ------------------
  |  Branch (348:12): [True: 41, False: 14.9k]
  ------------------
  349|  14.9k|}
OBJ_nid2ln:
  352|   202k|{
  353|   202k|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  354|       |
  355|   202k|    return ob == NULL ? NULL : ob->ln;
  ------------------
  |  Branch (355:12): [True: 0, False: 202k]
  ------------------
  356|   202k|}
OBJ_obj2txt:
  457|   297k|{
  458|   297k|    int i, n = 0, len, nid, first, use_bn;
  459|   297k|    BIGNUM *bl;
  460|   297k|    unsigned long l;
  461|   297k|    const unsigned char *p;
  462|   297k|    char tbuf[DECIMAL_SIZE(i) + DECIMAL_SIZE(l) + 2];
  463|   297k|    const char *s;
  464|       |
  465|       |    /* Ensure that, at every state, |buf| is NUL-terminated. */
  466|   297k|    if (buf != NULL && buf_len > 0)
  ------------------
  |  Branch (466:9): [True: 297k, False: 0]
  |  Branch (466:24): [True: 297k, False: 0]
  ------------------
  467|   297k|        buf[0] = '\0';
  468|       |
  469|   297k|    if (a == NULL || a->data == NULL)
  ------------------
  |  Branch (469:9): [True: 0, False: 297k]
  |  Branch (469:22): [True: 1, False: 297k]
  ------------------
  470|      1|        return 0;
  471|       |
  472|   297k|    if (!no_name && (nid = OBJ_obj2nid(a)) != NID_undef) {
  ------------------
  |  |   18|   264k|#define NID_undef                       0
  ------------------
  |  Branch (472:9): [True: 264k, False: 33.3k]
  |  Branch (472:21): [True: 176k, False: 87.4k]
  ------------------
  473|   176k|        s = OBJ_nid2ln(nid);
  474|   176k|        if (s == NULL)
  ------------------
  |  Branch (474:13): [True: 0, False: 176k]
  ------------------
  475|      0|            s = OBJ_nid2sn(nid);
  476|   176k|        if (s != NULL) {
  ------------------
  |  Branch (476:13): [True: 176k, False: 0]
  ------------------
  477|   176k|            if (buf != NULL)
  ------------------
  |  Branch (477:17): [True: 176k, False: 0]
  ------------------
  478|   176k|                OPENSSL_strlcpy(buf, s, buf_len);
  479|   176k|            return (int)strlen(s);
  480|   176k|        }
  481|   176k|    }
  482|       |
  483|   120k|    len = a->length;
  484|   120k|    p = a->data;
  485|       |
  486|   120k|    first = 1;
  487|   120k|    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|   120k|    if (len > 586)
  ------------------
  |  Branch (505:9): [True: 103, False: 120k]
  ------------------
  506|    103|        goto err;
  507|       |
  508|   422k|    while (len > 0) {
  ------------------
  |  Branch (508:12): [True: 301k, False: 120k]
  ------------------
  509|   301k|        l = 0;
  510|   301k|        use_bn = 0;
  511|   396k|        for (;;) {
  512|   396k|            unsigned char c = *p++;
  513|       |
  514|   396k|            len--;
  515|   396k|            if (len == 0 && (c & 0x80) != 0)
  ------------------
  |  Branch (515:17): [True: 120k, False: 275k]
  |  Branch (515:29): [True: 0, False: 120k]
  ------------------
  516|      0|                goto err;
  517|   396k|            if (use_bn) {
  ------------------
  |  Branch (517:17): [True: 21.4k, False: 375k]
  ------------------
  518|  21.4k|                if (!BN_add_word(bl, c & 0x7f))
  ------------------
  |  Branch (518:21): [True: 0, False: 21.4k]
  ------------------
  519|      0|                    goto err;
  520|   375k|            } else {
  521|   375k|                l |= c & 0x7f;
  522|   375k|            }
  523|   396k|            if ((c & 0x80) == 0)
  ------------------
  |  Branch (523:17): [True: 301k, False: 94.8k]
  ------------------
  524|   301k|                break;
  525|  94.8k|            if (!use_bn && l > (ULONG_MAX >> 7L)) {
  ------------------
  |  Branch (525:17): [True: 77.0k, False: 17.8k]
  |  Branch (525:28): [True: 3.62k, False: 73.4k]
  ------------------
  526|  3.62k|                if (bl == NULL && (bl = BN_new()) == NULL)
  ------------------
  |  Branch (526:21): [True: 2.76k, False: 864]
  |  Branch (526:35): [True: 0, False: 2.76k]
  ------------------
  527|      0|                    goto err;
  528|  3.62k|                if (!BN_set_word(bl, l))
  ------------------
  |  Branch (528:21): [True: 0, False: 3.62k]
  ------------------
  529|      0|                    goto err;
  530|  3.62k|                use_bn = 1;
  531|  3.62k|            }
  532|  94.8k|            if (use_bn) {
  ------------------
  |  Branch (532:17): [True: 21.4k, False: 73.4k]
  ------------------
  533|  21.4k|                if (!BN_lshift(bl, bl, 7))
  ------------------
  |  Branch (533:21): [True: 0, False: 21.4k]
  ------------------
  534|      0|                    goto err;
  535|  73.4k|            } else {
  536|  73.4k|                l <<= 7L;
  537|  73.4k|            }
  538|  94.8k|        }
  539|       |
  540|   301k|        if (first) {
  ------------------
  |  Branch (540:13): [True: 120k, False: 180k]
  ------------------
  541|   120k|            first = 0;
  542|   120k|            if (l >= 80) {
  ------------------
  |  Branch (542:17): [True: 22.5k, False: 98.1k]
  ------------------
  543|  22.5k|                i = 2;
  544|  22.5k|                if (use_bn) {
  ------------------
  |  Branch (544:21): [True: 2.34k, False: 20.1k]
  ------------------
  545|  2.34k|                    if (!BN_sub_word(bl, 80))
  ------------------
  |  Branch (545:25): [True: 0, False: 2.34k]
  ------------------
  546|      0|                        goto err;
  547|  20.1k|                } else {
  548|  20.1k|                    l -= 80;
  549|  20.1k|                }
  550|  98.1k|            } else {
  551|  98.1k|                i = (int)(l / 40);
  552|  98.1k|                l -= (long)(i * 40);
  553|  98.1k|            }
  554|   120k|            if (buf != NULL && buf_len > 1) {
  ------------------
  |  Branch (554:17): [True: 120k, False: 0]
  |  Branch (554:32): [True: 120k, False: 0]
  ------------------
  555|   120k|                *buf++ = i + '0';
  556|   120k|                *buf = '\0';
  557|   120k|                buf_len--;
  558|   120k|            }
  559|   120k|            n++;
  560|   120k|        }
  561|       |
  562|   301k|        if (use_bn) {
  ------------------
  |  Branch (562:13): [True: 3.62k, False: 298k]
  ------------------
  563|  3.62k|            char *bndec;
  564|  3.62k|            bndec = BN_bn2dec(bl);
  565|  3.62k|            if (!bndec)
  ------------------
  |  Branch (565:17): [True: 0, False: 3.62k]
  ------------------
  566|      0|                goto err;
  567|  3.62k|            i = strlen(bndec);
  568|  3.62k|            if (buf != NULL) {
  ------------------
  |  Branch (568:17): [True: 3.62k, False: 0]
  ------------------
  569|  3.62k|                if (buf_len > 1) {
  ------------------
  |  Branch (569:21): [True: 3.18k, False: 441]
  ------------------
  570|  3.18k|                    *buf++ = '.';
  571|  3.18k|                    *buf = '\0';
  572|  3.18k|                    buf_len--;
  573|  3.18k|                }
  574|  3.62k|                OPENSSL_strlcpy(buf, bndec, buf_len);
  575|  3.62k|                if (i > buf_len) {
  ------------------
  |  Branch (575:21): [True: 573, False: 3.05k]
  ------------------
  576|    573|                    buf += buf_len;
  577|    573|                    buf_len = 0;
  578|  3.05k|                } else {
  579|  3.05k|                    buf += i;
  580|  3.05k|                    buf_len -= i;
  581|  3.05k|                }
  582|  3.62k|            }
  583|  3.62k|            n++;
  584|  3.62k|            n += i;
  585|  3.62k|            OPENSSL_free(bndec);
  ------------------
  |  |  115|  3.62k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.62k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.62k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  586|   298k|        } else {
  587|   298k|            BIO_snprintf(tbuf, sizeof(tbuf), ".%lu", l);
  588|   298k|            i = strlen(tbuf);
  589|   298k|            if (buf && buf_len > 0) {
  ------------------
  |  Branch (589:17): [True: 298k, False: 0]
  |  Branch (589:24): [True: 270k, False: 27.3k]
  ------------------
  590|   270k|                OPENSSL_strlcpy(buf, tbuf, buf_len);
  591|   270k|                if (i > buf_len) {
  ------------------
  |  Branch (591:21): [True: 1.09k, False: 269k]
  ------------------
  592|  1.09k|                    buf += buf_len;
  593|  1.09k|                    buf_len = 0;
  594|   269k|                } else {
  595|   269k|                    buf += i;
  596|   269k|                    buf_len -= i;
  597|   269k|                }
  598|   270k|            }
  599|   298k|            n += i;
  600|   298k|            l = 0;
  601|   298k|        }
  602|   301k|    }
  603|       |
  604|   120k|    BN_free(bl);
  605|   120k|    return n;
  606|       |
  607|    103| err:
  608|    103|    BN_free(bl);
  609|    103|    return -1;
  610|   120k|}
OBJ_ln2nid:
  625|     14|{
  626|     14|    ASN1_OBJECT o;
  627|     14|    const ASN1_OBJECT *oo = &o;
  628|     14|    ADDED_OBJ ad, *adp;
  629|     14|    const unsigned int *op;
  630|     14|    int nid = NID_undef;
  ------------------
  |  |   18|     14|#define NID_undef                       0
  ------------------
  631|       |
  632|     14|    o.ln = s;
  633|     14|    op = OBJ_bsearch_ln(&oo, ln_objs, NUM_LN);
  ------------------
  |  | 3829|     14|#define NUM_LN 1312
  ------------------
  634|     14|    if (op != NULL)
  ------------------
  |  Branch (634:9): [True: 1, False: 13]
  ------------------
  635|      1|        return nid_objs[*op].nid;
  636|     13|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (636:9): [True: 0, False: 13]
  ------------------
  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|     13|    if (added != NULL) {
  ------------------
  |  Branch (640:9): [True: 0, False: 13]
  ------------------
  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|     13|    ossl_obj_unlock(1);
  648|     13|    return nid;
  649|     13|}
OBJ_sn2nid:
  652|     16|{
  653|     16|    ASN1_OBJECT o;
  654|     16|    const ASN1_OBJECT *oo = &o;
  655|     16|    ADDED_OBJ ad, *adp;
  656|     16|    const unsigned int *op;
  657|     16|    int nid = NID_undef;
  ------------------
  |  |   18|     16|#define NID_undef                       0
  ------------------
  658|       |
  659|     16|    o.sn = s;
  660|     16|    op = OBJ_bsearch_sn(&oo, sn_objs, NUM_SN);
  ------------------
  |  | 2513|     16|#define NUM_SN 1312
  ------------------
  661|     16|    if (op != NULL)
  ------------------
  |  Branch (661:9): [True: 7, False: 9]
  ------------------
  662|      7|        return nid_objs[*op].nid;
  663|      9|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (663:9): [True: 0, False: 9]
  ------------------
  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|      9|    if (added != NULL) {
  ------------------
  |  Branch (667:9): [True: 0, False: 9]
  ------------------
  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|      9|    ossl_obj_unlock(1);
  675|      9|    return nid;
  676|      9|}
OBJ_bsearch_:
  680|   915k|{
  681|   915k|    return OBJ_bsearch_ex_(key, base, num, size, cmp, 0);
  682|   915k|}
OBJ_bsearch_ex_:
  688|   915k|{
  689|   915k|    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|   915k|    return p;
  712|   915k|}
OBJ_length:
  832|  3.63k|{
  833|  3.63k|    if (obj == NULL)
  ------------------
  |  Branch (833:9): [True: 0, False: 3.63k]
  ------------------
  834|      0|        return 0;
  835|  3.63k|    return obj->length;
  836|  3.63k|}
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.32M|{
  852|  1.32M|    return ossl_obj_obj2nid(a, 1);
  853|  1.32M|}
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|   505k|{
   94|   505k|    if (!lock)
  ------------------
  |  Branch (94:9): [True: 0, False: 505k]
  ------------------
   95|      0|        return 1;
   96|   505k|    if (!ossl_init_added_lock())
  ------------------
  |  Branch (96:9): [True: 0, False: 505k]
  ------------------
   97|      0|        return 0;
   98|   505k|    return CRYPTO_THREAD_read_lock(ossl_obj_lock);
   99|   505k|}
obj_dat.c:ossl_init_added_lock:
   75|   505k|{
   76|   505k|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   77|       |    /* Make sure we've loaded config before checking for any "added" objects */
   78|   505k|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  468|   505k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
   79|   505k|#endif
   80|   505k|    return RUN_ONCE(&ossl_obj_lock_init, obj_lock_initialise);
  ------------------
  |  |  130|   505k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 505k, False: 0]
  |  |  ------------------
  ------------------
   81|   505k|}
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|   505k|{
  103|   505k|    if (lock)
  ------------------
  |  Branch (103:9): [True: 505k, False: 0]
  ------------------
  104|   505k|        CRYPTO_THREAD_unlock(ossl_obj_lock);
  105|   505k|}
obj_dat.c:ln_cmp:
  115|    148|{
  116|    148|    return strcmp((*a)->ln, nid_objs[*b].ln);
  117|    148|}
obj_dat.c:sn_cmp:
  108|    162|{
  109|    162|    return strcmp((*a)->sn, nid_objs[*b].sn);
  110|    162|}
obj_dat.c:ossl_obj_obj2nid:
  375|  1.32M|{
  376|  1.32M|    int nid = NID_undef;
  ------------------
  |  |   18|  1.32M|#define NID_undef                       0
  ------------------
  377|  1.32M|    const unsigned int *op;
  378|  1.32M|    ADDED_OBJ ad, *adp;
  379|       |
  380|  1.32M|    if (a == NULL)
  ------------------
  |  Branch (380:9): [True: 0, False: 1.32M]
  ------------------
  381|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  382|  1.32M|    if (a->nid != NID_undef)
  ------------------
  |  |   18|  1.32M|#define NID_undef                       0
  ------------------
  |  Branch (382:9): [True: 444k, False: 882k]
  ------------------
  383|   444k|        return a->nid;
  384|   882k|    if (a->length == 0)
  ------------------
  |  Branch (384:9): [True: 54.5k, False: 827k]
  ------------------
  385|  54.5k|        return NID_undef;
  ------------------
  |  |   18|  54.5k|#define NID_undef                       0
  ------------------
  386|       |
  387|   827k|    op = OBJ_bsearch_obj(&a, obj_objs, NUM_OBJ);
  ------------------
  |  | 5145|   827k|#define NUM_OBJ 1178
  ------------------
  388|   827k|    if (op != NULL)
  ------------------
  |  Branch (388:9): [True: 321k, False: 505k]
  ------------------
  389|   321k|        return nid_objs[*op].nid;
  390|   505k|    if (!ossl_obj_read_lock(lock)) {
  ------------------
  |  Branch (390:9): [True: 0, False: 505k]
  ------------------
  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|   505k|    if (added != NULL) {
  ------------------
  |  Branch (394:9): [True: 0, False: 505k]
  ------------------
  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|   505k|    ossl_obj_unlock(lock);
  402|   505k|    return nid;
  403|   505k|}
obj_dat.c:obj_cmp:
  359|  8.36M|{
  360|  8.36M|    int j;
  361|  8.36M|    const ASN1_OBJECT *a = *ap;
  362|  8.36M|    const ASN1_OBJECT *b = &nid_objs[*bp];
  363|       |
  364|  8.36M|    j = (a->length - b->length);
  365|  8.36M|    if (j)
  ------------------
  |  Branch (365:9): [True: 4.45M, False: 3.90M]
  ------------------
  366|  4.45M|        return j;
  367|  3.90M|    if (a->length == 0)
  ------------------
  |  Branch (367:9): [True: 0, False: 3.90M]
  ------------------
  368|      0|        return 0;
  369|  3.90M|    return memcmp(a->data, b->data, a->length);
  370|  3.90M|}

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

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

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

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

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

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

OSSL_PARAM_locate:
   54|   158k|{
   55|   158k|    if (p != NULL && key != NULL)
  ------------------
  |  Branch (55:9): [True: 158k, False: 6]
  |  Branch (55:22): [True: 158k, False: 0]
  ------------------
   56|   356k|        for (; p->key != NULL; p++)
  ------------------
  |  Branch (56:16): [True: 248k, False: 108k]
  ------------------
   57|   248k|            if (strcmp(key, p->key) == 0)
  ------------------
  |  Branch (57:17): [True: 49.6k, False: 198k]
  ------------------
   58|  49.6k|                return p;
   59|   108k|    return NULL;
   60|   158k|}
OSSL_PARAM_locate_const:
   63|   111k|{
   64|   111k|    return OSSL_PARAM_locate((OSSL_PARAM *)p, key);
   65|   111k|}
OSSL_PARAM_get_int:
  265|  30.8k|{
  266|  30.8k|#ifndef OPENSSL_SMALL_FOOTPRINT
  267|  30.8k|    switch (sizeof(int)) {
  ------------------
  |  Branch (267:13): [Folded - Ignored]
  ------------------
  268|  30.8k|    case sizeof(int32_t):
  ------------------
  |  Branch (268:5): [True: 30.8k, False: 0]
  ------------------
  269|  30.8k|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
  270|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (270:5): [True: 0, False: 30.8k]
  ------------------
  271|      0|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
  272|  30.8k|    }
  273|      0|#endif
  274|      0|    return general_get_int(p, val, sizeof(*val));
  275|  30.8k|}
OSSL_PARAM_set_int:
  278|  5.77k|{
  279|  5.77k|#ifndef OPENSSL_SMALL_FOOTPRINT
  280|  5.77k|    switch (sizeof(int)) {
  ------------------
  |  Branch (280:13): [Folded - Ignored]
  ------------------
  281|  5.77k|    case sizeof(int32_t):
  ------------------
  |  Branch (281:5): [True: 5.77k, False: 0]
  ------------------
  282|  5.77k|        return OSSL_PARAM_set_int32(p, (int32_t)val);
  283|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (283:5): [True: 0, False: 5.77k]
  ------------------
  284|      0|        return OSSL_PARAM_set_int64(p, (int64_t)val);
  285|  5.77k|    }
  286|      0|#endif
  287|      0|    return general_set_int(p, &val, sizeof(val));
  288|  5.77k|}
OSSL_PARAM_construct_int:
  291|  12.4k|{
  292|  12.4k|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(int));
  ------------------
  |  |  106|  12.4k|# define OSSL_PARAM_INTEGER              1
  ------------------
  293|  12.4k|}
OSSL_PARAM_construct_uint:
  322|      2|{
  323|      2|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|      2|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  324|      2|                                sizeof(unsigned int));
  325|      2|}
OSSL_PARAM_get_int32:
  391|  30.8k|{
  392|  30.8k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (392:9): [True: 0, False: 30.8k]
  |  Branch (392:24): [True: 0, False: 30.8k]
  ------------------
  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|  30.8k|    if (p->data == NULL) {
  ------------------
  |  Branch (397:9): [True: 0, False: 30.8k]
  ------------------
  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|  30.8k|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  30.8k|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (402:9): [True: 30.8k, False: 0]
  ------------------
  403|  30.8k|#ifndef OPENSSL_SMALL_FOOTPRINT
  404|  30.8k|        int64_t i64;
  405|       |
  406|  30.8k|        switch (p->data_size) {
  ------------------
  |  Branch (406:17): [True: 0, False: 30.8k]
  ------------------
  407|  30.8k|        case sizeof(int32_t):
  ------------------
  |  Branch (407:9): [True: 30.8k, False: 0]
  ------------------
  408|  30.8k|            *val = *(const int32_t *)p->data;
  409|  30.8k|            return 1;
  410|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (410:9): [True: 0, False: 30.8k]
  ------------------
  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|  30.8k|        }
  419|      0|#endif
  420|      0|        return general_get_int(p, val, sizeof(*val));
  421|       |
  422|  30.8k|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (422:16): [True: 0, False: 0]
  ------------------
  423|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  424|      0|        uint32_t u32;
  425|      0|        uint64_t u64;
  426|       |
  427|      0|        switch (p->data_size) {
  ------------------
  |  Branch (427:17): [True: 0, False: 0]
  ------------------
  428|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (428:9): [True: 0, False: 0]
  ------------------
  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|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (436:9): [True: 0, False: 0]
  ------------------
  437|      0|            u64 = *(const uint64_t *)p->data;
  438|      0|            if (u64 <= INT32_MAX) {
  ------------------
  |  Branch (438:17): [True: 0, False: 0]
  ------------------
  439|      0|                *val = (int32_t)u64;
  440|      0|                return 1;
  441|      0|            }
  442|      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)
  ------------------
  443|      0|            return 0;
  444|      0|        }
  445|      0|#endif
  446|      0|        return general_get_int(p, val, sizeof(*val));
  447|       |
  448|      0|    } 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|  30.8k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|      0|#   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|  30.8k|}
OSSL_PARAM_set_int32:
  471|  5.77k|{
  472|  5.77k|    if (p == NULL) {
  ------------------
  |  Branch (472:9): [True: 0, False: 5.77k]
  ------------------
  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|  5.77k|    p->return_size = 0;
  477|  5.77k|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  5.77k|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (477:9): [True: 5.77k, False: 0]
  ------------------
  478|  5.77k|#ifndef OPENSSL_SMALL_FOOTPRINT
  479|  5.77k|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  480|  5.77k|        if (p->data == NULL)
  ------------------
  |  Branch (480:13): [True: 0, False: 5.77k]
  ------------------
  481|      0|            return 1;
  482|  5.77k|        switch (p->data_size) {
  ------------------
  |  Branch (482:17): [True: 0, False: 5.77k]
  ------------------
  483|  5.77k|        case sizeof(int32_t):
  ------------------
  |  Branch (483:9): [True: 5.77k, False: 0]
  ------------------
  484|  5.77k|            *(int32_t *)p->data = val;
  485|  5.77k|            return 1;
  486|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (486:9): [True: 0, False: 5.77k]
  ------------------
  487|      0|            p->return_size = sizeof(int64_t);
  488|      0|            *(int64_t *)p->data = (int64_t)val;
  489|      0|            return 1;
  490|  5.77k|        }
  491|      0|#endif
  492|      0|        return general_set_int(p, &val, sizeof(val));
  493|  5.77k|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER && val >= 0) {
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (493:16): [True: 0, False: 0]
  |  Branch (493:63): [True: 0, False: 0]
  ------------------
  494|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  495|      0|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  496|      0|        if (p->data == NULL)
  ------------------
  |  Branch (496:13): [True: 0, False: 0]
  ------------------
  497|      0|            return 1;
  498|      0|        switch (p->data_size) {
  ------------------
  |  Branch (498:17): [True: 0, False: 0]
  ------------------
  499|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (499:9): [True: 0, False: 0]
  ------------------
  500|      0|            *(uint32_t *)p->data = (uint32_t)val;
  501|      0|            return 1;
  502|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (502:9): [True: 0, False: 0]
  ------------------
  503|      0|            p->return_size = sizeof(uint64_t);
  504|      0|            *(uint64_t *)p->data = (uint64_t)val;
  505|      0|            return 1;
  506|      0|        }
  507|      0|#endif
  508|      0|        return general_set_int(p, &val, sizeof(val));
  509|      0|    } 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|  5.77k|    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|  5.77k|}
OSSL_PARAM_get_uint64:
  850|      2|{
  851|      2|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (851:9): [True: 0, False: 2]
  |  Branch (851:24): [True: 0, False: 2]
  ------------------
  852|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  853|      0|        return 0;
  854|      0|    }
  855|       |
  856|      2|    if (p->data == NULL) {
  ------------------
  |  Branch (856:9): [True: 0, False: 2]
  ------------------
  857|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  858|      0|        return 0;
  859|      0|    }
  860|       |
  861|      2|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      2|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (861:9): [True: 2, False: 0]
  ------------------
  862|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  863|      2|        switch (p->data_size) {
  ------------------
  |  Branch (863:17): [True: 0, False: 2]
  ------------------
  864|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (864:9): [True: 0, False: 2]
  ------------------
  865|      0|            *val = *(const uint32_t *)p->data;
  866|      0|            return 1;
  867|      2|        case sizeof(uint64_t):
  ------------------
  |  Branch (867:9): [True: 2, False: 0]
  ------------------
  868|      2|            *val = *(const uint64_t *)p->data;
  869|      2|            return 1;
  870|      2|        }
  871|      0|#endif
  872|      0|        return general_get_uint(p, val, sizeof(*val));
  873|      2|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (873:16): [True: 0, False: 0]
  ------------------
  874|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  875|      0|        int32_t i32;
  876|      0|        int64_t i64;
  877|       |
  878|      0|        switch (p->data_size) {
  ------------------
  |  Branch (878:17): [True: 0, False: 0]
  ------------------
  879|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (879:9): [True: 0, False: 0]
  ------------------
  880|      0|            i32 = *(const int32_t *)p->data;
  881|      0|            if (i32 >= 0) {
  ------------------
  |  Branch (881:17): [True: 0, False: 0]
  ------------------
  882|      0|                *val = (uint64_t)i32;
  883|      0|                return 1;
  884|      0|            }
  885|      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)
  ------------------
  886|      0|            return 0;
  887|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (887:9): [True: 0, False: 0]
  ------------------
  888|      0|            i64 = *(const int64_t *)p->data;
  889|      0|            if (i64 >= 0) {
  ------------------
  |  Branch (889:17): [True: 0, False: 0]
  ------------------
  890|      0|                *val = (uint64_t)i64;
  891|      0|                return 1;
  892|      0|            }
  893|      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)
  ------------------
  894|      0|            return 0;
  895|      0|        }
  896|      0|#endif
  897|      0|        return general_get_uint(p, val, sizeof(*val));
  898|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (898:16): [True: 0, False: 0]
  ------------------
  899|      0|#ifndef OPENSSL_SYS_UEFI
  900|      0|        double d;
  901|       |
  902|      0|        switch (p->data_size) {
  ------------------
  |  Branch (902:17): [True: 0, False: 0]
  ------------------
  903|      0|        case sizeof(double):
  ------------------
  |  Branch (903:9): [True: 0, False: 0]
  ------------------
  904|      0|            d = *(const double *)p->data;
  905|      0|            if (d >= 0
  ------------------
  |  Branch (905:17): [True: 0, False: 0]
  ------------------
  906|       |                    /*
  907|       |                     * By subtracting 65535 (2^16-1) we cancel the low order
  908|       |                     * 15 bits of UINT64_MAX to avoid using imprecise floating
  909|       |                     * point values.
  910|       |                     */
  911|      0|                    && d < (double)(UINT64_MAX - 65535) + 65536.0
  ------------------
  |  Branch (911:24): [True: 0, False: 0]
  ------------------
  912|      0|                    && d == (uint64_t)d) {
  ------------------
  |  Branch (912:24): [True: 0, False: 0]
  ------------------
  913|      0|                *val = (uint64_t)d;
  914|      0|                return 1;
  915|      0|            }
  916|      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)
  ------------------
  917|      0|            return 0;
  918|      0|        }
  919|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  920|      0|        return 0;
  921|      0|#endif
  922|      0|    }
  923|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  924|      0|    return 0;
  925|      2|}
OSSL_PARAM_set_uint64:
  928|  4.13k|{
  929|  4.13k|    if (p == NULL) {
  ------------------
  |  Branch (929:9): [True: 0, False: 4.13k]
  ------------------
  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|  4.13k|    p->return_size = 0;
  934|       |
  935|  4.13k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  4.13k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (935:9): [True: 4.13k, False: 0]
  ------------------
  936|  4.13k|#ifndef OPENSSL_SMALL_FOOTPRINT
  937|  4.13k|        p->return_size = sizeof(uint64_t); /* Expected size */
  938|  4.13k|        if (p->data == NULL)
  ------------------
  |  Branch (938:13): [True: 0, False: 4.13k]
  ------------------
  939|      0|            return 1;
  940|  4.13k|        switch (p->data_size) {
  ------------------
  |  Branch (940:17): [True: 0, False: 4.13k]
  ------------------
  941|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (941:9): [True: 0, False: 4.13k]
  ------------------
  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|  4.13k|        case sizeof(uint64_t):
  ------------------
  |  Branch (949:9): [True: 4.13k, False: 0]
  ------------------
  950|  4.13k|            *(uint64_t *)p->data = val;
  951|  4.13k|            return 1;
  952|  4.13k|        }
  953|      0|#endif
  954|      0|        return general_set_uint(p, &val, sizeof(val));
  955|  4.13k|    } 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|  4.13k|    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|  4.13k|}
OSSL_PARAM_get_size_t:
 1006|      2|{
 1007|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
 1008|      2|    switch (sizeof(size_t)) {
  ------------------
  |  Branch (1008:13): [Folded - Ignored]
  ------------------
 1009|      0|    case sizeof(uint32_t):
  ------------------
  |  Branch (1009:5): [True: 0, False: 2]
  ------------------
 1010|      0|        return OSSL_PARAM_get_uint32(p, (uint32_t *)val);
 1011|      2|    case sizeof(uint64_t):
  ------------------
  |  Branch (1011:5): [True: 2, False: 0]
  ------------------
 1012|      2|        return OSSL_PARAM_get_uint64(p, (uint64_t *)val);
 1013|      2|    }
 1014|      0|#endif
 1015|      0|    return general_get_uint(p, val, sizeof(*val));
 1016|      2|}
OSSL_PARAM_set_size_t:
 1019|  4.13k|{
 1020|  4.13k|#ifndef OPENSSL_SMALL_FOOTPRINT
 1021|  4.13k|    switch (sizeof(size_t)) {
  ------------------
  |  Branch (1021:13): [Folded - Ignored]
  ------------------
 1022|      0|    case sizeof(uint32_t):
  ------------------
  |  Branch (1022:5): [True: 0, False: 4.13k]
  ------------------
 1023|      0|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
 1024|  4.13k|    case sizeof(uint64_t):
  ------------------
  |  Branch (1024:5): [True: 4.13k, False: 0]
  ------------------
 1025|  4.13k|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
 1026|  4.13k|    }
 1027|      0|#endif
 1028|      0|    return general_set_uint(p, &val, sizeof(val));
 1029|  4.13k|}
OSSL_PARAM_construct_size_t:
 1032|  4.13k|{
 1033|  4.13k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|  4.13k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
 1034|  4.13k|                                sizeof(size_t));
 1035|  4.13k|}
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|  3.18k|{
 1357|  3.18k|    int ret = get_string_internal(p, (void **)val, &max_len, NULL,
 1358|  3.18k|                                  OSSL_PARAM_UTF8_STRING);
  ------------------
  |  |  117|  3.18k|# 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|  3.18k|    size_t data_length = p->data_size;
 1372|       |
 1373|  3.18k|    if (ret == 0)
  ------------------
  |  Branch (1373:9): [True: 0, False: 3.18k]
  ------------------
 1374|      0|        return 0;
 1375|  3.18k|    if (data_length >= max_len)
  ------------------
  |  Branch (1375:9): [True: 0, False: 3.18k]
  ------------------
 1376|      0|        data_length = OPENSSL_strnlen(p->data, data_length);
 1377|  3.18k|    if (data_length >= max_len) {
  ------------------
  |  Branch (1377:9): [True: 0, False: 3.18k]
  ------------------
 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|  3.18k|    (*val)[data_length] = '\0';
 1382|       |
 1383|  3.18k|    return ret;
 1384|  3.18k|}
OSSL_PARAM_construct_utf8_string:
 1448|  4.46k|{
 1449|  4.46k|    if (buf != NULL && bsize == 0)
  ------------------
  |  Branch (1449:9): [True: 4.46k, False: 0]
  |  Branch (1449:24): [True: 4.46k, False: 0]
  ------------------
 1450|  4.46k|        bsize = strlen(buf);
 1451|  4.46k|    return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize);
  ------------------
  |  |  117|  4.46k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1452|  4.46k|}
OSSL_PARAM_construct_octet_string:
 1456|  3.18k|{
 1457|  3.18k|    return ossl_param_construct(key, OSSL_PARAM_OCTET_STRING, buf, bsize);
  ------------------
  |  |  123|  3.18k|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
 1458|  3.18k|}
OSSL_PARAM_get_utf8_ptr:
 1478|  2.55k|{
 1479|  2.55k|    return get_ptr_internal(p, (const void **)val, NULL, OSSL_PARAM_UTF8_PTR);
  ------------------
  |  |  141|  2.55k|# define OSSL_PARAM_UTF8_PTR             6
  ------------------
 1480|  2.55k|}
OSSL_PARAM_construct_end:
 1641|  5.12k|{
 1642|  5.12k|    OSSL_PARAM end = OSSL_PARAM_END;
  ------------------
  |  |   25|  5.12k|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1643|       |
 1644|  5.12k|    return end;
 1645|  5.12k|}
OSSL_PARAM_get_utf8_string_ptr:
 1665|  2.55k|{
 1666|  2.55k|    int rv;
 1667|       |
 1668|  2.55k|    ERR_set_mark();
 1669|  2.55k|    rv = OSSL_PARAM_get_utf8_ptr(p, val);
 1670|  2.55k|    ERR_pop_to_mark();
 1671|       |
 1672|  2.55k|    return rv || get_string_ptr_internal(p, (const void **)val, NULL,
  ------------------
  |  Branch (1672:12): [True: 0, False: 2.55k]
  |  Branch (1672:18): [True: 2.55k, False: 0]
  ------------------
 1673|  2.55k|                                         OSSL_PARAM_UTF8_STRING);
  ------------------
  |  |  117|  2.55k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1674|  2.55k|}
params.c:ossl_param_construct:
   69|  24.2k|{
   70|  24.2k|    OSSL_PARAM res;
   71|       |
   72|  24.2k|    res.key = key;
   73|  24.2k|    res.data_type = data_type;
   74|  24.2k|    res.data = data;
   75|  24.2k|    res.data_size = data_size;
   76|  24.2k|    res.return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|  24.2k|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
   77|  24.2k|    return res;
   78|  24.2k|}
params.c:get_string_internal:
 1308|  3.18k|{
 1309|  3.18k|    size_t sz, alloc_sz;
 1310|       |
 1311|  3.18k|    if ((val == NULL && used_len == NULL) || p == NULL) {
  ------------------
  |  Branch (1311:10): [True: 0, False: 3.18k]
  |  Branch (1311:25): [True: 0, False: 0]
  |  Branch (1311:46): [True: 0, False: 3.18k]
  ------------------
 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|  3.18k|    if (p->data_type != type) {
  ------------------
  |  Branch (1315:9): [True: 0, False: 3.18k]
  ------------------
 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|  3.18k|    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|  3.18k|    alloc_sz = sz + (type == OSSL_PARAM_UTF8_STRING || sz == 0);
  ------------------
  |  |  117|  6.37k|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (1325:22): [True: 3.18k, False: 0]
  |  Branch (1325:56): [True: 0, False: 0]
  ------------------
 1326|       |
 1327|  3.18k|    if (used_len != NULL)
  ------------------
  |  Branch (1327:9): [True: 0, False: 3.18k]
  ------------------
 1328|      0|        *used_len = sz;
 1329|       |
 1330|  3.18k|    if (p->data == NULL) {
  ------------------
  |  Branch (1330:9): [True: 0, False: 3.18k]
  ------------------
 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|  3.18k|    if (val == NULL)
  ------------------
  |  Branch (1335:9): [True: 0, False: 3.18k]
  ------------------
 1336|      0|        return 1;
 1337|       |
 1338|  3.18k|    if (*val == NULL) {
  ------------------
  |  Branch (1338:9): [True: 3.18k, False: 0]
  ------------------
 1339|  3.18k|        char *const q = OPENSSL_malloc(alloc_sz);
  ------------------
  |  |  102|  3.18k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.18k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.18k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1340|       |
 1341|  3.18k|        if (q == NULL)
  ------------------
  |  Branch (1341:13): [True: 0, False: 3.18k]
  ------------------
 1342|      0|            return 0;
 1343|  3.18k|        *val = q;
 1344|  3.18k|        *max_len = alloc_sz;
 1345|  3.18k|    }
 1346|       |
 1347|  3.18k|    if (*max_len < sz) {
  ------------------
  |  Branch (1347:9): [True: 0, False: 3.18k]
  ------------------
 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|  3.18k|    memcpy(*val, p->data, sz);
 1352|  3.18k|    return 1;
 1353|  3.18k|}
params.c:get_ptr_internal:
 1462|  2.55k|{
 1463|  2.55k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (1463:9): [True: 0, False: 2.55k]
  |  Branch (1463:24): [True: 0, False: 2.55k]
  ------------------
 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|  2.55k|    if (p->data_type != type) {
  ------------------
  |  Branch (1467:9): [True: 2.55k, False: 0]
  ------------------
 1468|  2.55k|        err_bad_type;
  ------------------
  |  |   35|  2.55k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|  2.55k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  2.55k|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|  2.55k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  291|  2.55k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  292|  2.55k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  312|  2.55k|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|  2.55k|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1469|  2.55k|        return 0;
 1470|  2.55k|    }
 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|  2.55k|}
params.c:get_string_ptr_internal:
 1649|  2.55k|{
 1650|  2.55k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (1650:9): [True: 0, False: 2.55k]
  |  Branch (1650:24): [True: 0, False: 2.55k]
  ------------------
 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|  2.55k|    if (p->data_type != type) {
  ------------------
  |  Branch (1654:9): [True: 0, False: 2.55k]
  ------------------
 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|  2.55k|    if (used_len != NULL)
  ------------------
  |  Branch (1658:9): [True: 0, False: 2.55k]
  ------------------
 1659|      0|        *used_len = p->data_size;
 1660|  2.55k|    *val = p->data;
 1661|  2.55k|    return 1;
 1662|  2.55k|}

ossl_pw_clear_passphrase_data:
   17|  55.6k|{
   18|  55.6k|    if (data != NULL) {
  ------------------
  |  Branch (18:9): [True: 55.6k, False: 0]
  ------------------
   19|  55.6k|        if (data->type == is_expl_passphrase)
  ------------------
  |  Branch (19:13): [True: 0, False: 55.6k]
  ------------------
   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|  55.6k|                               data->_.expl_passphrase.passphrase_len);
   22|  55.6k|        ossl_pw_clear_passphrase_cache(data);
   23|  55.6k|        memset(data, 0, sizeof(*data));
   24|  55.6k|    }
   25|  55.6k|}
ossl_pw_clear_passphrase_cache:
   28|  67.8k|{
   29|  67.8k|    OPENSSL_clear_free(data->cached_passphrase, data->cached_passphrase_len);
  ------------------
  |  |  113|  67.8k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  67.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  67.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   30|  67.8k|    data->cached_passphrase = NULL;
   31|  67.8k|}
ossl_pw_set_ossl_passphrase_cb:
   68|  1.73k|{
   69|  1.73k|    if (!ossl_assert(data != NULL && cb != NULL)) {
  ------------------
  |  |   52|  3.47k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 1.73k, False: 0]
  |  |  |  Branch (52:43): [True: 1.73k, False: 0]
  |  |  ------------------
  |  |   53|  1.73k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (69:9): [True: 0, False: 1.73k]
  ------------------
   70|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|  1.73k|    ossl_pw_clear_passphrase_data(data);
   74|  1.73k|    data->type = is_ossl_passphrase;
   75|  1.73k|    data->_.ossl_passphrase.passphrase_cb = cb;
   76|  1.73k|    data->_.ossl_passphrase.passphrase_cbarg = cbarg;
   77|  1.73k|    return 1;
   78|  1.73k|}
ossl_pw_enable_passphrase_caching:
   95|  12.1k|{
   96|  12.1k|    data->flag_cache_passphrase = 1;
   97|  12.1k|    return 1;
   98|  12.1k|}

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

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

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

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

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

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|      4|{
  125|      4|    return OPENSSL_zalloc(sizeof(OSSL_GLOBAL_PROPERTIES));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  126|      4|}
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|     16|{
  244|     16|    OSSL_METHOD_STORE *res;
  245|       |
  246|     16|    res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  104|     16|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  247|     16|    if (res != NULL) {
  ------------------
  |  Branch (247:9): [True: 16, False: 0]
  ------------------
  248|     16|        res->ctx = ctx;
  249|     16|        if ((res->algs = ossl_sa_ALGORITHM_new()) == NULL
  ------------------
  |  Branch (249:13): [True: 0, False: 16]
  ------------------
  250|     16|            || (res->lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (250:16): [True: 0, False: 16]
  ------------------
  251|     16|            || (res->biglock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (251:16): [True: 0, False: 16]
  ------------------
  252|      0|            ossl_method_store_free(res);
  253|      0|            return NULL;
  254|      0|        }
  255|     16|    }
  256|     16|    return res;
  257|     16|}
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|  13.9k|{
  273|  13.9k|    return store != NULL ? CRYPTO_THREAD_write_lock(store->biglock) : 0;
  ------------------
  |  Branch (273:12): [True: 13.9k, False: 0]
  ------------------
  274|  13.9k|}
ossl_method_unlock_store:
  277|  13.9k|{
  278|  13.9k|    return store != NULL ? CRYPTO_THREAD_unlock(store->biglock) : 0;
  ------------------
  |  Branch (278:12): [True: 13.9k, False: 0]
  ------------------
  279|  13.9k|}
ossl_method_store_add:
  295|    206|{
  296|    206|    ALGORITHM *alg = NULL;
  297|    206|    IMPLEMENTATION *impl;
  298|    206|    int ret = 0;
  299|    206|    int i;
  300|       |
  301|    206|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (301:9): [True: 0, False: 206]
  |  Branch (301:21): [True: 0, False: 206]
  |  Branch (301:39): [True: 0, False: 206]
  ------------------
  302|      0|        return 0;
  303|    206|    if (properties == NULL)
  ------------------
  |  Branch (303:9): [True: 0, False: 206]
  ------------------
  304|      0|        properties = "";
  305|       |
  306|    206|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|    206|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    206|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (306:9): [True: 0, False: 206]
  ------------------
  307|      0|        return 0;
  308|       |
  309|       |    /* Create new entry */
  310|    206|    impl = OPENSSL_malloc(sizeof(*impl));
  ------------------
  |  |  102|    206|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    206|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    206|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  311|    206|    if (impl == NULL)
  ------------------
  |  Branch (311:9): [True: 0, False: 206]
  ------------------
  312|      0|        return 0;
  313|    206|    impl->method.method = method;
  314|    206|    impl->method.up_ref = method_up_ref;
  315|    206|    impl->method.free = method_destruct;
  316|    206|    if (!ossl_method_up_ref(&impl->method)) {
  ------------------
  |  Branch (316:9): [True: 0, False: 206]
  ------------------
  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|    206|    impl->provider = prov;
  321|       |
  322|       |    /* Insert into the hash table if required */
  323|    206|    if (!ossl_property_write_lock(store)) {
  ------------------
  |  Branch (323:9): [True: 0, False: 206]
  ------------------
  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|    206|    ossl_method_cache_flush(store, nid);
  328|    206|    if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) {
  ------------------
  |  Branch (328:9): [True: 57, False: 149]
  ------------------
  329|     57|        impl->properties = ossl_parse_property(store->ctx, properties);
  330|     57|        if (impl->properties == NULL)
  ------------------
  |  Branch (330:13): [True: 0, False: 57]
  ------------------
  331|      0|            goto err;
  332|     57|        if (!ossl_prop_defn_set(store->ctx, properties, &impl->properties)) {
  ------------------
  |  Branch (332:13): [True: 0, False: 57]
  ------------------
  333|      0|            ossl_property_free(impl->properties);
  334|      0|            impl->properties = NULL;
  335|      0|            goto err;
  336|      0|        }
  337|     57|    }
  338|       |
  339|    206|    alg = ossl_method_store_retrieve(store, nid);
  340|    206|    if (alg == NULL) {
  ------------------
  |  Branch (340:9): [True: 74, False: 132]
  ------------------
  341|     74|        if ((alg = OPENSSL_zalloc(sizeof(*alg))) == NULL
  ------------------
  |  |  104|     74|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     74|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     74|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (341:13): [True: 0, False: 74]
  ------------------
  342|     74|                || (alg->impls = sk_IMPLEMENTATION_new_null()) == NULL
  ------------------
  |  Branch (342:20): [True: 0, False: 74]
  ------------------
  343|     74|                || (alg->cache = lh_QUERY_new(&query_hash, &query_cmp)) == NULL)
  ------------------
  |  Branch (343:20): [True: 0, False: 74]
  ------------------
  344|      0|            goto err;
  345|     74|        alg->nid = nid;
  346|     74|        if (!ossl_method_store_insert(store, alg))
  ------------------
  |  Branch (346:13): [True: 0, False: 74]
  ------------------
  347|      0|            goto err;
  348|     74|    }
  349|       |
  350|       |    /* Push onto stack if there isn't one there already */
  351|    860|    for (i = 0; i < sk_IMPLEMENTATION_num(alg->impls); i++) {
  ------------------
  |  Branch (351:17): [True: 654, False: 206]
  ------------------
  352|    654|        const IMPLEMENTATION *tmpimpl = sk_IMPLEMENTATION_value(alg->impls, i);
  353|       |
  354|    654|        if (tmpimpl->provider == impl->provider
  ------------------
  |  Branch (354:13): [True: 654, False: 0]
  ------------------
  355|    654|            && tmpimpl->properties == impl->properties)
  ------------------
  |  Branch (355:16): [True: 0, False: 654]
  ------------------
  356|      0|            break;
  357|    654|    }
  358|    206|    if (i == sk_IMPLEMENTATION_num(alg->impls)
  ------------------
  |  Branch (358:9): [True: 206, False: 0]
  ------------------
  359|    206|        && sk_IMPLEMENTATION_push(alg->impls, impl))
  ------------------
  |  Branch (359:12): [True: 206, False: 0]
  ------------------
  360|    206|        ret = 1;
  361|    206|    ossl_property_unlock(store);
  362|    206|    if (ret == 0)
  ------------------
  |  Branch (362:9): [True: 0, False: 206]
  ------------------
  363|      0|        impl_free(impl);
  364|    206|    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|    206|}
ossl_method_store_do_all:
  476|  6.96k|{
  477|  6.96k|    int i, j;
  478|  6.96k|    int numalgs, numimps;
  479|  6.96k|    STACK_OF(ALGORITHM) *tmpalgs;
  ------------------
  |  |   31|  6.96k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  480|  6.96k|    ALGORITHM *alg;
  481|       |
  482|  6.96k|    if (store != NULL) {
  ------------------
  |  Branch (482:9): [True: 6.96k, False: 0]
  ------------------
  483|       |
  484|  6.96k|        if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (484:13): [True: 0, False: 6.96k]
  ------------------
  485|      0|            return;
  486|       |       
  487|  6.96k|        tmpalgs = sk_ALGORITHM_new_reserve(NULL,
  488|  6.96k|                                           ossl_sa_ALGORITHM_num(store->algs));
  489|  6.96k|        if (tmpalgs == NULL) {
  ------------------
  |  Branch (489:13): [True: 0, False: 6.96k]
  ------------------
  490|      0|            ossl_property_unlock(store);
  491|      0|            return;
  492|      0|        }
  493|       |
  494|  6.96k|        ossl_sa_ALGORITHM_doall_arg(store->algs, alg_copy, tmpalgs);
  495|  6.96k|        ossl_property_unlock(store);
  496|  6.96k|        numalgs = sk_ALGORITHM_num(tmpalgs);
  497|  85.1k|        for (i = 0; i < numalgs; i++) {
  ------------------
  |  Branch (497:21): [True: 78.2k, False: 6.96k]
  ------------------
  498|  78.2k|            alg = sk_ALGORITHM_value(tmpalgs, i);
  499|  78.2k|            numimps = sk_IMPLEMENTATION_num(alg->impls);
  500|   864k|            for (j = 0; j < numimps; j++)
  ------------------
  |  Branch (500:25): [True: 786k, False: 78.2k]
  ------------------
  501|   786k|                alg_do_one(alg, sk_IMPLEMENTATION_value(alg->impls, j), fn, fnarg);
  502|  78.2k|        }
  503|  6.96k|        sk_ALGORITHM_free(tmpalgs);
  504|  6.96k|    }
  505|  6.96k|}
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_flush_all:
  606|      8|{
  607|      8|    if (!ossl_property_write_lock(store))
  ------------------
  |  Branch (607:9): [True: 0, False: 8]
  ------------------
  608|      0|        return 0;
  609|      8|    ossl_sa_ALGORITHM_doall(store->algs, &impl_cache_flush_alg);
  610|      8|    store->cache_nelem = 0;
  611|      8|    ossl_property_unlock(store);
  612|      8|    return 1;
  613|      8|}
ossl_method_store_cache_get:
  691|  5.72k|{
  692|  5.72k|    ALGORITHM *alg;
  693|  5.72k|    QUERY elem, *r;
  694|  5.72k|    int res = 0;
  695|       |
  696|  5.72k|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (696:9): [True: 0, False: 5.72k]
  |  Branch (696:21): [True: 0, False: 5.72k]
  |  Branch (696:38): [True: 0, False: 5.72k]
  ------------------
  697|      0|        return 0;
  698|       |
  699|  5.72k|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (699:9): [True: 0, False: 5.72k]
  ------------------
  700|      0|        return 0;
  701|  5.72k|    alg = ossl_method_store_retrieve(store, nid);
  702|  5.72k|    if (alg == NULL)
  ------------------
  |  Branch (702:9): [True: 1, False: 5.72k]
  ------------------
  703|      1|        goto err;
  704|       |
  705|  5.72k|    elem.query = prop_query;
  706|  5.72k|    elem.provider = prov;
  707|  5.72k|    r = lh_QUERY_retrieve(alg->cache, &elem);
  708|  5.72k|    if (r == NULL)
  ------------------
  |  Branch (708:9): [True: 3, False: 5.71k]
  ------------------
  709|      3|        goto err;
  710|  5.71k|    if (ossl_method_up_ref(&r->method)) {
  ------------------
  |  Branch (710:9): [True: 5.71k, False: 0]
  ------------------
  711|  5.71k|        *method = r->method.method;
  712|  5.71k|        res = 1;
  713|  5.71k|    }
  714|  5.72k|err:
  715|  5.72k|    ossl_property_unlock(store);
  716|  5.72k|    return res;
  717|  5.71k|}
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|     74|{
  226|     74|    OSSL_METHOD_STORE *store = arg;
  227|       |
  228|     74|    if (a != NULL) {
  ------------------
  |  Branch (228:9): [True: 74, False: 0]
  ------------------
  229|     74|        sk_IMPLEMENTATION_pop_free(a->impls, &impl_free);
  230|     74|        lh_QUERY_doall(a->cache, &impl_cache_free);
  231|     74|        lh_QUERY_free(a->cache);
  232|     74|        OPENSSL_free(a);
  ------------------
  |  |  115|     74|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     74|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     74|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  233|     74|    }
  234|     74|    if (store != NULL)
  ------------------
  |  Branch (234:9): [True: 74, False: 0]
  ------------------
  235|     74|        ossl_sa_ALGORITHM_set(store->algs, idx, NULL);
  236|     74|}
property.c:ossl_method_up_ref:
  162|  5.93k|{
  163|  5.93k|    return (*method->up_ref)(method->method);
  164|  5.93k|}
property.c:ossl_property_write_lock:
  177|    219|{
  178|    219|    return p != NULL ? CRYPTO_THREAD_write_lock(p->lock) : 0;
  ------------------
  |  Branch (178:12): [True: 219, False: 0]
  ------------------
  179|    219|}
property.c:ossl_method_store_retrieve:
  282|  6.14k|{
  283|  6.14k|    return ossl_sa_ALGORITHM_get(store->algs, nid);
  284|  6.14k|}
property.c:query_hash:
  187|  5.72k|{
  188|  5.72k|    return OPENSSL_LH_strhash(a->query);
  189|  5.72k|}
property.c:query_cmp:
  192|  5.71k|{
  193|  5.71k|    int res = strcmp(a->query, b->query);
  194|       |
  195|  5.71k|    if (res == 0 && a->provider != NULL && b->provider != NULL)
  ------------------
  |  Branch (195:9): [True: 5.71k, False: 0]
  |  Branch (195:21): [True: 5.71k, False: 0]
  |  Branch (195:44): [True: 0, False: 5.71k]
  ------------------
  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|  5.71k|    return res;
  200|  5.71k|}
property.c:ossl_method_store_insert:
  287|     74|{
  288|     74|    return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg);
  289|     74|}
property.c:ossl_property_unlock:
  182|  12.9k|{
  183|  12.9k|    return p != 0 ? CRYPTO_THREAD_unlock(p->lock) : 0;
  ------------------
  |  Branch (183:12): [True: 12.9k, False: 0]
  ------------------
  184|  12.9k|}
property.c:impl_free:
  203|    206|{
  204|    206|    if (impl != NULL) {
  ------------------
  |  Branch (204:9): [True: 206, False: 0]
  ------------------
  205|    206|        ossl_method_free(&impl->method);
  206|    206|        OPENSSL_free(impl);
  ------------------
  |  |  115|    206|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    206|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    206|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  207|    206|    }
  208|    206|}
property.c:ossl_method_cache_flush_alg:
  592|    132|{
  593|    132|    store->cache_nelem -= lh_QUERY_num_items(alg->cache);
  594|    132|    impl_cache_flush_alg(0, alg);
  595|    132|}
property.c:ossl_property_read_lock:
  172|  12.6k|{
  173|  12.6k|    return p != NULL ? CRYPTO_THREAD_read_lock(p->lock) : 0;
  ------------------
  |  Branch (173:12): [True: 12.6k, False: 0]
  ------------------
  174|  12.6k|}
property.c:alg_copy:
  467|  78.2k|{
  468|  78.2k|    STACK_OF(ALGORITHM) *newalg = arg;
  ------------------
  |  |   31|  78.2k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  469|       |
  470|  78.2k|    (void)sk_ALGORITHM_push(newalg, alg);
  471|  78.2k|}
property.c:alg_do_one:
  462|   786k|{
  463|   786k|    fn(alg->nid, impl->method.method, fnarg);
  464|   786k|}
property.c:ossl_method_cache_flush:
  598|    206|{
  599|    206|    ALGORITHM *alg = ossl_method_store_retrieve(store, nid);
  600|       |
  601|    206|    if (alg != NULL)
  ------------------
  |  Branch (601:9): [True: 132, False: 74]
  ------------------
  602|    132|        ossl_method_cache_flush_alg(store, alg);
  603|    206|}
property.c:impl_cache_flush_alg:
  219|    132|{
  220|    132|    lh_QUERY_doall(alg->cache, &impl_cache_free);
  221|    132|    lh_QUERY_flush(alg->cache);
  222|    132|}
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|    211|{
  168|    211|    (*method->free)(method->method);
  169|    211|}

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|    212|{
  347|    212|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  348|    212|    OSSL_PROPERTY_LIST *res = NULL;
  349|    212|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|    212|# define STACK_OF(type) struct stack_st_##type
  ------------------
  350|    212|    const char *s = defn;
  351|    212|    int done;
  352|       |
  353|    212|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (353:9): [True: 0, False: 212]
  |  Branch (353:22): [True: 0, False: 212]
  ------------------
  354|      0|        return NULL;
  355|       |
  356|    212|    s = skip_space(s);
  357|    212|    done = *s == '\0';
  358|  1.02k|    while (!done) {
  ------------------
  |  Branch (358:12): [True: 811, False: 212]
  ------------------
  359|    811|        const char *start = s;
  360|       |
  361|    811|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  102|    811|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    811|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    811|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  362|    811|        if (prop == NULL)
  ------------------
  |  Branch (362:13): [True: 0, False: 811]
  ------------------
  363|      0|            goto err;
  364|    811|        memset(&prop->v, 0, sizeof(prop->v));
  365|    811|        prop->optional = 0;
  366|    811|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (366:13): [True: 0, False: 811]
  ------------------
  367|      0|            goto err;
  368|    811|        prop->oper = OSSL_PROPERTY_OPER_EQ;
  369|    811|        if (prop->name_idx == 0) {
  ------------------
  |  Branch (369:13): [True: 0, False: 811]
  ------------------
  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|    811|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (374:13): [True: 811, False: 0]
  ------------------
  375|    811|            if (!parse_value(ctx, &s, prop, 1)) {
  ------------------
  |  Branch (375:17): [True: 0, False: 811]
  ------------------
  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|    811|        } 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|    811|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (386:13): [True: 0, False: 811]
  ------------------
  387|      0|            goto err;
  388|    811|        prop = NULL;
  389|    811|        done = !match_ch(&s, ',');
  390|    811|    }
  391|    212|    if (*s != '\0') {
  ------------------
  |  Branch (391:9): [True: 0, False: 212]
  ------------------
  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|    212|    res = stack_to_property_list(ctx, sk);
  397|       |
  398|    212|err:
  399|    212|    OPENSSL_free(prop);
  ------------------
  |  |  115|    212|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    212|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    212|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  400|    212|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  401|    212|    return res;
  402|    212|}
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|    219|{
  531|    219|    OPENSSL_free(p);
  ------------------
  |  |  115|    219|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    219|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    219|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  532|    219|}
ossl_property_parse_init:
  576|      4|{
  577|      4|    static const char *const predefined_names[] = {
  578|      4|        "provider",     /* Name of provider (default, legacy, fips) */
  579|      4|        "version",      /* Version number of this provider */
  580|      4|        "fips",         /* FIPS validated or FIPS supporting algorithm */
  581|      4|        "output",       /* Output type for encoders */
  582|      4|        "input",        /* Input type for decoders */
  583|      4|        "structure",    /* Structure name for encoders and decoders */
  584|      4|    };
  585|      4|    size_t i;
  586|       |
  587|     28|    for (i = 0; i < OSSL_NELEM(predefined_names); i++)
  ------------------
  |  |   14|     28|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (587:17): [True: 24, False: 4]
  ------------------
  588|     24|        if (ossl_property_name(ctx, predefined_names[i], 1) == 0)
  ------------------
  |  Branch (588:13): [True: 0, False: 24]
  ------------------
  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|      4|    if ((ossl_property_value(ctx, "yes", 1) != OSSL_PROPERTY_TRUE)
  ------------------
  |  |   37|      4|#define OSSL_PROPERTY_TRUE      1
  ------------------
  |  Branch (596:9): [True: 0, False: 4]
  ------------------
  597|      4|        || (ossl_property_value(ctx, "no", 1) != OSSL_PROPERTY_FALSE))
  ------------------
  |  |   38|      4|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (597:12): [True: 0, False: 4]
  ------------------
  598|      0|        goto err;
  599|       |
  600|      4|    return 1;
  601|      0|err:
  602|      0|    return 0;
  603|      4|}
property_parse.c:pd_compare:
  289|    778|{
  290|    778|    const OSSL_PROPERTY_DEFINITION *pd1 = *p1;
  291|    778|    const OSSL_PROPERTY_DEFINITION *pd2 = *p2;
  292|       |
  293|    778|    if (pd1->name_idx < pd2->name_idx)
  ------------------
  |  Branch (293:9): [True: 778, False: 0]
  ------------------
  294|    778|        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|  3.25k|{
   27|  3.25k|    while (ossl_isspace(*s))
  ------------------
  |  |   82|  3.25k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  3.25k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 0, False: 3.25k]
  |  |  ------------------
  ------------------
   28|      0|        s++;
   29|  3.25k|    return s;
   30|  3.25k|}
property_parse.c:parse_name:
   58|    812|{
   59|    812|    char name[100];
   60|    812|    int err = 0;
   61|    812|    size_t i = 0;
   62|    812|    const char *s = *t;
   63|    812|    int user_name = 0;
   64|       |
   65|    812|    for (;;) {
   66|    812|        if (!ossl_isalpha(*s)) {
  ------------------
  |  |   71|    812|# define ossl_isalpha(c)        (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|    812|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    812|# define CTYPE_MASK_lower       0x1
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|    812|# define CTYPE_MASK_upper       0x2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (66:13): [True: 0, False: 812]
  ------------------
   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|  5.35k|        do {
   72|  5.35k|            if (i < sizeof(name) - 1)
  ------------------
  |  Branch (72:17): [True: 5.35k, False: 0]
  ------------------
   73|  5.35k|                name[i++] = ossl_tolower(*s);
   74|      0|            else
   75|      0|                err = 1;
   76|  5.35k|        } while (*++s == '_' || ossl_isalnum(*s));
  ------------------
  |  |   70|  5.35k|# define ossl_isalnum(c)        (ossl_ctype_check((c), CTYPE_MASK_alnum))
  |  |  ------------------
  |  |  |  |   41|  5.35k|# define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  5.35k|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   27|  5.35k|# define CTYPE_MASK_lower       0x1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   28|  5.35k|# define CTYPE_MASK_upper       0x2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  5.35k|# define CTYPE_MASK_digit       0x4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (70:33): [True: 4.54k, False: 812]
  |  |  ------------------
  ------------------
  |  Branch (76:18): [True: 0, False: 5.35k]
  ------------------
   77|    812|        if (*s != '.')
  ------------------
  |  Branch (77:13): [True: 812, False: 0]
  ------------------
   78|    812|            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|    812|    name[i] = '\0';
   87|    812|    if (err) {
  ------------------
  |  Branch (87:9): [True: 0, False: 812]
  ------------------
   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|    812|    *t = skip_space(s);
   92|    812|    *idx = ossl_property_name(ctx, name, user_name && create);
  ------------------
  |  Branch (92:42): [True: 0, False: 812]
  |  Branch (92:55): [True: 0, False: 0]
  ------------------
   93|    812|    return 1;
   94|    812|}
property_parse.c:match_ch:
   33|  1.62k|{
   34|  1.62k|    const char *s = *t;
   35|       |
   36|  1.62k|    if (*s == m) {
  ------------------
  |  Branch (36:9): [True: 1.41k, False: 213]
  ------------------
   37|  1.41k|        *t = skip_space(s + 1);
   38|  1.41k|        return 1;
   39|  1.41k|    }
   40|    213|    return 0;
   41|  1.62k|}
property_parse.c:parse_value:
  258|    811|{
  259|    811|    const char *s = *t;
  260|    811|    int r = 0;
  261|       |
  262|    811|    if (*s == '"' || *s == '\'') {
  ------------------
  |  Branch (262:9): [True: 0, False: 811]
  |  Branch (262:22): [True: 0, False: 811]
  ------------------
  263|      0|        s++;
  264|      0|        r = parse_string(ctx, &s, s[-1], res, create);
  265|    811|    } else if (*s == '+') {
  ------------------
  |  Branch (265:16): [True: 0, False: 811]
  ------------------
  266|      0|        s++;
  267|      0|        r = parse_number(&s, res);
  268|    811|    } else if (*s == '-') {
  ------------------
  |  Branch (268:16): [True: 0, False: 811]
  ------------------
  269|      0|        s++;
  270|      0|        r = parse_number(&s, res);
  271|      0|        res->v.int_val = -res->v.int_val;
  272|    811|    } else if (*s == '0' && s[1] == 'x') {
  ------------------
  |  Branch (272:16): [True: 0, False: 811]
  |  Branch (272:29): [True: 0, False: 0]
  ------------------
  273|      0|        s += 2;
  274|      0|        r = parse_hex(&s, res);
  275|    811|    } else if (*s == '0' && ossl_isdigit(s[1])) {
  ------------------
  |  Branch (275:16): [True: 0, False: 811]
  |  Branch (275:29): [True: 0, False: 0]
  ------------------
  276|      0|        s++;
  277|      0|        r = parse_oct(&s, res);
  278|    811|    } else if (ossl_isdigit(*s)) {
  ------------------
  |  Branch (278:16): [True: 0, False: 811]
  ------------------
  279|      0|        return parse_number(t, res);
  280|    811|    } else if (ossl_isalpha(*s))
  ------------------
  |  |   71|    811|# define ossl_isalpha(c)        (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|    811|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    811|# define CTYPE_MASK_lower       0x1
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|    811|# define CTYPE_MASK_upper       0x2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:33): [True: 811, False: 0]
  |  |  ------------------
  ------------------
  281|    811|        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|    811|}
property_parse.c:parse_unquoted:
  226|    811|{
  227|    811|    char v[1000];
  228|    811|    const char *s = *t;
  229|    811|    size_t i = 0;
  230|    811|    int err = 0;
  231|       |
  232|    811|    if (*s == '\0' || *s == ',')
  ------------------
  |  Branch (232:9): [True: 0, False: 811]
  |  Branch (232:23): [True: 0, False: 811]
  ------------------
  233|      0|        return 0;
  234|  6.03k|    while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   80|  12.0k|# define ossl_isprint(c)        (ossl_ctype_check((c), CTYPE_MASK_print))
  |  |  ------------------
  |  |  |  |   35|  6.03k|# define CTYPE_MASK_print       0x100
  |  |  ------------------
  |  |  |  Branch (80:33): [True: 5.82k, False: 212]
  |  |  ------------------
  ------------------
                  while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   82|  11.8k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  5.82k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  ------------------
  |  Branch (234:32): [True: 5.82k, False: 0]
  |  Branch (234:53): [True: 5.22k, False: 599]
  ------------------
  235|  5.22k|        if (i < sizeof(v) - 1)
  ------------------
  |  Branch (235:13): [True: 5.22k, False: 0]
  ------------------
  236|  5.22k|            v[i++] = ossl_tolower(*s);
  237|      0|        else
  238|      0|            err = 1;
  239|  5.22k|        s++;
  240|  5.22k|    }
  241|    811|    if (!ossl_isspace(*s) && *s != '\0' && *s != ',') {
  ------------------
  |  |   82|  1.62k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|    811|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  ------------------
  |  Branch (241:9): [True: 811, False: 0]
  |  Branch (241:30): [True: 599, False: 212]
  |  Branch (241:44): [True: 0, False: 599]
  ------------------
  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|    811|    v[i] = 0;
  247|    811|    if (err)
  ------------------
  |  Branch (247:9): [True: 0, False: 811]
  ------------------
  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|    811|    else if ((res->v.str_val = ossl_property_value(ctx, v, create)) == 0)
  ------------------
  |  Branch (249:14): [True: 0, False: 811]
  ------------------
  250|      0|        err = 1;
  251|    811|    *t = skip_space(s);
  252|    811|    res->type = OSSL_PROPERTY_TYPE_STRING;
  253|    811|    return !err;
  254|    811|}
property_parse.c:stack_to_property_list:
  314|    217|{
  315|    217|    const int n = sk_OSSL_PROPERTY_DEFINITION_num(sk);
  316|    217|    OSSL_PROPERTY_LIST *r;
  317|    217|    OSSL_PROPERTY_IDX prev_name_idx = 0;
  318|    217|    int i;
  319|       |
  320|    217|    r = OPENSSL_malloc(sizeof(*r)
  ------------------
  |  |  102|    434|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    217|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    217|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (102:23): [True: 4, False: 213]
  |  |  ------------------
  ------------------
  321|    217|                       + (n <= 0 ? 0 : n - 1) * sizeof(r->properties[0]));
  322|    217|    if (r != NULL) {
  ------------------
  |  Branch (322:9): [True: 217, False: 0]
  ------------------
  323|    217|        sk_OSSL_PROPERTY_DEFINITION_sort(sk);
  324|       |
  325|    217|        r->has_optional = 0;
  326|  1.02k|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (326:21): [True: 812, False: 217]
  ------------------
  327|    812|            r->properties[i] = *sk_OSSL_PROPERTY_DEFINITION_value(sk, i);
  328|    812|            r->has_optional |= r->properties[i].optional;
  329|       |
  330|       |            /* Check for duplicated names */
  331|    812|            if (i > 0 && r->properties[i].name_idx == prev_name_idx) {
  ------------------
  |  Branch (331:17): [True: 599, False: 213]
  |  Branch (331:26): [True: 0, False: 599]
  ------------------
  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|    812|            prev_name_idx = r->properties[i].name_idx;
  339|    812|        }
  340|    217|        r->num_properties = n;
  341|    217|    }
  342|    217|    return r;
  343|    217|}
property_parse.c:pd_free:
  301|    812|{
  302|    812|    OPENSSL_free(pd);
  ------------------
  |  |  115|    812|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    812|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    812|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  303|    812|}

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

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|      4|void *ossl_property_string_data_new(OSSL_LIB_CTX *ctx) {
   97|      4|    PROPERTY_STRING_DATA *propdata = OPENSSL_zalloc(sizeof(*propdata));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   98|       |
   99|      4|    if (propdata == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 4]
  ------------------
  100|      0|        return NULL;
  101|       |
  102|      4|    propdata->lock = CRYPTO_THREAD_lock_new();
  103|      4|    propdata->prop_names = lh_PROPERTY_STRING_new(&property_hash,
  104|      4|                                                  &property_cmp);
  105|      4|    propdata->prop_values = lh_PROPERTY_STRING_new(&property_hash,
  106|      4|                                                   &property_cmp);
  107|      4|#ifndef OPENSSL_SMALL_FOOTPRINT
  108|      4|    propdata->prop_namelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  235|      4|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  109|      4|    propdata->prop_valuelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  235|      4|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  110|      4|#endif
  111|      4|    if (propdata->lock == NULL
  ------------------
  |  Branch (111:9): [True: 0, False: 4]
  ------------------
  112|      4|#ifndef OPENSSL_SMALL_FOOTPRINT
  113|      4|            || propdata->prop_namelist == NULL
  ------------------
  |  Branch (113:16): [True: 0, False: 4]
  ------------------
  114|      4|            || propdata->prop_valuelist == NULL
  ------------------
  |  Branch (114:16): [True: 0, False: 4]
  ------------------
  115|      4|#endif
  116|      4|            || propdata->prop_names == NULL
  ------------------
  |  Branch (116:16): [True: 0, False: 4]
  ------------------
  117|      4|            || propdata->prop_values == NULL) {
  ------------------
  |  Branch (117:16): [True: 0, False: 4]
  ------------------
  118|      0|        ossl_property_string_data_free(propdata);
  119|      0|        return NULL;
  120|      0|    }
  121|      4|    return propdata;
  122|      4|}
ossl_property_name:
  253|  77.3k|{
  254|  77.3k|    return ossl_property_string(ctx, 1, create, s);
  255|  77.3k|}
ossl_property_value:
  264|    819|{
  265|    819|    return ossl_property_string(ctx, 0, create, s);
  266|    819|}
ossl_property_value_str:
  269|  69.1k|{
  270|  69.1k|    return ossl_property_str(0, ctx, idx);
  271|  69.1k|}
property_string.c:property_table_free:
   66|      4|{
   67|      4|    PROP_TABLE *t = *pt;
   68|       |
   69|      4|    if (t != NULL) {
  ------------------
  |  Branch (69:9): [True: 4, False: 0]
  ------------------
   70|      4|        lh_PROPERTY_STRING_doall(t, &property_free);
   71|      4|        lh_PROPERTY_STRING_free(t);
   72|      4|        *pt = NULL;
   73|      4|    }
   74|      4|}
property_string.c:property_free:
   61|     37|{
   62|     37|    OPENSSL_free(ps);
  ------------------
  |  |  115|     37|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     37|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     37|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   63|     37|}
property_string.c:property_hash:
   51|  78.2k|{
   52|  78.2k|    return OPENSSL_LH_strhash(a->s);
   53|  78.2k|}
property_string.c:property_cmp:
   56|  78.1k|{
   57|  78.1k|    return strcmp(a->s, b->s);
   58|  78.1k|}
property_string.c:ossl_property_string:
  144|  78.1k|{
  145|  78.1k|    PROPERTY_STRING p, *ps, *ps_new;
  146|  78.1k|    PROP_TABLE *t;
  147|  78.1k|    OSSL_PROPERTY_IDX *pidx;
  148|  78.1k|    PROPERTY_STRING_DATA *propdata
  149|  78.1k|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |   99|  78.1k|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  150|       |
  151|  78.1k|    if (propdata == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 78.1k]
  ------------------
  152|      0|        return 0;
  153|       |
  154|  78.1k|    t = name ? propdata->prop_names : propdata->prop_values;
  ------------------
  |  Branch (154:9): [True: 77.3k, False: 819]
  ------------------
  155|  78.1k|    p.s = s;
  156|  78.1k|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (156:9): [True: 0, False: 78.1k]
  ------------------
  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|  78.1k|    ps = lh_PROPERTY_STRING_retrieve(t, &p);
  161|  78.1k|    if (ps == NULL && create) {
  ------------------
  |  Branch (161:9): [True: 53, False: 78.1k]
  |  Branch (161:23): [True: 53, False: 0]
  ------------------
  162|     53|        CRYPTO_THREAD_unlock(propdata->lock);
  163|     53|        if (!CRYPTO_THREAD_write_lock(propdata->lock)) {
  ------------------
  |  Branch (163:13): [True: 0, False: 53]
  ------------------
  164|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|     53|        pidx = name ? &propdata->prop_name_idx : &propdata->prop_value_idx;
  ------------------
  |  Branch (167:16): [True: 24, False: 29]
  ------------------
  168|     53|        ps = lh_PROPERTY_STRING_retrieve(t, &p);
  169|     53|        if (ps == NULL && (ps_new = new_property_string(s, pidx)) != NULL) {
  ------------------
  |  Branch (169:13): [True: 53, False: 0]
  |  Branch (169:27): [True: 53, False: 0]
  ------------------
  170|     53|#ifndef OPENSSL_SMALL_FOOTPRINT
  171|     53|            STACK_OF(OPENSSL_CSTRING) *slist;
  ------------------
  |  |   31|     53|# define STACK_OF(type) struct stack_st_##type
  ------------------
  172|       |
  173|     53|            slist = name ? propdata->prop_namelist : propdata->prop_valuelist;
  ------------------
  |  Branch (173:21): [True: 24, False: 29]
  ------------------
  174|     53|            if (sk_OPENSSL_CSTRING_push(slist, ps_new->s) <= 0) {
  ------------------
  |  |  242|     53|#define sk_OPENSSL_CSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
  ------------------
  |  Branch (174:17): [True: 0, False: 53]
  ------------------
  175|      0|                property_free(ps_new);
  176|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  177|      0|                return 0;
  178|      0|            }
  179|     53|#endif
  180|     53|            lh_PROPERTY_STRING_insert(t, ps_new);
  181|     53|            if (lh_PROPERTY_STRING_error(t)) {
  ------------------
  |  Branch (181:17): [True: 0, False: 53]
  ------------------
  182|       |                /*-
  183|       |                 * Undo the previous push which means also decrementing the
  184|       |                 * index and freeing the allocated storage.
  185|       |                 */
  186|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  187|      0|                sk_OPENSSL_CSTRING_pop(slist);
  ------------------
  |  |  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|     53|            ps = ps_new;
  195|     53|        }
  196|     53|    }
  197|  78.1k|    CRYPTO_THREAD_unlock(propdata->lock);
  198|  78.1k|    return ps != NULL ? ps->idx : 0;
  ------------------
  |  Branch (198:12): [True: 78.1k, False: 0]
  ------------------
  199|  78.1k|}
property_string.c:new_property_string:
  126|     53|{
  127|     53|    const size_t l = strlen(s);
  128|     53|    PROPERTY_STRING *ps = OPENSSL_malloc(sizeof(*ps) + l);
  ------------------
  |  |  102|     53|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     53|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     53|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  129|       |
  130|     53|    if (ps != NULL) {
  ------------------
  |  Branch (130:9): [True: 53, False: 0]
  ------------------
  131|     53|        memcpy(ps->body, s, l + 1);
  132|     53|        ps->s = ps->body;
  133|     53|        ps->idx = ++*pidx;
  134|     53|        if (ps->idx == 0) {
  ------------------
  |  Branch (134:13): [True: 0, False: 53]
  ------------------
  135|      0|            OPENSSL_free(ps);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|     53|    }
  139|     53|    return ps;
  140|     53|}
property_string.c:ossl_property_str:
  218|  69.1k|{
  219|  69.1k|    const char *r;
  220|  69.1k|    PROPERTY_STRING_DATA *propdata
  221|  69.1k|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |   99|  69.1k|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  222|       |
  223|  69.1k|    if (propdata == NULL)
  ------------------
  |  Branch (223:9): [True: 0, False: 69.1k]
  ------------------
  224|      0|        return NULL;
  225|       |
  226|  69.1k|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (226:9): [True: 0, False: 69.1k]
  ------------------
  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|  69.1k|    r = sk_OPENSSL_CSTRING_value(name ? propdata->prop_namelist
  ------------------
  |  |  233|   138k|#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: 69.1k]
  |  |  ------------------
  ------------------
  244|  69.1k|                                      : propdata->prop_valuelist, idx - 1);
  245|  69.1k|#endif
  246|  69.1k|    CRYPTO_THREAD_unlock(propdata->lock);
  247|       |
  248|  69.1k|    return r;
  249|  69.1k|}

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

ossl_child_prov_ctx_new:
   38|      4|{
   39|      4|    return OPENSSL_zalloc(sizeof(struct child_prov_globals));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      4|}
ossl_child_prov_ctx_free:
   43|      2|{
   44|      2|    struct child_prov_globals *gbl = vgbl;
   45|       |
   46|      2|    CRYPTO_THREAD_lock_free(gbl->lock);
   47|      2|    OPENSSL_free(gbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|      4|{
   32|      4|    PROVIDER_CONF_GLOBAL *pcgbl = OPENSSL_zalloc(sizeof(*pcgbl));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|       |
   34|      4|    if (pcgbl == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 4]
  ------------------
   35|      0|        return NULL;
   36|       |
   37|      4|    pcgbl->lock = CRYPTO_THREAD_lock_new();
   38|      4|    if (pcgbl->lock == NULL) {
  ------------------
  |  Branch (38:9): [True: 0, False: 4]
  ------------------
   39|      0|        OPENSSL_free(pcgbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|      4|    return pcgbl;
   44|      4|}
ossl_prov_conf_ctx_free:
   47|      2|{
   48|      2|    PROVIDER_CONF_GLOBAL *pcgbl = vpcgbl;
   49|       |
   50|      2|    sk_OSSL_PROVIDER_pop_free(pcgbl->activated_providers,
   51|      2|                              ossl_provider_free);
   52|       |
   53|      2|    OSSL_TRACE(CONF, "Cleaned up providers\n");
  ------------------
  |  |  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_info_clear:
  280|      2|{
  281|      2|    OPENSSL_free(info->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__
  |  |  ------------------
  ------------------
  282|      2|    OPENSSL_free(info->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__
  |  |  ------------------
  ------------------
  283|      2|    sk_INFOPAIR_pop_free(info->parameters, infopair_free);
  284|      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|      4|    for (i = 0; i < store->numprovinfo; i++)
  ------------------
  |  Branch (302:17): [True: 2, False: 2]
  ------------------
  303|      2|        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|      4|{
  310|      4|    struct provider_store_st *store = OPENSSL_zalloc(sizeof(*store));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  311|       |
  312|      4|    if (store == NULL
  ------------------
  |  Branch (312:9): [True: 0, False: 4]
  ------------------
  313|      4|        || (store->providers = sk_OSSL_PROVIDER_new(ossl_provider_cmp)) == NULL
  ------------------
  |  Branch (313:12): [True: 0, False: 4]
  ------------------
  314|      4|        || (store->default_path_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (314:12): [True: 0, False: 4]
  ------------------
  315|      4|#ifndef FIPS_MODULE
  316|      4|        || (store->child_cbs = sk_OSSL_PROVIDER_CHILD_CB_new_null()) == NULL
  ------------------
  |  Branch (316:12): [True: 0, False: 4]
  ------------------
  317|      4|#endif
  318|      4|        || (store->lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (318:12): [True: 0, False: 4]
  ------------------
  319|      0|        ossl_provider_store_free(store);
  320|      0|        return NULL;
  321|      0|    }
  322|      4|    store->libctx = ctx;
  323|      4|    store->use_fallbacks = 1;
  324|       |
  325|      4|    return store;
  326|      4|}
ossl_provider_info_add_to_store:
  356|      2|{
  357|      2|    struct provider_store_st *store = get_provider_store(libctx);
  358|      2|    int ret = 0;
  359|       |
  360|      2|    if (entry->name == NULL) {
  ------------------
  |  Branch (360:9): [True: 0, False: 2]
  ------------------
  361|      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)
  |  |  ------------------
  ------------------
  362|      0|        return 0;
  363|      0|    }
  364|       |
  365|      2|    if (store == NULL) {
  ------------------
  |  Branch (365:9): [True: 0, False: 2]
  ------------------
  366|      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)
  |  |  ------------------
  ------------------
  367|      0|        return 0;
  368|      0|    }
  369|       |
  370|      2|    if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (370:9): [True: 0, False: 2]
  ------------------
  371|      0|        return 0;
  372|      2|    if (store->provinfosz == 0) {
  ------------------
  |  Branch (372:9): [True: 2, False: 0]
  ------------------
  373|      2|        store->provinfo = OPENSSL_zalloc(sizeof(*store->provinfo)
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  374|      2|                                         * BUILTINS_BLOCK_SIZE);
  375|      2|        if (store->provinfo == NULL)
  ------------------
  |  Branch (375:13): [True: 0, False: 2]
  ------------------
  376|      0|            goto err;
  377|      2|        store->provinfosz = BUILTINS_BLOCK_SIZE;
  ------------------
  |  |  352|      2|#define BUILTINS_BLOCK_SIZE     10
  ------------------
  378|      2|    } else if (store->numprovinfo == store->provinfosz) {
  ------------------
  |  Branch (378:16): [True: 0, False: 0]
  ------------------
  379|      0|        OSSL_PROVIDER_INFO *tmpbuiltins;
  380|      0|        size_t newsz = store->provinfosz + BUILTINS_BLOCK_SIZE;
  ------------------
  |  |  352|      0|#define BUILTINS_BLOCK_SIZE     10
  ------------------
  381|       |
  382|      0|        tmpbuiltins = OPENSSL_realloc(store->provinfo,
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  383|      0|                                      sizeof(*store->provinfo) * newsz);
  384|      0|        if (tmpbuiltins == NULL)
  ------------------
  |  Branch (384:13): [True: 0, False: 0]
  ------------------
  385|      0|            goto err;
  386|      0|        store->provinfo = tmpbuiltins;
  387|      0|        store->provinfosz = newsz;
  388|      0|    }
  389|      2|    store->provinfo[store->numprovinfo] = *entry;
  390|      2|    store->numprovinfo++;
  391|       |
  392|      2|    ret = 1;
  393|      2| err:
  394|      2|    CRYPTO_THREAD_unlock(store->lock);
  395|      2|    return ret;
  396|      2|}
ossl_provider_find:
  400|      2|{
  401|      2|    struct provider_store_st *store = NULL;
  402|      2|    OSSL_PROVIDER *prov = NULL;
  403|       |
  404|      2|    if ((store = get_provider_store(libctx)) != NULL) {
  ------------------
  |  Branch (404:9): [True: 2, False: 0]
  ------------------
  405|      2|        OSSL_PROVIDER tmpl = { 0, };
  406|      2|        int i;
  407|       |
  408|      2|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  409|       |        /*
  410|       |         * Make sure any providers are loaded from config before we try to find
  411|       |         * them.
  412|       |         */
  413|      2|        if (!noconfig) {
  ------------------
  |  Branch (413:13): [True: 2, False: 0]
  ------------------
  414|      2|            if (ossl_lib_ctx_is_default(libctx))
  ------------------
  |  Branch (414:17): [True: 2, False: 0]
  ------------------
  415|      2|                OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  468|      2|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  416|      2|        }
  417|      2|#endif
  418|       |
  419|      2|        tmpl.name = (char *)name;
  420|      2|        if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (420:13): [True: 0, False: 2]
  ------------------
  421|      0|            return NULL;
  422|      2|        sk_OSSL_PROVIDER_sort(store->providers);
  423|      2|        if ((i = sk_OSSL_PROVIDER_find(store->providers, &tmpl)) != -1)
  ------------------
  |  Branch (423:13): [True: 0, False: 2]
  ------------------
  424|      0|            prov = sk_OSSL_PROVIDER_value(store->providers, i);
  425|      2|        CRYPTO_THREAD_unlock(store->lock);
  426|      2|        if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (426:13): [True: 0, False: 2]
  |  Branch (426:29): [True: 0, False: 0]
  ------------------
  427|      0|            prov = NULL;
  428|      2|    }
  429|       |
  430|      2|    return prov;
  431|      2|}
ossl_provider_up_ref:
  476|    208|{
  477|    208|    int ref = 0;
  478|       |
  479|    208|    if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0)
  ------------------
  |  Branch (479:9): [True: 0, False: 208]
  ------------------
  480|      0|        return 0;
  481|       |
  482|    208|#ifndef FIPS_MODULE
  483|    208|    if (prov->ischild) {
  ------------------
  |  Branch (483:9): [True: 0, False: 208]
  ------------------
  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|    208|#endif
  490|       |
  491|    208|    return ref;
  492|    208|}
ossl_provider_new:
  521|      2|{
  522|      2|    struct provider_store_st *store = NULL;
  523|      2|    OSSL_PROVIDER_INFO template;
  524|      2|    OSSL_PROVIDER *prov = NULL;
  525|       |
  526|      2|    if ((store = get_provider_store(libctx)) == NULL)
  ------------------
  |  Branch (526:9): [True: 0, False: 2]
  ------------------
  527|      0|        return NULL;
  528|       |
  529|      2|    memset(&template, 0, sizeof(template));
  530|      2|    if (init_function == NULL) {
  ------------------
  |  Branch (530:9): [True: 2, False: 0]
  ------------------
  531|      2|        const OSSL_PROVIDER_INFO *p;
  532|      2|        size_t i;
  533|       |
  534|       |        /* Check if this is a predefined builtin provider */
  535|      8|        for (p = ossl_predefined_providers; p->name != NULL; p++) {
  ------------------
  |  Branch (535:45): [True: 6, False: 2]
  ------------------
  536|      6|            if (strcmp(p->name, name) == 0) {
  ------------------
  |  Branch (536:17): [True: 0, False: 6]
  ------------------
  537|      0|                template = *p;
  538|      0|                break;
  539|      0|            }
  540|      6|        }
  541|      2|        if (p->name == NULL) {
  ------------------
  |  Branch (541:13): [True: 2, False: 0]
  ------------------
  542|       |            /* Check if this is a user added provider */
  543|      2|            if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (543:17): [True: 0, False: 2]
  ------------------
  544|      0|                return NULL;
  545|      2|            for (i = 0, p = store->provinfo; i < store->numprovinfo; p++, i++) {
  ------------------
  |  Branch (545:46): [True: 2, False: 0]
  ------------------
  546|      2|                if (strcmp(p->name, name) == 0) {
  ------------------
  |  Branch (546:21): [True: 2, False: 0]
  ------------------
  547|      2|                    template = *p;
  548|      2|                    break;
  549|      2|                }
  550|      2|            }
  551|      2|            CRYPTO_THREAD_unlock(store->lock);
  552|      2|        }
  553|      2|    } else {
  554|      0|        template.init = init_function;
  555|      0|    }
  556|       |
  557|      2|    if (params != NULL) {
  ------------------
  |  Branch (557:9): [True: 0, False: 2]
  ------------------
  558|      0|        int i;
  559|       |
  560|      0|        template.parameters = sk_INFOPAIR_new_null();
  561|      0|        if (template.parameters == NULL)
  ------------------
  |  Branch (561:13): [True: 0, False: 0]
  ------------------
  562|      0|            return NULL;
  563|       |
  564|      0|        for (i = 0; params[i].key != NULL; i++) {
  ------------------
  |  Branch (564:21): [True: 0, False: 0]
  ------------------
  565|      0|            if (params[i].data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (565:17): [True: 0, False: 0]
  ------------------
  566|      0|                continue;
  567|      0|            if (ossl_provider_info_add_parameter(&template, params[i].key,
  ------------------
  |  Branch (567:17): [True: 0, False: 0]
  ------------------
  568|      0|                                                 (char *)params[i].data) <= 0) {
  569|      0|                sk_INFOPAIR_pop_free(template.parameters, infopair_free);
  570|      0|                return NULL;
  571|      0|            }
  572|      0|        }
  573|      0|    }
  574|       |
  575|       |    /* provider_new() generates an error, so no need here */
  576|      2|    prov = provider_new(name, template.init, template.parameters);
  577|       |
  578|      2|    if (params != NULL) /* We copied the parameters, let's free them */
  ------------------
  |  Branch (578:9): [True: 0, False: 2]
  ------------------
  579|      0|        sk_INFOPAIR_pop_free(template.parameters, infopair_free);
  580|       |
  581|      2|    if (prov == NULL)
  ------------------
  |  Branch (581:9): [True: 0, False: 2]
  ------------------
  582|      0|        return NULL;
  583|       |
  584|      2|    if (!ossl_provider_set_module_path(prov, template.path)) {
  ------------------
  |  Branch (584:9): [True: 0, False: 2]
  ------------------
  585|      0|        ossl_provider_free(prov);
  586|      0|        return NULL;
  587|      0|    }
  588|       |
  589|      2|    prov->libctx = libctx;
  590|      2|#ifndef FIPS_MODULE
  591|      2|    prov->error_lib = ERR_get_next_error_library();
  592|      2|#endif
  593|       |
  594|       |    /*
  595|       |     * At this point, the provider is only partially "loaded".  To be
  596|       |     * fully "loaded", ossl_provider_activate() must also be called and it must
  597|       |     * then be added to the provider store.
  598|       |     */
  599|       |
  600|      2|    return prov;
  601|      2|}
ossl_provider_add_to_store:
  628|      2|{
  629|      2|    struct provider_store_st *store;
  630|      2|    int idx;
  631|      2|    OSSL_PROVIDER tmpl = { 0, };
  632|      2|    OSSL_PROVIDER *actualtmp = NULL;
  633|       |
  634|      2|    if (actualprov != NULL)
  ------------------
  |  Branch (634:9): [True: 2, False: 0]
  ------------------
  635|      2|        *actualprov = NULL;
  636|       |
  637|      2|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (637:9): [True: 0, False: 2]
  ------------------
  638|      0|        return 0;
  639|       |
  640|      2|    if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (640:9): [True: 0, False: 2]
  ------------------
  641|      0|        return 0;
  642|       |
  643|      2|    tmpl.name = (char *)prov->name;
  644|      2|    idx = sk_OSSL_PROVIDER_find(store->providers, &tmpl);
  645|      2|    if (idx == -1)
  ------------------
  |  Branch (645:9): [True: 2, False: 0]
  ------------------
  646|      2|        actualtmp = prov;
  647|      0|    else
  648|      0|        actualtmp = sk_OSSL_PROVIDER_value(store->providers, idx);
  649|       |
  650|      2|    if (idx == -1) {
  ------------------
  |  Branch (650:9): [True: 2, False: 0]
  ------------------
  651|      2|        if (sk_OSSL_PROVIDER_push(store->providers, prov) == 0)
  ------------------
  |  Branch (651:13): [True: 0, False: 2]
  ------------------
  652|      0|            goto err;
  653|      2|        prov->store = store;
  654|      2|        if (!create_provider_children(prov)) {
  ------------------
  |  Branch (654:13): [True: 0, False: 2]
  ------------------
  655|      0|            sk_OSSL_PROVIDER_delete_ptr(store->providers, prov);
  656|      0|            goto err;
  657|      0|        }
  658|      2|        if (!retain_fallbacks)
  ------------------
  |  Branch (658:13): [True: 0, False: 2]
  ------------------
  659|      0|            store->use_fallbacks = 0;
  660|      2|    }
  661|       |
  662|      2|    CRYPTO_THREAD_unlock(store->lock);
  663|       |
  664|      2|    if (actualprov != NULL) {
  ------------------
  |  Branch (664:9): [True: 2, False: 0]
  ------------------
  665|      2|        if (!ossl_provider_up_ref(actualtmp)) {
  ------------------
  |  Branch (665:13): [True: 0, False: 2]
  ------------------
  666|      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)
  |  |  ------------------
  ------------------
  667|      0|            actualtmp = NULL;
  668|      0|            return 0;
  669|      0|        }
  670|      2|        *actualprov = actualtmp;
  671|      2|    }
  672|       |
  673|      2|    if (idx >= 0) {
  ------------------
  |  Branch (673:9): [True: 0, False: 2]
  ------------------
  674|       |        /*
  675|       |         * The provider is already in the store. Probably two threads
  676|       |         * independently initialised their own provider objects with the same
  677|       |         * name and raced to put them in the store. This thread lost. We
  678|       |         * deactivate the one we just created and use the one that already
  679|       |         * exists instead.
  680|       |         * If we get here then we know we did not create provider children
  681|       |         * above, so we inform ossl_provider_deactivate not to attempt to remove
  682|       |         * any.
  683|       |         */
  684|      0|        ossl_provider_deactivate(prov, 0);
  685|      0|        ossl_provider_free(prov);
  686|      0|    }
  687|      2|#ifndef FIPS_MODULE
  688|      2|    else {
  689|       |        /*
  690|       |         * This can be done outside the lock. We tolerate other threads getting
  691|       |         * the wrong result briefly when creating OSSL_DECODER_CTXs.
  692|       |         */
  693|      2|        ossl_decoder_cache_flush(prov->libctx);
  694|      2|    }
  695|      2|#endif
  696|       |
  697|      2|    return 1;
  698|       |
  699|      0| err:
  700|      0|    CRYPTO_THREAD_unlock(store->lock);
  701|      0|    return 0;
  702|      2|}
ossl_provider_free:
  705|    209|{
  706|    209|    if (prov != NULL) {
  ------------------
  |  Branch (706:9): [True: 209, False: 0]
  ------------------
  707|    209|        int ref = 0;
  708|       |
  709|    209|        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|    209|        if (ref == 0) {
  ------------------
  |  Branch (719:13): [True: 1, False: 208]
  ------------------
  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|    208|#ifndef FIPS_MODULE
  756|    208|        else if (prov->ischild) {
  ------------------
  |  Branch (756:18): [True: 0, False: 208]
  ------------------
  757|      0|            ossl_provider_free_parent(prov, 0);
  758|      0|        }
  759|    209|#endif
  760|    209|    }
  761|    209|}
ossl_provider_set_module_path:
  765|      2|{
  766|      2|    OPENSSL_free(prov->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__
  |  |  ------------------
  ------------------
  767|      2|    prov->path = NULL;
  768|      2|    if (module_path == NULL)
  ------------------
  |  Branch (768:9): [True: 2, False: 0]
  ------------------
  769|      2|        return 1;
  770|      0|    if ((prov->path = OPENSSL_strdup(module_path)) != 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 (770:9): [True: 0, False: 0]
  ------------------
  771|      0|        return 1;
  772|      0|    return 0;
  773|      0|}
ossl_provider_activate:
 1301|      2|{
 1302|      2|    int count;
 1303|       |
 1304|      2|    if (prov == NULL)
  ------------------
  |  Branch (1304:9): [True: 0, False: 2]
  ------------------
 1305|      0|        return 0;
 1306|      2|#ifndef FIPS_MODULE
 1307|       |    /*
 1308|       |     * If aschild is true, then we only actually do the activation if the
 1309|       |     * provider is a child. If its not, this is still success.
 1310|       |     */
 1311|      2|    if (aschild && !prov->ischild)
  ------------------
  |  Branch (1311:9): [True: 0, False: 2]
  |  Branch (1311:20): [True: 0, False: 0]
  ------------------
 1312|      0|        return 1;
 1313|      2|#endif
 1314|      2|    if ((count = provider_activate(prov, 1, upcalls)) > 0)
  ------------------
  |  Branch (1314:9): [True: 2, False: 0]
  ------------------
 1315|      2|        return count == 1 ? provider_flush_store_cache(prov) : 1;
  ------------------
  |  Branch (1315:16): [True: 2, False: 0]
  ------------------
 1316|       |
 1317|      0|    return 0;
 1318|      2|}
ossl_provider_deactivate:
 1321|      3|{
 1322|      3|    int count;
 1323|       |
 1324|      3|    if (prov == NULL
  ------------------
  |  Branch (1324:9): [True: 0, False: 3]
  ------------------
 1325|      3|            || (count = provider_deactivate(prov, 1, removechildren)) < 0)
  ------------------
  |  Branch (1325:16): [True: 0, False: 3]
  ------------------
 1326|      0|        return 0;
 1327|      3|    return count == 0 ? provider_remove_store_methods(prov) : 1;
  ------------------
  |  Branch (1327:12): [True: 3, False: 0]
  ------------------
 1328|      3|}
ossl_provider_ctx:
 1331|  5.72k|{
 1332|  5.72k|    return prov != NULL ? prov->provctx : NULL;
  ------------------
  |  Branch (1332:12): [True: 5.72k, False: 0]
  ------------------
 1333|  5.72k|}
ossl_provider_doall_activated:
 1411|  6.96k|{
 1412|  6.96k|    int ret = 0, curr, max, ref = 0;
 1413|  6.96k|    struct provider_store_st *store = get_provider_store(ctx);
 1414|  6.96k|    STACK_OF(OSSL_PROVIDER) *provs = NULL;
  ------------------
  |  |   31|  6.96k|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1415|       |
 1416|  6.96k|#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|  6.96k|    if (ossl_lib_ctx_is_default(ctx))
  ------------------
  |  Branch (1421:9): [True: 6.96k, False: 0]
  ------------------
 1422|  6.96k|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  468|  6.96k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
 1423|  6.96k|#endif
 1424|       |
 1425|  6.96k|    if (store == NULL)
  ------------------
  |  Branch (1425:9): [True: 0, False: 6.96k]
  ------------------
 1426|      0|        return 1;
 1427|  6.96k|    if (!provider_activate_fallbacks(store))
  ------------------
  |  Branch (1427:9): [True: 0, False: 6.96k]
  ------------------
 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|  6.96k|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1434:9): [True: 0, False: 6.96k]
  ------------------
 1435|      0|        return 0;
 1436|  6.96k|    provs = sk_OSSL_PROVIDER_dup(store->providers);
 1437|  6.96k|    if (provs == NULL) {
  ------------------
  |  Branch (1437:9): [True: 0, False: 6.96k]
  ------------------
 1438|      0|        CRYPTO_THREAD_unlock(store->lock);
 1439|      0|        return 0;
 1440|      0|    }
 1441|  6.96k|    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|  20.8k|    for (curr = max - 1; curr >= 0; curr--) {
  ------------------
  |  Branch (1446:26): [True: 13.9k, False: 6.96k]
  ------------------
 1447|  13.9k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1448|       |
 1449|  13.9k|        if (!CRYPTO_THREAD_read_lock(prov->flag_lock))
  ------------------
  |  Branch (1449:13): [True: 0, False: 13.9k]
  ------------------
 1450|      0|            goto err_unlock;
 1451|  13.9k|        if (prov->flag_activated) {
  ------------------
  |  Branch (1451:13): [True: 13.9k, 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|  13.9k|            if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0) {
  ------------------
  |  Branch (1457:17): [True: 0, False: 13.9k]
  ------------------
 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|  13.9k|            if (!CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1467:17): [True: 0, False: 13.9k]
  ------------------
 1468|  13.9k|                                   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|  13.9k|        } else {
 1474|      0|            sk_OSSL_PROVIDER_delete(provs, curr);
 1475|      0|            max--;
 1476|      0|        }
 1477|  13.9k|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1478|  13.9k|    }
 1479|  6.96k|    CRYPTO_THREAD_unlock(store->lock);
 1480|       |
 1481|       |    /*
 1482|       |     * Now, we sweep through all providers not under lock
 1483|       |     */
 1484|  20.8k|    for (curr = 0; curr < max; curr++) {
  ------------------
  |  Branch (1484:20): [True: 13.9k, False: 6.96k]
  ------------------
 1485|  13.9k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1486|       |
 1487|  13.9k|        if (!cb(prov, cbdata)) {
  ------------------
  |  Branch (1487:13): [True: 0, False: 13.9k]
  ------------------
 1488|      0|            curr = -1;
 1489|      0|            goto finish;
 1490|      0|        }
 1491|  13.9k|    }
 1492|  6.96k|    curr = -1;
 1493|       |
 1494|  6.96k|    ret = 1;
 1495|  6.96k|    goto finish;
 1496|       |
 1497|      0| err_unlock:
 1498|      0|    CRYPTO_THREAD_unlock(store->lock);
 1499|  6.96k| 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|  20.8k|    for (curr++; curr < max; curr++) {
  ------------------
  |  Branch (1505:18): [True: 13.9k, False: 6.96k]
  ------------------
 1506|  13.9k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1507|       |
 1508|  13.9k|        if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &ref,
  ------------------
  |  Branch (1508:13): [True: 0, False: 13.9k]
  ------------------
 1509|  13.9k|                               prov->activatecnt_lock)) {
 1510|      0|            ret = 0;
 1511|      0|            continue;
 1512|      0|        }
 1513|  13.9k|        if (ref < 1) {
  ------------------
  |  Branch (1513:13): [True: 0, False: 13.9k]
  ------------------
 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|  13.9k|        if (!CRYPTO_DOWN_REF(&prov->refcnt, &ref)) {
  ------------------
  |  Branch (1530:13): [True: 0, False: 13.9k]
  ------------------
 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|  13.9k|        assert(ref > 0);
 1539|  13.9k|    }
 1540|  6.96k|    sk_OSSL_PROVIDER_free(provs);
 1541|  6.96k|    return ret;
 1542|  6.96k|}
ossl_provider_prov_ctx:
 1595|   720k|{
 1596|   720k|    if (prov != NULL)
  ------------------
  |  Branch (1596:9): [True: 720k, False: 0]
  ------------------
 1597|   720k|        return prov->provctx;
 1598|       |
 1599|      0|    return NULL;
 1600|   720k|}
ossl_provider_libctx:
 1611|  93.0k|{
 1612|  93.0k|    return prov != NULL ? prov->libctx : NULL;
  ------------------
  |  Branch (1612:12): [True: 87.2k, False: 5.71k]
  ------------------
 1613|  93.0k|}
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|  13.9k|{
 1663|  13.9k|    const OSSL_ALGORITHM *res;
 1664|       |
 1665|  13.9k|    if (prov->query_operation == NULL)
  ------------------
  |  Branch (1665:9): [True: 0, False: 13.9k]
  ------------------
 1666|      0|        return NULL;
 1667|  13.9k|    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|  13.9k|    return res;
 1674|  13.9k|}
ossl_provider_unquery_operation:
 1679|  13.9k|{
 1680|  13.9k|    if (prov->unquery_operation != NULL)
  ------------------
  |  Branch (1680:9): [True: 0, False: 13.9k]
  ------------------
 1681|      0|        prov->unquery_operation(prov->provctx, operation_id, algs);
 1682|  13.9k|}
ossl_provider_set_operation_bit:
 1685|     10|{
 1686|     10|    size_t byte = bitnum / 8;
 1687|     10|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 1688|       |
 1689|     10|    if (!CRYPTO_THREAD_write_lock(provider->opbits_lock))
  ------------------
  |  Branch (1689:9): [True: 0, False: 10]
  ------------------
 1690|      0|        return 0;
 1691|     10|    if (provider->operation_bits_sz <= byte) {
  ------------------
  |  Branch (1691:9): [True: 4, False: 6]
  ------------------
 1692|      4|        unsigned char *tmp = OPENSSL_realloc(provider->operation_bits,
  ------------------
  |  |  109|      4|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1693|      4|                                             byte + 1);
 1694|       |
 1695|      4|        if (tmp == NULL) {
  ------------------
  |  Branch (1695:13): [True: 0, False: 4]
  ------------------
 1696|      0|            CRYPTO_THREAD_unlock(provider->opbits_lock);
 1697|      0|            return 0;
 1698|      0|        }
 1699|      4|        provider->operation_bits = tmp;
 1700|      4|        memset(provider->operation_bits + provider->operation_bits_sz,
 1701|      4|               '\0', byte + 1 - provider->operation_bits_sz);
 1702|      4|        provider->operation_bits_sz = byte + 1;
 1703|      4|    }
 1704|     10|    provider->operation_bits[byte] |= bit;
 1705|     10|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 1706|     10|    return 1;
 1707|     10|}
ossl_provider_test_operation_bit:
 1711|  13.9k|{
 1712|  13.9k|    size_t byte = bitnum / 8;
 1713|  13.9k|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 1714|       |
 1715|  13.9k|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|  13.9k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  13.9k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1715:9): [True: 0, False: 13.9k]
  ------------------
 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|  13.9k|    *result = 0;
 1721|  13.9k|    if (!CRYPTO_THREAD_read_lock(provider->opbits_lock))
  ------------------
  |  Branch (1721:9): [True: 0, False: 13.9k]
  ------------------
 1722|      0|        return 0;
 1723|  13.9k|    if (provider->operation_bits_sz > byte)
  ------------------
  |  Branch (1723:9): [True: 13.9k, False: 4]
  ------------------
 1724|  13.9k|        *result = ((provider->operation_bits[byte] & bit) != 0);
 1725|  13.9k|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 1726|  13.9k|    return 1;
 1727|  13.9k|}
provider_core.c:provider_deactivate_free:
  236|      3|{
  237|      3|    if (prov->flag_activated)
  ------------------
  |  Branch (237:9): [True: 3, False: 0]
  ------------------
  238|      3|        ossl_provider_deactivate(prov, 1);
  239|      3|    ossl_provider_free(prov);
  240|      3|}
provider_core.c:get_provider_store:
  329|  6.98k|{
  330|  6.98k|    struct provider_store_st *store = NULL;
  331|       |
  332|  6.98k|    store = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_PROVIDER_STORE_INDEX);
  ------------------
  |  |   97|  6.98k|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  333|  6.98k|    if (store == NULL)
  ------------------
  |  Branch (333:9): [True: 0, False: 6.98k]
  ------------------
  334|  6.98k|        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|  6.98k|    return store;
  336|  6.98k|}
provider_core.c:provider_new:
  441|      3|{
  442|      3|    OSSL_PROVIDER *prov = NULL;
  443|       |
  444|      3|    if ((prov = OPENSSL_zalloc(sizeof(*prov))) == NULL)
  ------------------
  |  |  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 (444:9): [True: 0, False: 3]
  ------------------
  445|      0|        return NULL;
  446|      3|    if (!CRYPTO_NEW_REF(&prov->refcnt, 1)) {
  ------------------
  |  Branch (446:9): [True: 0, False: 3]
  ------------------
  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|      3|    if ((prov->activatecnt_lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (450:9): [True: 0, False: 3]
  ------------------
  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|      3|    if ((prov->opbits_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (456:9): [True: 0, False: 3]
  ------------------
  457|      3|        || (prov->flag_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (457:12): [True: 0, False: 3]
  ------------------
  458|      3|        || (prov->parameters = sk_INFOPAIR_deep_copy(parameters,
  ------------------
  |  Branch (458:12): [True: 0, False: 3]
  ------------------
  459|      3|                                                     infopair_copy,
  460|      3|                                                     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|      3|    if ((prov->name = OPENSSL_strdup(name)) == NULL) {
  ------------------
  |  |  119|      3|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (465:9): [True: 0, False: 3]
  ------------------
  466|      0|        ossl_provider_free(prov);
  467|      0|        return NULL;
  468|      0|    }
  469|       |
  470|      3|    prov->init_function = init_function;
  471|       |
  472|      3|    return prov;
  473|      3|}
provider_core.c:create_provider_children:
  605|      2|{
  606|      2|    int ret = 1;
  607|      2|#ifndef FIPS_MODULE
  608|      2|    struct provider_store_st *store = prov->store;
  609|      2|    OSSL_PROVIDER_CHILD_CB *child_cb;
  610|      2|    int i, max;
  611|       |
  612|      2|    max = sk_OSSL_PROVIDER_CHILD_CB_num(store->child_cbs);
  613|      2|    for (i = 0; i < max; i++) {
  ------------------
  |  Branch (613:17): [True: 0, False: 2]
  ------------------
  614|       |        /*
  615|       |         * This is newly activated (activatecnt == 1), so we need to
  616|       |         * create child providers as necessary.
  617|       |         */
  618|      0|        child_cb = sk_OSSL_PROVIDER_CHILD_CB_value(store->child_cbs, i);
  619|      0|        ret &= child_cb->create_cb((OSSL_CORE_HANDLE *)prov, child_cb->cbdata);
  620|      0|    }
  621|      2|#endif
  622|       |
  623|      2|    return ret;
  624|      2|}
provider_core.c:provider_activate:
 1165|      3|{
 1166|      3|    int count = -1;
 1167|      3|    struct provider_store_st *store;
 1168|      3|    int ret = 1;
 1169|       |
 1170|      3|    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|      3|    if (store == NULL) {
  ------------------
  |  Branch (1175:9): [True: 3, False: 0]
  ------------------
 1176|      3|        lock = 0;
 1177|      3|        if (!provider_init(prov))
  ------------------
  |  Branch (1177:13): [True: 0, False: 3]
  ------------------
 1178|      0|            return -1;
 1179|      3|    }
 1180|       |
 1181|      3|#ifndef FIPS_MODULE
 1182|      3|    if (prov->ischild && upcalls && !ossl_provider_up_ref_parent(prov, 1))
  ------------------
  |  Branch (1182:9): [True: 0, False: 3]
  |  Branch (1182:26): [True: 0, False: 0]
  |  Branch (1182:37): [True: 0, False: 0]
  ------------------
 1183|      0|        return -1;
 1184|      3|#endif
 1185|       |
 1186|      3|    if (lock && !CRYPTO_THREAD_read_lock(store->lock)) {
  ------------------
  |  Branch (1186:9): [True: 0, False: 3]
  |  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|      3|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1194:9): [True: 0, False: 3]
  |  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|      3|    if (CRYPTO_atomic_add(&prov->activatecnt, 1, &count, prov->activatecnt_lock)) {
  ------------------
  |  Branch (1202:9): [True: 3, False: 0]
  ------------------
 1203|      3|        prov->flag_activated = 1;
 1204|       |
 1205|      3|        if (count == 1 && store != NULL) {
  ------------------
  |  Branch (1205:13): [True: 3, False: 0]
  |  Branch (1205:27): [True: 0, False: 3]
  ------------------
 1206|      0|            ret = create_provider_children(prov);
 1207|      0|        }
 1208|      3|    }
 1209|      3|    if (lock) {
  ------------------
  |  Branch (1209:9): [True: 0, False: 3]
  ------------------
 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|      3|    if (!ret)
  ------------------
  |  Branch (1222:9): [True: 0, False: 3]
  ------------------
 1223|      0|        return -1;
 1224|       |
 1225|      3|    return count;
 1226|      3|}
provider_core.c:provider_init:
  871|      3|{
  872|      3|    const OSSL_DISPATCH *provider_dispatch = NULL;
  873|      3|    void *tmp_provctx = NULL;    /* safety measure */
  874|      3|#ifndef OPENSSL_NO_ERR
  875|      3|# ifndef FIPS_MODULE
  876|      3|    OSSL_FUNC_provider_get_reason_strings_fn *p_get_reason_strings = NULL;
  877|      3|# endif
  878|      3|#endif
  879|      3|    int ok = 0;
  880|       |
  881|      3|    if (!ossl_assert(!prov->flag_initialized)) {
  ------------------
  |  |   52|      3|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      3|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (881:9): [True: 0, False: 3]
  ------------------
  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|      3|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (890:9): [True: 0, False: 3]
  ------------------
  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|      3|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (961:9): [True: 0, False: 3]
  ------------------
  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|      3|    if (!prov->init_function((OSSL_CORE_HANDLE *)prov, core_dispatch,
  ------------------
  |  Branch (968:9): [True: 0, False: 3]
  ------------------
  969|      3|                             &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|      3|    prov->provctx = tmp_provctx;
  975|      3|    prov->dispatch = provider_dispatch;
  976|       |
  977|      3|    if (provider_dispatch != NULL) {
  ------------------
  |  Branch (977:9): [True: 3, False: 0]
  ------------------
  978|     12|        for (; provider_dispatch->function_id != 0; provider_dispatch++) {
  ------------------
  |  Branch (978:16): [True: 9, False: 3]
  ------------------
  979|      9|            switch (provider_dispatch->function_id) {
  ------------------
  |  Branch (979:21): [True: 0, False: 9]
  ------------------
  980|      3|            case OSSL_FUNC_PROVIDER_TEARDOWN:
  ------------------
  |  |  250|      3|# define OSSL_FUNC_PROVIDER_TEARDOWN           1024
  ------------------
  |  Branch (980:13): [True: 3, False: 6]
  ------------------
  981|      3|                prov->teardown =
  982|      3|                    OSSL_FUNC_provider_teardown(provider_dispatch);
  983|      3|                break;
  984|      1|            case OSSL_FUNC_PROVIDER_GETTABLE_PARAMS:
  ------------------
  |  |  252|      1|# define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS    1025
  ------------------
  |  Branch (984:13): [True: 1, False: 8]
  ------------------
  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: 8]
  ------------------
  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: 9]
  ------------------
  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: 8]
  ------------------
  997|      1|                prov->get_capabilities =
  998|      1|                    OSSL_FUNC_provider_get_capabilities(provider_dispatch);
  999|      1|                break;
 1000|      3|            case OSSL_FUNC_PROVIDER_QUERY_OPERATION:
  ------------------
  |  |  258|      3|# define OSSL_FUNC_PROVIDER_QUERY_OPERATION    1027
  ------------------
  |  Branch (1000:13): [True: 3, False: 6]
  ------------------
 1001|      3|                prov->query_operation =
 1002|      3|                    OSSL_FUNC_provider_query_operation(provider_dispatch);
 1003|      3|                break;
 1004|      0|            case OSSL_FUNC_PROVIDER_UNQUERY_OPERATION:
  ------------------
  |  |  261|      0|# define OSSL_FUNC_PROVIDER_UNQUERY_OPERATION  1028
  ------------------
  |  Branch (1004:13): [True: 0, False: 9]
  ------------------
 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: 9]
  ------------------
 1011|      0|                p_get_reason_strings =
 1012|      0|                    OSSL_FUNC_provider_get_reason_strings(provider_dispatch);
 1013|      0|                break;
 1014|      9|# endif
 1015|      9|#endif
 1016|      9|            }
 1017|      9|        }
 1018|      3|    }
 1019|       |
 1020|      3|#ifndef OPENSSL_NO_ERR
 1021|      3|# ifndef FIPS_MODULE
 1022|      3|    if (p_get_reason_strings != NULL) {
  ------------------
  |  Branch (1022:9): [True: 0, False: 3]
  ------------------
 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|      3|# endif
 1064|      3|#endif
 1065|       |
 1066|       |    /* With this flag set, this provider has become fully "loaded". */
 1067|      3|    prov->flag_initialized = 1;
 1068|      3|    ok = 1;
 1069|       |
 1070|      3| end:
 1071|      3|    return ok;
 1072|      3|}
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_flush_store_cache:
 1229|      2|{
 1230|      2|    struct provider_store_st *store;
 1231|      2|    int freeing;
 1232|       |
 1233|      2|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (1233:9): [True: 0, False: 2]
  ------------------
 1234|      0|        return 0;
 1235|       |
 1236|      2|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1236:9): [True: 0, False: 2]
  ------------------
 1237|      0|        return 0;
 1238|      2|    freeing = store->freeing;
 1239|      2|    CRYPTO_THREAD_unlock(store->lock);
 1240|       |
 1241|      2|    if (!freeing) {
  ------------------
  |  Branch (1241:9): [True: 2, False: 0]
  ------------------
 1242|      2|        int acc
 1243|      2|            = evp_method_store_cache_flush(prov->libctx)
 1244|      2|#ifndef FIPS_MODULE
 1245|      2|            + ossl_encoder_store_cache_flush(prov->libctx)
 1246|      2|            + ossl_decoder_store_cache_flush(prov->libctx)
 1247|      2|            + ossl_store_loader_store_cache_flush(prov->libctx)
 1248|      2|#endif
 1249|      2|            ;
 1250|       |
 1251|      2|#ifndef FIPS_MODULE
 1252|      2|        return acc == 4;
 1253|       |#else
 1254|       |        return acc == 1;
 1255|       |#endif
 1256|      2|    }
 1257|      0|    return 1;
 1258|      2|}
provider_core.c:provider_deactivate:
 1082|      3|{
 1083|      3|    int count;
 1084|      3|    struct provider_store_st *store;
 1085|      3|#ifndef FIPS_MODULE
 1086|      3|    int freeparent = 0;
 1087|      3|#endif
 1088|      3|    int lock = 1;
 1089|       |
 1090|      3|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|      3|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      3|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1090:9): [True: 0, False: 3]
  ------------------
 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|      3|    store = get_provider_store(prov->libctx);
 1098|      3|    if (store == NULL)
  ------------------
  |  Branch (1098:9): [True: 0, False: 3]
  ------------------
 1099|      0|        lock = 0;
 1100|       |
 1101|      3|    if (lock && !CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1101:9): [True: 3, False: 0]
  |  Branch (1101:17): [True: 0, False: 3]
  ------------------
 1102|      0|        return -1;
 1103|      3|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1103:9): [True: 3, False: 0]
  |  Branch (1103:17): [True: 0, False: 3]
  ------------------
 1104|      0|        CRYPTO_THREAD_unlock(store->lock);
 1105|      0|        return -1;
 1106|      0|    }
 1107|       |
 1108|      3|    CRYPTO_atomic_add(&prov->activatecnt, -1, &count, prov->activatecnt_lock);
 1109|      3|#ifndef FIPS_MODULE
 1110|      3|    if (count >= 1 && prov->ischild && upcalls) {
  ------------------
  |  Branch (1110:9): [True: 0, False: 3]
  |  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|      3|#endif
 1120|       |
 1121|      3|    if (count < 1)
  ------------------
  |  Branch (1121:9): [True: 3, False: 0]
  ------------------
 1122|      3|        prov->flag_activated = 0;
 1123|      0|#ifndef FIPS_MODULE
 1124|      0|    else
 1125|      0|        removechildren = 0;
 1126|      3|#endif
 1127|       |
 1128|      3|#ifndef FIPS_MODULE
 1129|      3|    if (removechildren && store != NULL) {
  ------------------
  |  Branch (1129:9): [True: 3, False: 0]
  |  Branch (1129:27): [True: 3, False: 0]
  ------------------
 1130|      3|        int i, max = sk_OSSL_PROVIDER_CHILD_CB_num(store->child_cbs);
 1131|      3|        OSSL_PROVIDER_CHILD_CB *child_cb;
 1132|       |
 1133|      3|        for (i = 0; i < max; i++) {
  ------------------
  |  Branch (1133:21): [True: 0, False: 3]
  ------------------
 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|      3|    }
 1138|      3|#endif
 1139|      3|    if (lock) {
  ------------------
  |  Branch (1139:9): [True: 3, False: 0]
  ------------------
 1140|      3|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1141|      3|        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|      3|#ifndef FIPS_MODULE
 1147|      3|        if (count < 1)
  ------------------
  |  Branch (1147:13): [True: 3, False: 0]
  ------------------
 1148|      3|            ossl_decoder_cache_flush(prov->libctx);
 1149|      3|#endif
 1150|      3|    }
 1151|      3|#ifndef FIPS_MODULE
 1152|      3|    if (freeparent)
  ------------------
  |  Branch (1152:9): [True: 0, False: 3]
  ------------------
 1153|      0|        ossl_provider_free_parent(prov, 1);
 1154|      3|#endif
 1155|       |
 1156|       |    /* We don't deinit here, that's done in ossl_provider_free() */
 1157|      3|    return count;
 1158|      3|}
provider_core.c:provider_remove_store_methods:
 1261|      3|{
 1262|      3|    struct provider_store_st *store;
 1263|      3|    int freeing;
 1264|       |
 1265|      3|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (1265:9): [True: 0, False: 3]
  ------------------
 1266|      0|        return 0;
 1267|       |
 1268|      3|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1268:9): [True: 0, False: 3]
  ------------------
 1269|      0|        return 0;
 1270|      3|    freeing = store->freeing;
 1271|      3|    CRYPTO_THREAD_unlock(store->lock);
 1272|       |
 1273|      3|    if (!freeing) {
  ------------------
  |  Branch (1273:9): [True: 0, False: 3]
  ------------------
 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|      3|    return 1;
 1298|      3|}
provider_core.c:provider_activate_fallbacks:
 1341|  6.96k|{
 1342|  6.96k|    int use_fallbacks;
 1343|  6.96k|    int activated_fallback_count = 0;
 1344|  6.96k|    int ret = 0;
 1345|  6.96k|    const OSSL_PROVIDER_INFO *p;
 1346|       |
 1347|  6.96k|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1347:9): [True: 0, False: 6.96k]
  ------------------
 1348|      0|        return 0;
 1349|  6.96k|    use_fallbacks = store->use_fallbacks;
 1350|  6.96k|    CRYPTO_THREAD_unlock(store->lock);
 1351|  6.96k|    if (!use_fallbacks)
  ------------------
  |  Branch (1351:9): [True: 6.96k, False: 1]
  ------------------
 1352|  6.96k|        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|  4.08k|{
  188|  4.08k|    const RAND_METHOD *tmp_meth = NULL;
  189|       |
  190|  4.08k|    if (!RUN_ONCE(&rand_init, do_rand_init))
  ------------------
  |  |  130|  4.08k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 4.08k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (190:9): [True: 0, False: 4.08k]
  ------------------
  191|      0|        return NULL;
  192|       |
  193|  4.08k|    if (!CRYPTO_THREAD_read_lock(rand_meth_lock))
  ------------------
  |  Branch (193:9): [True: 0, False: 4.08k]
  ------------------
  194|      0|        return NULL;
  195|  4.08k|    tmp_meth = default_RAND_meth;
  196|  4.08k|    CRYPTO_THREAD_unlock(rand_meth_lock);
  197|  4.08k|    if (tmp_meth != NULL)
  ------------------
  |  Branch (197:9): [True: 4.08k, False: 1]
  ------------------
  198|  4.08k|        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|  4.08k|{
  337|  4.08k|    EVP_RAND_CTX *rand;
  338|  4.08k|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  339|  4.08k|    const RAND_METHOD *meth = RAND_get_rand_method();
  340|       |
  341|  4.08k|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (341:9): [True: 4.08k, False: 0]
  |  Branch (341:25): [True: 0, False: 4.08k]
  ------------------
  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|  4.08k|#endif
  348|       |
  349|  4.08k|    rand = RAND_get0_private(ctx);
  350|  4.08k|    if (rand != NULL)
  ------------------
  |  Branch (350:9): [True: 4.08k, False: 0]
  ------------------
  351|  4.08k|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  352|       |
  353|      0|    return 0;
  354|  4.08k|}
ossl_rand_ctx_new:
  454|      4|{
  455|      4|    RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  456|       |
  457|      4|    if (dgbl == NULL)
  ------------------
  |  Branch (457:9): [True: 0, False: 4]
  ------------------
  458|      0|        return NULL;
  459|       |
  460|      4|#ifndef FIPS_MODULE
  461|       |    /*
  462|       |     * We need to ensure that base libcrypto thread handling has been
  463|       |     * initialised.
  464|       |     */
  465|      4|     OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
  ------------------
  |  |   31|      4|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  466|      4|#endif
  467|       |
  468|      4|    dgbl->lock = CRYPTO_THREAD_lock_new();
  469|      4|    if (dgbl->lock == NULL)
  ------------------
  |  Branch (469:9): [True: 0, False: 4]
  ------------------
  470|      0|        goto err1;
  471|       |
  472|      4|    if (!CRYPTO_THREAD_init_local(&dgbl->private, NULL))
  ------------------
  |  Branch (472:9): [True: 0, False: 4]
  ------------------
  473|      0|        goto err1;
  474|       |
  475|      4|    if (!CRYPTO_THREAD_init_local(&dgbl->public, NULL))
  ------------------
  |  Branch (475:9): [True: 0, False: 4]
  ------------------
  476|      0|        goto err2;
  477|       |
  478|      4|    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|  4.08k|{
  790|  4.08k|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
  791|  4.08k|    EVP_RAND_CTX *rand, *primary;
  792|       |
  793|  4.08k|    if (dgbl == NULL)
  ------------------
  |  Branch (793:9): [True: 0, False: 4.08k]
  ------------------
  794|      0|        return NULL;
  795|       |
  796|  4.08k|    rand = CRYPTO_THREAD_get_local(&dgbl->private);
  797|  4.08k|    if (rand == NULL) {
  ------------------
  |  Branch (797:9): [True: 1, False: 4.08k]
  ------------------
  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|  4.08k|    return rand;
  815|  4.08k|}
RAND_set_DRBG_type:
  939|      2|{
  940|      2|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
  941|       |
  942|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (942:9): [True: 0, False: 2]
  ------------------
  943|      0|        return 0;
  944|      2|    if (dgbl->primary != NULL) {
  ------------------
  |  Branch (944:9): [True: 0, False: 2]
  ------------------
  945|      0|        ERR_raise(ERR_LIB_CRYPTO, RAND_R_ALREADY_INSTANTIATED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  946|      0|        return 0;
  947|      0|    }
  948|      2|    return random_set_string(&dgbl->rng_name, drbg)
  ------------------
  |  Branch (948:12): [True: 2, False: 0]
  ------------------
  949|      2|        && random_set_string(&dgbl->rng_propq, propq)
  ------------------
  |  Branch (949:12): [True: 2, False: 0]
  ------------------
  950|      2|        && random_set_string(&dgbl->rng_cipher, cipher)
  ------------------
  |  Branch (950:12): [True: 2, False: 0]
  ------------------
  951|      2|        && random_set_string(&dgbl->rng_digest, digest);
  ------------------
  |  Branch (951:12): [True: 2, False: 0]
  ------------------
  952|      2|}
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|  4.09k|{
  512|  4.09k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_INDEX);
  ------------------
  |  |  101|  4.09k|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  513|  4.09k|}
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: 2, False: 0]
  ------------------
  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: 0, False: 2]
  ------------------
  667|      0|        cipher = dgbl->rng_cipher != NULL ? dgbl->rng_cipher : "AES-256-CTR";
  ------------------
  |  Branch (667:18): [True: 0, False: 0]
  ------------------
  668|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
  ------------------
  |  |  207|      0|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  112|      0|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  669|      0|                                                cipher, 0);
  670|      0|    }
  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: 0, False: 2]
  ------------------
  681|      0|        *p++ = OSSL_PARAM_construct_int(OSSL_DRBG_PARAM_USE_DF, &use_df);
  ------------------
  |  |  229|      0|# 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_lib.c:random_set_string:
  859|      8|{
  860|      8|    char *d = NULL;
  861|       |
  862|      8|    if (s != NULL) {
  ------------------
  |  Branch (862:9): [True: 2, False: 6]
  ------------------
  863|      2|        d = OPENSSL_strdup(s);
  ------------------
  |  |  119|      2|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  864|      2|        if (d == NULL)
  ------------------
  |  Branch (864:13): [True: 0, False: 2]
  ------------------
  865|      0|            return 0;
  866|      2|    }
  867|      8|    OPENSSL_free(*p);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  868|      8|    *p = d;
  869|      8|    return 1;
  870|      8|}

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

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: 4, False: 16]
  ------------------
   86|      4|        return 0;
   87|     16|    if (!ossl_rsa_param_decode(rsa, alg)) {
  ------------------
  |  Branch (87:9): [True: 3, False: 13]
  ------------------
   88|      3|        RSA_free(rsa);
   89|      3|        return 0;
   90|      3|    }
   91|       |
   92|     13|    RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK);
  ------------------
  |  |  117|     13|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
   93|     13|    switch (pkey->ameth->pkey_id) {
   94|     11|    case EVP_PKEY_RSA:
  ------------------
  |  |   60|     11|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|     11|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (94:5): [True: 11, False: 2]
  ------------------
   95|     11|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSA);
  ------------------
  |  |  118|     11|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
   96|     11|        break;
   97|      2|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   62|      2|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      2|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (97:5): [True: 2, False: 11]
  ------------------
   98|      2|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSASSAPSS);
  ------------------
  |  |  119|      2|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
   99|      2|        break;
  100|      0|    default:
  ------------------
  |  Branch (100:5): [True: 0, False: 13]
  ------------------
  101|       |        /* Leave the type bits zero */
  102|      0|        break;
  103|     13|    }
  104|       |
  105|     13|    if (!EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa)) {
  ------------------
  |  Branch (105:9): [True: 0, False: 13]
  ------------------
  106|      0|        RSA_free(rsa);
  107|      0|        return 0;
  108|      0|    }
  109|     13|    return 1;
  110|     13|}
rsa_ameth.c:pkey_rsa_print:
  301|     48|{
  302|     48|    const RSA *x = pkey->pkey.rsa;
  303|     48|    char *str;
  304|     48|    const char *s;
  305|     48|    int ret = 0, mod_len = 0, ex_primes;
  306|       |
  307|     48|    if (x->n != NULL)
  ------------------
  |  Branch (307:9): [True: 48, False: 0]
  ------------------
  308|     48|        mod_len = BN_num_bits(x->n);
  309|     48|    ex_primes = sk_RSA_PRIME_INFO_num(x->prime_infos);
  310|       |
  311|     48|    if (!BIO_indent(bp, off, 128))
  ------------------
  |  Branch (311:9): [True: 0, False: 48]
  ------------------
  312|      0|        goto err;
  313|       |
  314|     48|    if (BIO_printf(bp, "%s ", pkey_is_pss(pkey) ?  "RSA-PSS" : "RSA") <= 0)
  ------------------
  |  |  151|     48|#define pkey_is_pss(pkey) (pkey->ameth->pkey_id == EVP_PKEY_RSA_PSS)
  |  |  ------------------
  |  |  |  |   62|     48|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  |  |  ------------------
  |  |  |  |  |  |  583|     48|#define NID_rsassaPss           912
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (151:27): [True: 0, False: 48]
  |  |  ------------------
  ------------------
  |  Branch (314:9): [True: 0, False: 48]
  ------------------
  315|      0|        goto err;
  316|       |
  317|     48|    if (priv && x->d) {
  ------------------
  |  Branch (317:9): [True: 48, False: 0]
  |  Branch (317:17): [True: 48, False: 0]
  ------------------
  318|     48|        if (BIO_printf(bp, "Private-Key: (%d bit, %d primes)\n",
  ------------------
  |  Branch (318:13): [True: 0, False: 48]
  ------------------
  319|     48|                       mod_len, ex_primes <= 0 ? 2 : ex_primes + 2) <= 0)
  ------------------
  |  Branch (319:33): [True: 3, False: 45]
  ------------------
  320|      0|            goto err;
  321|     48|        str = "modulus:";
  322|     48|        s = "publicExponent:";
  323|     48|    } else {
  324|      0|        if (BIO_printf(bp, "Public-Key: (%d bit)\n", mod_len) <= 0)
  ------------------
  |  Branch (324:13): [True: 0, False: 0]
  ------------------
  325|      0|            goto err;
  326|      0|        str = "Modulus:";
  327|      0|        s = "Exponent:";
  328|      0|    }
  329|     48|    if (!ASN1_bn_print(bp, str, x->n, NULL, off))
  ------------------
  |  Branch (329:9): [True: 0, False: 48]
  ------------------
  330|      0|        goto err;
  331|     48|    if (!ASN1_bn_print(bp, s, x->e, NULL, off))
  ------------------
  |  Branch (331:9): [True: 0, False: 48]
  ------------------
  332|      0|        goto err;
  333|     48|    if (priv) {
  ------------------
  |  Branch (333:9): [True: 48, False: 0]
  ------------------
  334|     48|        int i;
  335|       |
  336|     48|        if (!ASN1_bn_print(bp, "privateExponent:", x->d, NULL, off))
  ------------------
  |  Branch (336:13): [True: 0, False: 48]
  ------------------
  337|      0|            goto err;
  338|     48|        if (!ASN1_bn_print(bp, "prime1:", x->p, NULL, off))
  ------------------
  |  Branch (338:13): [True: 0, False: 48]
  ------------------
  339|      0|            goto err;
  340|     48|        if (!ASN1_bn_print(bp, "prime2:", x->q, NULL, off))
  ------------------
  |  Branch (340:13): [True: 0, False: 48]
  ------------------
  341|      0|            goto err;
  342|     48|        if (!ASN1_bn_print(bp, "exponent1:", x->dmp1, NULL, off))
  ------------------
  |  Branch (342:13): [True: 0, False: 48]
  ------------------
  343|      0|            goto err;
  344|     48|        if (!ASN1_bn_print(bp, "exponent2:", x->dmq1, NULL, off))
  ------------------
  |  Branch (344:13): [True: 0, False: 48]
  ------------------
  345|      0|            goto err;
  346|     48|        if (!ASN1_bn_print(bp, "coefficient:", x->iqmp, NULL, off))
  ------------------
  |  Branch (346:13): [True: 0, False: 48]
  ------------------
  347|      0|            goto err;
  348|  3.93k|        for (i = 0; i < sk_RSA_PRIME_INFO_num(x->prime_infos); i++) {
  ------------------
  |  Branch (348:21): [True: 3.89k, False: 48]
  ------------------
  349|       |            /* print multi-prime info */
  350|  3.89k|            BIGNUM *bn = NULL;
  351|  3.89k|            RSA_PRIME_INFO *pinfo;
  352|  3.89k|            int j;
  353|       |
  354|  3.89k|            pinfo = sk_RSA_PRIME_INFO_value(x->prime_infos, i);
  355|  15.5k|            for (j = 0; j < 3; j++) {
  ------------------
  |  Branch (355:25): [True: 11.6k, False: 3.89k]
  ------------------
  356|  11.6k|                if (!BIO_indent(bp, off, 128))
  ------------------
  |  Branch (356:21): [True: 0, False: 11.6k]
  ------------------
  357|      0|                    goto err;
  358|  11.6k|                switch (j) {
  359|  3.89k|                case 0:
  ------------------
  |  Branch (359:17): [True: 3.89k, False: 7.78k]
  ------------------
  360|  3.89k|                    if (BIO_printf(bp, "prime%d:", i + 3) <= 0)
  ------------------
  |  Branch (360:25): [True: 0, False: 3.89k]
  ------------------
  361|      0|                        goto err;
  362|  3.89k|                    bn = pinfo->r;
  363|  3.89k|                    break;
  364|  3.89k|                case 1:
  ------------------
  |  Branch (364:17): [True: 3.89k, False: 7.78k]
  ------------------
  365|  3.89k|                    if (BIO_printf(bp, "exponent%d:", i + 3) <= 0)
  ------------------
  |  Branch (365:25): [True: 0, False: 3.89k]
  ------------------
  366|      0|                        goto err;
  367|  3.89k|                    bn = pinfo->d;
  368|  3.89k|                    break;
  369|  3.89k|                case 2:
  ------------------
  |  Branch (369:17): [True: 3.89k, False: 7.78k]
  ------------------
  370|  3.89k|                    if (BIO_printf(bp, "coefficient%d:", i + 3) <= 0)
  ------------------
  |  Branch (370:25): [True: 0, False: 3.89k]
  ------------------
  371|      0|                        goto err;
  372|  3.89k|                    bn = pinfo->t;
  373|  3.89k|                    break;
  374|      0|                default:
  ------------------
  |  Branch (374:17): [True: 0, False: 11.6k]
  ------------------
  375|      0|                    break;
  376|  11.6k|                }
  377|  11.6k|                if (!ASN1_bn_print(bp, "", bn, NULL, off))
  ------------------
  |  Branch (377:21): [True: 0, False: 11.6k]
  ------------------
  378|      0|                    goto err;
  379|  11.6k|            }
  380|  3.89k|        }
  381|     48|    }
  382|     48|    if (pkey_is_pss(pkey) && !rsa_pss_param_print(bp, 1, x->pss, off))
  ------------------
  |  |  151|     96|#define pkey_is_pss(pkey) (pkey->ameth->pkey_id == EVP_PKEY_RSA_PSS)
  |  |  ------------------
  |  |  |  |   62|     48|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  |  |  ------------------
  |  |  |  |  |  |  583|     48|#define NID_rsassaPss           912
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (151:27): [True: 0, False: 48]
  |  |  ------------------
  ------------------
  |  Branch (382:30): [True: 0, False: 0]
  ------------------
  383|      0|        goto err;
  384|     48|    ret = 1;
  385|     48| err:
  386|     48|    return ret;
  387|     48|}
rsa_ameth.c:rsa_priv_decode:
  174|      4|{
  175|      4|    int ret = 0;
  176|      4|    RSA *rsa = ossl_rsa_key_from_pkcs8(p8, NULL, NULL);
  177|       |
  178|      4|    if (rsa != NULL) {
  ------------------
  |  Branch (178:9): [True: 0, False: 4]
  ------------------
  179|      0|        ret = 1;
  180|      0|        EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa);
  181|      0|    }
  182|      4|    return ret;
  183|      4|}
rsa_ameth.c:rsa_priv_print:
  397|     48|{
  398|     48|    return pkey_rsa_print(bp, pkey, indent, 1);
  399|     48|}
rsa_ameth.c:int_rsa_free:
  201|  8.38k|{
  202|  8.38k|    RSA_free(pkey->pkey.rsa);
  203|  8.38k|}
rsa_ameth.c:old_rsa_priv_decode:
  131|  8.35k|{
  132|  8.35k|    RSA *rsa;
  133|       |
  134|  8.35k|    if ((rsa = d2i_RSAPrivateKey(NULL, pder, derlen)) == NULL)
  ------------------
  |  Branch (134:9): [True: 8.30k, False: 48]
  ------------------
  135|  8.30k|        return 0;
  136|     48|    EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa);
  137|     48|    return 1;
  138|  8.35k|}
rsa_ameth.c:old_rsa_priv_encode:
  141|     48|{
  142|     48|    return i2d_RSAPrivateKey(pkey->pkey.rsa, pder);
  143|     48|}

rsa_asn1.c:rsa_cb:
   30|   131k|{
   31|   131k|    if (operation == ASN1_OP_NEW_PRE) {
  ------------------
  |  |  742|   131k|# define ASN1_OP_NEW_PRE         0
  ------------------
  |  Branch (31:9): [True: 42.4k, False: 88.9k]
  ------------------
   32|  42.4k|        *pval = (ASN1_VALUE *)RSA_new();
   33|  42.4k|        if (*pval != NULL)
  ------------------
  |  Branch (33:13): [True: 42.4k, False: 0]
  ------------------
   34|  42.4k|            return 2;
   35|      0|        return 0;
   36|  88.9k|    } else if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  88.9k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (36:16): [True: 41.9k, False: 46.9k]
  ------------------
   37|  41.9k|        RSA_free((RSA *)*pval);
   38|  41.9k|        *pval = NULL;
   39|  41.9k|        return 2;
   40|  46.9k|    } else if (operation == ASN1_OP_D2I_POST) {
  ------------------
  |  |  747|  46.9k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (40:16): [True: 938, False: 46.0k]
  ------------------
   41|    938|        if (((RSA *)*pval)->version != RSA_ASN1_VERSION_MULTI) {
  ------------------
  |  |   60|    938|#  define RSA_ASN1_VERSION_MULTI          1
  ------------------
  |  Branch (41:13): [True: 350, False: 588]
  ------------------
   42|       |            /* not a multi-prime key, skip */
   43|    350|            return 1;
   44|    350|        }
   45|    588|        return (ossl_rsa_multip_calc_product((RSA *)*pval) == 1) ? 2 : 0;
  ------------------
  |  Branch (45:16): [True: 582, False: 6]
  ------------------
   46|    938|    }
   47|  46.0k|    return 1;
   48|   131k|}
rsa_asn1.c:rsa_pss_cb:
   79|  44.5k|{
   80|  44.5k|    if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  44.5k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (80:9): [True: 8.87k, False: 35.6k]
  ------------------
   81|  8.87k|        RSA_PSS_PARAMS *pss = (RSA_PSS_PARAMS *)*pval;
   82|  8.87k|        X509_ALGOR_free(pss->maskHash);
   83|  8.87k|    }
   84|  44.5k|    return 1;
   85|  44.5k|}
rsa_asn1.c:rsa_oaep_cb:
  100|  44.5k|{
  101|  44.5k|    if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  744|  44.5k|# define ASN1_OP_FREE_PRE        2
  ------------------
  |  Branch (101:9): [True: 8.87k, False: 35.6k]
  ------------------
  102|  8.87k|        RSA_OAEP_PARAMS *oaep = (RSA_OAEP_PARAMS *)*pval;
  103|  8.87k|        X509_ALGOR_free(oaep->maskHash);
  104|  8.87k|    }
  105|  44.5k|    return 1;
  106|  44.5k|}

ossl_rsa_todata:
  255|    374|{
  256|    374|    int ret = 0;
  257|    374|    const BIGNUM *rsa_d = NULL, *rsa_n = NULL, *rsa_e = NULL;
  258|    374|    STACK_OF(BIGNUM_const) *factors = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|    374|# define STACK_OF(type) struct stack_st_##type
  ------------------
  259|    374|    STACK_OF(BIGNUM_const) *exps = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|    374|# define STACK_OF(type) struct stack_st_##type
  ------------------
  260|    374|    STACK_OF(BIGNUM_const) *coeffs = sk_BIGNUM_const_new_null();
  ------------------
  |  |   31|    374|# define STACK_OF(type) struct stack_st_##type
  ------------------
  261|       |
  262|    374|    if (rsa == NULL || factors == NULL || exps == NULL || coeffs == NULL)
  ------------------
  |  Branch (262:9): [True: 0, False: 374]
  |  Branch (262:24): [True: 0, False: 374]
  |  Branch (262:43): [True: 0, False: 374]
  |  Branch (262:59): [True: 0, False: 374]
  ------------------
  263|      0|        goto err;
  264|       |
  265|    374|    RSA_get0_key(rsa, &rsa_n, &rsa_e, &rsa_d);
  266|    374|    ossl_rsa_get0_all_params(rsa, factors, exps, coeffs);
  267|       |
  268|    374|    if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_N, rsa_n)
  ------------------
  |  |  434|    374|# define OSSL_PKEY_PARAM_RSA_N "n"
  ------------------
  |  Branch (268:9): [True: 0, False: 374]
  ------------------
  269|    374|        || !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_E, rsa_e))
  ------------------
  |  |  409|    374|# define OSSL_PKEY_PARAM_RSA_E "e"
  ------------------
  |  Branch (269:12): [True: 0, False: 374]
  ------------------
  270|      0|        goto err;
  271|       |
  272|       |    /* Check private key data integrity */
  273|    374|    if (include_private && rsa_d != NULL) {
  ------------------
  |  Branch (273:9): [True: 374, False: 0]
  |  Branch (273:28): [True: 361, False: 13]
  ------------------
  274|       |
  275|    361|        if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_D,
  ------------------
  |  |  405|    361|# define OSSL_PKEY_PARAM_RSA_D "d"
  ------------------
  |  Branch (275:13): [True: 0, False: 361]
  ------------------
  276|    361|                                     rsa_d)
  277|    361|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (277:16): [True: 0, False: 361]
  ------------------
  278|    361|                                                  ossl_rsa_mp_factor_names,
  279|    361|                                                  factors)
  280|    361|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (280:16): [True: 0, False: 361]
  ------------------
  281|    361|                                                  ossl_rsa_mp_exp_names, exps)
  282|    361|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (282:16): [True: 0, False: 361]
  ------------------
  283|    361|                                                  ossl_rsa_mp_coeff_names,
  284|    361|                                                  coeffs))
  285|      0|            goto err;
  286|    361|    }
  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|    374|    ret = 1;
  294|    374| err:
  295|    374|    sk_BIGNUM_const_free(factors);
  296|    374|    sk_BIGNUM_const_free(exps);
  297|    374|    sk_BIGNUM_const_free(coeffs);
  298|    374|    return ret;
  299|    374|}
ossl_rsa_pss_params_30_todata:
  303|      3|{
  304|      3|    if (!ossl_rsa_pss_params_30_is_unrestricted(pss)) {
  ------------------
  |  Branch (304:9): [True: 2, False: 1]
  ------------------
  305|      2|        int hashalg_nid = ossl_rsa_pss_params_30_hashalg(pss);
  306|      2|        int maskgenalg_nid = ossl_rsa_pss_params_30_maskgenalg(pss);
  307|      2|        int maskgenhashalg_nid = ossl_rsa_pss_params_30_maskgenhashalg(pss);
  308|      2|        int saltlen = ossl_rsa_pss_params_30_saltlen(pss);
  309|      2|        int default_hashalg_nid = ossl_rsa_pss_params_30_hashalg(NULL);
  310|      2|        int default_maskgenalg_nid = ossl_rsa_pss_params_30_maskgenalg(NULL);
  311|      2|        int default_maskgenhashalg_nid =
  312|      2|                ossl_rsa_pss_params_30_maskgenhashalg(NULL);
  313|      2|        const char *mdname =
  314|      2|            (hashalg_nid == default_hashalg_nid
  ------------------
  |  Branch (314:14): [True: 2, False: 0]
  ------------------
  315|      2|             ? NULL : ossl_rsa_oaeppss_nid2name(hashalg_nid));
  316|      2|        const char *mgfname =
  317|      2|            (maskgenalg_nid == default_maskgenalg_nid
  ------------------
  |  Branch (317:14): [True: 2, False: 0]
  ------------------
  318|      2|             ? NULL : ossl_rsa_oaeppss_nid2name(maskgenalg_nid));
  319|      2|        const char *mgf1mdname =
  320|      2|            (maskgenhashalg_nid == default_maskgenhashalg_nid
  ------------------
  |  Branch (320:14): [True: 2, False: 0]
  ------------------
  321|      2|             ? NULL : ossl_rsa_oaeppss_nid2name(maskgenhashalg_nid));
  322|      2|        const char *key_md = OSSL_PKEY_PARAM_RSA_DIGEST;
  ------------------
  |  |  407|      2|# define OSSL_PKEY_PARAM_RSA_DIGEST OSSL_PKEY_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  339|      2|# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|      2|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  323|      2|        const char *key_mgf = OSSL_PKEY_PARAM_RSA_MASKGENFUNC;
  ------------------
  |  |  432|      2|# define OSSL_PKEY_PARAM_RSA_MASKGENFUNC OSSL_PKEY_PARAM_MASKGENFUNC
  |  |  ------------------
  |  |  |  |  386|      2|# define OSSL_PKEY_PARAM_MASKGENFUNC "mgf"
  |  |  ------------------
  ------------------
  324|      2|        const char *key_mgf1_md = OSSL_PKEY_PARAM_RSA_MGF1_DIGEST;
  ------------------
  |  |  433|      2|# define OSSL_PKEY_PARAM_RSA_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
  |  |  ------------------
  |  |  |  |  388|      2|# define OSSL_PKEY_PARAM_MGF1_DIGEST "mgf1-digest"
  |  |  ------------------
  ------------------
  325|      2|        const char *key_saltlen = OSSL_PKEY_PARAM_RSA_PSS_SALTLEN;
  ------------------
  |  |  436|      2|# 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|      2|        if ((mdname != NULL
  ------------------
  |  Branch (332:14): [True: 0, False: 2]
  ------------------
  333|      2|             && !ossl_param_build_set_utf8_string(bld, params, key_md, mdname))
  ------------------
  |  Branch (333:17): [True: 0, False: 0]
  ------------------
  334|      2|            || (mgfname != NULL
  ------------------
  |  Branch (334:17): [True: 0, False: 2]
  ------------------
  335|      2|                && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (335:20): [True: 0, False: 0]
  ------------------
  336|      0|                                                     key_mgf, mgfname))
  337|      2|            || (mgf1mdname != NULL
  ------------------
  |  Branch (337:17): [True: 0, False: 2]
  ------------------
  338|      2|                && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (338:20): [True: 0, False: 0]
  ------------------
  339|      0|                                                     key_mgf1_md, mgf1mdname))
  340|      2|            || (!ossl_param_build_set_int(bld, params, key_saltlen, saltlen)))
  ------------------
  |  Branch (340:16): [True: 0, False: 2]
  ------------------
  341|      0|            return 0;
  342|      2|    }
  343|      3|    return 1;
  344|      3|}
ossl_rsa_is_foreign:
  450|     61|{
  451|     61|#ifndef FIPS_MODULE
  452|     61|    if (rsa->engine != NULL || RSA_get_method(rsa) != RSA_PKCS1_OpenSSL())
  ------------------
  |  Branch (452:9): [True: 0, False: 61]
  |  Branch (452:32): [True: 0, False: 61]
  ------------------
  453|      0|        return 1;
  454|     61|#endif
  455|     61|    return 0;
  456|     61|}
ossl_rsa_pss_decode:
  562|      3|{
  563|      3|    RSA_PSS_PARAMS *pss;
  564|       |
  565|      3|    pss = ASN1_TYPE_unpack_sequence(ASN1_ITEM_rptr(RSA_PSS_PARAMS),
  ------------------
  |  |  426|      3|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  566|      3|                                    alg->parameter);
  567|       |
  568|      3|    if (pss == NULL)
  ------------------
  |  Branch (568:9): [True: 1, False: 2]
  ------------------
  569|      1|        return NULL;
  570|       |
  571|      2|    if (pss->maskGenAlgorithm != NULL) {
  ------------------
  |  Branch (571:9): [True: 0, False: 2]
  ------------------
  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|      2|    return pss;
  580|      2|}
ossl_rsa_pss_get_param_unverified:
  624|      2|{
  625|      2|    RSA_PSS_PARAMS_30 pss_params;
  626|       |
  627|       |    /* Get the defaults from the ONE place */
  628|      2|    (void)ossl_rsa_pss_params_30_set_defaults(&pss_params);
  629|       |
  630|      2|    if (pss == NULL)
  ------------------
  |  Branch (630:9): [True: 0, False: 2]
  ------------------
  631|      0|        return 0;
  632|      2|    *pmd = ossl_x509_algor_get_md(pss->hashAlgorithm);
  633|      2|    if (*pmd == NULL)
  ------------------
  |  Branch (633:9): [True: 0, False: 2]
  ------------------
  634|      0|        return 0;
  635|      2|    *pmgf1md = ossl_x509_algor_get_md(pss->maskHash);
  636|      2|    if (*pmgf1md == NULL)
  ------------------
  |  Branch (636:9): [True: 0, False: 2]
  ------------------
  637|      0|        return 0;
  638|      2|    if (pss->saltLength)
  ------------------
  |  Branch (638:9): [True: 0, False: 2]
  ------------------
  639|      0|        *psaltlen = ASN1_INTEGER_get(pss->saltLength);
  640|      2|    else
  641|      2|        *psaltlen = ossl_rsa_pss_params_30_saltlen(&pss_params);
  642|      2|    if (pss->trailerField)
  ------------------
  |  Branch (642:9): [True: 0, False: 2]
  ------------------
  643|      0|        *ptrailerField = ASN1_INTEGER_get(pss->trailerField);
  644|      2|    else
  645|      2|        *ptrailerField = ossl_rsa_pss_params_30_trailerfield(&pss_params);
  646|       |
  647|      2|    return 1;
  648|      2|}
ossl_rsa_param_decode:
  651|     22|{
  652|     22|    RSA_PSS_PARAMS *pss;
  653|     22|    const ASN1_OBJECT *algoid;
  654|     22|    const void *algp;
  655|     22|    int algptype;
  656|       |
  657|     22|    X509_ALGOR_get0(&algoid, &algptype, &algp, alg);
  658|     22|    if (OBJ_obj2nid(algoid) != EVP_PKEY_RSA_PSS)
  ------------------
  |  |   62|     22|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|     22|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (658:9): [True: 12, False: 10]
  ------------------
  659|     12|        return 1;
  660|     10|    if (algptype == V_ASN1_UNDEF)
  ------------------
  |  |   60|     10|# define V_ASN1_UNDEF                    -1
  ------------------
  |  Branch (660:9): [True: 1, False: 9]
  ------------------
  661|      1|        return 1;
  662|      9|    if (algptype != V_ASN1_SEQUENCE) {
  ------------------
  |  |   74|      9|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (662:9): [True: 6, False: 3]
  ------------------
  663|      6|        ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS);
  ------------------
  |  |  401|      6|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      6|    (ERR_new(),                                                 \
  |  |  |  |  404|      6|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      6|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      6|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      6|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      6|     ERR_set_error)
  |  |  ------------------
  ------------------
  664|      6|        return 0;
  665|      6|    }
  666|      3|    if ((pss = ossl_rsa_pss_decode(alg)) == NULL
  ------------------
  |  Branch (666:9): [True: 1, False: 2]
  ------------------
  667|      3|        || !ossl_rsa_set0_pss_params(rsa, pss)) {
  ------------------
  |  Branch (667:12): [True: 0, False: 2]
  ------------------
  668|      1|        RSA_PSS_PARAMS_free(pss);
  669|      1|        return 0;
  670|      1|    }
  671|      2|    if (!ossl_rsa_sync_to_pss_params_30(rsa))
  ------------------
  |  Branch (671:9): [True: 0, False: 2]
  ------------------
  672|      0|        return 0;
  673|      2|    return 1;
  674|      2|}
ossl_rsa_key_from_pkcs8:
  678|     11|{
  679|     11|    const unsigned char *p;
  680|     11|    RSA *rsa;
  681|     11|    int pklen;
  682|     11|    const X509_ALGOR *alg;
  683|       |
  684|     11|    if (!PKCS8_pkey_get0(NULL, &p, &pklen, &alg, p8inf))
  ------------------
  |  Branch (684:9): [True: 0, False: 11]
  ------------------
  685|      0|        return 0;
  686|     11|    rsa = d2i_RSAPrivateKey(NULL, &p, pklen);
  687|     11|    if (rsa == NULL) {
  ------------------
  |  Branch (687:9): [True: 5, False: 6]
  ------------------
  688|      5|        ERR_raise(ERR_LIB_RSA, ERR_R_RSA_LIB);
  ------------------
  |  |  401|      5|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      5|    (ERR_new(),                                                 \
  |  |  |  |  404|      5|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      5|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      5|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      5|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      5|     ERR_set_error)
  |  |  ------------------
  ------------------
  689|      5|        return NULL;
  690|      5|    }
  691|      6|    if (!ossl_rsa_param_decode(rsa, alg)) {
  ------------------
  |  Branch (691:9): [True: 4, False: 2]
  ------------------
  692|      4|        RSA_free(rsa);
  693|      4|        return NULL;
  694|      4|    }
  695|       |
  696|      2|    RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK);
  ------------------
  |  |  117|      2|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  697|      2|    switch (OBJ_obj2nid(alg->algorithm)) {
  698|      1|    case EVP_PKEY_RSA:
  ------------------
  |  |   60|      1|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|      1|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (698:5): [True: 1, False: 1]
  ------------------
  699|      1|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSA);
  ------------------
  |  |  118|      1|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  700|      1|        break;
  701|      1|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   62|      1|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      1|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (701:5): [True: 1, False: 1]
  ------------------
  702|      1|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSASSAPSS);
  ------------------
  |  |  119|      1|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  703|      1|        break;
  704|      0|    default:
  ------------------
  |  Branch (704:5): [True: 0, False: 2]
  ------------------
  705|       |        /* Leave the type bits zero */
  706|      0|        break;
  707|      2|    }
  708|       |
  709|      2|    return rsa;
  710|      2|}
rsa_backend.c:ossl_rsa_sync_to_pss_params_30:
  583|      2|{
  584|      2|    const RSA_PSS_PARAMS *legacy_pss = NULL;
  585|      2|    RSA_PSS_PARAMS_30 *pss = NULL;
  586|       |
  587|      2|    if (rsa != NULL
  ------------------
  |  Branch (587:9): [True: 2, False: 0]
  ------------------
  588|      2|        && (legacy_pss = RSA_get0_pss_params(rsa)) != NULL
  ------------------
  |  Branch (588:12): [True: 2, False: 0]
  ------------------
  589|      2|        && (pss = ossl_rsa_get0_pss_params_30(rsa)) != NULL) {
  ------------------
  |  Branch (589:12): [True: 2, False: 0]
  ------------------
  590|      2|        const EVP_MD *md = NULL, *mgf1md = NULL;
  591|      2|        int md_nid, mgf1md_nid, saltlen, trailerField;
  592|      2|        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|      2|        if (!ossl_rsa_pss_get_param_unverified(legacy_pss, &md, &mgf1md,
  ------------------
  |  Branch (603:13): [True: 0, False: 2]
  ------------------
  604|      2|                                               &saltlen, &trailerField))
  605|      0|            return 0;
  606|      2|        md_nid = EVP_MD_get_type(md);
  607|      2|        mgf1md_nid = EVP_MD_get_type(mgf1md);
  608|      2|        if (!ossl_rsa_pss_params_30_set_defaults(&pss_params)
  ------------------
  |  Branch (608:13): [True: 0, False: 2]
  ------------------
  609|      2|            || !ossl_rsa_pss_params_30_set_hashalg(&pss_params, md_nid)
  ------------------
  |  Branch (609:16): [True: 0, False: 2]
  ------------------
  610|      2|            || !ossl_rsa_pss_params_30_set_maskgenhashalg(&pss_params,
  ------------------
  |  Branch (610:16): [True: 0, False: 2]
  ------------------
  611|      2|                                                          mgf1md_nid)
  612|      2|            || !ossl_rsa_pss_params_30_set_saltlen(&pss_params, saltlen)
  ------------------
  |  Branch (612:16): [True: 0, False: 2]
  ------------------
  613|      2|            || !ossl_rsa_pss_params_30_set_trailerfield(&pss_params,
  ------------------
  |  Branch (613:16): [True: 0, False: 2]
  ------------------
  614|      2|                                                        trailerField))
  615|      0|            return 0;
  616|      2|        *pss = pss_params;
  617|      2|    }
  618|      2|    return 1;
  619|      2|}

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

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|  42.4k|{
   36|  42.4k|    return rsa_new_intern(NULL, NULL);
   37|  42.4k|}
RSA_get_method:
   40|     61|{
   41|     61|    return rsa->meth;
   42|     61|}
RSA_free:
  137|  89.0k|{
  138|  89.0k|    int i;
  139|       |
  140|  89.0k|    if (r == NULL)
  ------------------
  |  Branch (140:9): [True: 46.5k, False: 42.4k]
  ------------------
  141|  46.5k|        return;
  142|       |
  143|  42.4k|    CRYPTO_DOWN_REF(&r->references, &i);
  144|  42.4k|    REF_PRINT_COUNT("RSA", r);
  ------------------
  |  |  289|  42.4k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  42.4k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  42.4k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  42.4k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|  42.4k|    if (i > 0)
  ------------------
  |  Branch (145:9): [True: 13, False: 42.4k]
  ------------------
  146|     13|        return;
  147|  42.4k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|  42.4k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 42.4k]
  |  |  ------------------
  ------------------
  148|       |
  149|  42.4k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (149:9): [True: 42.4k, False: 0]
  |  Branch (149:28): [True: 42.4k, False: 0]
  ------------------
  150|  42.4k|        r->meth->finish(r);
  151|  42.4k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  152|  42.4k|    ENGINE_finish(r->engine);
  153|  42.4k|#endif
  154|       |
  155|  42.4k|#ifndef FIPS_MODULE
  156|  42.4k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data);
  ------------------
  |  |  237|  42.4k|# define CRYPTO_EX_INDEX_RSA              9
  ------------------
  157|  42.4k|#endif
  158|       |
  159|  42.4k|    CRYPTO_THREAD_lock_free(r->lock);
  160|  42.4k|    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|  42.4k|    BN_free(r->n);
  167|  42.4k|    BN_free(r->e);
  168|  42.4k|#endif
  169|  42.4k|    BN_clear_free(r->d);
  170|  42.4k|    BN_clear_free(r->p);
  171|  42.4k|    BN_clear_free(r->q);
  172|  42.4k|    BN_clear_free(r->dmp1);
  173|  42.4k|    BN_clear_free(r->dmq1);
  174|  42.4k|    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|  42.4k|#ifndef FIPS_MODULE
  181|  42.4k|    RSA_PSS_PARAMS_free(r->pss);
  182|  42.4k|    sk_RSA_PRIME_INFO_pop_free(r->prime_infos, ossl_rsa_multip_info_free);
  183|  42.4k|#endif
  184|  42.4k|    BN_BLINDING_free(r->blinding);
  185|  42.4k|    BN_BLINDING_free(r->mt_blinding);
  186|  42.4k|    OPENSSL_free(r);
  ------------------
  |  |  115|  42.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  42.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  42.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  187|  42.4k|}
RSA_up_ref:
  190|     13|{
  191|     13|    int i;
  192|       |
  193|     13|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (193:9): [True: 0, False: 13]
  ------------------
  194|      0|        return 0;
  195|       |
  196|     13|    REF_PRINT_COUNT("RSA", r);
  ------------------
  |  |  289|     13|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|     13|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|     13|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|     13|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|     13|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  281|     13|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 13]
  |  |  ------------------
  ------------------
  198|     13|    return i > 1 ? 1 : 0;
  ------------------
  |  Branch (198:12): [True: 13, False: 0]
  ------------------
  199|     13|}
ossl_rsa_set0_libctx:
  207|    374|{
  208|    374|    r->libctx = libctx;
  209|    374|}
ossl_ifc_ffc_compute_security_bits:
  323|    140|{
  324|    140|    uint64_t x;
  325|    140|    uint32_t lx;
  326|    140|    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|    140|    switch (n) {
  ------------------
  |  Branch (333:13): [True: 133, False: 7]
  ------------------
  334|      2|    case 2048:      /* SP 800-56B rev 2 Appendix D and FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (334:5): [True: 2, False: 138]
  ------------------
  335|      2|        return 112;
  336|      1|    case 3072:      /* SP 800-56B rev 2 Appendix D and FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (336:5): [True: 1, False: 139]
  ------------------
  337|      1|        return 128;
  338|      2|    case 4096:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (338:5): [True: 2, False: 138]
  ------------------
  339|      2|        return 152;
  340|      1|    case 6144:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (340:5): [True: 1, False: 139]
  ------------------
  341|      1|        return 176;
  342|      1|    case 7680:      /* FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (342:5): [True: 1, False: 139]
  ------------------
  343|      1|        return 192;
  344|      0|    case 8192:      /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (344:5): [True: 0, False: 140]
  ------------------
  345|      0|        return 200;
  346|      0|    case 15360:     /* FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (346:5): [True: 0, False: 140]
  ------------------
  347|      0|        return 256;
  348|    140|    }
  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|    133|    if (n >= 687737)
  ------------------
  |  Branch (356:9): [True: 0, False: 133]
  ------------------
  357|      0|        return 1200;
  358|    133|    if (n < 8)
  ------------------
  |  Branch (358:9): [True: 11, False: 122]
  ------------------
  359|     11|        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|    122|    if (n <= 7680)
  ------------------
  |  Branch (366:9): [True: 100, False: 22]
  ------------------
  367|    100|        cap = 192;
  368|     22|    else if (n <= 15360)
  ------------------
  |  Branch (368:14): [True: 10, False: 12]
  ------------------
  369|     10|        cap = 256;
  370|     12|    else
  371|     12|        cap = 1200;
  372|       |
  373|    122|    x = n * (uint64_t)log_2;
  374|    122|    lx = ilog_e(x);
  375|    122|    y = (uint16_t)((mul2(c1_923, icbrt64(mul2(mul2(x, lx), lx))) - c4_690)
  376|    122|                   / log_2);
  377|    122|    y = (y + 4) & ~7;
  378|    122|    if (y > cap)
  ------------------
  |  Branch (378:9): [True: 2, False: 120]
  ------------------
  379|      2|        y = cap;
  380|    122|    return y;
  381|    133|}
RSA_security_bits:
  386|    374|{
  387|    374|    int bits = BN_num_bits(rsa->n);
  388|       |
  389|    374|#ifndef FIPS_MODULE
  390|    374|    if (rsa->version == RSA_ASN1_VERSION_MULTI) {
  ------------------
  |  |   60|    374|#  define RSA_ASN1_VERSION_MULTI          1
  ------------------
  |  Branch (390:9): [True: 251, False: 123]
  ------------------
  391|       |        /* This ought to mean that we have private key at hand. */
  392|    251|        int ex_primes = sk_RSA_PRIME_INFO_num(rsa->prime_infos);
  393|       |
  394|    251|        if (ex_primes <= 0 || (ex_primes + 2) > ossl_rsa_multip_cap(bits))
  ------------------
  |  Branch (394:13): [True: 0, False: 251]
  |  Branch (394:31): [True: 234, False: 17]
  ------------------
  395|    234|            return 0;
  396|    251|    }
  397|    140|#endif
  398|    140|    return ossl_ifc_ffc_compute_security_bits(bits);
  399|    374|}
RSA_get0_key:
  556|    735|{
  557|    735|    if (n != NULL)
  ------------------
  |  Branch (557:9): [True: 735, False: 0]
  ------------------
  558|    735|        *n = r->n;
  559|    735|    if (e != NULL)
  ------------------
  |  Branch (559:9): [True: 735, False: 0]
  ------------------
  560|    735|        *e = r->e;
  561|    735|    if (d != NULL)
  ------------------
  |  Branch (561:9): [True: 735, False: 0]
  ------------------
  562|    735|        *d = r->d;
  563|    735|}
RSA_get_multi_prime_extra_count:
  575|    722|{
  576|    722|    int pnum;
  577|       |
  578|    722|    pnum = sk_RSA_PRIME_INFO_num(r->prime_infos);
  579|    722|    if (pnum <= 0)
  ------------------
  |  Branch (579:9): [True: 188, False: 534]
  ------------------
  580|    188|        pnum = 0;
  581|    722|    return pnum;
  582|    722|}
RSA_get0_n:
  646|    735|{
  647|    735|    return r->n;
  648|    735|}
RSA_get0_d:
  656|    361|{
  657|    361|    return r->d;
  658|    361|}
RSA_get0_p:
  661|  1.45k|{
  662|  1.45k|    return r->p;
  663|  1.45k|}
RSA_get0_q:
  666|    722|{
  667|    722|    return r->q;
  668|    722|}
RSA_get0_dmp1:
  671|    722|{
  672|    722|    return r->dmp1;
  673|    722|}
RSA_get0_dmq1:
  676|    722|{
  677|    722|    return r->dmq1;
  678|    722|}
RSA_get0_iqmp:
  681|    722|{
  682|    722|    return r->iqmp;
  683|    722|}
RSA_get0_pss_params:
  686|      2|{
  687|       |#ifdef FIPS_MODULE
  688|       |    return NULL;
  689|       |#else
  690|      2|    return r->pss;
  691|      2|#endif
  692|      2|}
ossl_rsa_set0_pss_params:
  696|      2|{
  697|       |#ifdef FIPS_MODULE
  698|       |    return 0;
  699|       |#else
  700|      2|    RSA_PSS_PARAMS_free(r->pss);
  701|      2|    r->pss = pss;
  702|      2|    return 1;
  703|      2|#endif
  704|      2|}
ossl_rsa_get0_pss_params_30:
  708|    738|{
  709|    738|    return &r->pss_params;
  710|    738|}
RSA_clear_flags:
  713|     15|{
  714|     15|    r->flags &= ~flags;
  715|     15|}
RSA_test_flags:
  718|  1.84k|{
  719|  1.84k|    return r->flags & flags;
  720|  1.84k|}
RSA_set_flags:
  723|     15|{
  724|     15|    r->flags |= flags;
  725|     15|}
ossl_rsa_get0_all_params:
  877|    735|{
  878|    735|#ifndef FIPS_MODULE
  879|    735|    RSA_PRIME_INFO *pinfo;
  880|    735|    int i, pnum;
  881|    735|#endif
  882|       |
  883|    735|    if (r == NULL)
  ------------------
  |  Branch (883:9): [True: 0, False: 735]
  ------------------
  884|      0|        return 0;
  885|       |
  886|       |    /* If |p| is NULL, there are no CRT parameters */
  887|    735|    if (RSA_get0_p(r) == NULL)
  ------------------
  |  Branch (887:9): [True: 13, False: 722]
  ------------------
  888|     13|        return 1;
  889|       |
  890|    722|    sk_BIGNUM_const_push(primes, RSA_get0_p(r));
  891|    722|    sk_BIGNUM_const_push(primes, RSA_get0_q(r));
  892|    722|    sk_BIGNUM_const_push(exps, RSA_get0_dmp1(r));
  893|    722|    sk_BIGNUM_const_push(exps, RSA_get0_dmq1(r));
  894|    722|    sk_BIGNUM_const_push(coeffs, RSA_get0_iqmp(r));
  895|       |
  896|    722|#ifndef FIPS_MODULE
  897|    722|    pnum = RSA_get_multi_prime_extra_count(r);
  898|  56.4k|    for (i = 0; i < pnum; i++) {
  ------------------
  |  Branch (898:17): [True: 55.7k, False: 722]
  ------------------
  899|  55.7k|        pinfo = sk_RSA_PRIME_INFO_value(r->prime_infos, i);
  900|  55.7k|        sk_BIGNUM_const_push(primes, pinfo->r);
  901|  55.7k|        sk_BIGNUM_const_push(exps, pinfo->d);
  902|  55.7k|        sk_BIGNUM_const_push(coeffs, pinfo->t);
  903|  55.7k|    }
  904|    722|#endif
  905|       |
  906|    722|    return 1;
  907|    735|}
rsa_lib.c:rsa_new_intern:
   76|  42.4k|{
   77|  42.4k|    RSA *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  42.4k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  42.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  42.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   78|       |
   79|  42.4k|    if (ret == NULL)
  ------------------
  |  Branch (79:9): [True: 0, False: 42.4k]
  ------------------
   80|      0|        return NULL;
   81|       |
   82|  42.4k|    ret->lock = CRYPTO_THREAD_lock_new();
   83|  42.4k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (83:9): [True: 0, False: 42.4k]
  ------------------
   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|  42.4k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 42.4k]
  ------------------
   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|  42.4k|    ret->libctx = libctx;
   96|  42.4k|    ret->meth = RSA_get_default_method();
   97|  42.4k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   98|  42.4k|    ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |  477|  42.4k|#  define RSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
   99|  42.4k|    if (engine) {
  ------------------
  |  Branch (99:9): [True: 0, False: 42.4k]
  ------------------
  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|  42.4k|    } else {
  106|  42.4k|        ret->engine = ENGINE_get_default_RSA();
  107|  42.4k|    }
  108|  42.4k|    if (ret->engine) {
  ------------------
  |  Branch (108:9): [True: 0, False: 42.4k]
  ------------------
  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|  42.4k|#endif
  116|       |
  117|  42.4k|    ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |  477|  42.4k|#  define RSA_FLAG_NON_FIPS_ALLOW                 0x0400
  ------------------
  118|  42.4k|#ifndef FIPS_MODULE
  119|  42.4k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data)) {
  ------------------
  |  |  237|  42.4k|# define CRYPTO_EX_INDEX_RSA              9
  ------------------
  |  Branch (119:9): [True: 0, False: 42.4k]
  ------------------
  120|      0|        goto err;
  121|      0|    }
  122|  42.4k|#endif
  123|       |
  124|  42.4k|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (124:9): [True: 42.4k, False: 0]
  |  Branch (124:38): [True: 0, False: 42.4k]
  ------------------
  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|  42.4k|    return ret;
  130|       |
  131|      0| err:
  132|      0|    RSA_free(ret);
  133|      0|    return NULL;
  134|  42.4k|}
rsa_lib.c:ilog_e:
  280|    122|{
  281|    122|    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|    962|    while (v >= 2 * scale) {
  ------------------
  |  Branch (290:12): [True: 840, False: 122]
  ------------------
  291|    840|        v >>= 1;
  292|    840|        r += scale;
  293|    840|    }
  294|  2.31k|    for (i = scale / 2; i != 0; i /= 2) {
  ------------------
  |  Branch (294:25): [True: 2.19k, False: 122]
  ------------------
  295|  2.19k|        v = mul2(v, v);
  296|  2.19k|        if (v >= 2 * scale) {
  ------------------
  |  Branch (296:13): [True: 1.04k, False: 1.15k]
  ------------------
  297|  1.04k|            v >>= 1;
  298|  1.04k|            r += i;
  299|  1.04k|        }
  300|  2.19k|    }
  301|    122|    r = (r * (uint64_t)scale) / log_e;
  302|    122|    return r;
  303|    122|}
rsa_lib.c:mul2:
  244|  2.56k|{
  245|  2.56k|    return a * b / scale;
  246|  2.56k|}
rsa_lib.c:icbrt64:
  256|    122|{
  257|    122|    uint64_t r = 0;
  258|    122|    uint64_t b;
  259|    122|    int s;
  260|       |
  261|  2.80k|    for (s = 63; s >= 0; s -= 3) {
  ------------------
  |  Branch (261:18): [True: 2.68k, False: 122]
  ------------------
  262|  2.68k|        r <<= 1;
  263|  2.68k|        b = 3 * r * (r + 1) + 1;
  264|  2.68k|        if ((x >> s) >= b) {
  ------------------
  |  Branch (264:13): [True: 668, False: 2.01k]
  ------------------
  265|    668|            x -= b << s;
  266|    668|            r++;
  267|    668|        }
  268|  2.68k|    }
  269|    122|    return r * cbrt_scale;
  270|    122|}

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

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

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

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

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

ossl_sha3_reset:
   16|      4|{
   17|      4|    memset(ctx->A, 0, sizeof(ctx->A));
   18|      4|    ctx->bufsz = 0;
   19|      4|    ctx->xof_state = XOF_STATE_INIT;
  ------------------
  |  |   35|      4|#define XOF_STATE_INIT    0
  ------------------
   20|      4|}
ossl_sha3_init:
   23|      2|{
   24|      2|    size_t bsz = SHA3_BLOCKSIZE(bitlen);
  ------------------
  |  |   21|      2|# define SHA3_BLOCKSIZE(bitlen) (KECCAK1600_WIDTH - bitlen * 2) / 8
  |  |  ------------------
  |  |  |  |   18|      2|# define KECCAK1600_WIDTH 1600
  |  |  ------------------
  ------------------
   25|       |
   26|      2|    if (bsz <= sizeof(ctx->buf)) {
  ------------------
  |  Branch (26:9): [True: 2, False: 0]
  ------------------
   27|      2|        ossl_sha3_reset(ctx);
   28|      2|        ctx->block_size = bsz;
   29|      2|        ctx->md_size = bitlen / 8;
   30|      2|        ctx->pad = pad;
   31|      2|        return 1;
   32|      2|    }
   33|       |
   34|      0|    return 0;
   35|      2|}
ossl_keccak_init:
   38|      2|{
   39|      2|    int ret = ossl_sha3_init(ctx, pad, bitlen);
   40|       |
   41|      2|    if (ret)
  ------------------
  |  Branch (41:9): [True: 2, False: 0]
  ------------------
   42|      2|        ctx->md_size = mdlen / 8;
   43|      2|    return ret;
   44|      2|}
ossl_sha3_final:
   98|      2|{
   99|      2|    size_t bsz = ctx->block_size;
  100|      2|    size_t num = ctx->bufsz;
  101|       |
  102|      2|    if (outlen == 0)
  ------------------
  |  Branch (102:9): [True: 0, False: 2]
  ------------------
  103|      0|        return 1;
  104|      2|    if (ctx->xof_state == XOF_STATE_SQUEEZE
  ------------------
  |  |   38|      4|#define XOF_STATE_SQUEEZE 3
  ------------------
  |  Branch (104:9): [True: 0, False: 2]
  ------------------
  105|      2|        || ctx->xof_state == XOF_STATE_FINAL)
  ------------------
  |  |   37|      2|#define XOF_STATE_FINAL   2
  ------------------
  |  Branch (105:12): [True: 0, False: 2]
  ------------------
  106|      0|        return 0;
  107|       |
  108|       |    /*
  109|       |     * Pad the data with 10*1. Note that |num| can be |bsz - 1|
  110|       |     * in which case both byte operations below are performed on
  111|       |     * same byte...
  112|       |     */
  113|      2|    memset(ctx->buf + num, 0, bsz - num);
  114|      2|    ctx->buf[num] = ctx->pad;
  115|      2|    ctx->buf[bsz - 1] |= 0x80;
  116|       |
  117|      2|    (void)SHA3_absorb(ctx->A, ctx->buf, bsz, bsz);
  118|       |
  119|      2|    ctx->xof_state = XOF_STATE_FINAL;
  ------------------
  |  |   37|      2|#define XOF_STATE_FINAL   2
  ------------------
  120|      2|    SHA3_squeeze(ctx->A, out, outlen, bsz, 0);
  121|      2|    return 1;
  122|      2|}

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

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

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

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

OPENSSL_sk_set_cmp_func:
   37|  2.30k|{
   38|  2.30k|    OPENSSL_sk_compfunc old = sk->comp;
   39|       |
   40|  2.30k|    if (sk->comp != c)
  ------------------
  |  Branch (40:9): [True: 2.30k, False: 0]
  ------------------
   41|  2.30k|        sk->sorted = 0;
   42|  2.30k|    sk->comp = c;
   43|       |
   44|  2.30k|    return old;
   45|  2.30k|}
OPENSSL_sk_dup:
   48|  6.96k|{
   49|  6.96k|    OPENSSL_STACK *ret;
   50|       |
   51|  6.96k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|  6.96k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  6.96k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  6.96k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (51:9): [True: 0, False: 6.96k]
  ------------------
   52|      0|        goto err;
   53|       |
   54|  6.96k|    if (sk == NULL) {
  ------------------
  |  Branch (54:9): [True: 2, False: 6.96k]
  ------------------
   55|      2|        ret->num = 0;
   56|      2|        ret->sorted = 0;
   57|      2|        ret->comp = NULL;
   58|  6.96k|    } else {
   59|       |        /* direct structure assignment */
   60|  6.96k|        *ret = *sk;
   61|  6.96k|    }
   62|       |
   63|  6.96k|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (63:9): [True: 2, False: 6.96k]
  |  Branch (63:23): [True: 0, False: 6.96k]
  ------------------
   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|  6.96k|    ret->data = OPENSSL_malloc(sizeof(*ret->data) * sk->num_alloc);
  ------------------
  |  |  102|  6.96k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  6.96k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  6.96k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   72|  6.96k|    if (ret->data == NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 6.96k]
  ------------------
   73|      0|        goto err;
   74|  6.96k|    memcpy(ret->data, sk->data, sizeof(void *) * sk->num);
   75|  6.96k|    return ret;
   76|       |
   77|      0| err:
   78|      0|    OPENSSL_sk_free(ret);
   79|      0|    return NULL;
   80|  6.96k|}
OPENSSL_sk_deep_copy:
   85|  24.3k|{
   86|  24.3k|    OPENSSL_STACK *ret;
   87|  24.3k|    int i;
   88|       |
   89|  24.3k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|  24.3k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  24.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  24.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (89:9): [True: 0, False: 24.3k]
  ------------------
   90|      0|        goto err;
   91|       |
   92|  24.3k|    if (sk == NULL) {
  ------------------
  |  Branch (92:9): [True: 3, False: 24.3k]
  ------------------
   93|      3|        ret->num = 0;
   94|      3|        ret->sorted = 0;
   95|      3|        ret->comp = NULL;
   96|  24.3k|    } else {
   97|       |        /* direct structure assignment */
   98|  24.3k|        *ret = *sk;
   99|  24.3k|    }
  100|       |
  101|  24.3k|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (101:9): [True: 3, False: 24.3k]
  |  Branch (101:23): [True: 0, False: 24.3k]
  ------------------
  102|       |        /* postpone |ret| data allocation */
  103|      3|        ret->data = NULL;
  104|      3|        ret->num_alloc = 0;
  105|      3|        return ret;
  106|      3|    }
  107|       |
  108|  24.3k|    ret->num_alloc = sk->num > min_nodes ? sk->num : min_nodes;
  ------------------
  |  Branch (108:22): [True: 22.8k, False: 1.47k]
  ------------------
  109|  24.3k|    ret->data = OPENSSL_zalloc(sizeof(*ret->data) * ret->num_alloc);
  ------------------
  |  |  104|  24.3k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  24.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  24.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  110|  24.3k|    if (ret->data == NULL)
  ------------------
  |  Branch (110:9): [True: 0, False: 24.3k]
  ------------------
  111|      0|        goto err;
  112|       |
  113|   501k|    for (i = 0; i < ret->num; ++i) {
  ------------------
  |  Branch (113:17): [True: 476k, False: 24.3k]
  ------------------
  114|   476k|        if (sk->data[i] == NULL)
  ------------------
  |  Branch (114:13): [True: 0, False: 476k]
  ------------------
  115|      0|            continue;
  116|   476k|        if ((ret->data[i] = copy_func(sk->data[i])) == NULL) {
  ------------------
  |  Branch (116:13): [True: 0, False: 476k]
  ------------------
  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|   476k|    }
  123|  24.3k|    return ret;
  124|       |
  125|      0| err:
  126|      0|    OPENSSL_sk_free(ret);
  127|      0|    return NULL;
  128|  24.3k|}
OPENSSL_sk_new_null:
  131|  3.63M|{
  132|  3.63M|    return OPENSSL_sk_new_reserve(NULL, 0);
  133|  3.63M|}
OPENSSL_sk_new:
  136|    225|{
  137|    225|    return OPENSSL_sk_new_reserve(c, 0);
  138|    225|}
OPENSSL_sk_new_reserve:
  227|  3.63M|{
  228|  3.63M|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |  104|  3.63M|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.63M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.63M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  229|       |
  230|  3.63M|    if (st == NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 3.63M]
  ------------------
  231|      0|        return NULL;
  232|       |
  233|  3.63M|    st->comp = c;
  234|       |
  235|  3.63M|    if (n <= 0)
  ------------------
  |  Branch (235:9): [True: 3.63M, False: 6.96k]
  ------------------
  236|  3.63M|        return st;
  237|       |
  238|  6.96k|    if (!sk_reserve(st, n, 1)) {
  ------------------
  |  Branch (238:9): [True: 0, False: 6.96k]
  ------------------
  239|      0|        OPENSSL_sk_free(st);
  240|      0|        return NULL;
  241|      0|    }
  242|       |
  243|  6.96k|    return st;
  244|  6.96k|}
OPENSSL_sk_insert:
  259|  8.11M|{
  260|  8.11M|    if (st == NULL) {
  ------------------
  |  Branch (260:9): [True: 0, False: 8.11M]
  ------------------
  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|  8.11M|    if (st->num == max_nodes) {
  ------------------
  |  Branch (264:9): [True: 0, False: 8.11M]
  ------------------
  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|  8.11M|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (269:9): [True: 0, False: 8.11M]
  ------------------
  270|      0|        return 0;
  271|       |
  272|  8.11M|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (272:9): [True: 8.11M, False: 0]
  |  Branch (272:29): [True: 0, False: 0]
  ------------------
  273|  8.11M|        st->data[st->num] = data;
  274|  8.11M|    } 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|  8.11M|    st->num++;
  280|  8.11M|    st->sorted = 0;
  281|  8.11M|    return st->num;
  282|  8.11M|}
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_find:
  383|      6|{
  384|      6|    return internal_find(st, data, OSSL_BSEARCH_FIRST_VALUE_ON_MATCH, NULL);
  ------------------
  |  |  151|      6|# define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
  ------------------
  385|      6|}
OPENSSL_sk_push:
  398|  8.10M|{
  399|  8.10M|    if (st == NULL)
  ------------------
  |  Branch (399:9): [True: 0, False: 8.10M]
  ------------------
  400|      0|        return 0;
  401|  8.10M|    return OPENSSL_sk_insert(st, data, st->num);
  402|  8.10M|}
OPENSSL_sk_pop_free:
  432|  1.79M|{
  433|  1.79M|    int i;
  434|       |
  435|  1.79M|    if (st == NULL)
  ------------------
  |  Branch (435:9): [True: 156k, False: 1.64M]
  ------------------
  436|   156k|        return;
  437|  5.69M|    for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (437:17): [True: 4.05M, False: 1.64M]
  ------------------
  438|  4.05M|        if (st->data[i] != NULL)
  ------------------
  |  Branch (438:13): [True: 4.05M, False: 360]
  ------------------
  439|  4.05M|            func((char *)st->data[i]);
  440|  1.64M|    OPENSSL_sk_free(st);
  441|  1.64M|}
OPENSSL_sk_free:
  444|  6.16M|{
  445|  6.16M|    if (st == NULL)
  ------------------
  |  Branch (445:9): [True: 2.48M, False: 3.67M]
  ------------------
  446|  2.48M|        return;
  447|  3.67M|    OPENSSL_free(st->data);
  ------------------
  |  |  115|  3.67M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.67M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.67M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  448|  3.67M|    OPENSSL_free(st);
  ------------------
  |  |  115|  3.67M|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.67M|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.67M|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  449|  3.67M|}
OPENSSL_sk_num:
  452|  23.5M|{
  453|  23.5M|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (453:12): [True: 4.35M, False: 19.1M]
  ------------------
  454|  23.5M|}
OPENSSL_sk_value:
  457|  15.8M|{
  458|  15.8M|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (458:9): [True: 0, False: 15.8M]
  |  Branch (458:23): [True: 0, False: 15.8M]
  |  Branch (458:32): [True: 0, False: 15.8M]
  ------------------
  459|      0|        return NULL;
  460|  15.8M|    return (void *)st->data[i];
  461|  15.8M|}
OPENSSL_sk_set:
  464|   123k|{
  465|   123k|    if (st == NULL) {
  ------------------
  |  Branch (465:9): [True: 0, False: 123k]
  ------------------
  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|   123k|    if (i < 0 || i >= st->num) {
  ------------------
  |  Branch (469:9): [True: 0, False: 123k]
  |  Branch (469:18): [True: 0, False: 123k]
  ------------------
  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|   123k|    st->data[i] = data;
  475|   123k|    st->sorted = 0;
  476|   123k|    return (void *)st->data[i];
  477|   123k|}
OPENSSL_sk_sort:
  480|    219|{
  481|    219|    if (st != NULL && !st->sorted && st->comp != NULL) {
  ------------------
  |  Branch (481:9): [True: 219, False: 0]
  |  Branch (481:23): [True: 219, False: 0]
  |  Branch (481:38): [True: 219, False: 0]
  ------------------
  482|    219|        if (st->num > 1)
  ------------------
  |  Branch (482:13): [True: 210, False: 9]
  ------------------
  483|    210|            qsort(st->data, st->num, sizeof(void *), st->comp);
  484|    219|        st->sorted = 1; /* empty or single-element stack is considered sorted */
  485|    219|    }
  486|    219|}
stack.c:sk_reserve:
  178|  8.11M|{
  179|  8.11M|    const void **tmpdata;
  180|  8.11M|    int num_alloc;
  181|       |
  182|       |    /* Check to see the reservation isn't exceeding the hard limit */
  183|  8.11M|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (183:9): [True: 0, False: 8.11M]
  ------------------
  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|  8.11M|    num_alloc = st->num + n;
  190|  8.11M|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (190:9): [True: 415k, False: 7.70M]
  ------------------
  191|   415k|        num_alloc = min_nodes;
  192|       |
  193|       |    /* If |st->data| allocation was postponed */
  194|  8.11M|    if (st->data == NULL) {
  ------------------
  |  Branch (194:9): [True: 315k, False: 7.80M]
  ------------------
  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|   315k|        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL)
  ------------------
  |  |  104|   315k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   315k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   315k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (199:13): [True: 0, False: 315k]
  ------------------
  200|      0|            return 0;
  201|   315k|        st->num_alloc = num_alloc;
  202|   315k|        return 1;
  203|   315k|    }
  204|       |
  205|  7.80M|    if (!exact) {
  ------------------
  |  Branch (205:9): [True: 7.80M, False: 0]
  ------------------
  206|  7.80M|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (206:13): [True: 7.73M, False: 65.0k]
  ------------------
  207|  7.73M|            return 1;
  208|  65.0k|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  209|  65.0k|        if (num_alloc == 0) {
  ------------------
  |  Branch (209:13): [True: 0, False: 65.0k]
  ------------------
  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|  65.0k|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (213:16): [True: 0, False: 0]
  ------------------
  214|      0|        return 1;
  215|      0|    }
  216|       |
  217|  65.0k|    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
  ------------------
  |  |  109|  65.0k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  65.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  65.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  218|  65.0k|    if (tmpdata == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 65.0k]
  ------------------
  219|      0|        return 0;
  220|       |
  221|  65.0k|    st->data = tmpdata;
  222|  65.0k|    st->num_alloc = num_alloc;
  223|  65.0k|    return 1;
  224|  65.0k|}
stack.c:compute_growth:
  160|  65.0k|{
  161|  65.0k|    int err = 0;
  162|       |
  163|   130k|    while (current < target) {
  ------------------
  |  Branch (163:12): [True: 65.0k, False: 65.0k]
  ------------------
  164|  65.0k|        if (current >= max_nodes)
  ------------------
  |  Branch (164:13): [True: 0, False: 65.0k]
  ------------------
  165|      0|            return 0;
  166|       |
  167|  65.0k|        current = safe_muldiv_int(current, 8, 5, &err);
  168|  65.0k|        if (err != 0)
  ------------------
  |  Branch (168:13): [True: 0, False: 65.0k]
  ------------------
  169|      0|            return 0;
  170|  65.0k|        if (current >= max_nodes)
  ------------------
  |  Branch (170:13): [True: 0, False: 65.0k]
  ------------------
  171|      0|            current = max_nodes;
  172|  65.0k|    }
  173|  65.0k|    return current;
  174|  65.0k|}
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|}
stack.c:internal_find:
  319|      6|{
  320|      6|    const void *r;
  321|      6|    int i, count = 0;
  322|      6|    int *pnum = pnum_matched;
  323|       |
  324|      6|    if (st == NULL || st->num == 0)
  ------------------
  |  Branch (324:9): [True: 0, False: 6]
  |  Branch (324:23): [True: 6, False: 0]
  ------------------
  325|      6|        return -1;
  326|       |
  327|      0|    if (pnum == NULL)
  ------------------
  |  Branch (327:9): [True: 0, False: 0]
  ------------------
  328|      0|        pnum = &count;
  329|       |
  330|      0|    if (st->comp == NULL) {
  ------------------
  |  Branch (330:9): [True: 0, False: 0]
  ------------------
  331|      0|        for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (331:21): [True: 0, False: 0]
  ------------------
  332|      0|            if (st->data[i] == data) {
  ------------------
  |  Branch (332:17): [True: 0, False: 0]
  ------------------
  333|      0|                *pnum = 1;
  334|      0|                return i;
  335|      0|            }
  336|      0|        *pnum = 0;
  337|      0|        return -1;
  338|      0|    }
  339|       |
  340|      0|    if (data == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 0]
  ------------------
  341|      0|        return -1;
  342|       |
  343|      0|    if (!st->sorted) {
  ------------------
  |  Branch (343:9): [True: 0, False: 0]
  ------------------
  344|      0|        int res = -1;
  345|       |
  346|      0|        for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (346:21): [True: 0, False: 0]
  ------------------
  347|      0|            if (st->comp(&data, st->data + i) == 0) {
  ------------------
  |  Branch (347:17): [True: 0, False: 0]
  ------------------
  348|      0|                if (res == -1)
  ------------------
  |  Branch (348:21): [True: 0, False: 0]
  ------------------
  349|      0|                    res = i;
  350|      0|                ++*pnum;
  351|       |                /* Check if only one result is wanted and exit if so */
  352|      0|                if (pnum_matched == NULL)
  ------------------
  |  Branch (352:21): [True: 0, False: 0]
  ------------------
  353|      0|                    return i;
  354|      0|            }
  355|      0|        if (res == -1)
  ------------------
  |  Branch (355:13): [True: 0, False: 0]
  ------------------
  356|      0|            *pnum = 0;
  357|      0|        return res;
  358|      0|    }
  359|       |
  360|      0|    if (pnum_matched != NULL)
  ------------------
  |  Branch (360:9): [True: 0, False: 0]
  ------------------
  361|      0|        ret_val_options |= OSSL_BSEARCH_FIRST_VALUE_ON_MATCH;
  ------------------
  |  |  151|      0|# define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
  ------------------
  362|      0|    r = ossl_bsearch(&data, st->data, st->num, sizeof(void *), st->comp,
  363|      0|                     ret_val_options);
  364|       |
  365|      0|    if (pnum_matched != NULL) {
  ------------------
  |  Branch (365:9): [True: 0, False: 0]
  ------------------
  366|      0|        *pnum = 0;
  367|      0|        if (r != NULL) {
  ------------------
  |  Branch (367:13): [True: 0, False: 0]
  ------------------
  368|      0|            const void **p = (const void **)r;
  369|       |
  370|      0|            while (p < st->data + st->num) {
  ------------------
  |  Branch (370:20): [True: 0, False: 0]
  ------------------
  371|      0|                if (st->comp(&data, p) != 0)
  ------------------
  |  Branch (371:21): [True: 0, False: 0]
  ------------------
  372|      0|                    break;
  373|      0|                ++*pnum;
  374|      0|                ++p;
  375|      0|            }
  376|      0|        }
  377|      0|    }
  378|       |
  379|      0|    return r == NULL ? -1 : (int)((const void **)r - st->data);
  ------------------
  |  Branch (379:12): [True: 0, False: 0]
  ------------------
  380|      0|}

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

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

ossl_store_loader_store_cache_flush:
  386|      2|{
  387|      2|    OSSL_METHOD_STORE *store = get_loader_store(libctx);
  388|       |
  389|      2|    if (store != NULL)
  ------------------
  |  Branch (389:9): [True: 2, False: 0]
  ------------------
  390|      2|        return ossl_method_store_cache_flush_all(store);
  391|      0|    return 1;
  392|      2|}
store_meth.c:get_loader_store:
  106|      2|{
  107|      2|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX);
  ------------------
  |  |  113|      2|# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX      15
  ------------------
  108|      2|}

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

ossl_crypto_mutex_new:
   97|      4|{
   98|      4|    pthread_mutex_t *mutex;
   99|       |
  100|      4|    if ((mutex = OPENSSL_zalloc(sizeof(*mutex))) == NULL)
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (100:9): [True: 0, False: 4]
  ------------------
  101|      0|        return NULL;
  102|      4|    if (pthread_mutex_init(mutex, NULL) != 0) {
  ------------------
  |  Branch (102:9): [True: 0, False: 4]
  ------------------
  103|      0|        OPENSSL_free(mutex);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|      4|    return (CRYPTO_MUTEX *)mutex;
  107|      4|}
ossl_crypto_mutex_free:
  142|      2|{
  143|      2|    pthread_mutex_t **mutex_p;
  144|       |
  145|      2|    if (mutex == NULL)
  ------------------
  |  Branch (145:9): [True: 0, False: 2]
  ------------------
  146|      0|        return;
  147|       |
  148|      2|    mutex_p = (pthread_mutex_t **)mutex;
  149|      2|    if (*mutex_p != NULL)
  ------------------
  |  Branch (149:9): [True: 2, False: 0]
  ------------------
  150|      2|        pthread_mutex_destroy(*mutex_p);
  151|      2|    OPENSSL_free(*mutex_p);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|      4|{
  157|      4|    pthread_cond_t *cv_p;
  158|       |
  159|      4|    if ((cv_p = OPENSSL_zalloc(sizeof(*cv_p))) == NULL)
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (159:9): [True: 0, False: 4]
  ------------------
  160|      0|        return NULL;
  161|      4|    if (pthread_cond_init(cv_p, NULL) != 0) {
  ------------------
  |  Branch (161:9): [True: 0, False: 4]
  ------------------
  162|      0|        OPENSSL_free(cv_p);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|      4|    return (CRYPTO_CONDVAR *) cv_p;
  166|      4|}
ossl_crypto_condvar_free:
  220|      2|{
  221|      2|    pthread_cond_t **cv_p;
  222|       |
  223|      2|    if (cv == NULL)
  ------------------
  |  Branch (223:9): [True: 0, False: 2]
  ------------------
  224|      0|        return;
  225|       |
  226|      2|    cv_p = (pthread_cond_t **)cv;
  227|      2|    if (*cv_p != NULL)
  ------------------
  |  Branch (227:9): [True: 2, False: 0]
  ------------------
  228|      2|        pthread_cond_destroy(*cv_p);
  229|      2|    OPENSSL_free(*cv_p);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|      4|{
  129|      4|    struct openssl_threads_st *t = OPENSSL_zalloc(sizeof(*t));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|       |
  131|      4|    if (t == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 4]
  ------------------
  132|      0|        return NULL;
  133|       |
  134|      4|    t->lock = ossl_crypto_mutex_new();
  135|      4|    t->cond_finished = ossl_crypto_condvar_new();
  136|       |
  137|      4|    if (t->lock == NULL || t->cond_finished == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 4]
  |  Branch (137:28): [True: 0, False: 4]
  ------------------
  138|      0|        goto fail;
  139|       |
  140|      4|    return t;
  141|       |
  142|      0|fail:
  143|      0|    ossl_threads_ctx_free((void *)t);
  144|      0|    return NULL;
  145|      4|}
ossl_threads_ctx_free:
  148|      2|{
  149|      2|    OSSL_LIB_CTX_THREADS *t = (OSSL_LIB_CTX_THREADS *) vdata;
  150|       |
  151|      2|    if (t == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 2]
  ------------------
  152|      0|        return;
  153|       |
  154|      2|    ossl_crypto_mutex_free(&t->lock);
  155|      2|    ossl_crypto_condvar_free(&t->cond_finished);
  156|      2|    OPENSSL_free(t);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  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|   158k|{
  706|   158k|# ifdef USE_RWLOCK
  707|   158k|    CRYPTO_RWLOCK *lock;
  708|       |
  709|   158k|    if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL)
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  |  Branch (709:9): [True: 0, False: 158k]
  ------------------
  710|       |        /* Don't set error, to avoid recursion blowup. */
  711|      0|        return NULL;
  712|       |
  713|   158k|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (713:9): [True: 0, False: 158k]
  ------------------
  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|   158k|    return lock;
  747|   158k|}
CRYPTO_THREAD_read_lock:
  750|  4.39M|{
  751|  4.39M|# ifdef USE_RWLOCK
  752|  4.39M|    if (pthread_rwlock_rdlock(lock) != 0)
  ------------------
  |  Branch (752:9): [True: 0, False: 4.39M]
  ------------------
  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|  4.39M|    return 1;
  762|  4.39M|}
CRYPTO_THREAD_write_lock:
  765|  16.8k|{
  766|  16.8k|# ifdef USE_RWLOCK
  767|  16.8k|    if (pthread_rwlock_wrlock(lock) != 0)
  ------------------
  |  Branch (767:9): [True: 0, False: 16.8k]
  ------------------
  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|  16.8k|    return 1;
  777|  16.8k|}
CRYPTO_THREAD_unlock:
  780|  4.40M|{
  781|  4.40M|# ifdef USE_RWLOCK
  782|  4.40M|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (782:9): [True: 0, False: 4.40M]
  ------------------
  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|  4.40M|    return 1;
  792|  4.40M|}
CRYPTO_THREAD_lock_free:
  795|   158k|{
  796|   158k|    if (lock == NULL)
  ------------------
  |  Branch (796:9): [True: 12, False: 158k]
  ------------------
  797|     12|        return;
  798|       |
  799|   158k|# ifdef USE_RWLOCK
  800|   158k|    pthread_rwlock_destroy(lock);
  801|       |# else
  802|       |    pthread_mutex_destroy(lock);
  803|       |# endif
  804|   158k|    OPENSSL_free(lock);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  805|       |
  806|   158k|    return;
  807|   158k|}
CRYPTO_THREAD_run_once:
  810|  82.8M|{
  811|  82.8M|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (811:9): [True: 0, False: 82.8M]
  ------------------
  812|      0|        return 0;
  813|       |
  814|  82.8M|    return 1;
  815|  82.8M|}
CRYPTO_THREAD_init_local:
  818|     20|{
  819|     20|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (819:9): [True: 0, False: 20]
  ------------------
  820|      0|        return 0;
  821|       |
  822|     20|    return 1;
  823|     20|}
CRYPTO_THREAD_get_local:
  826|  42.9M|{
  827|  42.9M|    return pthread_getspecific(*key);
  828|  42.9M|}
CRYPTO_THREAD_set_local:
  831|     19|{
  832|     19|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (832:9): [True: 0, False: 19]
  ------------------
  833|      0|        return 0;
  834|       |
  835|     19|    return 1;
  836|     19|}
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|  27.8k|{
  858|  27.8k|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  859|  27.8k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (859:9): [Folded - Ignored]
  ------------------
  860|  27.8k|        *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);
  861|  27.8k|        return 1;
  862|  27.8k|    }
  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|      6|{
  937|      6|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  938|      6|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (938:9): [Folded - Ignored]
  ------------------
  939|      6|        *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
  940|      6|        return 1;
  941|      6|    }
  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|  40.0M|{
  962|  40.0M|# if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE) && !defined(BROKEN_CLANG_ATOMICS)
  963|  40.0M|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (963:9): [Folded - Ignored]
  ------------------
  964|  40.0M|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
  965|  40.0M|        return 1;
  966|  40.0M|    }
  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|}
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_time_now:
   15|    744|{
   16|    744|    OSSL_TIME r;
   17|       |
   18|       |#if defined(_WIN32) && !defined(OPENSSL_SYS_UEFI)
   19|       |    SYSTEMTIME st;
   20|       |    union {
   21|       |        unsigned __int64 ul;
   22|       |        FILETIME ft;
   23|       |    } now;
   24|       |
   25|       |    GetSystemTime(&st);
   26|       |    SystemTimeToFileTime(&st, &now.ft);
   27|       |    /* re-bias to 1/1/1970 */
   28|       |# ifdef  __MINGW32__
   29|       |    now.ul -= 116444736000000000ULL;
   30|       |# else
   31|       |    now.ul -= 116444736000000000UI64;
   32|       |# endif
   33|       |    r.t = ((uint64_t)now.ul) * (OSSL_TIME_SECOND / 10000000);
   34|       |#else   /* defined(_WIN32) */
   35|    744|    struct timeval t;
   36|       |
   37|    744|    if (gettimeofday(&t, NULL) < 0) {
  ------------------
  |  Branch (37:9): [True: 0, False: 744]
  ------------------
   38|      0|        ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  292|      0|#   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_SYS, get_last_sys_error(),
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      0|# define get_last_sys_error()    errno
  ------------------
   39|      0|                       "calling gettimeofday()");
   40|      0|        return ossl_time_zero();
   41|      0|    }
   42|    744|    if (t.tv_sec <= 0)
  ------------------
  |  Branch (42:9): [True: 0, False: 744]
  ------------------
   43|      0|        r.t = t.tv_usec <= 0 ? 0 : t.tv_usec * OSSL_TIME_US;
  ------------------
  |  |   36|      0|# define OSSL_TIME_US     (OSSL_TIME_MS     / 1000)
  |  |  ------------------
  |  |  |  |   33|      0|# define OSSL_TIME_MS     (OSSL_TIME_SECOND / 1000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (43:15): [True: 0, False: 0]
  ------------------
   44|    744|    else
   45|    744|        r.t = ((uint64_t)t.tv_sec * 1000000 + t.tv_usec) * OSSL_TIME_US;
  ------------------
  |  |   36|    744|# define OSSL_TIME_US     (OSSL_TIME_MS     / 1000)
  |  |  ------------------
  |  |  |  |   33|    744|# define OSSL_TIME_MS     (OSSL_TIME_SECOND / 1000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|    744|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   46|    744|#endif  /* defined(_WIN32) */
   47|    744|    return r;
   48|    744|}

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

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

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

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

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

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

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

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|  24.9k|{
  180|  24.9k|    if (!cache)
  ------------------
  |  Branch (180:9): [True: 24.9k, False: 0]
  ------------------
  181|  24.9k|        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|}

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

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

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

v3_akid.c:i2v_AUTHORITY_KEYID:
   42|  1.14k|{
   43|  1.14k|    char *tmp = NULL;
   44|  1.14k|    STACK_OF(CONF_VALUE) *origextlist = extlist, *tmpextlist;
  ------------------
  |  |   31|  1.14k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   45|       |
   46|  1.14k|    if (akeyid->keyid) {
  ------------------
  |  Branch (46:9): [True: 531, False: 613]
  ------------------
   47|    531|        tmp = i2s_ASN1_OCTET_STRING(NULL, akeyid->keyid);
   48|    531|        if (tmp == NULL) {
  ------------------
  |  Branch (48:13): [True: 0, False: 531]
  ------------------
   49|      0|            ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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 NULL;
   51|      0|        }
   52|    531|        if (!X509V3_add_value((akeyid->issuer || akeyid->serial) ? "keyid" : NULL,
  ------------------
  |  Branch (52:13): [True: 0, False: 531]
  |  Branch (52:32): [True: 327, False: 204]
  |  Branch (52:50): [True: 1, False: 203]
  ------------------
   53|    531|                              tmp, &extlist)) {
   54|      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__
  |  |  ------------------
  ------------------
   55|      0|            ERR_raise(ERR_LIB_X509V3, ERR_R_X509_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|            goto err;
   57|      0|        }
   58|    531|        OPENSSL_free(tmp);
  ------------------
  |  |  115|    531|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    531|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    531|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   59|    531|    }
   60|  1.14k|    if (akeyid->issuer) {
  ------------------
  |  Branch (60:9): [True: 523, False: 621]
  ------------------
   61|    523|        tmpextlist = i2v_GENERAL_NAMES(NULL, akeyid->issuer, extlist);
   62|    523|        if (tmpextlist == NULL) {
  ------------------
  |  Branch (62:13): [True: 1, False: 522]
  ------------------
   63|      1|            ERR_raise(ERR_LIB_X509V3, ERR_R_X509_LIB);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  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)
  |  |  ------------------
  ------------------
   64|      1|            goto err;
   65|      1|        }
   66|    522|        extlist = tmpextlist;
   67|    522|    }
   68|  1.14k|    if (akeyid->serial) {
  ------------------
  |  Branch (68:9): [True: 258, False: 885]
  ------------------
   69|    258|        tmp = i2s_ASN1_OCTET_STRING(NULL, akeyid->serial);
   70|    258|        if (tmp == NULL) {
  ------------------
  |  Branch (70:13): [True: 0, False: 258]
  ------------------
   71|      0|            ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|    258|        if (!X509V3_add_value("serial", tmp, &extlist)) {
  ------------------
  |  Branch (74:13): [True: 0, False: 258]
  ------------------
   75|      0|            OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|      0|            goto err;
   77|      0|        }
   78|    258|        OPENSSL_free(tmp);
  ------------------
  |  |  115|    258|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    258|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    258|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|    258|    }
   80|  1.14k|    return extlist;
   81|      1| err:
   82|      1|    if (origextlist == NULL)
  ------------------
  |  Branch (82:9): [True: 1, False: 0]
  ------------------
   83|      1|        sk_CONF_VALUE_pop_free(extlist, X509V3_conf_free);
  ------------------
  |  |   59|      1|#define sk_CONF_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CONF_VALUE_sk_type(sk),ossl_check_CONF_VALUE_freefunc_type(freefunc))
  ------------------
   84|      1|    return NULL;
   85|  1.14k|}

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

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

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

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

DIST_POINT_set_dpname:
  485|    167|{
  486|    167|    int i;
  487|    167|    STACK_OF(X509_NAME_ENTRY) *frag;
  ------------------
  |  |   31|    167|# define STACK_OF(type) struct stack_st_##type
  ------------------
  488|    167|    X509_NAME_ENTRY *ne;
  489|       |
  490|    167|    if (dpn == NULL || dpn->type != 1)
  ------------------
  |  Branch (490:9): [True: 44, False: 123]
  |  Branch (490:24): [True: 12, False: 111]
  ------------------
  491|     56|        return 1;
  492|    111|    frag = dpn->name.relativename;
  493|    111|    X509_NAME_free(dpn->dpname); /* just in case it was already set */
  494|    111|    dpn->dpname = X509_NAME_dup(iname);
  495|    111|    if (dpn->dpname == NULL)
  ------------------
  |  Branch (495:9): [True: 1, False: 110]
  ------------------
  496|      1|        return 0;
  497|  1.14k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(frag); i++) {
  ------------------
  |  |  204|  1.14k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (497:17): [True: 1.03k, False: 110]
  ------------------
  498|  1.03k|        ne = sk_X509_NAME_ENTRY_value(frag, i);
  ------------------
  |  |  205|  1.03k|#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|  1.03k|        if (!X509_NAME_add_entry(dpn->dpname, ne, -1, i ? 0 : 1))
  ------------------
  |  Branch (499:13): [True: 0, False: 1.03k]
  |  Branch (499:55): [True: 930, False: 107]
  ------------------
  500|      0|            goto err;
  501|  1.03k|    }
  502|       |    /* generate cached encoding of name */
  503|    110|    if (i2d_X509_NAME(dpn->dpname, NULL) >= 0)
  ------------------
  |  Branch (503:9): [True: 110, False: 0]
  ------------------
  504|    110|        return 1;
  505|       |
  506|      0| err:
  507|      0|    X509_NAME_free(dpn->dpname);
  508|      0|    dpn->dpname = NULL;
  509|      0|    return 0;
  510|    110|}
v3_crld.c:dpn_cb:
  307|   107k|{
  308|   107k|    DIST_POINT_NAME *dpn = (DIST_POINT_NAME *)*pval;
  309|       |
  310|   107k|    switch (operation) {
  ------------------
  |  Branch (310:13): [True: 68.5k, False: 39.3k]
  ------------------
  311|  19.6k|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  743|  19.6k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (311:5): [True: 19.6k, False: 88.1k]
  ------------------
  312|  19.6k|        dpn->dpname = NULL;
  313|  19.6k|        break;
  314|       |
  315|  19.6k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  19.6k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (315:5): [True: 19.6k, False: 88.1k]
  ------------------
  316|  19.6k|        X509_NAME_free(dpn->dpname);
  317|  19.6k|        break;
  318|   107k|    }
  319|   107k|    return 1;
  320|   107k|}
v3_crld.c:i2r_idp:
  439|  8.02k|{
  440|  8.02k|    ISSUING_DIST_POINT *idp = pidp;
  441|  8.02k|    if (idp->distpoint)
  ------------------
  |  Branch (441:9): [True: 4.89k, False: 3.12k]
  ------------------
  442|  4.89k|        print_distpoint(out, idp->distpoint, indent);
  443|  8.02k|    if (idp->onlyuser > 0)
  ------------------
  |  Branch (443:9): [True: 525, False: 7.49k]
  ------------------
  444|    525|        BIO_printf(out, "%*sOnly User Certificates\n", indent, "");
  445|  8.02k|    if (idp->onlyCA > 0)
  ------------------
  |  Branch (445:9): [True: 115, False: 7.90k]
  ------------------
  446|    115|        BIO_printf(out, "%*sOnly CA Certificates\n", indent, "");
  447|  8.02k|    if (idp->indirectCRL > 0)
  ------------------
  |  Branch (447:9): [True: 747, False: 7.27k]
  ------------------
  448|    747|        BIO_printf(out, "%*sIndirect CRL\n", indent, "");
  449|  8.02k|    if (idp->onlysomereasons)
  ------------------
  |  Branch (449:9): [True: 1.57k, False: 6.44k]
  ------------------
  450|  1.57k|        print_reasons(out, "Only Some Reasons", idp->onlysomereasons, indent);
  451|  8.02k|    if (idp->onlyattr > 0)
  ------------------
  |  Branch (451:9): [True: 74, False: 7.94k]
  ------------------
  452|     74|        BIO_printf(out, "%*sOnly Attribute Certificates\n", indent, "");
  453|  8.02k|    if (!idp->distpoint && (idp->onlyuser <= 0) && (idp->onlyCA <= 0)
  ------------------
  |  Branch (453:9): [True: 3.12k, False: 4.89k]
  |  Branch (453:28): [True: 2.59k, False: 525]
  |  Branch (453:52): [True: 2.48k, False: 115]
  ------------------
  454|  8.02k|        && (idp->indirectCRL <= 0) && !idp->onlysomereasons
  ------------------
  |  Branch (454:12): [True: 1.73k, False: 747]
  |  Branch (454:39): [True: 163, False: 1.57k]
  ------------------
  455|  8.02k|        && (idp->onlyattr <= 0))
  ------------------
  |  Branch (455:12): [True: 89, False: 74]
  ------------------
  456|     89|        BIO_printf(out, "%*s<EMPTY>\n", indent, "");
  457|       |
  458|  8.02k|    return 1;
  459|  8.02k|}
v3_crld.c:print_distpoint:
  423|  4.89k|{
  424|  4.89k|    if (dpn->type == 0) {
  ------------------
  |  Branch (424:9): [True: 429, False: 4.46k]
  ------------------
  425|    429|        BIO_printf(out, "%*sFull Name:\n", indent, "");
  426|    429|        OSSL_GENERAL_NAMES_print(out, dpn->name.fullname, indent);
  427|  4.46k|    } else {
  428|  4.46k|        X509_NAME ntmp;
  429|  4.46k|        ntmp.entries = dpn->name.relativename;
  430|  4.46k|        BIO_printf(out, "%*sRelative Name:\n%*s", indent, "", indent + 2, "");
  431|  4.46k|        X509_NAME_print_ex(out, &ntmp, 0, XN_FLAG_ONELINE);
  ------------------
  |  |  358|  4.46k|# define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
  |  |  ------------------
  |  |  |  |  515|  4.46k|# define ASN1_STRFLGS_RFC2253    (ASN1_STRFLGS_ESC_2253 | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  440|  4.46k|# define ASN1_STRFLGS_ESC_2253           1
  |  |  |  |  ------------------
  |  |  |  |  516|  4.46k|                                ASN1_STRFLGS_ESC_CTRL | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  441|  4.46k|# define ASN1_STRFLGS_ESC_CTRL           2
  |  |  |  |  ------------------
  |  |  |  |  517|  4.46k|                                ASN1_STRFLGS_ESC_MSB | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|  4.46k|# define ASN1_STRFLGS_ESC_MSB            4
  |  |  |  |  ------------------
  |  |  |  |  518|  4.46k|                                ASN1_STRFLGS_UTF8_CONVERT | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  474|  4.46k|# define ASN1_STRFLGS_UTF8_CONVERT       0x10
  |  |  |  |  ------------------
  |  |  |  |  519|  4.46k|                                ASN1_STRFLGS_DUMP_UNKNOWN | \
  |  |  |  |  ------------------
  |  |  |  |  |  |  496|  4.46k|# define ASN1_STRFLGS_DUMP_UNKNOWN       0x100
  |  |  |  |  ------------------
  |  |  |  |  520|  4.46k|                                ASN1_STRFLGS_DUMP_DER)
  |  |  |  |  ------------------
  |  |  |  |  |  |  503|  4.46k|# define ASN1_STRFLGS_DUMP_DER           0x200
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  359|  4.46k|                        ASN1_STRFLGS_ESC_QUOTE | \
  |  |  ------------------
  |  |  |  |  454|  4.46k|# define ASN1_STRFLGS_ESC_QUOTE          8
  |  |  ------------------
  |  |  360|  4.46k|                        XN_FLAG_SEP_CPLUS_SPC | \
  |  |  ------------------
  |  |  |  |  321|  4.46k|# define XN_FLAG_SEP_CPLUS_SPC   (2 << 16)/* ,+ spaced: more readable */
  |  |  ------------------
  |  |  361|  4.46k|                        XN_FLAG_SPC_EQ | \
  |  |  ------------------
  |  |  |  |  336|  4.46k|# define XN_FLAG_SPC_EQ          (1 << 23)/* Put spaces round '=' */
  |  |  ------------------
  |  |  362|  4.46k|                        XN_FLAG_FN_SN)
  |  |  ------------------
  |  |  |  |  331|  4.46k|# define XN_FLAG_FN_SN           0/* Object short name */
  |  |  ------------------
  ------------------
  432|  4.46k|        BIO_puts(out, "\n");
  433|  4.46k|    }
  434|  4.89k|    return 1;
  435|  4.89k|}
v3_crld.c:print_reasons:
  187|  1.58k|{
  188|  1.58k|    int first = 1;
  189|  1.58k|    const BIT_STRING_BITNAME *pbn;
  190|  1.58k|    BIO_printf(out, "%*s%s:\n%*s", indent, "", rname, indent + 2, "");
  191|  15.8k|    for (pbn = reason_flags; pbn->lname; pbn++) {
  ------------------
  |  Branch (191:30): [True: 14.2k, False: 1.58k]
  ------------------
  192|  14.2k|        if (ASN1_BIT_STRING_get_bit(rflags, pbn->bitnum)) {
  ------------------
  |  Branch (192:13): [True: 2.21k, False: 12.0k]
  ------------------
  193|  2.21k|            if (first)
  ------------------
  |  Branch (193:17): [True: 919, False: 1.29k]
  ------------------
  194|    919|                first = 0;
  195|  1.29k|            else
  196|  1.29k|                BIO_puts(out, ", ");
  197|  2.21k|            BIO_puts(out, pbn->lname);
  198|  2.21k|        }
  199|  14.2k|    }
  200|  1.58k|    if (first)
  ------------------
  |  Branch (200:9): [True: 666, False: 919]
  ------------------
  201|    666|        BIO_puts(out, "<EMPTY>\n");
  202|    919|    else
  203|    919|        BIO_puts(out, "\n");
  204|  1.58k|    return 1;
  205|  1.58k|}
v3_crld.c:i2r_crldp:
  463|    476|{
  464|    476|    STACK_OF(DIST_POINT) *crld = pcrldp;
  ------------------
  |  |   31|    476|# define STACK_OF(type) struct stack_st_##type
  ------------------
  465|    476|    DIST_POINT *point;
  466|    476|    int i;
  467|  1.19k|    for (i = 0; i < sk_DIST_POINT_num(crld); i++) {
  ------------------
  |  |  331|  1.19k|#define sk_DIST_POINT_num(sk) OPENSSL_sk_num(ossl_check_const_DIST_POINT_sk_type(sk))
  ------------------
  |  Branch (467:17): [True: 719, False: 476]
  ------------------
  468|    719|        if (i > 0)
  ------------------
  |  Branch (468:13): [True: 341, False: 378]
  ------------------
  469|    341|            BIO_puts(out, "\n");
  470|    719|        point = sk_DIST_POINT_value(crld, i);
  ------------------
  |  |  332|    719|#define sk_DIST_POINT_value(sk, idx) ((DIST_POINT *)OPENSSL_sk_value(ossl_check_const_DIST_POINT_sk_type(sk), (idx)))
  ------------------
  471|    719|        if (point->distpoint)
  ------------------
  |  Branch (471:13): [True: 0, False: 719]
  ------------------
  472|      0|            print_distpoint(out, point->distpoint, indent);
  473|    719|        if (point->reasons)
  ------------------
  |  Branch (473:13): [True: 11, False: 708]
  ------------------
  474|     11|            print_reasons(out, "Reasons", point->reasons, indent);
  475|    719|        if (point->CRLissuer) {
  ------------------
  |  Branch (475:13): [True: 25, False: 694]
  ------------------
  476|     25|            BIO_printf(out, "%*sCRL Issuer:\n", indent, "");
  477|     25|            OSSL_GENERAL_NAMES_print(out, point->CRLissuer, indent);
  478|     25|        }
  479|    719|    }
  480|    476|    return 1;
  481|    476|}

i2s_ASN1_ENUMERATED_TABLE:
   43|    627|{
   44|    627|    ENUMERATED_NAMES *enam;
   45|    627|    long strval;
   46|       |
   47|    627|    strval = ASN1_ENUMERATED_get(e);
   48|  6.19k|    for (enam = method->usr_data; enam->lname; enam++) {
  ------------------
  |  Branch (48:35): [True: 5.64k, False: 549]
  ------------------
   49|  5.64k|        if (strval == enam->bitnum)
  ------------------
  |  Branch (49:13): [True: 78, False: 5.57k]
  ------------------
   50|     78|            return OPENSSL_strdup(enam->lname);
  ------------------
  |  |  119|     78|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     78|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     78|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   51|  5.64k|    }
   52|    549|    return i2s_ASN1_ENUMERATED(method, e);
   53|    627|}

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

v3_group_ac.c:i2s_GROUP_AC:
   31|      1|{
   32|      1|    return OPENSSL_strdup("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__
  |  |  ------------------
  ------------------
   33|      1|}

v3_ind_iss.c:i2s_INDIRECT_ISSUER:
   31|      1|{
   32|      1|    return OPENSSL_strdup("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__
  |  |  ------------------
  ------------------
   33|      1|}

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

v3_ncons.c:i2r_NAME_CONSTRAINTS:
  204|  1.32k|{
  205|  1.32k|    NAME_CONSTRAINTS *ncons = a;
  206|  1.32k|    do_i2r_name_constraints(method, ncons->permittedSubtrees,
  207|  1.32k|                            bp, ind, "Permitted");
  208|  1.32k|    if (ncons->permittedSubtrees && ncons->excludedSubtrees)
  ------------------
  |  Branch (208:9): [True: 1.06k, False: 267]
  |  Branch (208:37): [True: 18, False: 1.04k]
  ------------------
  209|     18|        BIO_puts(bp, "\n");
  210|  1.32k|    do_i2r_name_constraints(method, ncons->excludedSubtrees,
  211|  1.32k|                            bp, ind, "Excluded");
  212|  1.32k|    return 1;
  213|  1.32k|}
v3_ncons.c:do_i2r_name_constraints:
  218|  2.65k|{
  219|  2.65k|    GENERAL_SUBTREE *tree;
  220|  2.65k|    int i;
  221|  2.65k|    if (sk_GENERAL_SUBTREE_num(trees) > 0)
  ------------------
  |  |  539|  2.65k|#define sk_GENERAL_SUBTREE_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_SUBTREE_sk_type(sk))
  ------------------
  |  Branch (221:9): [True: 1.03k, False: 1.62k]
  ------------------
  222|  1.03k|        BIO_printf(bp, "%*s%s:\n", ind, "", name);
  223|  4.90k|    for (i = 0; i < sk_GENERAL_SUBTREE_num(trees); i++) {
  ------------------
  |  |  539|  4.90k|#define sk_GENERAL_SUBTREE_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_SUBTREE_sk_type(sk))
  ------------------
  |  Branch (223:17): [True: 2.24k, False: 2.65k]
  ------------------
  224|  2.24k|        if (i > 0)
  ------------------
  |  Branch (224:13): [True: 1.21k, False: 1.03k]
  ------------------
  225|  1.21k|            BIO_puts(bp, "\n");
  226|  2.24k|        tree = sk_GENERAL_SUBTREE_value(trees, i);
  ------------------
  |  |  540|  2.24k|#define sk_GENERAL_SUBTREE_value(sk, idx) ((GENERAL_SUBTREE *)OPENSSL_sk_value(ossl_check_const_GENERAL_SUBTREE_sk_type(sk), (idx)))
  ------------------
  227|  2.24k|        BIO_printf(bp, "%*s", ind + 2, "");
  228|  2.24k|        if (tree->base->type == GEN_IPADD)
  ------------------
  |  |  180|  2.24k|# define GEN_IPADD       7
  ------------------
  |  Branch (228:13): [True: 930, False: 1.31k]
  ------------------
  229|    930|            print_nc_ipadd(bp, tree->base->d.ip);
  230|  1.31k|        else
  231|  1.31k|            GENERAL_NAME_print(bp, tree->base);
  232|  2.24k|    }
  233|  2.65k|    return 1;
  234|  2.65k|}
v3_ncons.c:print_nc_ipadd:
  237|    930|{
  238|       |    /* ip->length should be 8 or 32 and len1 == len2 == 4 or len1 == len2 == 16 */
  239|    930|    int len1 = ip->length >= 16 ? 16 : ip->length >= 4 ? 4 : ip->length;
  ------------------
  |  Branch (239:16): [True: 43, False: 887]
  |  Branch (239:40): [True: 86, False: 801]
  ------------------
  240|    930|    int len2 = ip->length - len1;
  241|    930|    char *ip1 = ossl_ipaddr_to_asc(ip->data, len1);
  242|    930|    char *ip2 = ossl_ipaddr_to_asc(ip->data + len1, len2);
  243|    930|    int ret = ip1 != NULL && ip2 != NULL
  ------------------
  |  Branch (243:15): [True: 930, False: 0]
  |  Branch (243:30): [True: 930, False: 0]
  ------------------
  244|    930|        && BIO_printf(bp, "IP:%s/%s", ip1, ip2) > 0;
  ------------------
  |  Branch (244:12): [True: 930, False: 0]
  ------------------
  245|       |
  246|    930|    OPENSSL_free(ip1);
  ------------------
  |  |  115|    930|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    930|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    930|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  247|    930|    OPENSSL_free(ip2);
  ------------------
  |  |  115|    930|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    930|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    930|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  248|    930|    return ret;
  249|    930|}

v3_no_ass.c:i2s_NO_ASSERTION:
   31|      1|{
   32|      1|    return OPENSSL_strdup("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__
  |  |  ------------------
  ------------------
   33|      1|}

v3_no_rev_avail.c:i2s_NO_REV_AVAIL:
   31|      1|{
   32|      1|    return OPENSSL_strdup("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__
  |  |  ------------------
  ------------------
   33|      1|}

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

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

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

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

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

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

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

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

v3_soa_id.c:i2s_SOA_IDENTIFIER:
   31|      1|{
   32|      1|    return OPENSSL_strdup("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__
  |  |  ------------------
  ------------------
   33|      1|}

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

X509V3_add_value:
   82|  2.81k|{
   83|  2.81k|    return x509v3_add_len_value(name, value,
   84|  2.81k|                                value != NULL ? strlen((const char *)value) : 0,
  ------------------
  |  Branch (84:33): [True: 2.11k, False: 697]
  ------------------
   85|  2.81k|                                extlist);
   86|  2.81k|}
x509v3_add_len_value_uchar:
   98|  2.36k|{
   99|  2.36k|    return x509v3_add_len_value(name, (const char *)value, vallen, extlist);
  100|  2.36k|}
X509V3_conf_free:
  105|  5.08k|{
  106|  5.08k|    if (!conf)
  ------------------
  |  Branch (106:9): [True: 0, False: 5.08k]
  ------------------
  107|      0|        return;
  108|  5.08k|    OPENSSL_free(conf->name);
  ------------------
  |  |  115|  5.08k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.08k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.08k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  109|  5.08k|    OPENSSL_free(conf->value);
  ------------------
  |  |  115|  5.08k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.08k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.08k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  110|  5.08k|    OPENSSL_free(conf->section);
  ------------------
  |  |  115|  5.08k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.08k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.08k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|  5.08k|    OPENSSL_free(conf);
  ------------------
  |  |  115|  5.08k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.08k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.08k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|  5.08k|}
X509V3_add_value_bool:
  116|    276|{
  117|    276|    if (asn1_bool)
  ------------------
  |  Branch (117:9): [True: 1, False: 275]
  ------------------
  118|      1|        return X509V3_add_value(name, "TRUE", extlist);
  119|    275|    return X509V3_add_value(name, "FALSE", extlist);
  120|    276|}
i2s_ASN1_ENUMERATED:
  167|    549|{
  168|    549|    BIGNUM *bntmp = NULL;
  169|    549|    char *strtmp = NULL;
  170|       |
  171|    549|    if (!a)
  ------------------
  |  Branch (171:9): [True: 0, False: 549]
  ------------------
  172|      0|        return NULL;
  173|    549|    if ((bntmp = ASN1_ENUMERATED_to_BN(a, NULL)) == NULL)
  ------------------
  |  Branch (173:9): [True: 0, False: 549]
  ------------------
  174|    549|        ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  175|    549|    else if ((strtmp = bignum_to_string(bntmp)) == NULL)
  ------------------
  |  Branch (175:14): [True: 0, False: 549]
  ------------------
  176|    549|        ERR_raise(ERR_LIB_X509V3, ERR_R_X509V3_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  177|    549|    BN_free(bntmp);
  178|    549|    return strtmp;
  179|    549|}
i2s_ASN1_INTEGER:
  182|  16.1k|{
  183|  16.1k|    BIGNUM *bntmp = NULL;
  184|  16.1k|    char *strtmp = NULL;
  185|       |
  186|  16.1k|    if (!a)
  ------------------
  |  Branch (186:9): [True: 0, False: 16.1k]
  ------------------
  187|      0|        return NULL;
  188|  16.1k|    if ((bntmp = ASN1_INTEGER_to_BN(a, NULL)) == NULL)
  ------------------
  |  Branch (188:9): [True: 63, False: 16.0k]
  ------------------
  189|  16.1k|        ERR_raise(ERR_LIB_X509V3, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|     63|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     63|    (ERR_new(),                                                 \
  |  |  |  |  404|     63|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     63|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     63|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     63|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     63|     ERR_set_error)
  |  |  ------------------
  ------------------
  190|  16.0k|    else if ((strtmp = bignum_to_string(bntmp)) == NULL)
  ------------------
  |  Branch (190:14): [True: 0, False: 16.0k]
  ------------------
  191|  16.0k|        ERR_raise(ERR_LIB_X509V3, ERR_R_X509V3_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|  16.1k|    BN_free(bntmp);
  193|  16.1k|    return strtmp;
  194|  16.1k|}
X509V3_add_value_int:
  253|  1.34k|{
  254|  1.34k|    char *strtmp;
  255|  1.34k|    int ret;
  256|       |
  257|  1.34k|    if (!aint)
  ------------------
  |  Branch (257:9): [True: 1.21k, False: 130]
  ------------------
  258|  1.21k|        return 1;
  259|    130|    if ((strtmp = i2s_ASN1_INTEGER(NULL, aint)) == NULL)
  ------------------
  |  Branch (259:9): [True: 0, False: 130]
  ------------------
  260|      0|        return 0;
  261|    130|    ret = X509V3_add_value(name, strtmp, extlist);
  262|    130|    OPENSSL_free(strtmp);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  263|    130|    return ret;
  264|    130|}
ossl_ipaddr_to_asc:
 1039|  2.12k|{
 1040|       |    /*
 1041|       |     * 40 is enough space for the longest IPv6 address + nul terminator byte
 1042|       |     * XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX\0
 1043|       |     */
 1044|  2.12k|    char buf[40], *out;
 1045|  2.12k|    int i = 0, remain = 0, bytes = 0;
 1046|       |
 1047|  2.12k|    switch (len) {
 1048|    369|    case 4: /* IPv4 */
  ------------------
  |  Branch (1048:5): [True: 369, False: 1.75k]
  ------------------
 1049|    369|        BIO_snprintf(buf, sizeof(buf), "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
 1050|    369|        break;
 1051|     85|    case 16: /* IPv6 */
  ------------------
  |  Branch (1051:5): [True: 85, False: 2.04k]
  ------------------
 1052|     85|        for (out = buf, i = 8, remain = sizeof(buf);
 1053|    765|             i-- > 0 && bytes >= 0;
  ------------------
  |  Branch (1053:14): [True: 680, False: 85]
  |  Branch (1053:25): [True: 680, False: 0]
  ------------------
 1054|    680|             remain -= bytes, out += bytes) {
 1055|    680|            const char *template = (i > 0 ? "%X:" : "%X");
  ------------------
  |  Branch (1055:37): [True: 595, False: 85]
  ------------------
 1056|       |
 1057|    680|            bytes = BIO_snprintf(out, remain, template, p[0] << 8 | p[1]);
 1058|    680|            p += 2;
 1059|    680|        }
 1060|     85|        break;
 1061|  1.67k|    default:
  ------------------
  |  Branch (1061:5): [True: 1.67k, False: 454]
  ------------------
 1062|  1.67k|        BIO_snprintf(buf, sizeof(buf), "<invalid length=%d>", len);
 1063|  1.67k|        break;
 1064|  2.12k|    }
 1065|  2.12k|    return OPENSSL_strdup(buf);
  ------------------
  |  |  119|  2.12k|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.12k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.12k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1066|  2.12k|}
OSSL_GENERAL_NAMES_print:
 1398|    454|{
 1399|    454|    int i;
 1400|       |
 1401|  1.08k|    for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
  ------------------
  |  |  238|  1.08k|#define sk_GENERAL_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAME_sk_type(sk))
  ------------------
  |  Branch (1401:17): [True: 626, False: 454]
  ------------------
 1402|    626|        if (i > 0)
  ------------------
  |  Branch (1402:13): [True: 213, False: 413]
  ------------------
 1403|    213|            BIO_puts(out, "\n");
 1404|    626|        BIO_printf(out, "%*s", indent + 2, "");
 1405|    626|        GENERAL_NAME_print(out, sk_GENERAL_NAME_value(gens, i));
  ------------------
  |  |  239|    626|#define sk_GENERAL_NAME_value(sk, idx) ((GENERAL_NAME *)OPENSSL_sk_value(ossl_check_const_GENERAL_NAME_sk_type(sk), (idx)))
  ------------------
 1406|    626|    }
 1407|    454|    return 1;
 1408|    454|}
v3_utl.c:x509v3_add_len_value:
   42|  5.18k|{
   43|  5.18k|    CONF_VALUE *vtmp = NULL;
   44|  5.18k|    char *tname = NULL, *tvalue = NULL;
   45|  5.18k|    int sk_allocated = (*extlist == NULL);
   46|       |
   47|  5.18k|    if (name != NULL && (tname = OPENSSL_strdup(name)) == NULL)
  ------------------
  |  |  119|  4.87k|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.87k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.87k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (47:9): [True: 4.87k, False: 310]
  |  Branch (47:25): [True: 0, False: 4.87k]
  ------------------
   48|      0|        goto err;
   49|  5.18k|    if (value != NULL) {
  ------------------
  |  Branch (49:9): [True: 4.48k, False: 697]
  ------------------
   50|       |        /* We don't allow embedded NUL characters */
   51|  4.48k|        if (memchr(value, 0, vallen) != NULL)
  ------------------
  |  Branch (51:13): [True: 93, False: 4.39k]
  ------------------
   52|     93|            goto err;
   53|  4.39k|        tvalue = OPENSSL_strndup(value, vallen);
  ------------------
  |  |  121|  4.39k|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.39k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.39k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   54|  4.39k|        if (tvalue == NULL)
  ------------------
  |  Branch (54:13): [True: 0, False: 4.39k]
  ------------------
   55|      0|            goto err;
   56|  4.39k|    }
   57|  5.08k|    if ((vtmp = OPENSSL_malloc(sizeof(*vtmp))) == NULL)
  ------------------
  |  |  102|  5.08k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.08k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.08k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:9): [True: 0, False: 5.08k]
  ------------------
   58|      0|        goto err;
   59|  5.08k|    if (sk_allocated && (*extlist = sk_CONF_VALUE_new_null()) == NULL) {
  ------------------
  |  |   48|  2.76k|#define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (59:9): [True: 2.76k, False: 2.32k]
  |  Branch (59:25): [True: 0, False: 2.76k]
  ------------------
   60|      0|        ERR_raise(ERR_LIB_X509V3, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   61|      0|        goto err;
   62|      0|    }
   63|  5.08k|    vtmp->section = NULL;
   64|  5.08k|    vtmp->name = tname;
   65|  5.08k|    vtmp->value = tvalue;
   66|  5.08k|    if (!sk_CONF_VALUE_push(*extlist, vtmp))
  ------------------
  |  |   55|  5.08k|#define sk_CONF_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
  ------------------
  |  Branch (66:9): [True: 0, False: 5.08k]
  ------------------
   67|      0|        goto err;
   68|  5.08k|    return 1;
   69|     93| err:
   70|     93|    if (sk_allocated) {
  ------------------
  |  Branch (70:9): [True: 71, False: 22]
  ------------------
   71|     71|        sk_CONF_VALUE_free(*extlist);
  ------------------
  |  |   51|     71|#define sk_CONF_VALUE_free(sk) OPENSSL_sk_free(ossl_check_CONF_VALUE_sk_type(sk))
  ------------------
   72|     71|        *extlist = NULL;
   73|     71|    }
   74|     93|    OPENSSL_free(vtmp);
  ------------------
  |  |  115|     93|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     93|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     93|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   75|     93|    OPENSSL_free(tname);
  ------------------
  |  |  115|     93|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     93|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     93|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|     93|    OPENSSL_free(tvalue);
  ------------------
  |  |  115|     93|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     93|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     93|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|     93|    return 0;
   78|  5.08k|}
v3_utl.c:bignum_to_string:
  131|  16.6k|{
  132|  16.6k|    char *tmp, *ret;
  133|  16.6k|    size_t len;
  134|       |
  135|       |    /*
  136|       |     * Display large numbers in hex and small numbers in decimal. Converting to
  137|       |     * decimal takes quadratic time and is no more useful than hex for large
  138|       |     * numbers.
  139|       |     */
  140|  16.6k|    if (BN_num_bits(bn) < 128)
  ------------------
  |  Branch (140:9): [True: 15.2k, False: 1.40k]
  ------------------
  141|  15.2k|        return BN_bn2dec(bn);
  142|       |
  143|  1.40k|    tmp = BN_bn2hex(bn);
  144|  1.40k|    if (tmp == NULL)
  ------------------
  |  Branch (144:9): [True: 0, False: 1.40k]
  ------------------
  145|      0|        return NULL;
  146|       |
  147|  1.40k|    len = strlen(tmp) + 3;
  148|  1.40k|    ret = OPENSSL_malloc(len);
  ------------------
  |  |  102|  1.40k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.40k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.40k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  149|  1.40k|    if (ret == NULL) {
  ------------------
  |  Branch (149:9): [True: 0, False: 1.40k]
  ------------------
  150|      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__
  |  |  ------------------
  ------------------
  151|      0|        return NULL;
  152|      0|    }
  153|       |
  154|       |    /* Prepend "0x", but place it after the "-" if negative. */
  155|  1.40k|    if (tmp[0] == '-') {
  ------------------
  |  Branch (155:9): [True: 428, False: 981]
  ------------------
  156|    428|        OPENSSL_strlcpy(ret, "-0x", len);
  157|    428|        OPENSSL_strlcat(ret, tmp + 1, len);
  158|    981|    } else {
  159|    981|        OPENSSL_strlcpy(ret, "0x", len);
  160|    981|        OPENSSL_strlcat(ret, tmp, len);
  161|    981|    }
  162|  1.40k|    OPENSSL_free(tmp);
  ------------------
  |  |  115|  1.40k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.40k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.40k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|  1.40k|    return ret;
  164|  1.40k|}

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

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

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

X509_NAME_oneline:
   26|  2.46k|{
   27|  2.46k|    const X509_NAME_ENTRY *ne;
   28|  2.46k|    int i;
   29|  2.46k|    int n, lold, l, l1, l2, num, j, type;
   30|  2.46k|    int prev_set = -1;
   31|  2.46k|    const char *s;
   32|  2.46k|    char *p;
   33|  2.46k|    unsigned char *q;
   34|  2.46k|    BUF_MEM *b = NULL;
   35|  2.46k|    static const char hex[17] = "0123456789ABCDEF";
   36|  2.46k|    int gs_doit[4];
   37|  2.46k|    char tmp_buf[80];
   38|       |#ifdef CHARSET_EBCDIC
   39|       |    unsigned char ebcdic_buf[1024];
   40|       |#endif
   41|       |
   42|  2.46k|    if (buf == NULL) {
  ------------------
  |  Branch (42:9): [True: 2.40k, False: 60]
  ------------------
   43|  2.40k|        if ((b = BUF_MEM_new()) == NULL)
  ------------------
  |  Branch (43:13): [True: 0, False: 2.40k]
  ------------------
   44|      0|            goto buferr;
   45|  2.40k|        if (!BUF_MEM_grow(b, 200))
  ------------------
  |  Branch (45:13): [True: 0, False: 2.40k]
  ------------------
   46|      0|            goto buferr;
   47|  2.40k|        b->data[0] = '\0';
   48|  2.40k|        len = 200;
   49|  2.40k|    } else if (len == 0) {
  ------------------
  |  Branch (49:16): [True: 0, False: 60]
  ------------------
   50|      0|        return NULL;
   51|      0|    }
   52|  2.46k|    if (a == NULL) {
  ------------------
  |  Branch (52:9): [True: 0, False: 2.46k]
  ------------------
   53|      0|        if (b) {
  ------------------
  |  Branch (53:13): [True: 0, False: 0]
  ------------------
   54|      0|            buf = b->data;
   55|      0|            OPENSSL_free(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__
  |  |  ------------------
  ------------------
   56|      0|        }
   57|      0|        strncpy(buf, "NO X509_NAME", len);
   58|      0|        buf[len - 1] = '\0';
   59|      0|        return buf;
   60|      0|    }
   61|       |
   62|  2.46k|    len--;                      /* space for '\0' */
   63|  2.46k|    l = 0;
   64|  4.70k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
  ------------------
  |  |  204|  4.70k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (64:17): [True: 2.25k, False: 2.45k]
  ------------------
   65|  2.25k|        ne = sk_X509_NAME_ENTRY_value(a->entries, i);
  ------------------
  |  |  205|  2.25k|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
   66|  2.25k|        n = OBJ_obj2nid(ne->object);
   67|  2.25k|        if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) {
  ------------------
  |  |   18|  2.25k|#define NID_undef                       0
  ------------------
  |  Branch (67:13): [True: 1.62k, False: 627]
  |  Branch (67:33): [True: 0, False: 627]
  ------------------
   68|  1.62k|            i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object);
   69|  1.62k|            s = tmp_buf;
   70|  1.62k|        }
   71|  2.25k|        l1 = strlen(s);
   72|       |
   73|  2.25k|        type = ne->value->type;
   74|  2.25k|        num = ne->value->length;
   75|  2.25k|        if (num > NAME_ONELINE_MAX) {
  ------------------
  |  |   23|  2.25k|#define NAME_ONELINE_MAX    (1024 * 1024)
  ------------------
  |  Branch (75:13): [True: 0, False: 2.25k]
  ------------------
   76|      0|            ERR_raise(ERR_LIB_X509, X509_R_NAME_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   77|      0|            goto end;
   78|      0|        }
   79|  2.25k|        q = ne->value->data;
   80|       |#ifdef CHARSET_EBCDIC
   81|       |        if (type == V_ASN1_GENERALSTRING ||
   82|       |            type == V_ASN1_VISIBLESTRING ||
   83|       |            type == V_ASN1_PRINTABLESTRING ||
   84|       |            type == V_ASN1_TELETEXSTRING ||
   85|       |            type == V_ASN1_IA5STRING) {
   86|       |            if (num > (int)sizeof(ebcdic_buf))
   87|       |                num = sizeof(ebcdic_buf);
   88|       |            ascii2ebcdic(ebcdic_buf, q, num);
   89|       |            q = ebcdic_buf;
   90|       |        }
   91|       |#endif
   92|       |
   93|  2.25k|        if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) {
  ------------------
  |  |   87|  2.25k|# define V_ASN1_GENERALSTRING            27 /**/
  ------------------
  |  Branch (93:13): [True: 0, False: 2.25k]
  |  Branch (93:47): [True: 0, False: 0]
  ------------------
   94|      0|            gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0;
   95|      0|            for (j = 0; j < num; j++)
  ------------------
  |  Branch (95:25): [True: 0, False: 0]
  ------------------
   96|      0|                if (q[j] != 0)
  ------------------
  |  Branch (96:21): [True: 0, False: 0]
  ------------------
   97|      0|                    gs_doit[j & 3] = 1;
   98|       |
   99|      0|            if (gs_doit[0] | gs_doit[1] | gs_doit[2])
  ------------------
  |  Branch (99:17): [True: 0, False: 0]
  ------------------
  100|      0|                gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
  101|      0|            else {
  102|      0|                gs_doit[0] = gs_doit[1] = gs_doit[2] = 0;
  103|      0|                gs_doit[3] = 1;
  104|      0|            }
  105|      0|        } else
  106|  2.25k|            gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
  107|       |
  108|   307k|        for (l2 = j = 0; j < num; j++) {
  ------------------
  |  Branch (108:26): [True: 305k, False: 2.25k]
  ------------------
  109|   305k|            if (!gs_doit[j & 3])
  ------------------
  |  Branch (109:17): [True: 0, False: 305k]
  ------------------
  110|      0|                continue;
  111|   305k|            l2++;
  112|   305k|            if (q[j] == '/' || q[j] == '+')
  ------------------
  |  Branch (112:17): [True: 680, False: 304k]
  |  Branch (112:32): [True: 753, False: 303k]
  ------------------
  113|  1.43k|                l2++; /* char needs to be escaped */
  114|   303k|            else if ((ossl_toascii(q[j]) < ossl_toascii(' ')) ||
  ------------------
  |  |   56|   303k|#  define ossl_toascii(c)       (c)
  ------------------
                          else if ((ossl_toascii(q[j]) < ossl_toascii(' ')) ||
  ------------------
  |  |   56|   303k|#  define ossl_toascii(c)       (c)
  ------------------
  |  Branch (114:22): [True: 35.3k, False: 268k]
  ------------------
  115|   303k|                     (ossl_toascii(q[j]) > ossl_toascii('~')))
  ------------------
  |  |   56|   268k|#  define ossl_toascii(c)       (c)
  ------------------
                                   (ossl_toascii(q[j]) > ossl_toascii('~')))
  ------------------
  |  |   56|   268k|#  define ossl_toascii(c)       (c)
  ------------------
  |  Branch (115:22): [True: 254k, False: 13.4k]
  ------------------
  116|   290k|                l2 += 3;
  117|   305k|        }
  118|       |
  119|  2.25k|        lold = l;
  120|  2.25k|        l += 1 + l1 + 1 + l2;
  121|  2.25k|        if (l > NAME_ONELINE_MAX) {
  ------------------
  |  |   23|  2.25k|#define NAME_ONELINE_MAX    (1024 * 1024)
  ------------------
  |  Branch (121:13): [True: 0, False: 2.25k]
  ------------------
  122|      0|            ERR_raise(ERR_LIB_X509, X509_R_NAME_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|      0|            goto end;
  124|      0|        }
  125|  2.25k|        if (b != NULL) {
  ------------------
  |  Branch (125:13): [True: 2.21k, False: 32]
  ------------------
  126|  2.21k|            if (!BUF_MEM_grow(b, l + 1))
  ------------------
  |  Branch (126:17): [True: 0, False: 2.21k]
  ------------------
  127|      0|                goto buferr;
  128|  2.21k|            p = &(b->data[lold]);
  129|  2.21k|        } else if (l > len) {
  ------------------
  |  Branch (129:20): [True: 10, False: 22]
  ------------------
  130|     10|            break;
  131|     10|        } else
  132|     22|            p = &(buf[lold]);
  133|  2.24k|        *(p++) = prev_set == ne->set ? '+' : '/';
  ------------------
  |  Branch (133:18): [True: 1.01k, False: 1.22k]
  ------------------
  134|  2.24k|        memcpy(p, s, (unsigned int)l1);
  135|  2.24k|        p += l1;
  136|  2.24k|        *(p++) = '=';
  137|       |
  138|  2.24k|#ifndef CHARSET_EBCDIC          /* q was assigned above already. */
  139|  2.24k|        q = ne->value->data;
  140|  2.24k|#endif
  141|       |
  142|   306k|        for (j = 0; j < num; j++) {
  ------------------
  |  Branch (142:21): [True: 304k, False: 2.24k]
  ------------------
  143|   304k|            if (!gs_doit[j & 3])
  ------------------
  |  Branch (143:17): [True: 0, False: 304k]
  ------------------
  144|      0|                continue;
  145|   304k|#ifndef CHARSET_EBCDIC
  146|   304k|            n = q[j];
  147|   304k|            if ((n < ' ') || (n > '~')) {
  ------------------
  |  Branch (147:17): [True: 35.0k, False: 269k]
  |  Branch (147:30): [True: 254k, False: 14.7k]
  ------------------
  148|   289k|                *(p++) = '\\';
  149|   289k|                *(p++) = 'x';
  150|   289k|                *(p++) = hex[(n >> 4) & 0x0f];
  151|   289k|                *(p++) = hex[n & 0x0f];
  152|   289k|            } else {
  153|  14.7k|                if (n == '/' || n == '+')
  ------------------
  |  Branch (153:21): [True: 680, False: 14.0k]
  |  Branch (153:33): [True: 749, False: 13.3k]
  ------------------
  154|  1.42k|                    *(p++) = '\\';
  155|  14.7k|                *(p++) = n;
  156|  14.7k|            }
  157|       |#else
  158|       |            n = os_toascii[q[j]];
  159|       |            if ((n < os_toascii[' ']) || (n > os_toascii['~'])) {
  160|       |                *(p++) = '\\';
  161|       |                *(p++) = 'x';
  162|       |                *(p++) = hex[(n >> 4) & 0x0f];
  163|       |                *(p++) = hex[n & 0x0f];
  164|       |            } else {
  165|       |                if (n == os_toascii['/'] || n == os_toascii['+'])
  166|       |                    *(p++) = '\\';
  167|       |                *(p++) = q[j];
  168|       |            }
  169|       |#endif
  170|   304k|        }
  171|  2.24k|        *p = '\0';
  172|  2.24k|        prev_set = ne->set;
  173|  2.24k|    }
  174|  2.46k|    if (b != NULL) {
  ------------------
  |  Branch (174:9): [True: 2.40k, False: 60]
  ------------------
  175|  2.40k|        p = b->data;
  176|  2.40k|        OPENSSL_free(b);
  ------------------
  |  |  115|  2.40k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.40k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.40k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|  2.40k|    } else
  178|     60|        p = buf;
  179|  2.46k|    if (i == 0)
  ------------------
  |  Branch (179:9): [True: 1.68k, False: 783]
  ------------------
  180|  1.68k|        *p = '\0';
  181|  2.46k|    return p;
  182|      0| buferr:
  183|      0|    ERR_raise(ERR_LIB_X509, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  184|      0| end:
  185|      0|    BUF_MEM_free(b);
  186|      0|    return NULL;
  187|      0|}

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

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

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

X509_NAME_entry_count:
   51|  4.81k|{
   52|  4.81k|    int ret;
   53|       |
   54|  4.81k|    if (name == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 4.81k]
  ------------------
   55|      0|        return 0;
   56|  4.81k|    ret = sk_X509_NAME_ENTRY_num(name->entries);
  ------------------
  |  |  204|  4.81k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
   57|  4.81k|    return ret > 0 ? ret : 0;
  ------------------
  |  Branch (57:12): [True: 4.46k, False: 348]
  ------------------
   58|  4.81k|}
X509_NAME_get_entry:
   93|  8.26k|{
   94|  8.26k|    if (name == NULL || sk_X509_NAME_ENTRY_num(name->entries) <= loc
  ------------------
  |  |  204|  8.26k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (94:9): [True: 0, False: 8.26k]
  |  Branch (94:25): [True: 0, False: 8.26k]
  ------------------
   95|  8.26k|        || loc < 0)
  ------------------
  |  Branch (95:12): [True: 0, False: 8.26k]
  ------------------
   96|      0|        return NULL;
   97|       |
   98|  8.26k|    return sk_X509_NAME_ENTRY_value(name->entries, loc);
  ------------------
  |  |  205|  8.26k|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
   99|  8.26k|}
X509_NAME_add_entry:
  190|  1.03k|{
  191|  1.03k|    X509_NAME_ENTRY *new_name = NULL;
  192|  1.03k|    int n, i, inc;
  193|  1.03k|    STACK_OF(X509_NAME_ENTRY) *sk;
  ------------------
  |  |   31|  1.03k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  194|       |
  195|  1.03k|    if (name == NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 1.03k]
  ------------------
  196|      0|        return 0;
  197|  1.03k|    sk = name->entries;
  198|  1.03k|    n = sk_X509_NAME_ENTRY_num(sk);
  ------------------
  |  |  204|  1.03k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  199|  1.03k|    if (loc > n)
  ------------------
  |  Branch (199:9): [True: 0, False: 1.03k]
  ------------------
  200|      0|        loc = n;
  201|  1.03k|    else if (loc < 0)
  ------------------
  |  Branch (201:14): [True: 1.03k, False: 0]
  ------------------
  202|  1.03k|        loc = n;
  203|  1.03k|    inc = (set == 0);
  204|  1.03k|    name->modified = 1;
  205|       |
  206|  1.03k|    if (set == -1) {
  ------------------
  |  Branch (206:9): [True: 0, False: 1.03k]
  ------------------
  207|      0|        if (loc == 0) {
  ------------------
  |  Branch (207:13): [True: 0, False: 0]
  ------------------
  208|      0|            set = 0;
  209|      0|            inc = 1;
  210|      0|        } else {
  211|      0|            set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set;
  ------------------
  |  |  205|      0|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
  212|      0|        }
  213|  1.03k|    } else {                    /* if (set >= 0) */
  214|       |
  215|  1.03k|        if (loc >= n) {
  ------------------
  |  Branch (215:13): [True: 1.03k, False: 0]
  ------------------
  216|  1.03k|            if (loc != 0)
  ------------------
  |  Branch (216:17): [True: 930, False: 107]
  ------------------
  217|    930|                set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set + 1;
  ------------------
  |  |  205|    930|#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|    107|            else
  219|    107|                set = 0;
  220|  1.03k|        } else
  221|      0|            set = sk_X509_NAME_ENTRY_value(sk, loc)->set;
  ------------------
  |  |  205|      0|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
  222|  1.03k|    }
  223|       |
  224|  1.03k|    if ((new_name = X509_NAME_ENTRY_dup(ne)) == NULL)
  ------------------
  |  Branch (224:9): [True: 0, False: 1.03k]
  ------------------
  225|      0|        goto err;
  226|  1.03k|    new_name->set = set;
  227|  1.03k|    if (!sk_X509_NAME_ENTRY_insert(sk, new_name, loc)) {
  ------------------
  |  |  219|  1.03k|#define sk_X509_NAME_ENTRY_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr), (idx))
  ------------------
  |  Branch (227:9): [True: 0, False: 1.03k]
  ------------------
  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|  1.03k|    if (inc) {
  ------------------
  |  Branch (231:9): [True: 930, False: 107]
  ------------------
  232|    930|        n = sk_X509_NAME_ENTRY_num(sk);
  ------------------
  |  |  204|    930|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  233|    930|        for (i = loc + 1; i < n; i++)
  ------------------
  |  Branch (233:27): [True: 0, False: 930]
  ------------------
  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|    930|    }
  236|  1.03k|    return 1;
  237|      0| err:
  238|      0|    X509_NAME_ENTRY_free(new_name);
  239|      0|    return 0;
  240|  1.03k|}
X509_NAME_ENTRY_get_object:
  343|  8.26k|{
  344|  8.26k|    if (ne == NULL)
  ------------------
  |  Branch (344:9): [True: 0, False: 8.26k]
  ------------------
  345|      0|        return NULL;
  346|  8.26k|    return ne->object;
  347|  8.26k|}
X509_NAME_ENTRY_get_data:
  350|  8.26k|{
  351|  8.26k|    if (ne == NULL)
  ------------------
  |  Branch (351:9): [True: 0, False: 8.26k]
  ------------------
  352|      0|        return NULL;
  353|  8.26k|    return ne->value;
  354|  8.26k|}
X509_NAME_ENTRY_set:
  357|  12.0k|{
  358|  12.0k|    return ne->set;
  359|  12.0k|}

X509_CRL_digest:
  607|  5.71k|{
  608|  5.71k|    if (type == NULL) {
  ------------------
  |  Branch (608:9): [True: 0, False: 5.71k]
  ------------------
  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|  5.71k|    if (EVP_MD_is_a(type, SN_sha1)
  ------------------
  |  | 2310|  5.71k|#define SN_sha1         "SHA1"
  ------------------
  |  Branch (612:9): [True: 5.71k, False: 0]
  ------------------
  613|  5.71k|            && (data->flags & EXFLAG_SET) != 0
  ------------------
  |  |  659|  5.71k|# define EXFLAG_SET              0x100
  ------------------
  |  Branch (613:16): [True: 0, False: 5.71k]
  ------------------
  614|  5.71k|            && (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|  5.71k|    return
  622|  5.71k|        ossl_asn1_item_digest_ex(ASN1_ITEM_rptr(X509_CRL), type, (char *)data,
  ------------------
  |  |  426|  5.71k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  623|  5.71k|                                 md, len, data->libctx, data->propq);
  624|  5.71k|}
i2d_PKCS8_PRIV_KEY_INFO_bio:
  784|     33|{
  785|     33|    return ASN1_i2d_bio_of(PKCS8_PRIV_KEY_INFO, i2d_PKCS8_PRIV_KEY_INFO, bp,
  ------------------
  |  |  970|     33|    (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \
  |  |  ------------------
  |  |  |  |  360|     33|    ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:22): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  971|     33|                  out, \
  |  |  972|     33|                  CHECKED_PTR_OF(const type, x)))
  |  |  ------------------
  |  |  |  |  364|     33|    ((void*) (1 ? p : (type*)0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:15): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  786|     33|                           p8inf);
  787|     33|}

x_crl.c:crl_inf_cb:
   49|   116k|{
   50|   116k|    X509_CRL_INFO *a = (X509_CRL_INFO *)*pval;
   51|       |
   52|   116k|    if (!a || !a->revoked)
  ------------------
  |  Branch (52:9): [True: 8.87k, False: 107k]
  |  Branch (52:15): [True: 103k, False: 4.65k]
  ------------------
   53|   111k|        return 1;
   54|  4.65k|    switch (operation) {
  ------------------
  |  Branch (54:13): [True: 2.34k, False: 2.30k]
  ------------------
   55|       |        /*
   56|       |         * Just set cmp function here. We don't sort because that would
   57|       |         * affect the output of X509_CRL_print().
   58|       |         */
   59|  2.30k|    case ASN1_OP_D2I_POST:
  ------------------
  |  |  747|  2.30k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (59:5): [True: 2.30k, False: 2.34k]
  ------------------
   60|  2.30k|        (void)sk_X509_REVOKED_set_cmp_func(a->revoked, X509_REVOKED_cmp);
  ------------------
  |  |  129|  2.30k|#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|  2.30k|        break;
   62|  4.65k|    }
   63|  4.65k|    return 1;
   64|  4.65k|}
x_crl.c:crl_cb:
  160|  96.7k|{
  161|  96.7k|    X509_CRL *crl = (X509_CRL *)*pval;
  162|  96.7k|    STACK_OF(X509_EXTENSION) *exts;
  ------------------
  |  |   31|  96.7k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  163|  96.7k|    X509_EXTENSION *ext;
  164|  96.7k|    int idx, i;
  165|       |
  166|  96.7k|    switch (operation) {
  ------------------
  |  Branch (166:13): [True: 46.8k, False: 49.8k]
  ------------------
  167|  14.7k|    case ASN1_OP_D2I_PRE:
  ------------------
  |  |  746|  14.7k|# define ASN1_OP_D2I_PRE         4
  ------------------
  |  Branch (167:5): [True: 14.7k, False: 81.9k]
  ------------------
  168|  14.7k|        if (crl->meth->crl_free) {
  ------------------
  |  Branch (168:13): [True: 0, False: 14.7k]
  ------------------
  169|      0|            if (!crl->meth->crl_free(crl))
  ------------------
  |  Branch (169:17): [True: 0, False: 0]
  ------------------
  170|      0|                return 0;
  171|      0|        }
  172|  14.7k|        AUTHORITY_KEYID_free(crl->akid);
  173|  14.7k|        ISSUING_DIST_POINT_free(crl->idp);
  174|  14.7k|        ASN1_INTEGER_free(crl->crl_number);
  175|  14.7k|        ASN1_INTEGER_free(crl->base_crl_number);
  176|  14.7k|        sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
  ------------------
  |  |  285|  14.7k|#define sk_GENERAL_NAMES_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_GENERAL_NAMES_sk_type(sk),ossl_check_GENERAL_NAMES_freefunc_type(freefunc))
  ------------------
  177|       |        /* fall through */
  178|       |
  179|  29.4k|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  743|  29.4k|# define ASN1_OP_NEW_POST        1
  ------------------
  |  Branch (179:5): [True: 14.7k, False: 81.9k]
  ------------------
  180|  29.4k|        crl->idp = NULL;
  181|  29.4k|        crl->akid = NULL;
  182|  29.4k|        crl->flags = 0;
  183|  29.4k|        crl->idp_flags = 0;
  184|  29.4k|        crl->idp_reasons = CRLDP_ALL_REASONS;
  ------------------
  |  |  309|  29.4k|# define CRLDP_ALL_REASONS       0x807f
  ------------------
  185|  29.4k|        crl->meth = default_crl_method;
  186|  29.4k|        crl->meth_data = NULL;
  187|  29.4k|        crl->issuers = NULL;
  188|  29.4k|        crl->crl_number = NULL;
  189|  29.4k|        crl->base_crl_number = NULL;
  190|  29.4k|        break;
  191|       |
  192|  5.71k|    case ASN1_OP_D2I_POST:
  ------------------
  |  |  747|  5.71k|# define ASN1_OP_D2I_POST        5
  ------------------
  |  Branch (192:5): [True: 5.71k, False: 91.0k]
  ------------------
  193|  5.71k|        if (!X509_CRL_digest(crl, EVP_sha1(), crl->sha1_hash, NULL))
  ------------------
  |  Branch (193:13): [True: 0, False: 5.71k]
  ------------------
  194|      0|            crl->flags |= EXFLAG_NO_FINGERPRINT;
  ------------------
  |  |  671|      0|# define EXFLAG_NO_FINGERPRINT   0x100000
  ------------------
  195|  5.71k|        crl->idp = X509_CRL_get_ext_d2i(crl,
  196|  5.71k|                                        NID_issuing_distribution_point, &i,
  ------------------
  |  | 2698|  5.71k|#define NID_issuing_distribution_point          770
  ------------------
  197|  5.71k|                                        NULL);
  198|  5.71k|        if (crl->idp != NULL) {
  ------------------
  |  Branch (198:13): [True: 167, False: 5.54k]
  ------------------
  199|    167|            if (!setup_idp(crl, crl->idp))
  ------------------
  |  Branch (199:17): [True: 1, False: 166]
  ------------------
  200|      1|                crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|      1|# define EXFLAG_INVALID          0x80
  ------------------
  201|    167|        }
  202|  5.54k|        else if (i != -1) {
  ------------------
  |  Branch (202:18): [True: 4.58k, False: 967]
  ------------------
  203|  4.58k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|  4.58k|# define EXFLAG_INVALID          0x80
  ------------------
  204|  4.58k|        }
  205|       |
  206|  5.71k|        crl->akid = X509_CRL_get_ext_d2i(crl,
  207|  5.71k|                                         NID_authority_key_identifier, &i,
  ------------------
  |  | 2733|  5.71k|#define NID_authority_key_identifier            90
  ------------------
  208|  5.71k|                                         NULL);
  209|  5.71k|        if (crl->akid == NULL && i != -1)
  ------------------
  |  Branch (209:13): [True: 5.68k, False: 27]
  |  Branch (209:34): [True: 1.91k, False: 3.76k]
  ------------------
  210|  1.91k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|  1.91k|# define EXFLAG_INVALID          0x80
  ------------------
  211|       |
  212|  5.71k|        crl->crl_number = X509_CRL_get_ext_d2i(crl,
  213|  5.71k|                                               NID_crl_number, &i, NULL);
  ------------------
  |  | 2678|  5.71k|#define NID_crl_number          88
  ------------------
  214|  5.71k|        if (crl->crl_number == NULL && i != -1)
  ------------------
  |  Branch (214:13): [True: 4.27k, False: 1.44k]
  |  Branch (214:40): [True: 386, False: 3.88k]
  ------------------
  215|    386|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|    386|# define EXFLAG_INVALID          0x80
  ------------------
  216|       |
  217|  5.71k|        crl->base_crl_number = X509_CRL_get_ext_d2i(crl,
  218|  5.71k|                                                    NID_delta_crl, &i,
  ------------------
  |  | 2693|  5.71k|#define NID_delta_crl           140
  ------------------
  219|  5.71k|                                                    NULL);
  220|  5.71k|        if (crl->base_crl_number == NULL && i != -1)
  ------------------
  |  Branch (220:13): [True: 5.53k, False: 180]
  |  Branch (220:45): [True: 6, False: 5.52k]
  ------------------
  221|      6|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|      6|# define EXFLAG_INVALID          0x80
  ------------------
  222|       |        /* Delta CRLs must have CRL number */
  223|  5.71k|        if (crl->base_crl_number && !crl->crl_number)
  ------------------
  |  Branch (223:13): [True: 180, False: 5.53k]
  |  Branch (223:37): [True: 180, False: 0]
  ------------------
  224|    180|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|    180|# 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|  5.71k|        exts = crl->crl.extensions;
  234|       |
  235|  22.7k|        for (idx = 0; idx < sk_X509_EXTENSION_num(exts); idx++) {
  ------------------
  |  |  235|  22.7k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (235:23): [True: 17.0k, False: 5.68k]
  ------------------
  236|  17.0k|            int nid;
  237|  17.0k|            ext = sk_X509_EXTENSION_value(exts, idx);
  ------------------
  |  |  236|  17.0k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  238|  17.0k|            nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext));
  239|  17.0k|            if (nid == NID_freshest_crl)
  ------------------
  |  | 2773|  17.0k|#define NID_freshest_crl                857
  ------------------
  |  Branch (239:17): [True: 24, False: 17.0k]
  ------------------
  240|     24|                crl->flags |= EXFLAG_FRESHEST;
  ------------------
  |  |  664|     24|# define EXFLAG_FRESHEST         0x1000
  ------------------
  241|  17.0k|            if (X509_EXTENSION_get_critical(ext)) {
  ------------------
  |  Branch (241:17): [True: 2.00k, False: 15.0k]
  ------------------
  242|       |                /* We handle IDP and deltas */
  243|  2.00k|                if ((nid == NID_issuing_distribution_point)
  ------------------
  |  | 2698|  2.00k|#define NID_issuing_distribution_point          770
  ------------------
  |  Branch (243:21): [True: 1.94k, False: 56]
  ------------------
  244|  2.00k|                    || (nid == NID_authority_key_identifier)
  ------------------
  |  | 2733|     56|#define NID_authority_key_identifier            90
  ------------------
  |  Branch (244:24): [True: 23, False: 33]
  ------------------
  245|  2.00k|                    || (nid == NID_delta_crl))
  ------------------
  |  | 2693|     33|#define NID_delta_crl           140
  ------------------
  |  Branch (245:24): [True: 3, False: 30]
  ------------------
  246|  1.97k|                    continue;
  247|     30|                crl->flags |= EXFLAG_CRITICAL;
  ------------------
  |  |  660|     30|# define EXFLAG_CRITICAL         0x200
  ------------------
  248|     30|                break;
  249|  2.00k|            }
  250|  17.0k|        }
  251|       |
  252|  5.71k|        if (!crl_set_issuers(crl))
  ------------------
  |  Branch (252:13): [True: 0, False: 5.71k]
  ------------------
  253|      0|            return 0;
  254|       |
  255|  5.71k|        if (crl->meth->crl_init) {
  ------------------
  |  Branch (255:13): [True: 0, False: 5.71k]
  ------------------
  256|      0|            if (crl->meth->crl_init(crl) == 0)
  ------------------
  |  Branch (256:17): [True: 0, False: 0]
  ------------------
  257|      0|                return 0;
  258|      0|        }
  259|       |
  260|  5.71k|        crl->flags |= EXFLAG_SET;
  ------------------
  |  |  659|  5.71k|# define EXFLAG_SET              0x100
  ------------------
  261|  5.71k|        break;
  262|       |
  263|  14.7k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  745|  14.7k|# define ASN1_OP_FREE_POST       3
  ------------------
  |  Branch (263:5): [True: 14.7k, False: 81.9k]
  ------------------
  264|  14.7k|        if (crl->meth != NULL && crl->meth->crl_free != NULL) {
  ------------------
  |  Branch (264:13): [True: 14.7k, False: 0]
  |  Branch (264:34): [True: 0, False: 14.7k]
  ------------------
  265|      0|            if (!crl->meth->crl_free(crl))
  ------------------
  |  Branch (265:17): [True: 0, False: 0]
  ------------------
  266|      0|                return 0;
  267|      0|        }
  268|  14.7k|        AUTHORITY_KEYID_free(crl->akid);
  269|  14.7k|        ISSUING_DIST_POINT_free(crl->idp);
  270|  14.7k|        ASN1_INTEGER_free(crl->crl_number);
  271|  14.7k|        ASN1_INTEGER_free(crl->base_crl_number);
  272|  14.7k|        sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
  ------------------
  |  |  285|  14.7k|#define sk_GENERAL_NAMES_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_GENERAL_NAMES_sk_type(sk),ossl_check_GENERAL_NAMES_freefunc_type(freefunc))
  ------------------
  273|  14.7k|        OPENSSL_free(crl->propq);
  ------------------
  |  |  115|  14.7k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  14.7k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  14.7k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  274|  14.7k|        break;
  275|      0|    case ASN1_OP_DUP_POST:
  ------------------
  |  |  757|      0|# define ASN1_OP_DUP_POST        15
  ------------------
  |  Branch (275:5): [True: 0, False: 96.7k]
  ------------------
  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|  96.7k|    }
  284|  96.7k|    return 1;
  285|  96.7k|}
x_crl.c:setup_idp:
  290|    167|{
  291|    167|    int idp_only = 0;
  292|       |
  293|       |    /* Set various flags according to IDP */
  294|    167|    crl->idp_flags |= IDP_PRESENT;
  ------------------
  |  |  601|    167|# define IDP_PRESENT     0x1
  ------------------
  295|    167|    if (idp->onlyuser > 0) {
  ------------------
  |  Branch (295:9): [True: 8, False: 159]
  ------------------
  296|      8|        idp_only++;
  297|      8|        crl->idp_flags |= IDP_ONLYUSER;
  ------------------
  |  |  605|      8|# define IDP_ONLYUSER    0x4
  ------------------
  298|      8|    }
  299|    167|    if (idp->onlyCA > 0) {
  ------------------
  |  Branch (299:9): [True: 9, False: 158]
  ------------------
  300|      9|        idp_only++;
  301|      9|        crl->idp_flags |= IDP_ONLYCA;
  ------------------
  |  |  607|      9|# define IDP_ONLYCA      0x8
  ------------------
  302|      9|    }
  303|    167|    if (idp->onlyattr > 0) {
  ------------------
  |  Branch (303:9): [True: 25, False: 142]
  ------------------
  304|     25|        idp_only++;
  305|     25|        crl->idp_flags |= IDP_ONLYATTR;
  ------------------
  |  |  609|     25|# define IDP_ONLYATTR    0x10
  ------------------
  306|     25|    }
  307|       |
  308|    167|    if (idp_only > 1)
  ------------------
  |  Branch (308:9): [True: 3, False: 164]
  ------------------
  309|      3|        crl->idp_flags |= IDP_INVALID;
  ------------------
  |  |  603|      3|# define IDP_INVALID     0x2
  ------------------
  310|       |
  311|    167|    if (idp->indirectCRL > 0)
  ------------------
  |  Branch (311:9): [True: 3, False: 164]
  ------------------
  312|      3|        crl->idp_flags |= IDP_INDIRECT;
  ------------------
  |  |  611|      3|# define IDP_INDIRECT    0x20
  ------------------
  313|       |
  314|    167|    if (idp->onlysomereasons) {
  ------------------
  |  Branch (314:9): [True: 6, False: 161]
  ------------------
  315|      6|        crl->idp_flags |= IDP_REASONS;
  ------------------
  |  |  613|      6|# define IDP_REASONS     0x40
  ------------------
  316|      6|        if (idp->onlysomereasons->length > 0)
  ------------------
  |  Branch (316:13): [True: 3, False: 3]
  ------------------
  317|      3|            crl->idp_reasons = idp->onlysomereasons->data[0];
  318|      6|        if (idp->onlysomereasons->length > 1)
  ------------------
  |  Branch (318:13): [True: 3, False: 3]
  ------------------
  319|      3|            crl->idp_reasons |= (idp->onlysomereasons->data[1] << 8);
  320|      6|        crl->idp_reasons &= CRLDP_ALL_REASONS;
  ------------------
  |  |  309|      6|# define CRLDP_ALL_REASONS       0x807f
  ------------------
  321|      6|    }
  322|       |
  323|    167|    return DIST_POINT_set_dpname(idp->distpoint, X509_CRL_get_issuer(crl));
  324|    167|}
x_crl.c:crl_set_issuers:
   83|  5.71k|{
   84|       |
   85|  5.71k|    int i, j;
   86|  5.71k|    GENERAL_NAMES *gens, *gtmp;
   87|  5.71k|    STACK_OF(X509_REVOKED) *revoked;
  ------------------
  |  |   31|  5.71k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   88|       |
   89|  5.71k|    revoked = X509_CRL_get_REVOKED(crl);
   90|       |
   91|  5.71k|    gens = NULL;
   92|  26.5k|    for (i = 0; i < sk_X509_REVOKED_num(revoked); i++) {
  ------------------
  |  |  105|  26.5k|#define sk_X509_REVOKED_num(sk) OPENSSL_sk_num(ossl_check_const_X509_REVOKED_sk_type(sk))
  ------------------
  |  Branch (92:17): [True: 22.4k, False: 4.13k]
  ------------------
   93|  22.4k|        X509_REVOKED *rev = sk_X509_REVOKED_value(revoked, i);
  ------------------
  |  |  106|  22.4k|#define sk_X509_REVOKED_value(sk, idx) ((X509_REVOKED *)OPENSSL_sk_value(ossl_check_const_X509_REVOKED_sk_type(sk), (idx)))
  ------------------
   94|  22.4k|        STACK_OF(X509_EXTENSION) *exts;
  ------------------
  |  |   31|  22.4k|# define STACK_OF(type) struct stack_st_##type
  ------------------
   95|  22.4k|        ASN1_ENUMERATED *reason;
   96|  22.4k|        X509_EXTENSION *ext;
   97|       |
   98|  22.4k|        gtmp = X509_REVOKED_get_ext_d2i(rev,
   99|  22.4k|                                        NID_certificate_issuer, &j, NULL);
  ------------------
  |  | 2703|  22.4k|#define NID_certificate_issuer          771
  ------------------
  100|  22.4k|        if (gtmp == NULL && j != -1) {
  ------------------
  |  Branch (100:13): [True: 21.3k, False: 1.04k]
  |  Branch (100:29): [True: 45, False: 21.3k]
  ------------------
  101|     45|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|     45|# define EXFLAG_INVALID          0x80
  ------------------
  102|     45|            return 1;
  103|     45|        }
  104|       |
  105|  22.4k|        if (gtmp != NULL) {
  ------------------
  |  Branch (105:13): [True: 1.04k, False: 21.3k]
  ------------------
  106|  1.04k|            if (crl->issuers == NULL) {
  ------------------
  |  Branch (106:17): [True: 143, False: 905]
  ------------------
  107|    143|                crl->issuers = sk_GENERAL_NAMES_new_null();
  ------------------
  |  |  274|    143|#define sk_GENERAL_NAMES_new_null() ((STACK_OF(GENERAL_NAMES) *)OPENSSL_sk_new_null())
  ------------------
  108|    143|                if (crl->issuers == NULL) {
  ------------------
  |  Branch (108:21): [True: 0, False: 143]
  ------------------
  109|      0|                    GENERAL_NAMES_free(gtmp);
  110|      0|                    return 0;
  111|      0|                }
  112|    143|            }
  113|  1.04k|            if (!sk_GENERAL_NAMES_push(crl->issuers, gtmp)) {
  ------------------
  |  |  281|  1.04k|#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: 1.04k]
  ------------------
  114|      0|                GENERAL_NAMES_free(gtmp);
  115|      0|                return 0;
  116|      0|            }
  117|  1.04k|            gens = gtmp;
  118|  1.04k|        }
  119|  22.4k|        rev->issuer = gens;
  120|       |
  121|  22.4k|        reason = X509_REVOKED_get_ext_d2i(rev, NID_crl_reason, &j, NULL);
  ------------------
  |  | 2683|  22.4k|#define NID_crl_reason          141
  ------------------
  122|  22.4k|        if (reason == NULL && j != -1) {
  ------------------
  |  Branch (122:13): [True: 7.62k, False: 14.7k]
  |  Branch (122:31): [True: 1.53k, False: 6.08k]
  ------------------
  123|  1.53k|            crl->flags |= EXFLAG_INVALID;
  ------------------
  |  |  657|  1.53k|# define EXFLAG_INVALID          0x80
  ------------------
  124|  1.53k|            return 1;
  125|  1.53k|        }
  126|       |
  127|  20.8k|        if (reason != NULL) {
  ------------------
  |  Branch (127:13): [True: 14.7k, False: 6.08k]
  ------------------
  128|  14.7k|            rev->reason = ASN1_ENUMERATED_get(reason);
  129|  14.7k|            ASN1_ENUMERATED_free(reason);
  130|  14.7k|        } else
  131|  6.08k|            rev->reason = CRL_REASON_NONE;
  ------------------
  |  |  311|  6.08k|# define CRL_REASON_NONE                         -1
  ------------------
  132|       |
  133|       |        /* Check for critical CRL entry extensions */
  134|       |
  135|  20.8k|        exts = rev->extensions;
  136|       |
  137|  41.9k|        for (j = 0; j < sk_X509_EXTENSION_num(exts); j++) {
  ------------------
  |  |  235|  41.9k|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (137:21): [True: 21.0k, False: 20.8k]
  ------------------
  138|  21.0k|            ext = sk_X509_EXTENSION_value(exts, j);
  ------------------
  |  |  236|  21.0k|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  139|  21.0k|            if (X509_EXTENSION_get_critical(ext)) {
  ------------------
  |  Branch (139:17): [True: 0, False: 21.0k]
  ------------------
  140|      0|                if (OBJ_obj2nid(X509_EXTENSION_get_object(ext))
  ------------------
  |  Branch (140:21): [True: 0, False: 0]
  ------------------
  141|      0|                    == NID_certificate_issuer)
  ------------------
  |  | 2703|      0|#define NID_certificate_issuer          771
  ------------------
  142|      0|                    continue;
  143|      0|                crl->flags |= EXFLAG_CRITICAL;
  ------------------
  |  |  660|      0|# define EXFLAG_CRITICAL         0x200
  ------------------
  144|      0|                break;
  145|      0|            }
  146|  21.0k|        }
  147|       |
  148|  20.8k|    }
  149|       |
  150|  4.13k|    return 1;
  151|       |
  152|  5.71k|}

X509_NAME_print:
  504|  2.40k|{
  505|  2.40k|    char *s, *c, *b;
  506|  2.40k|    int i;
  507|       |
  508|  2.40k|    b = X509_NAME_oneline(name, NULL, 0);
  509|  2.40k|    if (b == NULL)
  ------------------
  |  Branch (509:9): [True: 0, False: 2.40k]
  ------------------
  510|      0|        return 0;
  511|  2.40k|    if (*b == '\0') {
  ------------------
  |  Branch (511:9): [True: 1.63k, False: 775]
  ------------------
  512|  1.63k|        OPENSSL_free(b);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  513|  1.63k|        return 1;
  514|  1.63k|    }
  515|    775|    s = b + 1;                  /* skip the first slash */
  516|       |
  517|    775|    c = s;
  518|  1.19M|    for (;;) {
  519|  1.19M|        if (((*s == '/') &&
  ------------------
  |  Branch (519:14): [True: 1.12k, False: 1.19M]
  ------------------
  520|  1.19M|             (ossl_isupper(s[1]) && ((s[2] == '=') ||
  ------------------
  |  Branch (520:15): [True: 601, False: 522]
  |  Branch (520:38): [True: 95, False: 506]
  ------------------
  521|    601|                                (ossl_isupper(s[2]) && (s[3] == '='))
  ------------------
  |  Branch (521:34): [True: 169, False: 337]
  |  Branch (521:56): [True: 97, False: 72]
  ------------------
  522|  1.19M|              ))) || (*s == '\0'))
  ------------------
  |  Branch (522:22): [True: 775, False: 1.19M]
  ------------------
  523|    967|        {
  524|    967|            i = s - c;
  525|    967|            if (BIO_write(bp, c, i) != i)
  ------------------
  |  Branch (525:17): [True: 0, False: 967]
  ------------------
  526|      0|                goto err;
  527|    967|            c = s + 1;          /* skip following slash */
  528|    967|            if (*s != '\0') {
  ------------------
  |  Branch (528:17): [True: 192, False: 775]
  ------------------
  529|    192|                if (BIO_write(bp, ", ", 2) != 2)
  ------------------
  |  Branch (529:21): [True: 0, False: 192]
  ------------------
  530|      0|                    goto err;
  531|    192|            }
  532|    967|        }
  533|  1.19M|        if (*s == '\0')
  ------------------
  |  Branch (533:13): [True: 775, False: 1.19M]
  ------------------
  534|    775|            break;
  535|  1.19M|        s++;
  536|  1.19M|    }
  537|       |
  538|    775|    OPENSSL_free(b);
  ------------------
  |  |  115|    775|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    775|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    775|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  539|    775|    return 1;
  540|      0| err:
  541|      0|    ERR_raise(ERR_LIB_X509, ERR_R_BUF_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  542|      0|    OPENSSL_free(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__
  |  |  ------------------
  ------------------
  543|      0|    return 0;
  544|    775|}
x_name.c:x509_name_ex_new:
   91|   147k|{
   92|   147k|    X509_NAME *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|   147k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   147k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   147k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|       |
   94|   147k|    if (ret == NULL)
  ------------------
  |  Branch (94:9): [True: 0, False: 147k]
  ------------------
   95|      0|        return 0;
   96|   147k|    if ((ret->entries = sk_X509_NAME_ENTRY_new_null()) == NULL) {
  ------------------
  |  |  207|   147k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (96:9): [True: 0, False: 147k]
  ------------------
   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|   147k|    if ((ret->bytes = BUF_MEM_new()) == NULL) {
  ------------------
  |  Branch (100:9): [True: 0, False: 147k]
  ------------------
  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|   147k|    ret->modified = 1;
  105|   147k|    *val = (ASN1_VALUE *)ret;
  106|   147k|    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|   147k|}
x_name.c:x509_name_ex_free:
  117|   147k|{
  118|   147k|    X509_NAME *a;
  119|       |
  120|   147k|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 147k]
  |  Branch (120:25): [True: 0, False: 147k]
  ------------------
  121|      0|        return;
  122|   147k|    a = (X509_NAME *)*pval;
  123|       |
  124|   147k|    BUF_MEM_free(a->bytes);
  125|   147k|    sk_X509_NAME_ENTRY_pop_free(a->entries, X509_NAME_ENTRY_free);
  ------------------
  |  |  218|   147k|#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|   147k|    OPENSSL_free(a->canon_enc);
  ------------------
  |  |  115|   147k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   147k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   147k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  127|   147k|    OPENSSL_free(a);
  ------------------
  |  |  115|   147k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   147k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   147k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  128|   147k|    *pval = NULL;
  129|   147k|}
x_name.c:x509_name_ex_d2i:
  145|  63.7k|{
  146|  63.7k|    const unsigned char *p = *in, *q;
  147|  63.7k|    union {
  148|  63.7k|        STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
  149|  63.7k|        ASN1_VALUE *a;
  150|  63.7k|    } intname = {
  151|  63.7k|        NULL
  152|  63.7k|    };
  153|  63.7k|    union {
  154|  63.7k|        X509_NAME *x;
  155|  63.7k|        ASN1_VALUE *a;
  156|  63.7k|    } nm = {
  157|  63.7k|        NULL
  158|  63.7k|    };
  159|  63.7k|    int i, j, ret;
  160|  63.7k|    STACK_OF(X509_NAME_ENTRY) *entries;
  ------------------
  |  |   31|  63.7k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  161|  63.7k|    X509_NAME_ENTRY *entry;
  162|       |
  163|  63.7k|    if (len > X509_NAME_MAX)
  ------------------
  |  |   24|  63.7k|#define X509_NAME_MAX (1024 * 1024)
  ------------------
  |  Branch (163:9): [True: 0, False: 63.7k]
  ------------------
  164|      0|        len = X509_NAME_MAX;
  ------------------
  |  |   24|      0|#define X509_NAME_MAX (1024 * 1024)
  ------------------
  165|  63.7k|    q = p;
  166|       |
  167|       |    /* Get internal representation of Name */
  168|  63.7k|    ret = ASN1_item_ex_d2i(&intname.a,
  169|  63.7k|                           &p, len, ASN1_ITEM_rptr(X509_NAME_INTERNAL),
  ------------------
  |  |  426|  63.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  170|  63.7k|                           tag, aclass, opt, ctx);
  171|       |
  172|  63.7k|    if (ret <= 0)
  ------------------
  |  Branch (172:9): [True: 40.4k, False: 23.2k]
  ------------------
  173|  40.4k|        return ret;
  174|       |
  175|  23.2k|    if (*val)
  ------------------
  |  Branch (175:9): [True: 18.1k, False: 5.16k]
  ------------------
  176|  18.1k|        x509_name_ex_free(val, NULL);
  177|  23.2k|    if (!x509_name_ex_new(&nm.a, NULL))
  ------------------
  |  Branch (177:9): [True: 0, False: 23.2k]
  ------------------
  178|      0|        goto err;
  179|       |    /* We've decoded it: now cache encoding */
  180|  23.2k|    if (!BUF_MEM_grow(nm.x->bytes, p - q))
  ------------------
  |  Branch (180:9): [True: 0, False: 23.2k]
  ------------------
  181|      0|        goto err;
  182|  23.2k|    memcpy(nm.x->bytes->data, q, p - q);
  183|       |
  184|       |    /* Convert internal representation to X509_NAME structure */
  185|  1.72M|    for (i = 0; i < sk_STACK_OF_X509_NAME_ENTRY_num(intname.s); i++) {
  ------------------
  |  Branch (185:17): [True: 1.69M, False: 23.2k]
  ------------------
  186|  1.69M|        entries = sk_STACK_OF_X509_NAME_ENTRY_value(intname.s, i);
  187|  1.82M|        for (j = 0; j < sk_X509_NAME_ENTRY_num(entries); j++) {
  ------------------
  |  |  204|  1.82M|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (187:21): [True: 123k, False: 1.69M]
  ------------------
  188|   123k|            entry = sk_X509_NAME_ENTRY_value(entries, j);
  ------------------
  |  |  205|   123k|#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|   123k|            entry->set = i;
  190|   123k|            if (!sk_X509_NAME_ENTRY_push(nm.x->entries, entry))
  ------------------
  |  |  214|   123k|#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: 123k]
  ------------------
  191|      0|                goto err;
  192|   123k|            (void)sk_X509_NAME_ENTRY_set(entries, j, NULL);
  ------------------
  |  |  220|   123k|#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|   123k|        }
  194|  1.69M|    }
  195|  23.2k|    ret = x509_name_canon(nm.x);
  196|  23.2k|    if (!ret)
  ------------------
  |  Branch (196:9): [True: 165, False: 23.1k]
  ------------------
  197|    165|        goto err;
  198|  23.1k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  199|  23.1k|                                         local_sk_X509_NAME_ENTRY_free);
  200|  23.1k|    nm.x->modified = 0;
  201|  23.1k|    *val = nm.a;
  202|  23.1k|    *in = p;
  203|  23.1k|    return ret;
  204|       |
  205|    165| err:
  206|    165|    if (nm.x != NULL)
  ------------------
  |  Branch (206:9): [True: 165, False: 0]
  ------------------
  207|    165|        X509_NAME_free(nm.x);
  208|    165|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  209|    165|                                         local_sk_X509_NAME_ENTRY_pop_free);
  210|    165|    ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  401|    165|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    165|    (ERR_new(),                                                 \
  |  |  |  |  404|    165|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    165|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    165|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    165|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    165|     ERR_set_error)
  |  |  ------------------
  ------------------
  211|    165|    return 0;
  212|  23.2k|}
x_name.c:x509_name_canon:
  311|  23.3k|{
  312|  23.3k|    unsigned char *p;
  313|  23.3k|    STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname;
  ------------------
  |  |   31|  23.3k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  314|  23.3k|    STACK_OF(X509_NAME_ENTRY) *entries = NULL;
  ------------------
  |  |   31|  23.3k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  315|  23.3k|    X509_NAME_ENTRY *entry, *tmpentry = NULL;
  316|  23.3k|    int i, set = -1, ret = 0, len;
  317|       |
  318|  23.3k|    OPENSSL_free(a->canon_enc);
  ------------------
  |  |  115|  23.3k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  23.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  23.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  319|  23.3k|    a->canon_enc = NULL;
  320|       |    /* Special case: empty X509_NAME => null encoding */
  321|  23.3k|    if (sk_X509_NAME_ENTRY_num(a->entries) == 0) {
  ------------------
  |  |  204|  23.3k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (321:9): [True: 12.7k, False: 10.5k]
  ------------------
  322|  12.7k|        a->canon_enclen = 0;
  323|  12.7k|        return 1;
  324|  12.7k|    }
  325|  10.5k|    intname = sk_STACK_OF_X509_NAME_ENTRY_new_null();
  326|  10.5k|    if (intname == NULL) {
  ------------------
  |  Branch (326:9): [True: 0, False: 10.5k]
  ------------------
  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|   134k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
  ------------------
  |  |  204|   134k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (330:17): [True: 124k, False: 10.4k]
  ------------------
  331|   124k|        entry = sk_X509_NAME_ENTRY_value(a->entries, i);
  ------------------
  |  |  205|   124k|#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|   124k|        if (entry->set != set) {
  ------------------
  |  Branch (332:13): [True: 52.7k, False: 71.3k]
  ------------------
  333|  52.7k|            entries = sk_X509_NAME_ENTRY_new_null();
  ------------------
  |  |  207|  52.7k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  334|  52.7k|            if (entries == NULL)
  ------------------
  |  Branch (334:17): [True: 0, False: 52.7k]
  ------------------
  335|      0|                goto err;
  336|  52.7k|            if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries)) {
  ------------------
  |  Branch (336:17): [True: 0, False: 52.7k]
  ------------------
  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|  52.7k|            set = entry->set;
  342|  52.7k|        }
  343|   124k|        tmpentry = X509_NAME_ENTRY_new();
  344|   124k|        if (tmpentry == NULL) {
  ------------------
  |  Branch (344:13): [True: 0, False: 124k]
  ------------------
  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|   124k|        tmpentry->object = OBJ_dup(entry->object);
  349|   124k|        if (tmpentry->object == NULL) {
  ------------------
  |  Branch (349:13): [True: 0, False: 124k]
  ------------------
  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|   124k|        if (!asn1_string_canon(tmpentry->value, entry->value))
  ------------------
  |  Branch (353:13): [True: 165, False: 123k]
  ------------------
  354|    165|            goto err;
  355|   123k|        if (!sk_X509_NAME_ENTRY_push(entries, tmpentry)) {
  ------------------
  |  |  214|   123k|#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: 123k]
  ------------------
  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|   123k|        tmpentry = NULL;
  360|   123k|    }
  361|       |
  362|       |    /* Finally generate encoding */
  363|  10.4k|    len = i2d_name_canon(intname, NULL);
  364|  10.4k|    if (len < 0)
  ------------------
  |  Branch (364:9): [True: 0, False: 10.4k]
  ------------------
  365|      0|        goto err;
  366|  10.4k|    a->canon_enclen = len;
  367|       |
  368|  10.4k|    p = OPENSSL_malloc(a->canon_enclen);
  ------------------
  |  |  102|  10.4k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  10.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  10.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  369|  10.4k|    if (p == NULL)
  ------------------
  |  Branch (369:9): [True: 0, False: 10.4k]
  ------------------
  370|      0|        goto err;
  371|       |
  372|  10.4k|    a->canon_enc = p;
  373|       |
  374|  10.4k|    i2d_name_canon(intname, &p);
  375|       |
  376|  10.4k|    ret = 1;
  377|       |
  378|  10.5k| err:
  379|  10.5k|    X509_NAME_ENTRY_free(tmpentry);
  380|  10.5k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
  381|  10.5k|                                         local_sk_X509_NAME_ENTRY_pop_free);
  382|  10.5k|    return ret;
  383|  10.4k|}
x_name.c:asn1_string_canon:
  393|   124k|{
  394|   124k|    unsigned char *to, *from;
  395|   124k|    int len, i;
  396|       |
  397|       |    /* If type not in bitmask just copy string across */
  398|   124k|    if (!(ASN1_tag2bit(in->type) & ASN1_MASK_CANON)) {
  ------------------
  |  |  388|   124k|        (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  117|   124k|# define B_ASN1_UTF8STRING       0x2000
  |  |  ------------------
  |  |                       (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  115|   124k|# define B_ASN1_BMPSTRING        0x0800
  |  |  ------------------
  |  |                       (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
  |  |  ------------------
  |  |  |  |  112|   124k|# define B_ASN1_UNIVERSALSTRING  0x0100
  |  |  ------------------
  |  |  389|   124k|        | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  103|   124k|# define B_ASN1_PRINTABLESTRING  0x0002
  |  |  ------------------
  |  |                       | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  104|   124k|# define B_ASN1_T61STRING        0x0004
  |  |  ------------------
  |  |                       | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  107|   124k|# define B_ASN1_IA5STRING        0x0010
  |  |  ------------------
  |  |  390|   124k|        | B_ASN1_VISIBLESTRING)
  |  |  ------------------
  |  |  |  |  110|   124k|# define B_ASN1_VISIBLESTRING    0x0040
  |  |  ------------------
  ------------------
  |  Branch (398:9): [True: 38.0k, False: 86.0k]
  ------------------
  399|  38.0k|        if (!ASN1_STRING_copy(out, in))
  ------------------
  |  Branch (399:13): [True: 0, False: 38.0k]
  ------------------
  400|      0|            return 0;
  401|  38.0k|        return 1;
  402|  38.0k|    }
  403|       |
  404|  86.0k|    out->type = V_ASN1_UTF8STRING;
  ------------------
  |  |   73|  86.0k|# define V_ASN1_UTF8STRING               12
  ------------------
  405|  86.0k|    out->length = ASN1_STRING_to_UTF8(&out->data, in);
  406|  86.0k|    if (out->length == -1)
  ------------------
  |  Branch (406:9): [True: 165, False: 85.9k]
  ------------------
  407|    165|        return 0;
  408|       |
  409|  85.9k|    to = out->data;
  410|  85.9k|    from = to;
  411|       |
  412|  85.9k|    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|  87.0k|    while (len > 0 && ossl_isspace(*from)) {
  ------------------
  |  |   82|  20.4k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  20.4k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 1.07k, False: 19.3k]
  |  |  ------------------
  ------------------
  |  Branch (422:12): [True: 20.4k, False: 66.5k]
  ------------------
  423|  1.07k|        from++;
  424|  1.07k|        len--;
  425|  1.07k|    }
  426|       |
  427|  85.9k|    to = from + len;
  428|       |
  429|       |    /* Ignore trailing spaces */
  430|  86.2k|    while (len > 0 && ossl_isspace(to[-1])) {
  ------------------
  |  |   82|  19.6k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  19.6k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 280, False: 19.3k]
  |  |  ------------------
  ------------------
  |  Branch (430:12): [True: 19.6k, False: 66.5k]
  ------------------
  431|    280|        to--;
  432|    280|        len--;
  433|    280|    }
  434|       |
  435|  85.9k|    to = out->data;
  436|       |
  437|  85.9k|    i = 0;
  438|  27.4M|    while (i < len) {
  ------------------
  |  Branch (438:12): [True: 27.3M, False: 85.9k]
  ------------------
  439|       |        /* If not ASCII set just copy across */
  440|  27.3M|        if (!ossl_isascii(*from)) {
  ------------------
  |  |   75|  27.3M|# define ossl_isascii(c)        (((c) & ~127) == 0)
  ------------------
  |  Branch (440:13): [True: 26.8M, False: 521k]
  ------------------
  441|  26.8M|            *to++ = *from++;
  442|  26.8M|            i++;
  443|  26.8M|        }
  444|       |        /* Collapse multiple spaces */
  445|   521k|        else if (ossl_isspace(*from)) {
  ------------------
  |  |   82|   521k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|   521k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 23.4k, False: 497k]
  |  |  ------------------
  ------------------
  446|       |            /* Copy one space across */
  447|  23.4k|            *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|   254k|            do {
  454|   254k|                from++;
  455|   254k|                i++;
  456|   254k|            }
  457|   254k|            while (ossl_isspace(*from));
  ------------------
  |  |   82|   254k|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|   254k|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 230k, False: 23.4k]
  |  |  ------------------
  ------------------
  458|   497k|        } else {
  459|   497k|            *to++ = ossl_tolower(*from);
  460|   497k|            from++;
  461|   497k|            i++;
  462|   497k|        }
  463|  27.3M|    }
  464|       |
  465|  85.9k|    out->length = to - out->data;
  466|       |
  467|  85.9k|    return 1;
  468|       |
  469|  86.0k|}
x_name.c:i2d_name_canon:
  473|  20.8k|{
  474|  20.8k|    int i, len, ltmp;
  475|  20.8k|    const ASN1_VALUE *v;
  476|  20.8k|    STACK_OF(ASN1_VALUE) *intname = (STACK_OF(ASN1_VALUE) *)_intname;
  ------------------
  |  |   31|  20.8k|# define STACK_OF(type) struct stack_st_##type
  ------------------
  477|       |
  478|  20.8k|    len = 0;
  479|   125k|    for (i = 0; i < sk_ASN1_VALUE_num(intname); i++) {
  ------------------
  |  |  898|   125k|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (479:17): [True: 105k, False: 20.8k]
  ------------------
  480|   105k|        v = sk_ASN1_VALUE_value(intname, i);
  ------------------
  |  |  899|   105k|#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
  ------------------
  481|   105k|        ltmp = ASN1_item_ex_i2d(&v, in,
  482|   105k|                                ASN1_ITEM_rptr(X509_NAME_ENTRIES), -1, -1);
  ------------------
  |  |  426|   105k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  483|   105k|        if (ltmp < 0 || len > INT_MAX - ltmp)
  ------------------
  |  Branch (483:13): [True: 0, False: 105k]
  |  Branch (483:25): [True: 0, False: 105k]
  ------------------
  484|      0|            return -1;
  485|   105k|        len += ltmp;
  486|   105k|    }
  487|  20.8k|    return len;
  488|  20.8k|}
x_name.c:local_sk_X509_NAME_ENTRY_free:
  132|   327k|{
  133|   327k|    sk_X509_NAME_ENTRY_free(ne);
  ------------------
  |  |  210|   327k|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  134|   327k|}
x_name.c:local_sk_X509_NAME_ENTRY_pop_free:
  137|  1.42M|{
  138|  1.42M|    sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free);
  ------------------
  |  |  218|  1.42M|#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|  1.42M|}
x_name.c:x509_name_ex_i2d:
  216|  12.4k|{
  217|  12.4k|    int ret;
  218|  12.4k|    X509_NAME *a = (X509_NAME *)*val;
  219|       |
  220|  12.4k|    if (a->modified) {
  ------------------
  |  Branch (220:9): [True: 107, False: 12.2k]
  ------------------
  221|    107|        ret = x509_name_encode(a);
  222|    107|        if (ret < 0)
  ------------------
  |  Branch (222:13): [True: 0, False: 107]
  ------------------
  223|      0|            return ret;
  224|    107|        ret = x509_name_canon(a);
  225|    107|        if (!ret)
  ------------------
  |  Branch (225:13): [True: 0, False: 107]
  ------------------
  226|      0|            return -1;
  227|    107|    }
  228|  12.4k|    ret = a->bytes->length;
  229|  12.4k|    if (out != NULL) {
  ------------------
  |  Branch (229:9): [True: 2.28k, False: 10.1k]
  ------------------
  230|  2.28k|        memcpy(*out, a->bytes->data, ret);
  231|  2.28k|        *out += ret;
  232|  2.28k|    }
  233|  12.4k|    return ret;
  234|  12.4k|}
x_name.c:x509_name_encode:
  237|    107|{
  238|    107|    union {
  239|    107|        STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
  240|    107|        const ASN1_VALUE *a;
  241|    107|    } intname = {
  242|    107|        NULL
  243|    107|    };
  244|    107|    int len;
  245|    107|    unsigned char *p;
  246|    107|    STACK_OF(X509_NAME_ENTRY) *entries = NULL;
  ------------------
  |  |   31|    107|# define STACK_OF(type) struct stack_st_##type
  ------------------
  247|    107|    X509_NAME_ENTRY *entry;
  248|    107|    int i, set = -1;
  249|       |
  250|    107|    intname.s = sk_STACK_OF_X509_NAME_ENTRY_new_null();
  251|    107|    if (!intname.s)
  ------------------
  |  Branch (251:9): [True: 0, False: 107]
  ------------------
  252|      0|        goto cerr;
  253|  1.14k|    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
  ------------------
  |  |  204|  1.14k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (253:17): [True: 1.03k, False: 107]
  ------------------
  254|  1.03k|        entry = sk_X509_NAME_ENTRY_value(a->entries, i);
  ------------------
  |  |  205|  1.03k|#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|  1.03k|        if (entry->set != set) {
  ------------------
  |  Branch (255:13): [True: 1.03k, False: 0]
  ------------------
  256|  1.03k|            entries = sk_X509_NAME_ENTRY_new_null();
  ------------------
  |  |  207|  1.03k|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  257|  1.03k|            if (!entries)
  ------------------
  |  Branch (257:17): [True: 0, False: 1.03k]
  ------------------
  258|      0|                goto cerr;
  259|  1.03k|            if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname.s, entries)) {
  ------------------
  |  Branch (259:17): [True: 0, False: 1.03k]
  ------------------
  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|  1.03k|            set = entry->set;
  264|  1.03k|        }
  265|  1.03k|        if (!sk_X509_NAME_ENTRY_push(entries, entry))
  ------------------
  |  |  214|  1.03k|#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: 1.03k]
  ------------------
  266|      0|            goto cerr;
  267|  1.03k|    }
  268|    107|    len = ASN1_item_ex_i2d(&intname.a, NULL,
  269|    107|                           ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1);
  ------------------
  |  |  426|    107|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  270|    107|    if (!BUF_MEM_grow(a->bytes, len)) {
  ------------------
  |  Branch (270:9): [True: 0, False: 107]
  ------------------
  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|    107|    p = (unsigned char *)a->bytes->data;
  275|    107|    ASN1_item_ex_i2d(&intname.a,
  276|    107|                     &p, ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1);
  ------------------
  |  |  426|    107|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  277|    107|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  278|    107|                                         local_sk_X509_NAME_ENTRY_free);
  279|    107|    a->modified = 0;
  280|    107|    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|}
x_name.c:x509_name_ex_print:
  292|  2.40k|{
  293|  2.40k|    if (X509_NAME_print_ex(out, (const X509_NAME *)*pval,
  ------------------
  |  Branch (293:9): [True: 0, False: 2.40k]
  ------------------
  294|  2.40k|                           indent, pctx->nm_flags) <= 0)
  295|      0|        return 0;
  296|  2.40k|    return 2;
  297|  2.40k|}

ossl_d2i_X509_PUBKEY_INTERNAL:
   71|  10.0k|{
   72|  10.0k|    X509_PUBKEY *xpub = OPENSSL_zalloc(sizeof(*xpub));
  ------------------
  |  |  104|  10.0k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  10.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  10.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|       |
   74|  10.0k|    if (xpub == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 10.0k]
  ------------------
   75|      0|        return NULL;
   76|  10.0k|    return (X509_PUBKEY *)ASN1_item_d2i_ex((ASN1_VALUE **)&xpub, pp, len,
   77|  10.0k|                                           ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
  ------------------
  |  |  426|  10.0k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   78|  10.0k|                                           libctx, propq);
   79|  10.0k|}
ossl_X509_PUBKEY_INTERNAL_free:
   82|  11.3k|{
   83|  11.3k|    ASN1_item_free((ASN1_VALUE *)xpub, ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL));
  ------------------
  |  |  426|  11.3k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   84|  11.3k|}
X509_PUBKEY_get0:
  456|    655|{
  457|    655|    if (key == NULL) {
  ------------------
  |  Branch (457:9): [True: 0, False: 655]
  ------------------
  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|    655|    if (key->pkey == NULL) {
  ------------------
  |  Branch (462:9): [True: 367, False: 288]
  ------------------
  463|       |        /* We failed to decode the key when we loaded it, or it was never set */
  464|    367|        ERR_raise(ERR_LIB_EVP, EVP_R_DECODE_ERROR);
  ------------------
  |  |  401|    367|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    367|    (ERR_new(),                                                 \
  |  |  |  |  404|    367|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    367|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    367|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    367|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    367|     ERR_set_error)
  |  |  ------------------
  ------------------
  465|    367|        return NULL;
  466|    367|    }
  467|       |
  468|    288|    return key->pkey;
  469|    655|}
X509_PUBKEY_get:
  472|    655|{
  473|    655|    EVP_PKEY *ret = X509_PUBKEY_get0(key);
  474|       |
  475|    655|    if (ret != NULL && !EVP_PKEY_up_ref(ret)) {
  ------------------
  |  Branch (475:9): [True: 288, False: 367]
  |  Branch (475:24): [True: 0, False: 288]
  ------------------
  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|    655|    return ret;
  480|    655|}
ossl_d2i_PUBKEY_legacy:
  536|    658|{
  537|    658|    return d2i_PUBKEY_int(a, pp, length, NULL, NULL, 1, d2i_X509_PUBKEY);
  538|    658|}
d2i_PUBKEY_ex:
  542|      2|{
  543|      2|    return d2i_PUBKEY_int(a, pp, length, libctx, propq, 0, d2i_X509_PUBKEY);
  544|      2|}
d2i_RSA_PUBKEY:
  606|     21|{
  607|     21|    EVP_PKEY *pkey;
  608|     21|    RSA *key = NULL;
  609|     21|    const unsigned char *q;
  610|       |
  611|     21|    q = *pp;
  612|     21|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  613|     21|    if (pkey == NULL)
  ------------------
  |  Branch (613:9): [True: 8, False: 13]
  ------------------
  614|      8|        return NULL;
  615|     13|    key = EVP_PKEY_get1_RSA(pkey);
  616|     13|    EVP_PKEY_free(pkey);
  617|     13|    if (key == NULL)
  ------------------
  |  Branch (617:9): [True: 0, False: 13]
  ------------------
  618|      0|        return NULL;
  619|     13|    *pp = q;
  620|     13|    if (a != NULL) {
  ------------------
  |  Branch (620:9): [True: 0, False: 13]
  ------------------
  621|      0|        RSA_free(*a);
  622|      0|        *a = key;
  623|      0|    }
  624|     13|    return key;
  625|     13|}
ossl_d2i_DH_PUBKEY:
  647|     75|{
  648|     75|    EVP_PKEY *pkey;
  649|     75|    DH *key = NULL;
  650|     75|    const unsigned char *q;
  651|       |
  652|     75|    q = *pp;
  653|     75|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  654|     75|    if (pkey == NULL)
  ------------------
  |  Branch (654:9): [True: 3, False: 72]
  ------------------
  655|      3|        return NULL;
  656|     72|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_DH)
  ------------------
  |  |   68|     72|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|     72|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
  |  Branch (656:9): [True: 72, False: 0]
  ------------------
  657|     72|        key = EVP_PKEY_get1_DH(pkey);
  658|     72|    EVP_PKEY_free(pkey);
  659|     72|    if (key == NULL)
  ------------------
  |  Branch (659:9): [True: 0, False: 72]
  ------------------
  660|      0|        return NULL;
  661|     72|    *pp = q;
  662|     72|    if (a != NULL) {
  ------------------
  |  Branch (662:9): [True: 0, False: 72]
  ------------------
  663|      0|        DH_free(*a);
  664|      0|        *a = key;
  665|      0|    }
  666|     72|    return key;
  667|     72|}
ossl_d2i_DHx_PUBKEY:
  688|     12|{
  689|     12|    EVP_PKEY *pkey;
  690|     12|    DH *key = NULL;
  691|     12|    const unsigned char *q;
  692|       |
  693|     12|    q = *pp;
  694|     12|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  695|     12|    if (pkey == NULL)
  ------------------
  |  Branch (695:9): [True: 11, False: 1]
  ------------------
  696|     11|        return NULL;
  697|      1|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_DHX)
  ------------------
  |  |   69|      1|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5299|      1|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (697:9): [True: 1, False: 0]
  ------------------
  698|      1|        key = EVP_PKEY_get1_DH(pkey);
  699|      1|    EVP_PKEY_free(pkey);
  700|      1|    if (key == NULL)
  ------------------
  |  Branch (700:9): [True: 0, False: 1]
  ------------------
  701|      0|        return NULL;
  702|      1|    *pp = q;
  703|      1|    if (a != NULL) {
  ------------------
  |  Branch (703:9): [True: 0, False: 1]
  ------------------
  704|      0|        DH_free(*a);
  705|      0|        *a = key;
  706|      0|    }
  707|      1|    return key;
  708|      1|}
d2i_DSA_PUBKEY:
  731|     38|{
  732|     38|    EVP_PKEY *pkey;
  733|     38|    DSA *key = NULL;
  734|     38|    const unsigned char *q;
  735|       |
  736|     38|    q = *pp;
  737|     38|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  738|     38|    if (pkey == NULL)
  ------------------
  |  Branch (738:9): [True: 36, False: 2]
  ------------------
  739|     36|        return NULL;
  740|      2|    key = EVP_PKEY_get1_DSA(pkey);
  741|      2|    EVP_PKEY_free(pkey);
  742|      2|    if (key == NULL)
  ------------------
  |  Branch (742:9): [True: 0, False: 2]
  ------------------
  743|      0|        return NULL;
  744|      2|    *pp = q;
  745|      2|    if (a != NULL) {
  ------------------
  |  Branch (745:9): [True: 0, False: 2]
  ------------------
  746|      0|        DSA_free(*a);
  747|      0|        *a = key;
  748|      0|    }
  749|      2|    return key;
  750|      2|}
ossl_d2i_DSA_PUBKEY:
  754|     38|{
  755|     38|    DSA *key = NULL;
  756|     38|    const unsigned char *data;
  757|     38|    const BIGNUM *p, *q, *g;
  758|       |
  759|     38|    data = *pp;
  760|     38|    key = d2i_DSA_PUBKEY(NULL, &data, length);
  761|     38|    if (key == NULL)
  ------------------
  |  Branch (761:9): [True: 36, False: 2]
  ------------------
  762|     36|        return NULL;
  763|      2|    DSA_get0_pqg(key, &p, &q, &g);
  764|      2|    if (p == NULL || q == NULL || g == NULL) {
  ------------------
  |  Branch (764:9): [True: 1, False: 1]
  |  Branch (764:22): [True: 0, False: 1]
  |  Branch (764:35): [True: 0, False: 1]
  ------------------
  765|      1|        DSA_free(key);
  766|      1|        return NULL;
  767|      1|    }
  768|      1|    *pp = data;
  769|      1|    if (a != NULL) {
  ------------------
  |  Branch (769:9): [True: 0, False: 1]
  ------------------
  770|      0|        DSA_free(*a);
  771|      0|        *a = key;
  772|      0|    }
  773|      1|    return key;
  774|      2|}
d2i_EC_PUBKEY:
  797|    500|{
  798|    500|    EVP_PKEY *pkey;
  799|    500|    EC_KEY *key = NULL;
  800|    500|    const unsigned char *q;
  801|    500|    int type;
  802|       |
  803|    500|    q = *pp;
  804|    500|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  805|    500|    if (pkey == NULL)
  ------------------
  |  Branch (805:9): [True: 303, False: 197]
  ------------------
  806|    303|        return NULL;
  807|    197|    type = EVP_PKEY_get_id(pkey);
  808|    197|    if (type == EVP_PKEY_EC || type == EVP_PKEY_SM2)
  ------------------
  |  |   70|    197|# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|    394|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
                  if (type == EVP_PKEY_EC || type == EVP_PKEY_SM2)
  ------------------
  |  |   71|      1|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|      1|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (808:9): [True: 196, False: 1]
  |  Branch (808:32): [True: 1, False: 0]
  ------------------
  809|    197|        key = EVP_PKEY_get1_EC_KEY(pkey);
  810|    197|    EVP_PKEY_free(pkey);
  811|    197|    if (key == NULL)
  ------------------
  |  Branch (811:9): [True: 0, False: 197]
  ------------------
  812|      0|        return NULL;
  813|    197|    *pp = q;
  814|    197|    if (a != NULL) {
  ------------------
  |  Branch (814:9): [True: 0, False: 197]
  ------------------
  815|      0|        EC_KEY_free(*a);
  816|      0|        *a = key;
  817|      0|    }
  818|    197|    return key;
  819|    197|}
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: 4, False: 1]
  ------------------
  850|      4|        return NULL;
  851|      1|    key = ossl_evp_pkey_get1_ED25519(pkey);
  852|      1|    EVP_PKEY_free(pkey);
  853|      1|    if (key == NULL)
  ------------------
  |  Branch (853:9): [True: 0, False: 1]
  ------------------
  854|      0|        return NULL;
  855|      1|    *pp = q;
  856|      1|    if (a != NULL) {
  ------------------
  |  Branch (856:9): [True: 0, False: 1]
  ------------------
  857|      0|        ossl_ecx_key_free(*a);
  858|      0|        *a = key;
  859|      0|    }
  860|      1|    return key;
  861|      1|}
ossl_d2i_ED448_PUBKEY:
  883|      2|{
  884|      2|    EVP_PKEY *pkey;
  885|      2|    ECX_KEY *key = NULL;
  886|      2|    const unsigned char *q;
  887|       |
  888|      2|    q = *pp;
  889|      2|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  890|      2|    if (pkey == NULL)
  ------------------
  |  Branch (890:9): [True: 1, False: 1]
  ------------------
  891|      1|        return NULL;
  892|      1|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_ED448)
  ------------------
  |  |   82|      1|# define EVP_PKEY_ED448 NID_ED448
  |  |  ------------------
  |  |  |  | 5508|      1|#define NID_ED448               1088
  |  |  ------------------
  ------------------
  |  Branch (892:9): [True: 1, False: 0]
  ------------------
  893|      1|        key = ossl_evp_pkey_get1_ED448(pkey);
  894|      1|    EVP_PKEY_free(pkey);
  895|      1|    if (key == NULL)
  ------------------
  |  Branch (895:9): [True: 0, False: 1]
  ------------------
  896|      0|        return NULL;
  897|      1|    *pp = q;
  898|      1|    if (a != NULL) {
  ------------------
  |  Branch (898:9): [True: 0, False: 1]
  ------------------
  899|      0|        ossl_ecx_key_free(*a);
  900|      0|        *a = key;
  901|      0|    }
  902|      1|    return key;
  903|      1|}
ossl_d2i_X25519_PUBKEY:
  925|      2|{
  926|      2|    EVP_PKEY *pkey;
  927|      2|    ECX_KEY *key = NULL;
  928|      2|    const unsigned char *q;
  929|       |
  930|      2|    q = *pp;
  931|      2|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  932|      2|    if (pkey == NULL)
  ------------------
  |  Branch (932:9): [True: 2, False: 0]
  ------------------
  933|      2|        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|      3|{
  968|      3|    EVP_PKEY *pkey;
  969|      3|    ECX_KEY *key = NULL;
  970|      3|    const unsigned char *q;
  971|       |
  972|      3|    q = *pp;
  973|      3|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  974|      3|    if (pkey == NULL)
  ------------------
  |  Branch (974:9): [True: 2, False: 1]
  ------------------
  975|      2|        return NULL;
  976|      1|    if (EVP_PKEY_get_id(pkey) == EVP_PKEY_X448)
  ------------------
  |  |   81|      1|# define EVP_PKEY_X448 NID_X448
  |  |  ------------------
  |  |  |  | 5500|      1|#define NID_X448                1035
  |  |  ------------------
  ------------------
  |  Branch (976:9): [True: 1, False: 0]
  ------------------
  977|      1|        key = ossl_evp_pkey_get1_X448(pkey);
  978|      1|    EVP_PKEY_free(pkey);
  979|      1|    if (key == NULL)
  ------------------
  |  Branch (979:9): [True: 0, False: 1]
  ------------------
  980|      0|        return NULL;
  981|      1|    *pp = q;
  982|      1|    if (a != NULL) {
  ------------------
  |  Branch (982:9): [True: 0, False: 1]
  ------------------
  983|      0|        ossl_ecx_key_free(*a);
  984|      0|        *a = key;
  985|      0|    }
  986|      1|    return key;
  987|      1|}
X509_PUBKEY_get0_param:
 1031|  1.93k|{
 1032|  1.93k|    if (ppkalg)
  ------------------
  |  Branch (1032:9): [True: 0, False: 1.93k]
  ------------------
 1033|      0|        *ppkalg = pub->algor->algorithm;
 1034|  1.93k|    if (pk) {
  ------------------
  |  Branch (1034:9): [True: 655, False: 1.27k]
  ------------------
 1035|    655|        *pk = pub->public_key->data;
 1036|    655|        *ppklen = pub->public_key->length;
 1037|    655|    }
 1038|  1.93k|    if (pa)
  ------------------
  |  Branch (1038:9): [True: 1.93k, False: 0]
  ------------------
 1039|  1.93k|        *pa = pub->algor;
 1040|  1.93k|    return 1;
 1041|  1.93k|}
ossl_x509_PUBKEY_get0_libctx:
 1073|    498|{
 1074|    498|    if (plibctx)
  ------------------
  |  Branch (1074:9): [True: 498, False: 0]
  ------------------
 1075|    498|        *plibctx = key->libctx;
 1076|    498|    if (ppropq)
  ------------------
  |  Branch (1076:9): [True: 498, False: 0]
  ------------------
 1077|    498|        *ppropq = key->propq;
 1078|    498|    return 1;
 1079|    498|}
x_pubkey.c:x509_pubkey_ex_i2d:
  240|  1.24k|{
  241|  1.24k|    return ASN1_item_ex_i2d(pval, out, ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
  ------------------
  |  |  426|  1.24k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  242|  1.24k|                            tag, aclass);
  243|  1.24k|}
x_pubkey.c:x509_pubkey_ex_print:
  247|    752|{
  248|    752|    return ASN1_item_print(out, *pval, indent,
  249|    752|                           ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL), pctx);
  ------------------
  |  |  426|    752|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  250|    752|}
x_pubkey.c:x509_pubkey_ex_new_ex:
  113|  68.3k|{
  114|  68.3k|    X509_PUBKEY *ret;
  115|       |
  116|  68.3k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|  68.3k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  68.3k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  68.3k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (116:9): [True: 0, False: 68.3k]
  ------------------
  117|      0|        return 0;
  118|  68.3k|    if (!x509_pubkey_ex_populate((ASN1_VALUE **)&ret, NULL)
  ------------------
  |  Branch (118:9): [True: 0, False: 68.3k]
  ------------------
  119|  68.3k|        || !x509_pubkey_set0_libctx(ret, libctx, propq)) {
  ------------------
  |  Branch (119:12): [True: 0, False: 68.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|  68.3k|    } else {
  124|  68.3k|        *pval = (ASN1_VALUE *)ret;
  125|  68.3k|    }
  126|       |
  127|  68.3k|    return ret != NULL;
  128|  68.3k|}
x_pubkey.c:x509_pubkey_ex_populate:
  101|  94.6k|{
  102|  94.6k|    X509_PUBKEY *pubkey = (X509_PUBKEY *)*pval;
  103|       |
  104|  94.6k|    return (pubkey->algor != NULL
  ------------------
  |  Branch (104:13): [True: 25.6k, False: 69.0k]
  ------------------
  105|  94.6k|            || (pubkey->algor = X509_ALGOR_new()) != NULL)
  ------------------
  |  Branch (105:16): [True: 69.0k, False: 0]
  ------------------
  106|  94.6k|        && (pubkey->public_key != NULL
  ------------------
  |  Branch (106:13): [True: 25.6k, False: 69.0k]
  ------------------
  107|  94.6k|            || (pubkey->public_key = ASN1_BIT_STRING_new()) != NULL);
  ------------------
  |  Branch (107:16): [True: 69.0k, False: 0]
  ------------------
  108|  94.6k|}
x_pubkey.c:x509_pubkey_ex_d2i_ex:
  135|  26.3k|{
  136|  26.3k|    const unsigned char *in_saved = *in;
  137|  26.3k|    size_t publen;
  138|  26.3k|    X509_PUBKEY *pubkey;
  139|  26.3k|    int ret;
  140|  26.3k|    OSSL_DECODER_CTX *dctx = NULL;
  141|  26.3k|    unsigned char *tmpbuf = NULL;
  142|       |
  143|  26.3k|    if (*pval == NULL && !x509_pubkey_ex_new_ex(pval, it, libctx, propq))
  ------------------
  |  Branch (143:9): [True: 11.5k, False: 14.7k]
  |  Branch (143:26): [True: 0, False: 11.5k]
  ------------------
  144|      0|        return 0;
  145|  26.3k|    if (!x509_pubkey_ex_populate(pval, NULL)) {
  ------------------
  |  Branch (145:9): [True: 0, False: 26.3k]
  ------------------
  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|  26.3k|    if ((ret = ASN1_item_ex_d2i(pval, in, len,
  ------------------
  |  Branch (151:9): [True: 21.4k, False: 4.86k]
  ------------------
  152|  26.3k|                                ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
  ------------------
  |  |  426|  26.3k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  153|  26.3k|                                tag, aclass, opt, ctx)) <= 0)
  154|  21.4k|        return ret;
  155|       |
  156|  4.86k|    publen = *in - in_saved;
  157|  4.86k|    if (!ossl_assert(publen > 0)) {
  ------------------
  |  |   52|  4.86k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  4.86k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (157:9): [True: 0, False: 4.86k]
  ------------------
  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|  4.86k|    pubkey = (X509_PUBKEY *)*pval;
  163|  4.86k|    EVP_PKEY_free(pubkey->pkey);
  164|  4.86k|    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|  4.86k|    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|  4.86k|    if ((ret = x509_pubkey_decode(&pubkey->pkey, pubkey)) == -1) {
  ------------------
  |  Branch (177:9): [True: 0, False: 4.86k]
  ------------------
  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|  4.86k|    if (ret <= 0 && !pubkey->flag_force_legacy) {
  ------------------
  |  Branch (184:9): [True: 4.57k, False: 288]
  |  Branch (184:21): [True: 4.20k, False: 367]
  ------------------
  185|  4.20k|        const unsigned char *p;
  186|  4.20k|        char txtoidname[OSSL_MAX_NAME_SIZE];
  187|  4.20k|        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|  4.20k|        if (aclass != V_ASN1_UNIVERSAL) {
  ------------------
  |  |   47|  4.20k|# define V_ASN1_UNIVERSAL                0x00
  ------------------
  |  Branch (193:13): [True: 0, False: 4.20k]
  ------------------
  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|  4.20k|        p = in_saved;
  201|       |
  202|  4.20k|        if (OBJ_obj2txt(txtoidname, sizeof(txtoidname),
  ------------------
  |  Branch (202:13): [True: 1, False: 4.20k]
  ------------------
  203|  4.20k|                        pubkey->algor->algorithm, 0) <= 0) {
  204|      1|            ERR_clear_last_mark();
  205|      1|            goto end;
  206|      1|        }
  207|  4.20k|        if ((dctx =
  ------------------
  |  Branch (207:13): [True: 4.20k, False: 0]
  ------------------
  208|  4.20k|             OSSL_DECODER_CTX_new_for_pkey(&pubkey->pkey,
  209|  4.20k|                                           "DER", "SubjectPublicKeyInfo",
  210|  4.20k|                                           txtoidname, EVP_PKEY_PUBLIC_KEY,
  ------------------
  |  |   92|  4.20k|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |   88|  4.20k|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  ------------------
  |  |  |  |  |  |  574|  4.20k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  569|  4.20k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  4.20k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  570|  4.20k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  568|  4.20k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  211|  4.20k|                                           pubkey->libctx,
  212|  4.20k|                                           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|  4.20k|            if (OSSL_DECODER_from_data(dctx, &p, &slen)) {
  ------------------
  |  Branch (217:17): [True: 287, False: 3.91k]
  ------------------
  218|    287|                if (slen != 0) {
  ------------------
  |  Branch (218:21): [True: 0, False: 287]
  ------------------
  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|    287|            }
  228|  4.20k|    }
  229|       |
  230|  4.86k|    ERR_pop_to_mark();
  231|  4.86k|    ret = 1;
  232|  4.86k| end:
  233|  4.86k|    OSSL_DECODER_CTX_free(dctx);
  234|  4.86k|    OPENSSL_free(tmpbuf);
  ------------------
  |  |  115|  4.86k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.86k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.86k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  235|  4.86k|    return ret;
  236|  4.86k|}
x_pubkey.c:x509_pubkey_set0_libctx:
   49|  69.0k|{
   50|  69.0k|    if (x != NULL) {
  ------------------
  |  Branch (50:9): [True: 69.0k, False: 0]
  ------------------
   51|  69.0k|        x->libctx = libctx;
   52|  69.0k|        OPENSSL_free(x->propq);
  ------------------
  |  |  115|  69.0k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  69.0k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  69.0k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   53|  69.0k|        x->propq = NULL;
   54|  69.0k|        if (propq != NULL) {
  ------------------
  |  Branch (54:13): [True: 0, False: 69.0k]
  ------------------
   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|  69.0k|    }
   60|  69.0k|    return 1;
   61|  69.0k|}
x_pubkey.c:x509_pubkey_ex_free:
   87|  47.5k|{
   88|  47.5k|    X509_PUBKEY *pubkey;
   89|       |
   90|  47.5k|    if (pval != NULL && (pubkey = (X509_PUBKEY *)*pval) != NULL) {
  ------------------
  |  Branch (90:9): [True: 47.5k, False: 0]
  |  Branch (90:25): [True: 47.5k, False: 0]
  ------------------
   91|  47.5k|        X509_ALGOR_free(pubkey->algor);
   92|  47.5k|        ASN1_BIT_STRING_free(pubkey->public_key);
   93|  47.5k|        EVP_PKEY_free(pubkey->pkey);
   94|  47.5k|        OPENSSL_free(pubkey->propq);
  ------------------
  |  |  115|  47.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  47.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  47.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   95|  47.5k|        OPENSSL_free(pubkey);
  ------------------
  |  |  115|  47.5k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  47.5k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  47.5k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   96|  47.5k|        *pval = NULL;
   97|  47.5k|    }
   98|  47.5k|}
x_pubkey.c:x509_pubkey_decode:
  405|  4.86k|{
  406|  4.86k|    EVP_PKEY *pkey;
  407|  4.86k|    int nid;
  408|       |
  409|  4.86k|    nid = OBJ_obj2nid(key->algor->algorithm);
  410|  4.86k|    if (!key->flag_force_legacy) {
  ------------------
  |  Branch (410:9): [True: 4.20k, False: 655]
  ------------------
  411|  4.20k|#ifndef OPENSSL_NO_ENGINE
  412|  4.20k|        ENGINE *e = NULL;
  413|       |
  414|  4.20k|        e = ENGINE_get_pkey_meth_engine(nid);
  415|  4.20k|        if (e == NULL)
  ------------------
  |  Branch (415:13): [True: 4.20k, False: 0]
  ------------------
  416|  4.20k|            return 0;
  417|      0|        ENGINE_finish(e);
  418|       |#else
  419|       |        return 0;
  420|       |#endif
  421|      0|    }
  422|       |
  423|    655|    pkey = EVP_PKEY_new();
  424|    655|    if (pkey == NULL) {
  ------------------
  |  Branch (424:9): [True: 0, False: 655]
  ------------------
  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|    655|    if (!EVP_PKEY_set_type(pkey, nid)) {
  ------------------
  |  Branch (429:9): [True: 0, False: 655]
  ------------------
  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|    655|    if (pkey->ameth->pub_decode) {
  ------------------
  |  Branch (434:9): [True: 655, 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|    655|        if (!pkey->ameth->pub_decode(pkey, key))
  ------------------
  |  Branch (440:13): [True: 367, False: 288]
  ------------------
  441|    367|            goto error;
  442|    655|    } 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|    288|    *ppkey = pkey;
  448|    288|    return 1;
  449|       |
  450|    367| error:
  451|    367|    EVP_PKEY_free(pkey);
  452|    367|    return 0;
  453|    655|}
x_pubkey.c:d2i_PUBKEY_int:
  494|    660|{
  495|    660|    X509_PUBKEY *xpk, *xpk2 = NULL, **pxpk = NULL;
  496|    660|    EVP_PKEY *pktmp = NULL;
  497|    660|    const unsigned char *q;
  498|       |
  499|    660|    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|    660|    if (libctx != NULL || propq != NULL || force_legacy) {
  ------------------
  |  Branch (506:9): [True: 0, False: 660]
  |  Branch (506:27): [True: 0, False: 660]
  |  Branch (506:44): [True: 658, False: 2]
  ------------------
  507|    658|        xpk2 = OPENSSL_zalloc(sizeof(*xpk2));
  ------------------
  |  |  104|    658|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    658|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    658|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  508|    658|        if (xpk2 == NULL)
  ------------------
  |  Branch (508:13): [True: 0, False: 658]
  ------------------
  509|      0|            return NULL;
  510|    658|        if (!x509_pubkey_set0_libctx(xpk2, libctx, propq))
  ------------------
  |  Branch (510:13): [True: 0, False: 658]
  ------------------
  511|      0|            goto end;
  512|    658|        xpk2->flag_force_legacy = !!force_legacy;
  513|    658|        pxpk = &xpk2;
  514|    658|    }
  515|    660|    xpk = d2i_x509_pubkey(pxpk, &q, length);
  516|    660|    if (xpk == NULL)
  ------------------
  |  Branch (516:9): [True: 5, False: 655]
  ------------------
  517|      5|        goto end;
  518|    655|    pktmp = X509_PUBKEY_get(xpk);
  519|    655|    X509_PUBKEY_free(xpk);
  520|    655|    xpk2 = NULL;                 /* We know that xpk == xpk2 */
  521|    655|    if (pktmp == NULL)
  ------------------
  |  Branch (521:9): [True: 367, False: 288]
  ------------------
  522|    367|        goto end;
  523|    288|    *pp = q;
  524|    288|    if (a != NULL) {
  ------------------
  |  Branch (524:9): [True: 0, False: 288]
  ------------------
  525|      0|        EVP_PKEY_free(*a);
  526|      0|        *a = pktmp;
  527|      0|    }
  528|    660| end:
  529|    660|    X509_PUBKEY_free(xpk2);
  530|    660|    return pktmp;
  531|    288|}

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

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

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

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

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

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

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

property.c:ossl_sa_ALGORITHM_new:
   27|     16|    { \
   28|     16|        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
   29|     16|    } \
property.c:ossl_sa_ALGORITHM_doall_arg:
   56|  6.96k|    { \
   57|  6.96k|        ossl_sa_doall_arg((OPENSSL_SA *)sa, \
   58|  6.96k|                          (void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
   59|  6.96k|    } \
property.c:ossl_sa_ALGORITHM_set:
   68|    148|    { \
   69|    148|        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
   70|    148|    } \
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|  6.14k|    { \
   63|  6.14k|        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
   64|  6.14k|    } \
property.c:ossl_sa_ALGORITHM_num:
   42|  6.96k|    { \
   43|  6.96k|        return ossl_sa_num((OPENSSL_SA *)sa); \
   44|  6.96k|    } \
property.c:ossl_sa_ALGORITHM_doall:
   48|      8|    { \
   49|      8|        ossl_sa_doall((OPENSSL_SA *)sa, \
   50|      8|                      (void (*)(ossl_uintmax_t, void *))leaf); \
   51|      8|    } \

bio_print.c:ossl_assert_int:
   45|   229M|{
   46|   229M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 229M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   229M|    return expr;
   50|   229M|}
decoder_lib.c:ossl_assert_int:
   45|  75.6k|{
   46|  75.6k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 75.6k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  75.6k|    return expr;
   50|  75.6k|}
decoder_meth.c:ossl_assert_int:
   45|   316k|{
   46|   316k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 316k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   316k|    return expr;
   50|   316k|}
encoder_lib.c:ossl_assert_int:
   45|   141k|{
   46|   141k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 141k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   141k|    return expr;
   50|   141k|}
encoder_meth.c:ossl_assert_int:
   45|   900k|{
   46|   900k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 900k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   900k|    return expr;
   50|   900k|}
encoder_pkey.c:ossl_assert_int:
   45|  6.90k|{
   46|  6.90k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 6.90k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  6.90k|    return expr;
   50|  6.90k|}
evp_fetch.c:ossl_assert_int:
   45|  17.3k|{
   46|  17.3k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 17.3k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  17.3k|    return expr;
   50|  17.3k|}
p_lib.c:ossl_assert_int:
   45|  40.1k|{
   46|  40.1k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 40.1k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  40.1k|    return expr;
   50|  40.1k|}
core_fetch.c:ossl_assert_int:
   45|  13.9k|{
   46|  13.9k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 13.9k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  13.9k|    return expr;
   50|  13.9k|}
core_namemap.c:ossl_assert_int:
   45|    206|{
   46|    206|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 206]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    206|    return expr;
   50|    206|}
packet.c:ossl_assert_int:
   45|  28.9k|{
   46|  28.9k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 28.9k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  28.9k|    return expr;
   50|  28.9k|}
passphrase.c:ossl_assert_int:
   45|  1.73k|{
   46|  1.73k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.73k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.73k|    return expr;
   50|  1.73k|}
provider_core.c:ossl_assert_int:
   45|  13.9k|{
   46|  13.9k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 13.9k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  13.9k|    return expr;
   50|  13.9k|}
defn_cache.c:ossl_assert_int:
   45|    412|{
   46|    412|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 412]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    412|    return expr;
   50|    412|}
property.c:ossl_assert_int:
   45|    211|{
   46|    211|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 211]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    211|    return expr;
   50|    211|}
x_pubkey.c:ossl_assert_int:
   45|  4.86k|{
   46|  4.86k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 4.86k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  4.86k|    return expr;
   50|  4.86k|}
der_rsa_key.c:ossl_assert_int:
   45|      2|{
   46|      2|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 2]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|      2|    return expr;
   50|      2|}

bn_lib.c:constant_time_select_int:
  340|  1.52M|{
  341|  1.52M|    return (int)constant_time_select(mask, (unsigned)(a), (unsigned)(b));
  342|  1.52M|}
bn_lib.c:constant_time_select:
  320|  1.52M|{
  321|  1.52M|    return (value_barrier(mask) & a) | (value_barrier(~mask) & b);
  322|  1.52M|}
bn_lib.c:value_barrier:
  271|  3.04M|{
  272|  3.04M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  273|  3.04M|    unsigned int r;
  274|  3.04M|    __asm__("" : "=r"(r) : "0"(a));
  275|       |#else
  276|       |    volatile unsigned int r = a;
  277|       |#endif
  278|  3.04M|    return r;
  279|  3.04M|}
bn_lib.c:constant_time_lt_bn:
  161|  1.52M|{
  162|  1.52M|    return constant_time_msb_bn(a ^ ((a ^ b) | ((a - b) ^ b)));
  163|  1.52M|}
bn_lib.c:constant_time_msb_bn:
  156|  1.52M|{
  157|  1.52M|    return 0 - (a >> (sizeof(a) * 8 - 1));
  158|  1.52M|}
bn_lib.c:constant_time_msb:
  101|  7.71M|{
  102|  7.71M|    return 0 - (a >> (sizeof(a) * 8 - 1));
  103|  7.71M|}
bn_lib.c:constant_time_eq_int:
  254|  7.71M|{
  255|  7.71M|    return constant_time_eq((unsigned)(a), (unsigned)(b));
  256|  7.71M|}
bn_lib.c:constant_time_eq:
  233|  7.71M|{
  234|  7.71M|    return constant_time_is_zero(a ^ b);
  235|  7.71M|}
bn_lib.c:constant_time_is_zero:
  207|  7.71M|{
  208|  7.71M|    return constant_time_msb(~a & (a - 1));
  209|  7.71M|}
bn_exp.c:constant_time_eq_int:
  254|  1.24M|{
  255|  1.24M|    return constant_time_eq((unsigned)(a), (unsigned)(b));
  256|  1.24M|}
bn_exp.c:constant_time_eq:
  233|  1.24M|{
  234|  1.24M|    return constant_time_is_zero(a ^ b);
  235|  1.24M|}
bn_exp.c:constant_time_is_zero:
  207|  1.24M|{
  208|  1.24M|    return constant_time_msb(~a & (a - 1));
  209|  1.24M|}
bn_exp.c:constant_time_msb:
  101|  1.24M|{
  102|  1.24M|    return 0 - (a >> (sizeof(a) * 8 - 1));
  103|  1.24M|}
rsaz_exp.c:constant_time_select_64:
  358|      8|{
  359|      8|    return (value_barrier_64(mask) & a) | (value_barrier_64(~mask) & b);
  360|      8|}
rsaz_exp.c:value_barrier_64:
  295|     16|{
  296|     16|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  297|     16|    uint64_t r;
  298|     16|    __asm__("" : "=r"(r) : "0"(a));
  299|       |#else
  300|       |    volatile uint64_t r = a;
  301|       |#endif
  302|     16|    return r;
  303|     16|}
curve448.c:constant_time_lookup:
  440|    450|{
  441|    450|    size_t i, j;
  442|    450|    const unsigned char *tablec = (const unsigned char *)table;
  443|    450|    unsigned char *outc = (unsigned char *)out;
  444|    450|    unsigned char mask;
  445|       |
  446|    450|    memset(out, 0, rowsize);
  447|       |
  448|       |    /* Note idx may underflow - but that is well defined */
  449|  7.65k|    for (i = 0; i < numrows; i++, idx--) {
  ------------------
  |  Branch (449:17): [True: 7.20k, False: 450]
  ------------------
  450|  7.20k|        mask = (unsigned char)constant_time_is_zero_s(idx);
  451|  1.38M|        for (j = 0; j < rowsize; j++)
  ------------------
  |  Branch (451:21): [True: 1.38M, False: 7.20k]
  ------------------
  452|  1.38M|            *(outc + j) |= constant_time_select_8(mask, *(tablec++), 0);
  453|  7.20k|    }
  454|    450|}
curve448.c:constant_time_is_zero_s:
  212|  7.20k|{
  213|  7.20k|    return constant_time_msb_s(~a & (a - 1));
  214|  7.20k|}
curve448.c:constant_time_msb_s:
  117|  7.20k|{
  118|  7.20k|    return 0 - (a >> (sizeof(a) * 8 - 1));
  119|  7.20k|}
curve448.c:constant_time_select_8:
  334|  1.38M|{
  335|  1.38M|    return (unsigned char)constant_time_select(mask, a, b);
  336|  1.38M|}
curve448.c:constant_time_select:
  320|  1.38M|{
  321|  1.38M|    return (value_barrier(mask) & a) | (value_barrier(~mask) & b);
  322|  1.38M|}
curve448.c:value_barrier:
  271|  2.76M|{
  272|  2.76M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  273|  2.76M|    unsigned int r;
  274|  2.76M|    __asm__("" : "=r"(r) : "0"(a));
  275|       |#else
  276|       |    volatile unsigned int r = a;
  277|       |#endif
  278|  2.76M|    return r;
  279|  2.76M|}
curve448.c:constant_time_select_64:
  358|  3.60k|{
  359|  3.60k|    return (value_barrier_64(mask) & a) | (value_barrier_64(~mask) & b);
  360|  3.60k|}
curve448.c:value_barrier_64:
  295|  7.20k|{
  296|  7.20k|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  297|  7.20k|    uint64_t r;
  298|  7.20k|    __asm__("" : "=r"(r) : "0"(a));
  299|       |#else
  300|       |    volatile uint64_t r = a;
  301|       |#endif
  302|  7.20k|    return r;
  303|  7.20k|}
curve448.c:constant_time_cond_swap_64:
  394|  3.60k|{
  395|  3.60k|    uint64_t xor = *a ^ *b;
  396|       |
  397|  3.60k|    xor &= mask;
  398|  3.60k|    *a ^= xor;
  399|  3.60k|    *b ^= xor;
  400|  3.60k|}
f_generic.c:constant_time_is_zero_64:
  227|      5|{
  228|      5|    return constant_time_msb_64(~a & (a - 1));
  229|      5|}
f_generic.c:constant_time_msb_64:
  112|      5|{
  113|      5|    return 0 - (a >> 63);
  114|      5|}
scalar.c:constant_time_is_zero_64:
  227|      2|{
  228|      2|    return constant_time_msb_64(~a & (a - 1));
  229|      2|}
scalar.c:constant_time_msb_64:
  112|      2|{
  113|      2|    return 0 - (a >> 63);
  114|      2|}

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

ssl_sess.c:CRYPTO_NEW_REF:
  268|    463|{
  269|    463|    refcnt->val = n;
  270|    463|    return 1;
  271|    463|}
ssl_sess.c:CRYPTO_FREE_REF:
  273|    463|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|    463|{
  275|    463|}
ssl_sess.c:CRYPTO_DOWN_REF:
   50|    463|{
   51|    463|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|    463|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 463, False: 0]
  ------------------
   53|    463|        atomic_thread_fence(memory_order_acquire);
   54|    463|    return 1;
   55|    463|}
tasn_utl.c:CRYPTO_NEW_REF:
  268|  36.0k|{
  269|  36.0k|    refcnt->val = n;
  270|  36.0k|    return 1;
  271|  36.0k|}
tasn_utl.c:CRYPTO_FREE_REF:
  273|  36.0k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  36.0k|{
  275|  36.0k|}
tasn_utl.c:CRYPTO_DOWN_REF:
   50|  36.0k|{
   51|  36.0k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  36.0k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 36.0k, False: 0]
  ------------------
   53|  36.0k|        atomic_thread_fence(memory_order_acquire);
   54|  36.0k|    return 1;
   55|  36.0k|}
bio_lib.c:CRYPTO_NEW_REF:
  268|  1.62M|{
  269|  1.62M|    refcnt->val = n;
  270|  1.62M|    return 1;
  271|  1.62M|}
bio_lib.c:CRYPTO_FREE_REF:
  273|  1.62M|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  1.62M|{
  275|  1.62M|}
bio_lib.c:CRYPTO_DOWN_REF:
   50|  1.64M|{
   51|  1.64M|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  1.64M|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 1.62M, False: 16.8k]
  ------------------
   53|  1.62M|        atomic_thread_fence(memory_order_acquire);
   54|  1.64M|    return 1;
   55|  1.64M|}
bio_lib.c:CRYPTO_UP_REF:
   34|  16.8k|{
   35|  16.8k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  16.8k|    return 1;
   37|  16.8k|}
dh_lib.c:CRYPTO_NEW_REF:
  268|  29.3k|{
  269|  29.3k|    refcnt->val = n;
  270|  29.3k|    return 1;
  271|  29.3k|}
dh_lib.c:CRYPTO_DOWN_REF:
   50|  29.4k|{
   51|  29.4k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  29.4k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 29.3k, False: 73]
  ------------------
   53|  29.3k|        atomic_thread_fence(memory_order_acquire);
   54|  29.4k|    return 1;
   55|  29.4k|}
dh_lib.c:CRYPTO_FREE_REF:
  273|  29.3k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  29.3k|{
  275|  29.3k|}
dh_lib.c:CRYPTO_UP_REF:
   34|     73|{
   35|     73|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|     73|    return 1;
   37|     73|}
dsa_lib.c:CRYPTO_NEW_REF:
  268|  39.0k|{
  269|  39.0k|    refcnt->val = n;
  270|  39.0k|    return 1;
  271|  39.0k|}
dsa_lib.c:CRYPTO_DOWN_REF:
   50|  39.0k|{
   51|  39.0k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  39.0k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 39.0k, False: 2]
  ------------------
   53|  39.0k|        atomic_thread_fence(memory_order_acquire);
   54|  39.0k|    return 1;
   55|  39.0k|}
dsa_lib.c:CRYPTO_FREE_REF:
  273|  39.0k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  39.0k|{
  275|  39.0k|}
dsa_lib.c:CRYPTO_UP_REF:
   34|      2|{
   35|      2|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|      2|    return 1;
   37|      2|}
ec_key.c:CRYPTO_DOWN_REF:
   50|  14.8k|{
   51|  14.8k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  14.8k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 14.6k, False: 197]
  ------------------
   53|  14.6k|        atomic_thread_fence(memory_order_acquire);
   54|  14.8k|    return 1;
   55|  14.8k|}
ec_key.c:CRYPTO_FREE_REF:
  273|  14.6k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  14.6k|{
  275|  14.6k|}
ec_key.c:CRYPTO_UP_REF:
   34|    197|{
   35|    197|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|    197|    return 1;
   37|    197|}
ec_kmeth.c:CRYPTO_NEW_REF:
  268|  14.6k|{
  269|  14.6k|    refcnt->val = n;
  270|  14.6k|    return 1;
  271|  14.6k|}
decoder_meth.c:CRYPTO_UP_REF:
   34|   280k|{
   35|   280k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|   280k|    return 1;
   37|   280k|}
decoder_meth.c:CRYPTO_DOWN_REF:
   50|   280k|{
   51|   280k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|   280k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 40, False: 280k]
  ------------------
   53|     40|        atomic_thread_fence(memory_order_acquire);
   54|   280k|    return 1;
   55|   280k|}
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|}
encoder_meth.c:CRYPTO_UP_REF:
   34|  38.2k|{
   35|  38.2k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  38.2k|    return 1;
   37|  38.2k|}
encoder_meth.c:CRYPTO_DOWN_REF:
   50|  38.3k|{
   51|  38.3k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  38.3k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 115, False: 38.2k]
  ------------------
   53|    115|        atomic_thread_fence(memory_order_acquire);
   54|  38.3k|    return 1;
   55|  38.3k|}
encoder_meth.c:CRYPTO_FREE_REF:
  273|    115|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|    115|{
  275|    115|}
encoder_meth.c:CRYPTO_NEW_REF:
  268|    115|{
  269|    115|    refcnt->val = n;
  270|    115|    return 1;
  271|    115|}
digest.c:CRYPTO_NEW_REF:
  268|     27|{
  269|     27|    refcnt->val = n;
  270|     27|    return 1;
  271|     27|}
digest.c:CRYPTO_UP_REF:
   34|  11.4k|{
   35|  11.4k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  11.4k|    return 1;
   37|  11.4k|}
digest.c:CRYPTO_DOWN_REF:
   50|  11.4k|{
   51|  11.4k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  11.4k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 27, False: 11.4k]
  ------------------
   53|     27|        atomic_thread_fence(memory_order_acquire);
   54|  11.4k|    return 1;
   55|  11.4k|}
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|   201k|{
   35|   201k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|   201k|    return 1;
   37|   201k|}
keymgmt_meth.c:CRYPTO_DOWN_REF:
   50|   201k|{
   51|   201k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|   201k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 18, False: 201k]
  ------------------
   53|     18|        atomic_thread_fence(memory_order_acquire);
   54|   201k|    return 1;
   55|   201k|}
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|  11.6k|{
  269|  11.6k|    refcnt->val = n;
  270|  11.6k|    return 1;
  271|  11.6k|}
p_lib.c:CRYPTO_FREE_REF:
  273|  11.6k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  11.6k|{
  275|  11.6k|}
p_lib.c:CRYPTO_UP_REF:
   34|    288|{
   35|    288|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|    288|    return 1;
   37|    288|}
p_lib.c:CRYPTO_DOWN_REF:
   50|  11.9k|{
   51|  11.9k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  11.9k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 11.6k, False: 288]
  ------------------
   53|  11.6k|        atomic_thread_fence(memory_order_acquire);
   54|  11.9k|    return 1;
   55|  11.9k|}
provider_core.c:CRYPTO_UP_REF:
   34|  14.1k|{
   35|  14.1k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|  14.1k|    return 1;
   37|  14.1k|}
provider_core.c:CRYPTO_NEW_REF:
  268|      3|{
  269|      3|    refcnt->val = n;
  270|      3|    return 1;
  271|      3|}
provider_core.c:CRYPTO_DOWN_REF:
   50|  14.1k|{
   51|  14.1k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  14.1k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 1, False: 14.1k]
  ------------------
   53|      1|        atomic_thread_fence(memory_order_acquire);
   54|  14.1k|    return 1;
   55|  14.1k|}
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|  42.4k|{
  269|  42.4k|    refcnt->val = n;
  270|  42.4k|    return 1;
  271|  42.4k|}
rsa_lib.c:CRYPTO_DOWN_REF:
   50|  42.4k|{
   51|  42.4k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  42.4k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 42.4k, False: 13]
  ------------------
   53|  42.4k|        atomic_thread_fence(memory_order_acquire);
   54|  42.4k|    return 1;
   55|  42.4k|}
rsa_lib.c:CRYPTO_FREE_REF:
  273|  42.4k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  42.4k|{
  275|  42.4k|}
rsa_lib.c:CRYPTO_UP_REF:
   34|     13|{
   35|     13|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|     13|    return 1;
   37|     13|}
ossl_core_bio.c:CRYPTO_UP_REF:
   34|   195k|{
   35|   195k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|   195k|    return 1;
   37|   195k|}
ossl_core_bio.c:CRYPTO_DOWN_REF:
   50|   212k|{
   51|   212k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|   212k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 16.8k, False: 195k]
  ------------------
   53|  16.8k|        atomic_thread_fence(memory_order_acquire);
   54|   212k|    return 1;
   55|   212k|}
ossl_core_bio.c:CRYPTO_FREE_REF:
  273|  16.8k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  16.8k|{
  275|  16.8k|}
ossl_core_bio.c:CRYPTO_NEW_REF:
  268|  16.8k|{
  269|  16.8k|    refcnt->val = n;
  270|  16.8k|    return 1;
  271|  16.8k|}
ecx_key.c:CRYPTO_NEW_REF:
  268|     15|{
  269|     15|    refcnt->val = n;
  270|     15|    return 1;
  271|     15|}
ecx_key.c:CRYPTO_FREE_REF:
  273|     15|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|     15|{
  275|     15|}
ecx_key.c:CRYPTO_DOWN_REF:
   50|     18|{
   51|     18|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|     18|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 15, False: 3]
  ------------------
   53|     15|        atomic_thread_fence(memory_order_acquire);
   54|     18|    return 1;
   55|     18|}
ecx_key.c:CRYPTO_UP_REF:
   34|      3|{
   35|      3|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|      3|    return 1;
   37|      3|}
evp_rand.c:CRYPTO_UP_REF:
   34|     16|{
   35|     16|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   36|     16|    return 1;
   37|     16|}
evp_rand.c:CRYPTO_NEW_REF:
  268|      9|{
  269|      9|    refcnt->val = n;
  270|      9|    return 1;
  271|      9|}
evp_rand.c:CRYPTO_FREE_REF:
  273|      9|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|      9|{
  275|      9|}
evp_rand.c:CRYPTO_DOWN_REF:
   50|     25|{
   51|     25|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|     25|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 9, False: 16]
  ------------------
   53|      9|        atomic_thread_fence(memory_order_acquire);
   54|     25|    return 1;
   55|     25|}

ssl_sess.c:safe_add_time:
   49|    860|    {                                                                        \
   50|    860|        type r;                                                              \
   51|    860|                                                                             \
   52|    860|        if (!__builtin_add_overflow(a, b, &r))                               \
  ------------------
  |  Branch (52:13): [True: 756, False: 104]
  ------------------
   53|    860|            return r;                                                        \
   54|    860|        *err |= 1;                                                           \
   55|    104|        return a + b;                                                            \
   56|    860|    }
stack.c:safe_muldiv_int:
  322|  65.0k|    {                                                                        \
  323|  65.0k|        int e2 = 0;                                                          \
  324|  65.0k|        type q, r, x, y;                                                     \
  325|  65.0k|                                                                             \
  326|  65.0k|        if (c == 0) {                                                        \
  ------------------
  |  Branch (326:13): [True: 0, False: 65.0k]
  ------------------
  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|  65.0k|        x = safe_mul_ ## type_name(a, b, &e2);                               \
  331|  65.0k|        if (!e2)                                                             \
  ------------------
  |  Branch (331:13): [True: 65.0k, False: 0]
  ------------------
  332|  65.0k|            return safe_div_ ## type_name(x, c, err);                        \
  333|  65.0k|        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|  65.0k|    }
stack.c:safe_mul_int:
  136|  65.0k|    {                                                                        \
  137|  65.0k|        type r;                                                              \
  138|  65.0k|                                                                             \
  139|  65.0k|        if (!__builtin_mul_overflow(a, b, &r))                               \
  ------------------
  |  Branch (139:13): [True: 65.0k, False: 0]
  ------------------
  140|  65.0k|            return r;                                                        \
  141|  65.0k|        *err |= 1;                                                           \
  142|      0|        return (a < 0) ^ (b < 0) ? min : max;                                \
  ------------------
  |  Branch (142:16): [True: 0, False: 0]
  ------------------
  143|  65.0k|    }
stack.c:safe_div_int:
  199|  65.0k|    {                                                                        \
  200|  65.0k|        if (b == 0) {                                                        \
  ------------------
  |  Branch (200:13): [True: 0, False: 65.0k]
  ------------------
  201|      0|            *err |= 1;                                                       \
  202|      0|            return a < 0 ? min : max;                                        \
  ------------------
  |  Branch (202:20): [True: 0, False: 0]
  ------------------
  203|      0|        }                                                                    \
  204|  65.0k|        if (b == -1 && a == min) {                                           \
  ------------------
  |  Branch (204:13): [True: 0, False: 65.0k]
  |  Branch (204:24): [True: 0, False: 0]
  ------------------
  205|      0|            *err |= 1;                                                       \
  206|      0|            return max;                                                      \
  207|      0|        }                                                                    \
  208|  65.0k|        return a / b;                                                        \
  209|  65.0k|    }

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

ssl_asn1.c:ossl_time_to_time_t:
  130|    393|{
  131|    393|    return (time_t)(t.t / OSSL_TIME_SECOND);
  ------------------
  |  |   30|    393|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  ------------------
  132|    393|}
ssl_asn1.c:ossl_time2ticks:
   68|    393|{
   69|    393|    return t.t;
   70|    393|}
ssl_asn1.c:ossl_time_from_time_t:
  137|    116|{
  138|    116|    OSSL_TIME ot;
  139|       |
  140|    116|    ot.t = t;
  141|    116|    ot.t *= OSSL_TIME_SECOND;
  ------------------
  |  |   30|    116|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  ------------------
  142|    116|    return ot;
  143|    116|}
ssl_asn1.c:ossl_ticks2time:
   58|    397|{
   59|    397|    OSSL_TIME r;
   60|       |
   61|    397|    r.t = ticks;
   62|    397|    return r;
   63|    397|}
ssl_sess.c:ossl_time_add:
  172|    860|{
  173|    860|    OSSL_TIME r;
  174|    860|    int err = 0;
  175|       |
  176|    860|    r.t = safe_add_time(a.t, b.t, &err);
  177|    860|    return err ? ossl_time_infinite() : r;
  ------------------
  |  Branch (177:12): [True: 104, False: 756]
  ------------------
  178|    860|}
ssl_sess.c:ossl_time_infinite:
   84|    104|{
   85|    104|    return ossl_ticks2time(~(uint64_t)0);
   86|    104|}
ssl_sess.c:ossl_ticks2time:
   58|    567|{
   59|    567|    OSSL_TIME r;
   60|       |
   61|    567|    r.t = ticks;
   62|    567|    return r;
   63|    567|}
ssl_txt.c:ossl_time_is_zero:
  159|    778|{
  160|    778|    return ossl_time_compare(t, ossl_time_zero()) == 0;
  161|    778|}
ssl_txt.c:ossl_time_compare:
  148|    778|{
  149|    778|    if (a.t > b.t)
  ------------------
  |  Branch (149:9): [True: 774, False: 4]
  ------------------
  150|    774|        return 1;
  151|      4|    if (a.t < b.t)
  ------------------
  |  Branch (151:9): [True: 0, False: 4]
  ------------------
  152|      0|        return -1;
  153|      4|    return 0;
  154|      4|}
ssl_txt.c:ossl_time_zero:
   78|    778|{
   79|    778|    return ossl_ticks2time(0);
   80|    778|}
ssl_txt.c:ossl_ticks2time:
   58|    778|{
   59|    778|    OSSL_TIME r;
   60|       |
   61|    778|    r.t = ticks;
   62|    778|    return r;
   63|    778|}
ssl_txt.c:ossl_time_to_time_t:
  130|    387|{
  131|    387|    return (time_t)(t.t / OSSL_TIME_SECOND);
  ------------------
  |  |   30|    387|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  ------------------
  132|    387|}
ssl_txt.c:ossl_time2ticks:
   68|    387|{
   69|    387|    return t.t;
   70|    387|}

a_utf8.c:is_unicode_surrogate:
   22|  66.8k|{
   23|  66.8k|    return value >= SURROGATE_MIN && value <= SURROGATE_MAX;
  ------------------
  |  Branch (23:12): [True: 30.3k, False: 36.5k]
  |  Branch (23:38): [True: 341, False: 29.9k]
  ------------------
   24|  66.8k|}
a_mbstr.c:is_unicode_valid:
   27|  14.1M|{
   28|  14.1M|    return value <= UNICODE_MAX && !is_unicode_surrogate(value);
  ------------------
  |  Branch (28:12): [True: 14.1M, False: 37]
  |  Branch (28:36): [True: 14.1M, False: 11]
  ------------------
   29|  14.1M|}
a_mbstr.c:is_unicode_surrogate:
   22|  14.1M|{
   23|  14.1M|    return value >= SURROGATE_MIN && value <= SURROGATE_MAX;
  ------------------
  |  Branch (23:12): [True: 1.08k, False: 14.1M]
  |  Branch (23:38): [True: 11, False: 1.07k]
  ------------------
   24|  14.1M|}

ssl_asn1.c:i2d_SSL_SESSION_ASN1:
  848|    393|        { \
  849|    393|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, \
  850|    393|                                     ASN1_ITEM_rptr(stname)); \
  ------------------
  |  |  426|    393|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  851|    393|        }
ssl_asn1.c:d2i_SSL_SESSION_ASN1:
  843|  11.5k|        { \
  844|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, \
  845|  11.5k|                                               ASN1_ITEM_rptr(stname)); \
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  846|  11.5k|        } \
ssl_asn1.c:SSL_SESSION_ASN1_it:
  178|  23.4k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  23.4k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  23.4k|        { \
  |  |  |  |   96|  23.4k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  23.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  23.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  23.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  23.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  23.4k|                tname##_seq_tt,\
  182|  23.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  23.4k|                NULL,\
  184|  23.4k|                sizeof(stname),\
  185|  23.4k|                #stname \
  186|  23.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  23.4k|                }; \
  |  |  103|  23.4k|        return &local_it; \
  |  |  104|  23.4k|        }
  ------------------
ASN1_TIME_it:
  770|   424k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   424k|        { \
  |  |   96|   424k|                static const ASN1_ITEM local_it = {
  ------------------
  771|   424k|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|   424k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|   424k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   424k|                }; \
  |  |  103|   424k|        return &local_it; \
  |  |  104|   424k|        }
  ------------------
NETSCAPE_CERT_SEQUENCE_it:
  247|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  11.5k|                tname##_seq_tt,\
  251|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  11.5k|                &tname##_aux,\
  253|  11.5k|                sizeof(stname),\
  254|  11.5k|                #tname \
  255|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
PBEPARAM_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
PBE2PARAM_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
PBKDF2PARAM_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
PKCS8_PRIV_KEY_INFO_it:
  247|   207k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   207k|        { \
  |  |   96|   207k|                static const ASN1_ITEM local_it = {
  ------------------
  248|   207k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   207k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|   207k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   207k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|   207k|                tname##_seq_tt,\
  251|   207k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|   207k|                &tname##_aux,\
  253|   207k|                sizeof(stname),\
  254|   207k|                #tname \
  255|   207k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   207k|                }; \
  |  |  103|   207k|        return &local_it; \
  |  |  104|   207k|        }
  ------------------
d2i_PKCS8_PRIV_KEY_INFO:
  826|   108k|        { \
  827|   108k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|   108k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|   108k|        } \
i2d_PKCS8_PRIV_KEY_INFO:
  830|     70|        { \
  831|     70|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     70|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     70|        }
PKCS8_PRIV_KEY_INFO_new:
  812|    155|        { \
  813|    155|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|    155|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|    155|        } \
PKCS8_PRIV_KEY_INFO_free:
  816|  87.8k|        { \
  817|  87.8k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  87.8k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  87.8k|        }
ASN1_OCTET_STRING_it:
  764|  2.38M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  2.38M|        { \
  |  |   96|  2.38M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  2.38M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  2.38M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  2.38M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  2.38M|                }; \
  |  |  103|  2.38M|        return &local_it; \
  |  |  104|  2.38M|        }
  ------------------
d2i_ASN1_OCTET_STRING:
  826|   146k|        { \
  827|   146k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|   146k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|   146k|        } \
i2d_ASN1_OCTET_STRING:
  830|     11|        { \
  831|     11|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     11|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     11|        }
ASN1_INTEGER_it:
  764|  2.61M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  2.61M|        { \
  |  |   96|  2.61M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  2.61M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  2.61M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  2.61M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  2.61M|                }; \
  |  |  103|  2.61M|        return &local_it; \
  |  |  104|  2.61M|        }
  ------------------
d2i_ASN1_INTEGER:
  826|   188k|        { \
  827|   188k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|   188k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|   188k|        } \
i2d_ASN1_INTEGER:
  830|     25|        { \
  831|     25|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     25|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     25|        }
ASN1_ENUMERATED_it:
  764|  91.9k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  91.9k|        { \
  |  |   96|  91.9k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  91.9k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  91.9k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  91.9k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  91.9k|                }; \
  |  |  103|  91.9k|        return &local_it; \
  |  |  104|  91.9k|        }
  ------------------
d2i_ASN1_ENUMERATED:
  826|  9.35k|        { \
  827|  9.35k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  9.35k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  9.35k|        } \
ASN1_BIT_STRING_it:
  764|   951k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   951k|        { \
  |  |   96|   951k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   951k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   951k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   951k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   951k|                }; \
  |  |  103|   951k|        return &local_it; \
  |  |  104|   951k|        }
  ------------------
ASN1_UTF8STRING_it:
  764|   109k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   109k|        { \
  |  |   96|   109k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   109k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   109k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   109k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   109k|                }; \
  |  |  103|   109k|        return &local_it; \
  |  |  104|   109k|        }
  ------------------
ASN1_PRINTABLESTRING_it:
  764|  11.5k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  11.5k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  11.5k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
ASN1_T61STRING_it:
  764|  11.5k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  11.5k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  11.5k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
ASN1_IA5STRING_it:
  764|   249k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   249k|        { \
  |  |   96|   249k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   249k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   249k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   249k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   249k|                }; \
  |  |  103|   249k|        return &local_it; \
  |  |  104|   249k|        }
  ------------------
ASN1_GENERALSTRING_it:
  764|  11.5k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  11.5k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  11.5k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
ASN1_UTCTIME_it:
  764|  11.5k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  11.5k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  11.5k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
ASN1_GENERALIZEDTIME_it:
  764|   280k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   280k|        { \
  |  |   96|   280k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   280k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   280k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   280k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   280k|                }; \
  |  |  103|   280k|        return &local_it; \
  |  |  104|   280k|        }
  ------------------
ASN1_VISIBLESTRING_it:
  764|  11.5k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  11.5k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  11.5k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
ASN1_UNIVERSALSTRING_it:
  764|  11.5k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  11.5k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  11.5k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
ASN1_BMPSTRING_it:
  764|  11.5k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  11.5k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  11.5k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
ASN1_NULL_it:
  764|  64.2k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  64.2k|        { \
  |  |   96|  64.2k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  64.2k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  64.2k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  64.2k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  64.2k|                }; \
  |  |  103|  64.2k|        return &local_it; \
  |  |  104|  64.2k|        }
  ------------------
ASN1_OBJECT_it:
  764|  4.13M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  4.13M|        { \
  |  |   96|  4.13M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  4.13M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  4.13M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  4.13M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  4.13M|                }; \
  |  |  103|  4.13M|        return &local_it; \
  |  |  104|  4.13M|        }
  ------------------
ASN1_ANY_it:
  764|  14.4M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  14.4M|        { \
  |  |   96|  14.4M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  14.4M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  14.4M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  14.4M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  14.4M|                }; \
  |  |  103|  14.4M|        return &local_it; \
  |  |  104|  14.4M|        }
  ------------------
ASN1_SEQUENCE_it:
  764|  5.58M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  5.58M|        { \
  |  |   96|  5.58M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  5.58M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  5.58M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  5.58M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  5.58M|                }; \
  |  |  103|  5.58M|        return &local_it; \
  |  |  104|  5.58M|        }
  ------------------
i2d_ASN1_TYPE:
  830|  3.36k|        { \
  831|  3.36k|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  3.36k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|  3.36k|        }
ASN1_TYPE_new:
  812|  3.20M|        { \
  813|  3.20M|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  3.20M|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  3.20M|        } \
ASN1_TYPE_free:
  816|  1.54M|        { \
  817|  1.54M|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  1.54M|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  1.54M|        }
ASN1_PRINTABLE_it:
  770|  1.40M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.40M|        { \
  |  |   96|  1.40M|                static const ASN1_ITEM local_it = {
  ------------------
  771|  1.40M|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|  1.40M|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|  1.40M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.40M|                }; \
  |  |  103|  1.40M|        return &local_it; \
  |  |  104|  1.40M|        }
  ------------------
DISPLAYTEXT_it:
  770|  77.2k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  77.2k|        { \
  |  |   96|  77.2k|                static const ASN1_ITEM local_it = {
  ------------------
  771|  77.2k|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|  77.2k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|  77.2k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  77.2k|                }; \
  |  |  103|  77.2k|        return &local_it; \
  |  |  104|  77.2k|        }
  ------------------
DIRECTORYSTRING_it:
  770|  72.3k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  72.3k|        { \
  |  |   96|  72.3k|                static const ASN1_ITEM local_it = {
  ------------------
  771|  72.3k|                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
  ------------------
  |  |   85|  72.3k|# define ASN1_ITYPE_MSTRING              0x5
  ------------------
  772|  72.3k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  72.3k|                }; \
  |  |  103|  72.3k|        return &local_it; \
  |  |  104|  72.3k|        }
  ------------------
ASN1_BOOLEAN_it:
  764|  11.5k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  11.5k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  11.5k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
ASN1_TBOOLEAN_it:
  764|  11.5k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  765|  11.5k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  11.5k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
ASN1_FBOOLEAN_it:
  764|  1.37M|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|  1.37M|        { \
  |  |   96|  1.37M|                static const ASN1_ITEM local_it = {
  ------------------
  765|  1.37M|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|  1.37M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|  1.37M|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|  1.37M|                }; \
  |  |  103|  1.37M|        return &local_it; \
  |  |  104|  1.37M|        }
  ------------------
ASN1_OCTET_STRING_NDEF_it:
  764|   121k|                                ASN1_ITEM_start(itname) \
  ------------------
  |  |   95|   121k|        { \
  |  |   96|   121k|                static const ASN1_ITEM local_it = {
  ------------------
  765|   121k|                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
  ------------------
  |  |   80|   121k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  766|   121k|                                ASN1_ITEM_end(itname)
  ------------------
  |  |  102|   121k|                }; \
  |  |  103|   121k|        return &local_it; \
  |  |  104|   121k|        }
  ------------------
ASN1_SEQUENCE_ANY_it:
  113|  21.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  21.4k|        { \
  |  |   96|  21.4k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  21.4k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  21.4k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  21.4k|                -1,\
  116|  21.4k|                &tname##_item_tt,\
  117|  21.4k|                0,\
  118|  21.4k|                NULL,\
  119|  21.4k|                0,\
  120|  21.4k|                #tname \
  121|  21.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  21.4k|                }; \
  |  |  103|  21.4k|        return &local_it; \
  |  |  104|  21.4k|        }
  ------------------
ASN1_SET_ANY_it:
  113|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  11.5k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  11.5k|                -1,\
  116|  11.5k|                &tname##_item_tt,\
  117|  11.5k|                0,\
  118|  11.5k|                NULL,\
  119|  11.5k|                0,\
  120|  11.5k|                #tname \
  121|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
d2i_ASN1_SEQUENCE_ANY:
  826|  9.90k|        { \
  827|  9.90k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  9.90k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  9.90k|        } \
X509_ALGOR_it:
  166|  1.50M|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.50M|        { \
  |  |   96|  1.50M|                static const ASN1_ITEM local_it = {
  ------------------
  167|  1.50M|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.50M|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  1.50M|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.50M|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  1.50M|                tname##_seq_tt,\
  170|  1.50M|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  1.50M|                NULL,\
  172|  1.50M|                sizeof(stname),\
  173|  1.50M|                #tname \
  174|  1.50M|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.50M|                }; \
  |  |  103|  1.50M|        return &local_it; \
  |  |  104|  1.50M|        }
  ------------------
X509_ALGORS_it:
  113|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  11.5k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  11.5k|                -1,\
  116|  11.5k|                &tname##_item_tt,\
  117|  11.5k|                0,\
  118|  11.5k|                NULL,\
  119|  11.5k|                0,\
  120|  11.5k|                #tname \
  121|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
X509_ALGOR_new:
  812|  69.0k|        { \
  813|  69.0k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  69.0k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  69.0k|        } \
X509_ALGOR_free:
  816|  65.3k|        { \
  817|  65.3k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  65.3k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  65.3k|        }
X509_SIG_it:
  166|  38.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  38.1k|        { \
  |  |   96|  38.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  38.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  38.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  38.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  38.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  38.1k|                tname##_seq_tt,\
  170|  38.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  38.1k|                NULL,\
  172|  38.1k|                sizeof(stname),\
  173|  38.1k|                #tname \
  174|  38.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  38.1k|                }; \
  |  |  103|  38.1k|        return &local_it; \
  |  |  104|  38.1k|        }
  ------------------
NETSCAPE_SPKAC_it:
  166|  38.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  38.1k|        { \
  |  |   96|  38.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  38.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  38.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  38.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  38.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  38.1k|                tname##_seq_tt,\
  170|  38.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  38.1k|                NULL,\
  172|  38.1k|                sizeof(stname),\
  173|  38.1k|                #tname \
  174|  38.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  38.1k|                }; \
  |  |  103|  38.1k|        return &local_it; \
  |  |  104|  38.1k|        }
  ------------------
NETSCAPE_SPKI_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
X509_VAL_it:
  166|  58.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  58.0k|        { \
  |  |   96|  58.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  58.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  58.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  58.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  58.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  58.0k|                tname##_seq_tt,\
  170|  58.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  58.0k|                NULL,\
  172|  58.0k|                sizeof(stname),\
  173|  58.0k|                #tname \
  174|  58.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  58.0k|                }; \
  |  |  103|  58.0k|        return &local_it; \
  |  |  104|  58.0k|        }
  ------------------
CMS_IssuerAndSerialNumber_it:
  166|  8.98k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  8.98k|        { \
  |  |   96|  8.98k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  8.98k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  8.98k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  8.98k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  8.98k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  8.98k|                tname##_seq_tt,\
  170|  8.98k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  8.98k|                NULL,\
  172|  8.98k|                sizeof(stname),\
  173|  8.98k|                #tname \
  174|  8.98k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  8.98k|                }; \
  |  |  103|  8.98k|        return &local_it; \
  |  |  104|  8.98k|        }
  ------------------
CMS_CertificateChoices_it:
  320|  3.49M|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  3.49M|        { \
  |  |   96|  3.49M|                static const ASN1_ITEM local_it = {
  ------------------
  321|  3.49M|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  3.49M|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  3.49M|                offsetof(stname,selname) ,\
  323|  3.49M|                tname##_ch_tt,\
  324|  3.49M|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  3.49M|                NULL,\
  326|  3.49M|                sizeof(stname),\
  327|  3.49M|                #stname \
  328|  3.49M|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.49M|                }; \
  |  |  103|  3.49M|        return &local_it; \
  |  |  104|  3.49M|        }
  ------------------
CMS_SignerInfo_it:
  247|  5.85k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  5.85k|        { \
  |  |   96|  5.85k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  5.85k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  5.85k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  5.85k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  5.85k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  5.85k|                tname##_seq_tt,\
  251|  5.85k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  5.85k|                &tname##_aux,\
  253|  5.85k|                sizeof(stname),\
  254|  5.85k|                #tname \
  255|  5.85k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  5.85k|                }; \
  |  |  103|  5.85k|        return &local_it; \
  |  |  104|  5.85k|        }
  ------------------
CMS_RevocationInfoChoice_it:
  320|  6.42k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  6.42k|        { \
  |  |   96|  6.42k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  6.42k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  6.42k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  6.42k|                offsetof(stname,selname) ,\
  323|  6.42k|                tname##_ch_tt,\
  324|  6.42k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  6.42k|                NULL,\
  326|  6.42k|                sizeof(stname),\
  327|  6.42k|                #stname \
  328|  6.42k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  6.42k|                }; \
  |  |  103|  6.42k|        return &local_it; \
  |  |  104|  6.42k|        }
  ------------------
CMS_SignedData_it:
  218|  1.05k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  1.05k|        { \
  |  |   96|  1.05k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  1.05k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  1.05k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  1.05k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.05k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  1.05k|                tname##_seq_tt,\
  222|  1.05k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  1.05k|                NULL,\
  224|  1.05k|                sizeof(tname),\
  225|  1.05k|                #tname \
  226|  1.05k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.05k|                }; \
  |  |  103|  1.05k|        return &local_it; \
  |  |  104|  1.05k|        }
  ------------------
CMS_EncryptedContentInfo_it:
  270|    401|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    401|        { \
  |  |   96|    401|                static const ASN1_ITEM local_it = {
  ------------------
  271|    401|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|    401|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  272|    401|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    401|# define V_ASN1_SEQUENCE                 16
  ------------------
  273|    401|                tname##_seq_tt,\
  274|    401|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  275|    401|                &tname##_aux,\
  276|    401|                sizeof(stname),\
  277|    401|                #stname \
  278|    401|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    401|                }; \
  |  |  103|    401|        return &local_it; \
  |  |  104|    401|        }
  ------------------
CMS_KeyTransRecipientInfo_it:
  166|  9.46k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  9.46k|        { \
  |  |   96|  9.46k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  9.46k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  9.46k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  9.46k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  9.46k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  9.46k|                tname##_seq_tt,\
  170|  9.46k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  9.46k|                NULL,\
  172|  9.46k|                sizeof(stname),\
  173|  9.46k|                #tname \
  174|  9.46k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  9.46k|                }; \
  |  |  103|  9.46k|        return &local_it; \
  |  |  104|  9.46k|        }
  ------------------
CMS_OtherKeyAttribute_it:
  166|    770|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    770|        { \
  |  |   96|    770|                static const ASN1_ITEM local_it = {
  ------------------
  167|    770|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    770|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|    770|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    770|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|    770|                tname##_seq_tt,\
  170|    770|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|    770|                NULL,\
  172|    770|                sizeof(stname),\
  173|    770|                #tname \
  174|    770|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    770|                }; \
  |  |  103|    770|        return &local_it; \
  |  |  104|    770|        }
  ------------------
CMS_RecipientKeyIdentifier_it:
  166|      8|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      8|        { \
  |  |   96|      8|                static const ASN1_ITEM local_it = {
  ------------------
  167|      8|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      8|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      8|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      8|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      8|                tname##_seq_tt,\
  170|      8|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      8|                NULL,\
  172|      8|                sizeof(stname),\
  173|      8|                #tname \
  174|      8|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      8|                }; \
  |  |  103|      8|        return &local_it; \
  |  |  104|      8|        }
  ------------------
CMS_RecipientEncryptedKey_it:
  247|  3.72k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  3.72k|        { \
  |  |   96|  3.72k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  3.72k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  3.72k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  3.72k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  3.72k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  3.72k|                tname##_seq_tt,\
  251|  3.72k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  3.72k|                &tname##_aux,\
  253|  3.72k|                sizeof(stname),\
  254|  3.72k|                #tname \
  255|  3.72k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  3.72k|                }; \
  |  |  103|  3.72k|        return &local_it; \
  |  |  104|  3.72k|        }
  ------------------
CMS_OriginatorPublicKey_it:
  166|      5|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      5|        { \
  |  |   96|      5|                static const ASN1_ITEM local_it = {
  ------------------
  167|      5|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      5|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      5|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      5|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      5|                tname##_seq_tt,\
  170|      5|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      5|                NULL,\
  172|      5|                sizeof(stname),\
  173|      5|                #tname \
  174|      5|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      5|                }; \
  |  |  103|      5|        return &local_it; \
  |  |  104|      5|        }
  ------------------
CMS_KeyAgreeRecipientInfo_it:
  247|  12.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.7k|        { \
  |  |   96|  12.7k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  12.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  12.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  12.7k|                tname##_seq_tt,\
  251|  12.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  12.7k|                &tname##_aux,\
  253|  12.7k|                sizeof(stname),\
  254|  12.7k|                #tname \
  255|  12.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.7k|                }; \
  |  |  103|  12.7k|        return &local_it; \
  |  |  104|  12.7k|        }
  ------------------
CMS_KEKRecipientInfo_it:
  166|  6.89k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  6.89k|        { \
  |  |   96|  6.89k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  6.89k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  6.89k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  6.89k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  6.89k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  6.89k|                tname##_seq_tt,\
  170|  6.89k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  6.89k|                NULL,\
  172|  6.89k|                sizeof(stname),\
  173|  6.89k|                #tname \
  174|  6.89k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  6.89k|                }; \
  |  |  103|  6.89k|        return &local_it; \
  |  |  104|  6.89k|        }
  ------------------
CMS_PasswordRecipientInfo_it:
  166|  20.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  20.8k|        { \
  |  |   96|  20.8k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  20.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  20.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  20.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  20.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  20.8k|                tname##_seq_tt,\
  170|  20.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  20.8k|                NULL,\
  172|  20.8k|                sizeof(stname),\
  173|  20.8k|                #tname \
  174|  20.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  20.8k|                }; \
  |  |  103|  20.8k|        return &local_it; \
  |  |  104|  20.8k|        }
  ------------------
CMS_RecipientInfo_it:
  344|  27.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  27.1k|        { \
  |  |   96|  27.1k|                static const ASN1_ITEM local_it = {
  ------------------
  345|  27.1k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  27.1k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  346|  27.1k|                offsetof(stname,selname) ,\
  347|  27.1k|                tname##_ch_tt,\
  348|  27.1k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  349|  27.1k|                &tname##_aux,\
  350|  27.1k|                sizeof(stname),\
  351|  27.1k|                #stname \
  352|  27.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  27.1k|                }; \
  |  |  103|  27.1k|        return &local_it; \
  |  |  104|  27.1k|        }
  ------------------
CMS_EnvelopedData_it:
  218|    282|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|    282|        { \
  |  |   96|    282|                static const ASN1_ITEM local_it = {
  ------------------
  219|    282|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|    282|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|    282|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    282|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|    282|                tname##_seq_tt,\
  222|    282|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|    282|                NULL,\
  224|    282|                sizeof(tname),\
  225|    282|                #tname \
  226|    282|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    282|                }; \
  |  |  103|    282|        return &local_it; \
  |  |  104|    282|        }
  ------------------
CMS_DigestedData_it:
  218|     12|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     12|        { \
  |  |   96|     12|                static const ASN1_ITEM local_it = {
  ------------------
  219|     12|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|     12|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|     12|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     12|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|     12|                tname##_seq_tt,\
  222|     12|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|     12|                NULL,\
  224|     12|                sizeof(tname),\
  225|     12|                #tname \
  226|     12|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     12|                }; \
  |  |  103|     12|        return &local_it; \
  |  |  104|     12|        }
  ------------------
CMS_EncryptedData_it:
  218|     48|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     48|        { \
  |  |   96|     48|                static const ASN1_ITEM local_it = {
  ------------------
  219|     48|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|     48|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|     48|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     48|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|     48|                tname##_seq_tt,\
  222|     48|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|     48|                NULL,\
  224|     48|                sizeof(tname),\
  225|     48|                #tname \
  226|     48|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     48|                }; \
  |  |  103|     48|        return &local_it; \
  |  |  104|     48|        }
  ------------------
CMS_AuthEnvelopedData_it:
  218|      3|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      3|        { \
  |  |   96|      3|                static const ASN1_ITEM local_it = {
  ------------------
  219|      3|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|      3|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|      3|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      3|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|      3|                tname##_seq_tt,\
  222|      3|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|      3|                NULL,\
  224|      3|                sizeof(tname),\
  225|      3|                #tname \
  226|      3|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      3|                }; \
  |  |  103|      3|        return &local_it; \
  |  |  104|      3|        }
  ------------------
CMS_CompressedData_it:
  218|     11|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     11|        { \
  |  |   96|     11|                static const ASN1_ITEM local_it = {
  ------------------
  219|     11|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|     11|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|     11|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     11|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|     11|                tname##_seq_tt,\
  222|     11|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|     11|                NULL,\
  224|     11|                sizeof(tname),\
  225|     11|                #tname \
  226|     11|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     11|                }; \
  |  |  103|     11|        return &local_it; \
  |  |  104|     11|        }
  ------------------
CMS_ContentInfo_it:
  270|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  271|  11.5k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  11.5k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  272|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  273|  11.5k|                tname##_seq_tt,\
  274|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  275|  11.5k|                &tname##_aux,\
  276|  11.5k|                sizeof(stname),\
  277|  11.5k|                #stname \
  278|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
CMS_ReceiptRequest_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
cms_asn1.c:CMS_OtherCertificateFormat_it:
  178|    697|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    697|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    697|        { \
  |  |  |  |   96|    697|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|    697|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    697|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|    697|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    697|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|    697|                tname##_seq_tt,\
  182|    697|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|    697|                NULL,\
  184|    697|                sizeof(stname),\
  185|    697|                #stname \
  186|    697|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    697|                }; \
  |  |  103|    697|        return &local_it; \
  |  |  104|    697|        }
  ------------------
cms_asn1.c:CMS_SignerIdentifier_it:
  332|  9.52k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  9.52k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  9.52k|        { \
  |  |  |  |   96|  9.52k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  9.52k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  9.52k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  9.52k|                offsetof(stname,selname) ,\
  335|  9.52k|                tname##_ch_tt,\
  336|  9.52k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  9.52k|                NULL,\
  338|  9.52k|                sizeof(stname),\
  339|  9.52k|                #stname \
  340|  9.52k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  9.52k|                }; \
  |  |  103|  9.52k|        return &local_it; \
  |  |  104|  9.52k|        }
  ------------------
cms_asn1.c:CMS_OtherRevocationInfoFormat_it:
  178|    466|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    466|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    466|        { \
  |  |  |  |   96|    466|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|    466|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    466|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|    466|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    466|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|    466|                tname##_seq_tt,\
  182|    466|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|    466|                NULL,\
  184|    466|                sizeof(stname),\
  185|    466|                #stname \
  186|    466|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    466|                }; \
  |  |  103|    466|        return &local_it; \
  |  |  104|    466|        }
  ------------------
cms_asn1.c:CMS_EncapsulatedContentInfo_it:
  229|  2.31k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  2.31k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  2.31k|        { \
  |  |  |  |   96|  2.31k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  230|  2.31k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  2.31k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  231|  2.31k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  2.31k|# define V_ASN1_SEQUENCE                 16
  ------------------
  232|  2.31k|                tname##_seq_tt,\
  233|  2.31k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  234|  2.31k|                NULL,\
  235|  2.31k|                sizeof(tname),\
  236|  2.31k|                #tname \
  237|  2.31k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.31k|                }; \
  |  |  103|  2.31k|        return &local_it; \
  |  |  104|  2.31k|        }
  ------------------
cms_asn1.c:CMS_KeyAgreeRecipientIdentifier_it:
  332|  2.24k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  2.24k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  2.24k|        { \
  |  |  |  |   96|  2.24k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  2.24k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  2.24k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  2.24k|                offsetof(stname,selname) ,\
  335|  2.24k|                tname##_ch_tt,\
  336|  2.24k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  2.24k|                NULL,\
  338|  2.24k|                sizeof(stname),\
  339|  2.24k|                #stname \
  340|  2.24k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.24k|                }; \
  |  |  103|  2.24k|        return &local_it; \
  |  |  104|  2.24k|        }
  ------------------
cms_asn1.c:CMS_OriginatorIdentifierOrKey_it:
  332|  8.48k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  8.48k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  8.48k|        { \
  |  |  |  |   96|  8.48k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  8.48k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  8.48k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  8.48k|                offsetof(stname,selname) ,\
  335|  8.48k|                tname##_ch_tt,\
  336|  8.48k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  8.48k|                NULL,\
  338|  8.48k|                sizeof(stname),\
  339|  8.48k|                #stname \
  340|  8.48k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  8.48k|                }; \
  |  |  103|  8.48k|        return &local_it; \
  |  |  104|  8.48k|        }
  ------------------
cms_asn1.c:CMS_KEKIdentifier_it:
  178|    593|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    593|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    593|        { \
  |  |  |  |   96|    593|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|    593|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|    593|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|    593|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    593|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|    593|                tname##_seq_tt,\
  182|    593|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|    593|                NULL,\
  184|    593|                sizeof(stname),\
  185|    593|                #stname \
  186|    593|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    593|                }; \
  |  |  103|    593|        return &local_it; \
  |  |  104|    593|        }
  ------------------
cms_asn1.c:CMS_OtherRecipientInfo_it:
  178|  2.35k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  2.35k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  2.35k|        { \
  |  |  |  |   96|  2.35k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  2.35k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  2.35k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  2.35k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  2.35k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  2.35k|                tname##_seq_tt,\
  182|  2.35k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  2.35k|                NULL,\
  184|  2.35k|                sizeof(stname),\
  185|  2.35k|                #stname \
  186|  2.35k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  2.35k|                }; \
  |  |  103|  2.35k|        return &local_it; \
  |  |  104|  2.35k|        }
  ------------------
cms_asn1.c:CMS_OriginatorInfo_it:
  178|  1.82k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  1.82k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  1.82k|        { \
  |  |  |  |   96|  1.82k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  1.82k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.82k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  1.82k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.82k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  1.82k|                tname##_seq_tt,\
  182|  1.82k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  1.82k|                NULL,\
  184|  1.82k|                sizeof(stname),\
  185|  1.82k|                #stname \
  186|  1.82k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.82k|                }; \
  |  |  103|  1.82k|        return &local_it; \
  |  |  104|  1.82k|        }
  ------------------
cms_asn1.c:CMS_ContentInfo_adb:
  463|  29.3k|        { \
  464|  29.3k|        static const ASN1_ADB internal_adb = \
  465|  29.3k|                {\
  466|  29.3k|                flags,\
  467|  29.3k|                offsetof(name, field),\
  468|  29.3k|                adb_cb,\
  469|  29.3k|                name##_adbtbl,\
  470|  29.3k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  29.3k|                def,\
  472|  29.3k|                none\
  473|  29.3k|                }; \
  474|  29.3k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  29.3k|        } \
cms_asn1.c:CMS_AuthenticatedData_it:
  229|    751|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|    751|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|    751|        { \
  |  |  |  |   96|    751|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  230|    751|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|    751|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  231|    751|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|    751|# define V_ASN1_SEQUENCE                 16
  ------------------
  232|    751|                tname##_seq_tt,\
  233|    751|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  234|    751|                NULL,\
  235|    751|                sizeof(tname),\
  236|    751|                #tname \
  237|    751|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|    751|                }; \
  |  |  103|    751|        return &local_it; \
  |  |  104|    751|        }
  ------------------
cms_asn1.c:CMS_ReceiptsFrom_it:
  332|  17.8k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  17.8k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  17.8k|        { \
  |  |  |  |   96|  17.8k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  333|  17.8k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  17.8k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  334|  17.8k|                offsetof(stname,selname) ,\
  335|  17.8k|                tname##_ch_tt,\
  336|  17.8k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  337|  17.8k|                NULL,\
  338|  17.8k|                sizeof(stname),\
  339|  17.8k|                #stname \
  340|  17.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  17.8k|                }; \
  |  |  103|  17.8k|        return &local_it; \
  |  |  104|  17.8k|        }
  ------------------
DHparams_it:
  247|  23.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  23.1k|        { \
  |  |   96|  23.1k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  23.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  23.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  23.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  23.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  23.1k|                tname##_seq_tt,\
  251|  23.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  23.1k|                &tname##_aux,\
  253|  23.1k|                sizeof(stname),\
  254|  23.1k|                #tname \
  255|  23.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  23.1k|                }; \
  |  |  103|  23.1k|        return &local_it; \
  |  |  104|  23.1k|        }
  ------------------
d2i_DHparams:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_DHparams:
  830|     60|        { \
  831|     60|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     60|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     60|        }
d2i_int_dhx:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_int_dhx:
  830|     91|        { \
  831|     91|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     91|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     91|        }
dh_asn1.c:DHxparams_it:
  178|  11.6k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  11.6k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  11.6k|        { \
  |  |  |  |   96|  11.6k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  11.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  11.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  11.6k|                tname##_seq_tt,\
  182|  11.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  11.6k|                NULL,\
  184|  11.6k|                sizeof(stname),\
  185|  11.6k|                #stname \
  186|  11.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.6k|                }; \
  |  |  103|  11.6k|        return &local_it; \
  |  |  104|  11.6k|        }
  ------------------
dh_asn1.c:DHvparams_it:
  178|  27.6k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  27.6k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  27.6k|        { \
  |  |  |  |   96|  27.6k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  27.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  27.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  27.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  27.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  27.6k|                tname##_seq_tt,\
  182|  27.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  27.6k|                NULL,\
  184|  27.6k|                sizeof(stname),\
  185|  27.6k|                #stname \
  186|  27.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  27.6k|                }; \
  |  |  103|  27.6k|        return &local_it; \
  |  |  104|  27.6k|        }
  ------------------
d2i_DSAPrivateKey:
  826|  27.7k|        { \
  827|  27.7k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  27.7k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  27.7k|        } \
i2d_DSAPrivateKey:
  830|    672|        { \
  831|    672|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|    672|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    672|        }
d2i_DSAparams:
  826|  12.0k|        { \
  827|  12.0k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  12.0k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  12.0k|        } \
i2d_DSAparams:
  830|     15|        { \
  831|     15|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     15|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     15|        }
d2i_DSAPublicKey:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_DSAPublicKey:
  830|      9|        { \
  831|      9|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|      9|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|      9|        }
dsa_asn1.c:DSAPrivateKey_it:
  258|  28.4k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  28.4k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  28.4k|        { \
  |  |  |  |   96|  28.4k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|  28.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  28.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|  28.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  28.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|  28.4k|                tname##_seq_tt,\
  262|  28.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|  28.4k|                &tname##_aux,\
  264|  28.4k|                sizeof(stname),\
  265|  28.4k|                #stname \
  266|  28.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  28.4k|                }; \
  |  |  103|  28.4k|        return &local_it; \
  |  |  104|  28.4k|        }
  ------------------
dsa_asn1.c:DSAparams_it:
  258|  12.0k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  12.0k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  12.0k|        { \
  |  |  |  |   96|  12.0k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|  12.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|  12.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|  12.0k|                tname##_seq_tt,\
  262|  12.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|  12.0k|                &tname##_aux,\
  264|  12.0k|                sizeof(stname),\
  265|  12.0k|                #stname \
  266|  12.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.0k|                }; \
  |  |  103|  12.0k|        return &local_it; \
  |  |  104|  12.0k|        }
  ------------------
dsa_asn1.c:DSAPublicKey_it:
  258|  11.5k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  11.5k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  11.5k|        { \
  |  |  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|  11.5k|                tname##_seq_tt,\
  262|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|  11.5k|                &tname##_aux,\
  264|  11.5k|                sizeof(stname),\
  265|  11.5k|                #stname \
  266|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
ECPARAMETERS_it:
  166|  74.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  74.9k|        { \
  |  |   96|  74.9k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  74.9k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  74.9k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  74.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  74.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  74.9k|                tname##_seq_tt,\
  170|  74.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  74.9k|                NULL,\
  172|  74.9k|                sizeof(stname),\
  173|  74.9k|                #tname \
  174|  74.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  74.9k|                }; \
  |  |  103|  74.9k|        return &local_it; \
  |  |  104|  74.9k|        }
  ------------------
ECPARAMETERS_new:
  812|    241|        { \
  813|    241|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|    241|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|    241|        } \
ECPKPARAMETERS_it:
  320|   150k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   150k|        { \
  |  |   96|   150k|                static const ASN1_ITEM local_it = {
  ------------------
  321|   150k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|   150k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|   150k|                offsetof(stname,selname) ,\
  323|   150k|                tname##_ch_tt,\
  324|   150k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|   150k|                NULL,\
  326|   150k|                sizeof(stname),\
  327|   150k|                #stname \
  328|   150k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   150k|                }; \
  |  |  103|   150k|        return &local_it; \
  |  |  104|   150k|        }
  ------------------
d2i_ECPKPARAMETERS:
  826|  23.1k|        { \
  827|  23.1k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  23.1k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  23.1k|        } \
i2d_ECPKPARAMETERS:
  830|    224|        { \
  831|    224|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|    224|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    224|        }
ECPKPARAMETERS_new:
  812|  1.31k|        { \
  813|  1.31k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  1.31k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  1.31k|        } \
ECPKPARAMETERS_free:
  816|  23.3k|        { \
  817|  23.3k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  23.3k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  23.3k|        }
d2i_EC_PRIVATEKEY:
  826|  35.8k|        { \
  827|  35.8k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  35.8k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  35.8k|        } \
i2d_EC_PRIVATEKEY:
  830|  1.07k|        { \
  831|  1.07k|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  1.07k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|  1.07k|        }
EC_PRIVATEKEY_new:
  812|  1.43k|        { \
  813|  1.43k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  1.43k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|  1.43k|        } \
EC_PRIVATEKEY_free:
  816|  4.07k|        { \
  817|  4.07k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  4.07k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  4.07k|        }
ec_asn1.c:X9_62_PENTANOMIAL_it:
  178|     23|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     23|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     23|        { \
  |  |  |  |   96|     23|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|     23|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     23|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|     23|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     23|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|     23|                tname##_seq_tt,\
  182|     23|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|     23|                NULL,\
  184|     23|                sizeof(stname),\
  185|     23|                #stname \
  186|     23|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     23|                }; \
  |  |  103|     23|        return &local_it; \
  |  |  104|     23|        }
  ------------------
ec_asn1.c:X9_62_CHARACTERISTIC_TWO_it:
  178|     62|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     62|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     62|        { \
  |  |  |  |   96|     62|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|     62|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     62|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|     62|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     62|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|     62|                tname##_seq_tt,\
  182|     62|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|     62|                NULL,\
  184|     62|                sizeof(stname),\
  185|     62|                #stname \
  186|     62|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     62|                }; \
  |  |  103|     62|        return &local_it; \
  |  |  104|     62|        }
  ------------------
ec_asn1.c:X9_62_CHARACTERISTIC_TWO_adb:
  463|     92|        { \
  464|     92|        static const ASN1_ADB internal_adb = \
  465|     92|                {\
  466|     92|                flags,\
  467|     92|                offsetof(name, field),\
  468|     92|                adb_cb,\
  469|     92|                name##_adbtbl,\
  470|     92|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|     92|                def,\
  472|     92|                none\
  473|     92|                }; \
  474|     92|                return (const ASN1_ITEM *) &internal_adb; \
  475|     92|        } \
ec_asn1.c:X9_62_FIELDID_it:
  178|  93.7k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  93.7k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  93.7k|        { \
  |  |  |  |   96|  93.7k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  93.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  93.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  93.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  93.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  93.7k|                tname##_seq_tt,\
  182|  93.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  93.7k|                NULL,\
  184|  93.7k|                sizeof(stname),\
  185|  93.7k|                #stname \
  186|  93.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  93.7k|                }; \
  |  |  103|  93.7k|        return &local_it; \
  |  |  104|  93.7k|        }
  ------------------
ec_asn1.c:X9_62_FIELDID_adb:
  463|  89.6k|        { \
  464|  89.6k|        static const ASN1_ADB internal_adb = \
  465|  89.6k|                {\
  466|  89.6k|                flags,\
  467|  89.6k|                offsetof(name, field),\
  468|  89.6k|                adb_cb,\
  469|  89.6k|                name##_adbtbl,\
  470|  89.6k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  89.6k|                def,\
  472|  89.6k|                none\
  473|  89.6k|                }; \
  474|  89.6k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  89.6k|        } \
ec_asn1.c:X9_62_CURVE_it:
  178|  79.9k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  79.9k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  79.9k|        { \
  |  |  |  |   96|  79.9k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  79.9k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  79.9k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  79.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  79.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  79.9k|                tname##_seq_tt,\
  182|  79.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  79.9k|                NULL,\
  184|  79.9k|                sizeof(stname),\
  185|  79.9k|                #stname \
  186|  79.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  79.9k|                }; \
  |  |  103|  79.9k|        return &local_it; \
  |  |  104|  79.9k|        }
  ------------------
ec_asn1.c:EC_PRIVATEKEY_it:
  178|  42.4k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  42.4k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  42.4k|        { \
  |  |  |  |   96|  42.4k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  42.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  42.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  42.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  42.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  42.4k|                tname##_seq_tt,\
  182|  42.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  42.4k|                NULL,\
  184|  42.4k|                sizeof(stname),\
  185|  42.4k|                #stname \
  186|  42.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  42.4k|                }; \
  |  |  103|  42.4k|        return &local_it; \
  |  |  104|  42.4k|        }
  ------------------
d2i_ESS_ISSUER_SERIAL:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_ESS_ISSUER_SERIAL:
  830|      3|        { \
  831|      3|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|      3|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|      3|        }
ESS_ISSUER_SERIAL_free:
  816|      3|        { \
  817|      3|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|      3|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|      3|        }
d2i_ESS_CERT_ID:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_ESS_CERT_ID:
  830|     20|        { \
  831|     20|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     20|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     20|        }
ESS_CERT_ID_free:
  816|     20|        { \
  817|     20|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|     20|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|     20|        }
ESS_SIGNING_CERT_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
d2i_ESS_SIGNING_CERT:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_ESS_SIGNING_CERT:
  830|     20|        { \
  831|     20|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     20|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     20|        }
ESS_SIGNING_CERT_free:
  816|     20|        { \
  817|     20|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|     20|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|     20|        }
d2i_ESS_CERT_ID_V2:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_ESS_CERT_ID_V2:
  830|     25|        { \
  831|     25|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     25|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     25|        }
ESS_CERT_ID_V2_free:
  816|     25|        { \
  817|     25|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|     25|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|     25|        }
ESS_SIGNING_CERT_V2_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
d2i_ESS_SIGNING_CERT_V2:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_ESS_SIGNING_CERT_V2:
  830|     20|        { \
  831|     20|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     20|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     20|        }
ESS_SIGNING_CERT_V2_free:
  816|     20|        { \
  817|     20|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|     20|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|     20|        }
ess_asn1.c:ESS_ISSUER_SERIAL_it:
  178|  76.3k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  76.3k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  76.3k|        { \
  |  |  |  |   96|  76.3k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  76.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  76.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  76.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  76.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  76.3k|                tname##_seq_tt,\
  182|  76.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  76.3k|                NULL,\
  184|  76.3k|                sizeof(stname),\
  185|  76.3k|                #stname \
  186|  76.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  76.3k|                }; \
  |  |  103|  76.3k|        return &local_it; \
  |  |  104|  76.3k|        }
  ------------------
ess_asn1.c:ESS_CERT_ID_it:
  178|  26.5k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  26.5k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  26.5k|        { \
  |  |  |  |   96|  26.5k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  26.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  26.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  26.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  26.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  26.5k|                tname##_seq_tt,\
  182|  26.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  26.5k|                NULL,\
  184|  26.5k|                sizeof(stname),\
  185|  26.5k|                #stname \
  186|  26.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  26.5k|                }; \
  |  |  103|  26.5k|        return &local_it; \
  |  |  104|  26.5k|        }
  ------------------
ess_asn1.c:ESS_CERT_ID_V2_it:
  178|  26.5k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  26.5k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  26.5k|        { \
  |  |  |  |   96|  26.5k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  26.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  26.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  26.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  26.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  26.5k|                tname##_seq_tt,\
  182|  26.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  26.5k|                NULL,\
  184|  26.5k|                sizeof(stname),\
  185|  26.5k|                #stname \
  186|  26.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  26.5k|                }; \
  |  |  103|  26.5k|        return &local_it; \
  |  |  104|  26.5k|        }
  ------------------
OCSP_SIGNATURE_it:
  166|  38.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  38.1k|        { \
  |  |   96|  38.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  38.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  38.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  38.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  38.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  38.1k|                tname##_seq_tt,\
  170|  38.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  38.1k|                NULL,\
  172|  38.1k|                sizeof(stname),\
  173|  38.1k|                #tname \
  174|  38.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  38.1k|                }; \
  |  |  103|  38.1k|        return &local_it; \
  |  |  104|  38.1k|        }
  ------------------
OCSP_CERTID_it:
  166|  65.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  65.3k|        { \
  |  |   96|  65.3k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  65.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  65.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  65.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  65.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  65.3k|                tname##_seq_tt,\
  170|  65.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  65.3k|                NULL,\
  172|  65.3k|                sizeof(stname),\
  173|  65.3k|                #tname \
  174|  65.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  65.3k|                }; \
  |  |  103|  65.3k|        return &local_it; \
  |  |  104|  65.3k|        }
  ------------------
OCSP_ONEREQ_it:
  166|  33.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  33.2k|        { \
  |  |   96|  33.2k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  33.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  33.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  33.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  33.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  33.2k|                tname##_seq_tt,\
  170|  33.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  33.2k|                NULL,\
  172|  33.2k|                sizeof(stname),\
  173|  33.2k|                #tname \
  174|  33.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  33.2k|                }; \
  |  |  103|  33.2k|        return &local_it; \
  |  |  104|  33.2k|        }
  ------------------
OCSP_REQINFO_it:
  166|  38.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  38.1k|        { \
  |  |   96|  38.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  38.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  38.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  38.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  38.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  38.1k|                tname##_seq_tt,\
  170|  38.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  38.1k|                NULL,\
  172|  38.1k|                sizeof(stname),\
  173|  38.1k|                #tname \
  174|  38.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  38.1k|                }; \
  |  |  103|  38.1k|        return &local_it; \
  |  |  104|  38.1k|        }
  ------------------
OCSP_REQUEST_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
OCSP_RESPBYTES_it:
  166|  38.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  38.1k|        { \
  |  |   96|  38.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  38.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  38.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  38.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  38.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  38.1k|                tname##_seq_tt,\
  170|  38.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  38.1k|                NULL,\
  172|  38.1k|                sizeof(stname),\
  173|  38.1k|                #tname \
  174|  38.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  38.1k|                }; \
  |  |  103|  38.1k|        return &local_it; \
  |  |  104|  38.1k|        }
  ------------------
OCSP_RESPONSE_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
OCSP_RESPID_it:
  320|  57.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  57.2k|        { \
  |  |   96|  57.2k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  57.2k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  57.2k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  57.2k|                offsetof(stname,selname) ,\
  323|  57.2k|                tname##_ch_tt,\
  324|  57.2k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  57.2k|                NULL,\
  326|  57.2k|                sizeof(stname),\
  327|  57.2k|                #stname \
  328|  57.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  57.2k|                }; \
  |  |  103|  57.2k|        return &local_it; \
  |  |  104|  57.2k|        }
  ------------------
OCSP_REVOKEDINFO_it:
  166|  22.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  22.7k|        { \
  |  |   96|  22.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  22.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  22.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  22.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  22.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  22.7k|                tname##_seq_tt,\
  170|  22.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  22.7k|                NULL,\
  172|  22.7k|                sizeof(stname),\
  173|  22.7k|                #tname \
  174|  22.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  22.7k|                }; \
  |  |  103|  22.7k|        return &local_it; \
  |  |  104|  22.7k|        }
  ------------------
OCSP_CERTSTATUS_it:
  320|  29.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  29.2k|        { \
  |  |   96|  29.2k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  29.2k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  29.2k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  29.2k|                offsetof(stname,selname) ,\
  323|  29.2k|                tname##_ch_tt,\
  324|  29.2k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  29.2k|                NULL,\
  326|  29.2k|                sizeof(stname),\
  327|  29.2k|                #stname \
  328|  29.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  29.2k|                }; \
  |  |  103|  29.2k|        return &local_it; \
  |  |  104|  29.2k|        }
  ------------------
OCSP_SINGLERESP_it:
  166|  29.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  29.2k|        { \
  |  |   96|  29.2k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  29.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  29.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  29.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  29.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  29.2k|                tname##_seq_tt,\
  170|  29.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  29.2k|                NULL,\
  172|  29.2k|                sizeof(stname),\
  173|  29.2k|                #tname \
  174|  29.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  29.2k|                }; \
  |  |  103|  29.2k|        return &local_it; \
  |  |  104|  29.2k|        }
  ------------------
OCSP_RESPDATA_it:
  166|  38.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  38.1k|        { \
  |  |   96|  38.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  38.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  38.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  38.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  38.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  38.1k|                tname##_seq_tt,\
  170|  38.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  38.1k|                NULL,\
  172|  38.1k|                sizeof(stname),\
  173|  38.1k|                #tname \
  174|  38.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  38.1k|                }; \
  |  |  103|  38.1k|        return &local_it; \
  |  |  104|  38.1k|        }
  ------------------
OCSP_BASICRESP_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
OCSP_CRLID_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
OCSP_SERVICELOC_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
PKCS12_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
PKCS12_MAC_DATA_it:
  166|  38.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  38.1k|        { \
  |  |   96|  38.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  38.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  38.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  38.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  38.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  38.1k|                tname##_seq_tt,\
  170|  38.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  38.1k|                NULL,\
  172|  38.1k|                sizeof(stname),\
  173|  38.1k|                #tname \
  174|  38.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  38.1k|                }; \
  |  |  103|  38.1k|        return &local_it; \
  |  |  104|  38.1k|        }
  ------------------
PKCS12_BAGS_it:
  166|  12.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.0k|        { \
  |  |   96|  12.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.0k|                tname##_seq_tt,\
  170|  12.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.0k|                NULL,\
  172|  12.0k|                sizeof(stname),\
  173|  12.0k|                #tname \
  174|  12.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.0k|                }; \
  |  |  103|  12.0k|        return &local_it; \
  |  |  104|  12.0k|        }
  ------------------
PKCS12_SAFEBAG_it:
  166|  43.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  43.4k|        { \
  |  |   96|  43.4k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  43.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  43.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  43.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  43.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  43.4k|                tname##_seq_tt,\
  170|  43.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  43.4k|                NULL,\
  172|  43.4k|                sizeof(stname),\
  173|  43.4k|                #tname \
  174|  43.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  43.4k|                }; \
  |  |  103|  43.4k|        return &local_it; \
  |  |  104|  43.4k|        }
  ------------------
PKCS12_SAFEBAGS_it:
  113|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  11.5k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  11.5k|                -1,\
  116|  11.5k|                &tname##_item_tt,\
  117|  11.5k|                0,\
  118|  11.5k|                NULL,\
  119|  11.5k|                0,\
  120|  11.5k|                #tname \
  121|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
PKCS12_AUTHSAFES_it:
  113|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  11.5k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  11.5k|                -1,\
  116|  11.5k|                &tname##_item_tt,\
  117|  11.5k|                0,\
  118|  11.5k|                NULL,\
  119|  11.5k|                0,\
  120|  11.5k|                #tname \
  121|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
p12_asn.c:PKCS12_BAGS_adb:
  463|  30.1k|        { \
  464|  30.1k|        static const ASN1_ADB internal_adb = \
  465|  30.1k|                {\
  466|  30.1k|                flags,\
  467|  30.1k|                offsetof(name, field),\
  468|  30.1k|                adb_cb,\
  469|  30.1k|                name##_adbtbl,\
  470|  30.1k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  30.1k|                def,\
  472|  30.1k|                none\
  473|  30.1k|                }; \
  474|  30.1k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  30.1k|        } \
p12_asn.c:PKCS12_SAFEBAG_adb:
  463|  51.7k|        { \
  464|  51.7k|        static const ASN1_ADB internal_adb = \
  465|  51.7k|                {\
  466|  51.7k|                flags,\
  467|  51.7k|                offsetof(name, field),\
  468|  51.7k|                adb_cb,\
  469|  51.7k|                name##_adbtbl,\
  470|  51.7k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  51.7k|                def,\
  472|  51.7k|                none\
  473|  51.7k|                }; \
  474|  51.7k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  51.7k|        } \
PKCS7_it:
  270|   139k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   139k|        { \
  |  |   96|   139k|                static const ASN1_ITEM local_it = {
  ------------------
  271|   139k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|   139k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  272|   139k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   139k|# define V_ASN1_SEQUENCE                 16
  ------------------
  273|   139k|                tname##_seq_tt,\
  274|   139k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  275|   139k|                &tname##_aux,\
  276|   139k|                sizeof(stname),\
  277|   139k|                #stname \
  278|   139k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   139k|                }; \
  |  |  103|   139k|        return &local_it; \
  |  |  104|   139k|        }
  ------------------
PKCS7_SIGNED_it:
  218|  12.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.9k|        { \
  |  |   96|  12.9k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  12.9k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  12.9k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  12.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  12.9k|                tname##_seq_tt,\
  222|  12.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  12.9k|                NULL,\
  224|  12.9k|                sizeof(tname),\
  225|  12.9k|                #tname \
  226|  12.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.9k|                }; \
  |  |  103|  12.9k|        return &local_it; \
  |  |  104|  12.9k|        }
  ------------------
PKCS7_SIGNER_INFO_it:
  247|  33.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  33.3k|        { \
  |  |   96|  33.3k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  33.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  33.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  33.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  33.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  33.3k|                tname##_seq_tt,\
  251|  33.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  33.3k|                &tname##_aux,\
  253|  33.3k|                sizeof(stname),\
  254|  33.3k|                #tname \
  255|  33.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  33.3k|                }; \
  |  |  103|  33.3k|        return &local_it; \
  |  |  104|  33.3k|        }
  ------------------
PKCS7_ISSUER_AND_SERIAL_it:
  166|  62.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  62.8k|        { \
  |  |   96|  62.8k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  62.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  62.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  62.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  62.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  62.8k|                tname##_seq_tt,\
  170|  62.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  62.8k|                NULL,\
  172|  62.8k|                sizeof(stname),\
  173|  62.8k|                #tname \
  174|  62.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  62.8k|                }; \
  |  |  103|  62.8k|        return &local_it; \
  |  |  104|  62.8k|        }
  ------------------
PKCS7_ENVELOPE_it:
  218|  11.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.6k|        { \
  |  |   96|  11.6k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  11.6k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  11.6k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  11.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  11.6k|                tname##_seq_tt,\
  222|  11.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  11.6k|                NULL,\
  224|  11.6k|                sizeof(tname),\
  225|  11.6k|                #tname \
  226|  11.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.6k|                }; \
  |  |  103|  11.6k|        return &local_it; \
  |  |  104|  11.6k|        }
  ------------------
PKCS7_RECIP_INFO_it:
  247|  31.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  31.4k|        { \
  |  |   96|  31.4k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  31.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  31.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  31.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  31.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  31.4k|                tname##_seq_tt,\
  251|  31.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  31.4k|                &tname##_aux,\
  253|  31.4k|                sizeof(stname),\
  254|  31.4k|                #tname \
  255|  31.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  31.4k|                }; \
  |  |  103|  31.4k|        return &local_it; \
  |  |  104|  31.4k|        }
  ------------------
PKCS7_ENC_CONTENT_it:
  218|  68.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  68.5k|        { \
  |  |   96|  68.5k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  68.5k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  68.5k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  68.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  68.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  68.5k|                tname##_seq_tt,\
  222|  68.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  68.5k|                NULL,\
  224|  68.5k|                sizeof(tname),\
  225|  68.5k|                #tname \
  226|  68.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  68.5k|                }; \
  |  |  103|  68.5k|        return &local_it; \
  |  |  104|  68.5k|        }
  ------------------
PKCS7_SIGN_ENVELOPE_it:
  218|  11.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.7k|        { \
  |  |   96|  11.7k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  11.7k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  11.7k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  11.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  11.7k|                tname##_seq_tt,\
  222|  11.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  11.7k|                NULL,\
  224|  11.7k|                sizeof(tname),\
  225|  11.7k|                #tname \
  226|  11.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.7k|                }; \
  |  |  103|  11.7k|        return &local_it; \
  |  |  104|  11.7k|        }
  ------------------
PKCS7_ENCRYPT_it:
  218|  11.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.7k|        { \
  |  |   96|  11.7k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  11.7k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  11.7k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  11.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  11.7k|                tname##_seq_tt,\
  222|  11.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  11.7k|                NULL,\
  224|  11.7k|                sizeof(tname),\
  225|  11.7k|                #tname \
  226|  11.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.7k|                }; \
  |  |  103|  11.7k|        return &local_it; \
  |  |  104|  11.7k|        }
  ------------------
PKCS7_DIGEST_it:
  218|  11.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.6k|        { \
  |  |   96|  11.6k|                static const ASN1_ITEM local_it = {
  ------------------
  219|  11.6k|                ASN1_ITYPE_NDEF_SEQUENCE,\
  ------------------
  |  |   86|  11.6k|# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
  ------------------
  220|  11.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  221|  11.6k|                tname##_seq_tt,\
  222|  11.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  223|  11.6k|                NULL,\
  224|  11.6k|                sizeof(tname),\
  225|  11.6k|                #tname \
  226|  11.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.6k|                }; \
  |  |  103|  11.6k|        return &local_it; \
  |  |  104|  11.6k|        }
  ------------------
PKCS7_ATTR_SIGN_it:
  113|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  11.5k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  11.5k|                -1,\
  116|  11.5k|                &tname##_item_tt,\
  117|  11.5k|                0,\
  118|  11.5k|                NULL,\
  119|  11.5k|                0,\
  120|  11.5k|                #tname \
  121|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
PKCS7_ATTR_VERIFY_it:
  113|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  11.5k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  11.5k|                -1,\
  116|  11.5k|                &tname##_item_tt,\
  117|  11.5k|                0,\
  118|  11.5k|                NULL,\
  119|  11.5k|                0,\
  120|  11.5k|                #tname \
  121|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
pk7_asn1.c:PKCS7_adb:
  463|   144k|        { \
  464|   144k|        static const ASN1_ADB internal_adb = \
  465|   144k|                {\
  466|   144k|                flags,\
  467|   144k|                offsetof(name, field),\
  468|   144k|                adb_cb,\
  469|   144k|                name##_adbtbl,\
  470|   144k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|   144k|                def,\
  472|   144k|                none\
  473|   144k|                }; \
  474|   144k|                return (const ASN1_ITEM *) &internal_adb; \
  475|   144k|        } \
RSA_PRIME_INFO_it:
  166|   266k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   266k|        { \
  |  |   96|   266k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   266k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   266k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   266k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   266k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   266k|                tname##_seq_tt,\
  170|   266k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   266k|                NULL,\
  172|   266k|                sizeof(stname),\
  173|   266k|                #tname \
  174|   266k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   266k|                }; \
  |  |  103|   266k|        return &local_it; \
  |  |  104|   266k|        }
  ------------------
RSAPrivateKey_it:
  247|  34.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  34.8k|        { \
  |  |   96|  34.8k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  34.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  34.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  34.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  34.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  34.8k|                tname##_seq_tt,\
  251|  34.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  34.8k|                &tname##_aux,\
  253|  34.8k|                sizeof(stname),\
  254|  34.8k|                #tname \
  255|  34.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  34.8k|                }; \
  |  |  103|  34.8k|        return &local_it; \
  |  |  104|  34.8k|        }
  ------------------
RSAPublicKey_it:
  247|  23.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  23.1k|        { \
  |  |   96|  23.1k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  23.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  23.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  23.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  23.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  23.1k|                tname##_seq_tt,\
  251|  23.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  23.1k|                &tname##_aux,\
  253|  23.1k|                sizeof(stname),\
  254|  23.1k|                #tname \
  255|  23.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  23.1k|                }; \
  |  |  103|  23.1k|        return &local_it; \
  |  |  104|  23.1k|        }
  ------------------
RSA_PSS_PARAMS_it:
  247|  53.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  53.9k|        { \
  |  |   96|  53.9k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  53.9k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  53.9k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  53.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  53.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  53.9k|                tname##_seq_tt,\
  251|  53.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  53.9k|                &tname##_aux,\
  253|  53.9k|                sizeof(stname),\
  254|  53.9k|                #tname \
  255|  53.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  53.9k|                }; \
  |  |  103|  53.9k|        return &local_it; \
  |  |  104|  53.9k|        }
  ------------------
RSA_PSS_PARAMS_free:
  816|  42.4k|        { \
  817|  42.4k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  42.4k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  42.4k|        }
RSA_OAEP_PARAMS_it:
  247|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  11.5k|                tname##_seq_tt,\
  251|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  11.5k|                &tname##_aux,\
  253|  11.5k|                sizeof(stname),\
  254|  11.5k|                #tname \
  255|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
d2i_RSAPrivateKey:
  826|  22.8k|        { \
  827|  22.8k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  22.8k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  22.8k|        } \
i2d_RSAPrivateKey:
  830|    409|        { \
  831|    409|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|    409|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    409|        }
d2i_RSAPublicKey:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_RSAPublicKey:
  830|     48|        { \
  831|     48|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     48|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     48|        }
d2i_TS_MSG_IMPRINT:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_TS_MSG_IMPRINT:
  830|      5|        { \
  831|      5|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|      5|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|      5|        }
TS_MSG_IMPRINT_free:
  816|      5|        { \
  817|      5|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|      5|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|      5|        }
d2i_TS_REQ:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_TS_REQ:
  830|    906|        { \
  831|    906|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|    906|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    906|        }
TS_REQ_free:
  816|    906|        { \
  817|    906|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|    906|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|    906|        }
d2i_TS_ACCURACY:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_TS_ACCURACY:
  830|    339|        { \
  831|    339|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|    339|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    339|        }
TS_ACCURACY_free:
  816|    339|        { \
  817|    339|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|    339|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|    339|        }
d2i_TS_TST_INFO:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_TS_TST_INFO:
  830|      9|        { \
  831|      9|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|      9|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|      9|        }
TS_TST_INFO_free:
  816|  8.88k|        { \
  817|  8.88k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  8.88k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  8.88k|        }
d2i_TS_STATUS_INFO:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_TS_STATUS_INFO:
  830|    511|        { \
  831|    511|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|    511|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    511|        }
TS_STATUS_INFO_free:
  816|    511|        { \
  817|    511|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|    511|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|    511|        }
d2i_TS_RESP:
  826|  11.5k|        { \
  827|  11.5k|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|  11.5k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|  11.5k|        } \
i2d_TS_RESP:
  830|     99|        { \
  831|     99|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|     99|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|     99|        }
TS_RESP_free:
  816|     99|        { \
  817|     99|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|     99|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|     99|        }
ts_asn1.c:TS_MSG_IMPRINT_it:
  178|  53.4k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  53.4k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  53.4k|        { \
  |  |  |  |   96|  53.4k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  53.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  53.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  53.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  53.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  53.4k|                tname##_seq_tt,\
  182|  53.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  53.4k|                NULL,\
  184|  53.4k|                sizeof(stname),\
  185|  53.4k|                #stname \
  186|  53.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  53.4k|                }; \
  |  |  103|  53.4k|        return &local_it; \
  |  |  104|  53.4k|        }
  ------------------
ts_asn1.c:TS_REQ_it:
  178|  13.3k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  13.3k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  13.3k|        { \
  |  |  |  |   96|  13.3k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  13.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  13.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  13.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  13.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  13.3k|                tname##_seq_tt,\
  182|  13.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  13.3k|                NULL,\
  184|  13.3k|                sizeof(stname),\
  185|  13.3k|                #stname \
  186|  13.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.3k|                }; \
  |  |  103|  13.3k|        return &local_it; \
  |  |  104|  13.3k|        }
  ------------------
ts_asn1.c:TS_ACCURACY_it:
  178|  38.8k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  38.8k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  38.8k|        { \
  |  |  |  |   96|  38.8k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  38.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  38.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  38.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  38.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  38.8k|                tname##_seq_tt,\
  182|  38.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  38.8k|                NULL,\
  184|  38.8k|                sizeof(stname),\
  185|  38.8k|                #stname \
  186|  38.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  38.8k|                }; \
  |  |  103|  38.8k|        return &local_it; \
  |  |  104|  38.8k|        }
  ------------------
ts_asn1.c:TS_TST_INFO_it:
  178|  20.4k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  20.4k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  20.4k|        { \
  |  |  |  |   96|  20.4k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  20.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  20.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  20.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  20.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  20.4k|                tname##_seq_tt,\
  182|  20.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  20.4k|                NULL,\
  184|  20.4k|                sizeof(stname),\
  185|  20.4k|                #stname \
  186|  20.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  20.4k|                }; \
  |  |  103|  20.4k|        return &local_it; \
  |  |  104|  20.4k|        }
  ------------------
ts_asn1.c:TS_STATUS_INFO_it:
  178|  39.4k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  39.4k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  39.4k|        { \
  |  |  |  |   96|  39.4k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  39.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  39.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  39.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  39.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  39.4k|                tname##_seq_tt,\
  182|  39.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  39.4k|                NULL,\
  184|  39.4k|                sizeof(stname),\
  185|  39.4k|                #stname \
  186|  39.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  39.4k|                }; \
  |  |  103|  39.4k|        return &local_it; \
  |  |  104|  39.4k|        }
  ------------------
ts_asn1.c:TS_RESP_it:
  258|  11.7k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  11.7k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  11.7k|        { \
  |  |  |  |   96|  11.7k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  259|  11.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  260|  11.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  261|  11.7k|                tname##_seq_tt,\
  262|  11.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  263|  11.7k|                &tname##_aux,\
  264|  11.7k|                sizeof(stname),\
  265|  11.7k|                #stname \
  266|  11.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.7k|                }; \
  |  |  103|  11.7k|        return &local_it; \
  |  |  104|  11.7k|        }
  ------------------
OSSL_TARGET_it:
  320|  8.96k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  8.96k|        { \
  |  |   96|  8.96k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  8.96k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  8.96k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  8.96k|                offsetof(stname,selname) ,\
  323|  8.96k|                tname##_ch_tt,\
  324|  8.96k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  8.96k|                NULL,\
  326|  8.96k|                sizeof(stname),\
  327|  8.96k|                #stname \
  328|  8.96k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  8.96k|                }; \
  |  |  103|  8.96k|        return &local_it; \
  |  |  104|  8.96k|        }
  ------------------
OSSL_TARGETS_it:
  113|  47.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  47.0k|        { \
  |  |   96|  47.0k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  47.0k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  47.0k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  47.0k|                -1,\
  116|  47.0k|                &tname##_item_tt,\
  117|  47.0k|                0,\
  118|  47.0k|                NULL,\
  119|  47.0k|                0,\
  120|  47.0k|                #tname \
  121|  47.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  47.0k|                }; \
  |  |  103|  47.0k|        return &local_it; \
  |  |  104|  47.0k|        }
  ------------------
OSSL_TARGETING_INFORMATION_it:
  113|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  11.5k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  11.5k|                -1,\
  116|  11.5k|                &tname##_item_tt,\
  117|  11.5k|                0,\
  118|  11.5k|                NULL,\
  119|  11.5k|                0,\
  120|  11.5k|                #tname \
  121|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
v3_ac_tgt.c:OSSL_TARGET_CERT_it:
  178|  1.73k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  1.73k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  1.73k|        { \
  |  |  |  |   96|  1.73k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  1.73k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  1.73k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  1.73k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  1.73k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  1.73k|                tname##_seq_tt,\
  182|  1.73k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  1.73k|                NULL,\
  184|  1.73k|                sizeof(stname),\
  185|  1.73k|                #stname \
  186|  1.73k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  1.73k|                }; \
  |  |  103|  1.73k|        return &local_it; \
  |  |  104|  1.73k|        }
  ------------------
v3_ac_tgt.c:OSSL_ISSUER_SERIAL_it:
  178|     14|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     14|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     14|        { \
  |  |  |  |   96|     14|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|     14|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     14|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|     14|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     14|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|     14|                tname##_seq_tt,\
  182|     14|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|     14|                NULL,\
  184|     14|                sizeof(stname),\
  185|     14|                #stname \
  186|     14|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     14|                }; \
  |  |  103|     14|        return &local_it; \
  |  |  104|     14|        }
  ------------------
v3_ac_tgt.c:OSSL_OBJECT_DIGEST_INFO_it:
  178|     15|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|     15|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|     15|        { \
  |  |  |  |   96|     15|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|     15|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     15|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|     15|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     15|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|     15|                tname##_seq_tt,\
  182|     15|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|     15|                NULL,\
  184|     15|                sizeof(stname),\
  185|     15|                #stname \
  186|     15|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     15|                }; \
  |  |  103|     15|        return &local_it; \
  |  |  104|     15|        }
  ------------------
IPAddressRange_it:
  166|  42.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  42.7k|        { \
  |  |   96|  42.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  42.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  42.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  42.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  42.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  42.7k|                tname##_seq_tt,\
  170|  42.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  42.7k|                NULL,\
  172|  42.7k|                sizeof(stname),\
  173|  42.7k|                #tname \
  174|  42.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  42.7k|                }; \
  |  |  103|  42.7k|        return &local_it; \
  |  |  104|  42.7k|        }
  ------------------
IPAddressOrRange_it:
  320|  31.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  31.9k|        { \
  |  |   96|  31.9k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  31.9k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  31.9k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  31.9k|                offsetof(stname,selname) ,\
  323|  31.9k|                tname##_ch_tt,\
  324|  31.9k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  31.9k|                NULL,\
  326|  31.9k|                sizeof(stname),\
  327|  31.9k|                #stname \
  328|  31.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  31.9k|                }; \
  |  |  103|  31.9k|        return &local_it; \
  |  |  104|  31.9k|        }
  ------------------
IPAddressChoice_it:
  320|  29.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  29.3k|        { \
  |  |   96|  29.3k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  29.3k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  29.3k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  29.3k|                offsetof(stname,selname) ,\
  323|  29.3k|                tname##_ch_tt,\
  324|  29.3k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  29.3k|                NULL,\
  326|  29.3k|                sizeof(stname),\
  327|  29.3k|                #stname \
  328|  29.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  29.3k|                }; \
  |  |  103|  29.3k|        return &local_it; \
  |  |  104|  29.3k|        }
  ------------------
IPAddressFamily_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
AUTHORITY_KEYID_it:
  166|  71.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  71.1k|        { \
  |  |   96|  71.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  71.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  71.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  71.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  71.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  71.1k|                tname##_seq_tt,\
  170|  71.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  71.1k|                NULL,\
  172|  71.1k|                sizeof(stname),\
  173|  71.1k|                #tname \
  174|  71.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  71.1k|                }; \
  |  |  103|  71.1k|        return &local_it; \
  |  |  104|  71.1k|        }
  ------------------
AUTHORITY_KEYID_free:
  816|  54.3k|        { \
  817|  54.3k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  54.3k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  54.3k|        }
ASRange_it:
  166|  43.2k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  43.2k|        { \
  |  |   96|  43.2k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  43.2k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  43.2k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  43.2k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  43.2k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  43.2k|                tname##_seq_tt,\
  170|  43.2k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  43.2k|                NULL,\
  172|  43.2k|                sizeof(stname),\
  173|  43.2k|                #tname \
  174|  43.2k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  43.2k|                }; \
  |  |  103|  43.2k|        return &local_it; \
  |  |  104|  43.2k|        }
  ------------------
ASIdOrRange_it:
  320|  54.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  54.3k|        { \
  |  |   96|  54.3k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  54.3k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  54.3k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  54.3k|                offsetof(stname,selname) ,\
  323|  54.3k|                tname##_ch_tt,\
  324|  54.3k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  54.3k|                NULL,\
  326|  54.3k|                sizeof(stname),\
  327|  54.3k|                #stname \
  328|  54.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  54.3k|                }; \
  |  |  103|  54.3k|        return &local_it; \
  |  |  104|  54.3k|        }
  ------------------
ASIdentifierChoice_it:
  320|  73.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  73.8k|        { \
  |  |   96|  73.8k|                static const ASN1_ITEM local_it = {
  ------------------
  321|  73.8k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|  73.8k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|  73.8k|                offsetof(stname,selname) ,\
  323|  73.8k|                tname##_ch_tt,\
  324|  73.8k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|  73.8k|                NULL,\
  326|  73.8k|                sizeof(stname),\
  327|  73.8k|                #stname \
  328|  73.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  73.8k|                }; \
  |  |  103|  73.8k|        return &local_it; \
  |  |  104|  73.8k|        }
  ------------------
ASIdentifiers_it:
  166|  36.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  36.4k|        { \
  |  |   96|  36.4k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  36.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  36.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  36.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  36.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  36.4k|                tname##_seq_tt,\
  170|  36.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  36.4k|                NULL,\
  172|  36.4k|                sizeof(stname),\
  173|  36.4k|                #tname \
  174|  36.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  36.4k|                }; \
  |  |  103|  36.4k|        return &local_it; \
  |  |  104|  36.4k|        }
  ------------------
ASIdentifiers_free:
  816|  24.9k|        { \
  817|  24.9k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  24.9k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  24.9k|        }
BASIC_CONSTRAINTS_it:
  166|  12.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.0k|        { \
  |  |   96|  12.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.0k|                tname##_seq_tt,\
  170|  12.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.0k|                NULL,\
  172|  12.0k|                sizeof(stname),\
  173|  12.0k|                #tname \
  174|  12.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.0k|                }; \
  |  |  103|  12.0k|        return &local_it; \
  |  |  104|  12.0k|        }
  ------------------
CERTIFICATEPOLICIES_it:
  113|  12.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.0k|        { \
  |  |   96|  12.0k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  12.0k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  12.0k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  12.0k|                -1,\
  116|  12.0k|                &tname##_item_tt,\
  117|  12.0k|                0,\
  118|  12.0k|                NULL,\
  119|  12.0k|                0,\
  120|  12.0k|                #tname \
  121|  12.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.0k|                }; \
  |  |  103|  12.0k|        return &local_it; \
  |  |  104|  12.0k|        }
  ------------------
POLICYINFO_it:
  166|  70.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  70.6k|        { \
  |  |   96|  70.6k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  70.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  70.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  70.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  70.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  70.6k|                tname##_seq_tt,\
  170|  70.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  70.6k|                NULL,\
  172|  70.6k|                sizeof(stname),\
  173|  70.6k|                #tname \
  174|  70.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  70.6k|                }; \
  |  |  103|  70.6k|        return &local_it; \
  |  |  104|  70.6k|        }
  ------------------
POLICYQUALINFO_it:
  166|  33.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  33.6k|        { \
  |  |   96|  33.6k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  33.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  33.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  33.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  33.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  33.6k|                tname##_seq_tt,\
  170|  33.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  33.6k|                NULL,\
  172|  33.6k|                sizeof(stname),\
  173|  33.6k|                #tname \
  174|  33.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  33.6k|                }; \
  |  |  103|  33.6k|        return &local_it; \
  |  |  104|  33.6k|        }
  ------------------
USERNOTICE_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
NOTICEREF_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|        }
  ------------------
v3_cpols.c:POLICYQUALINFO_adb:
  463|  31.9k|        { \
  464|  31.9k|        static const ASN1_ADB internal_adb = \
  465|  31.9k|                {\
  466|  31.9k|                flags,\
  467|  31.9k|                offsetof(name, field),\
  468|  31.9k|                adb_cb,\
  469|  31.9k|                name##_adbtbl,\
  470|  31.9k|                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
  471|  31.9k|                def,\
  472|  31.9k|                none\
  473|  31.9k|                }; \
  474|  31.9k|                return (const ASN1_ITEM *) &internal_adb; \
  475|  31.9k|        } \
DIST_POINT_NAME_it:
  344|   210k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   210k|        { \
  |  |   96|   210k|                static const ASN1_ITEM local_it = {
  ------------------
  345|   210k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|   210k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  346|   210k|                offsetof(stname,selname) ,\
  347|   210k|                tname##_ch_tt,\
  348|   210k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  349|   210k|                &tname##_aux,\
  350|   210k|                sizeof(stname),\
  351|   210k|                #stname \
  352|   210k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   210k|                }; \
  |  |  103|   210k|        return &local_it; \
  |  |  104|   210k|        }
  ------------------
DIST_POINT_it:
  166|  62.7k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  62.7k|        { \
  |  |   96|  62.7k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  62.7k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  62.7k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  62.7k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  62.7k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  62.7k|                tname##_seq_tt,\
  170|  62.7k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  62.7k|                NULL,\
  172|  62.7k|                sizeof(stname),\
  173|  62.7k|                #tname \
  174|  62.7k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  62.7k|                }; \
  |  |  103|  62.7k|        return &local_it; \
  |  |  104|  62.7k|        }
  ------------------
CRL_DIST_POINTS_it:
  113|  39.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  39.3k|        { \
  |  |   96|  39.3k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  39.3k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  39.3k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  39.3k|                -1,\
  116|  39.3k|                &tname##_item_tt,\
  117|  39.3k|                0,\
  118|  39.3k|                NULL,\
  119|  39.3k|                0,\
  120|  39.3k|                #tname \
  121|  39.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  39.3k|                }; \
  |  |  103|  39.3k|        return &local_it; \
  |  |  104|  39.3k|        }
  ------------------
CRL_DIST_POINTS_free:
  816|  24.9k|        { \
  817|  24.9k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  24.9k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  24.9k|        }
ISSUING_DIST_POINT_it:
  166|  63.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  63.3k|        { \
  |  |   96|  63.3k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  63.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  63.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  63.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  63.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  63.3k|                tname##_seq_tt,\
  170|  63.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  63.3k|                NULL,\
  172|  63.3k|                sizeof(stname),\
  173|  63.3k|                #tname \
  174|  63.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  63.3k|                }; \
  |  |  103|  63.3k|        return &local_it; \
  |  |  104|  63.3k|        }
  ------------------
ISSUING_DIST_POINT_free:
  816|  29.4k|        { \
  817|  29.4k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  29.4k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  29.4k|        }
EXTENDED_KEY_USAGE_it:
  113|  13.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  13.1k|        { \
  |  |   96|  13.1k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  13.1k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  13.1k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  13.1k|                -1,\
  116|  13.1k|                &tname##_item_tt,\
  117|  13.1k|                0,\
  118|  13.1k|                NULL,\
  119|  13.1k|                0,\
  120|  13.1k|                #tname \
  121|  13.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  13.1k|                }; \
  |  |  103|  13.1k|        return &local_it; \
  |  |  104|  13.1k|        }
  ------------------
OTHERNAME_it:
  166|  72.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  72.3k|        { \
  |  |   96|  72.3k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  72.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  72.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  72.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  72.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  72.3k|                tname##_seq_tt,\
  170|  72.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  72.3k|                NULL,\
  172|  72.3k|                sizeof(stname),\
  173|  72.3k|                #tname \
  174|  72.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  72.3k|                }; \
  |  |  103|  72.3k|        return &local_it; \
  |  |  104|  72.3k|        }
  ------------------
EDIPARTYNAME_it:
  166|  55.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  55.8k|        { \
  |  |   96|  55.8k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  55.8k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  55.8k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  55.8k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  55.8k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  55.8k|                tname##_seq_tt,\
  170|  55.8k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  55.8k|                NULL,\
  172|  55.8k|                sizeof(stname),\
  173|  55.8k|                #tname \
  174|  55.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  55.8k|                }; \
  |  |  103|  55.8k|        return &local_it; \
  |  |  104|  55.8k|        }
  ------------------
GENERAL_NAME_it:
  320|   295k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   295k|        { \
  |  |   96|   295k|                static const ASN1_ITEM local_it = {
  ------------------
  321|   295k|                ASN1_ITYPE_CHOICE,\
  ------------------
  |  |   82|   295k|# define ASN1_ITYPE_CHOICE               0x2
  ------------------
  322|   295k|                offsetof(stname,selname) ,\
  323|   295k|                tname##_ch_tt,\
  324|   295k|                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
  325|   295k|                NULL,\
  326|   295k|                sizeof(stname),\
  327|   295k|                #stname \
  328|   295k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   295k|                }; \
  |  |  103|   295k|        return &local_it; \
  |  |  104|   295k|        }
  ------------------
GENERAL_NAMES_it:
  113|  51.8k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  51.8k|        { \
  |  |   96|  51.8k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  51.8k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  51.8k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  51.8k|                -1,\
  116|  51.8k|                &tname##_item_tt,\
  117|  51.8k|                0,\
  118|  51.8k|                NULL,\
  119|  51.8k|                0,\
  120|  51.8k|                #tname \
  121|  51.8k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  51.8k|                }; \
  |  |  103|  51.8k|        return &local_it; \
  |  |  104|  51.8k|        }
  ------------------
GENERAL_NAMES_free:
  816|  25.9k|        { \
  817|  25.9k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  25.9k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  25.9k|        }
ACCESS_DESCRIPTION_it:
  166|  38.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  38.5k|        { \
  |  |   96|  38.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  38.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  38.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  38.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  38.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  38.5k|                tname##_seq_tt,\
  170|  38.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  38.5k|                NULL,\
  172|  38.5k|                sizeof(stname),\
  173|  38.5k|                #tname \
  174|  38.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  38.5k|                }; \
  |  |  103|  38.5k|        return &local_it; \
  |  |  104|  38.5k|        }
  ------------------
AUTHORITY_INFO_ACCESS_it:
  113|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  11.5k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  11.5k|                -1,\
  116|  11.5k|                &tname##_item_tt,\
  117|  11.5k|                0,\
  118|  11.5k|                NULL,\
  119|  11.5k|                0,\
  120|  11.5k|                #tname \
  121|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
GENERAL_SUBTREE_it:
  166|  41.3k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  41.3k|        { \
  |  |   96|  41.3k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  41.3k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  41.3k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  41.3k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  41.3k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  41.3k|                tname##_seq_tt,\
  170|  41.3k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  41.3k|                NULL,\
  172|  41.3k|                sizeof(stname),\
  173|  41.3k|                #tname \
  174|  41.3k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  41.3k|                }; \
  |  |  103|  41.3k|        return &local_it; \
  |  |  104|  41.3k|        }
  ------------------
NAME_CONSTRAINTS_it:
  166|  39.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  39.1k|        { \
  |  |   96|  39.1k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  39.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  39.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  39.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  39.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  39.1k|                tname##_seq_tt,\
  170|  39.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  39.1k|                NULL,\
  172|  39.1k|                sizeof(stname),\
  173|  39.1k|                #tname \
  174|  39.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  39.1k|                }; \
  |  |  103|  39.1k|        return &local_it; \
  |  |  104|  39.1k|        }
  ------------------
NAME_CONSTRAINTS_free:
  816|  24.9k|        { \
  817|  24.9k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  24.9k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  24.9k|        }
PROXY_POLICY_it:
  166|  36.9k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  36.9k|        { \
  |  |   96|  36.9k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  36.9k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  36.9k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  36.9k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  36.9k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  36.9k|                tname##_seq_tt,\
  170|  36.9k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  36.9k|                NULL,\
  172|  36.9k|                sizeof(stname),\
  173|  36.9k|                #tname \
  174|  36.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  36.9k|                }; \
  |  |  103|  36.9k|        return &local_it; \
  |  |  104|  36.9k|        }
  ------------------
PROXY_CERT_INFO_EXTENSION_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
POLICY_CONSTRAINTS_it:
  166|  12.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.6k|        { \
  |  |   96|  12.6k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.6k|                tname##_seq_tt,\
  170|  12.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.6k|                NULL,\
  172|  12.6k|                sizeof(stname),\
  173|  12.6k|                #tname \
  174|  12.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.6k|                }; \
  |  |  103|  12.6k|        return &local_it; \
  |  |  104|  12.6k|        }
  ------------------
PKEY_USAGE_PERIOD_it:
  166|  12.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.0k|        { \
  |  |   96|  12.0k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  12.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  12.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  12.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  12.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  12.0k|                tname##_seq_tt,\
  170|  12.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  12.0k|                NULL,\
  172|  12.0k|                sizeof(stname),\
  173|  12.0k|                #tname \
  174|  12.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.0k|                }; \
  |  |  103|  12.0k|        return &local_it; \
  |  |  104|  12.0k|        }
  ------------------
POLICY_MAPPING_it:
  166|  30.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  30.4k|        { \
  |  |   96|  30.4k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  30.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  30.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  30.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  30.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  30.4k|                tname##_seq_tt,\
  170|  30.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  30.4k|                NULL,\
  172|  30.4k|                sizeof(stname),\
  173|  30.4k|                #tname \
  174|  30.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  30.4k|                }; \
  |  |  103|  30.4k|        return &local_it; \
  |  |  104|  30.4k|        }
  ------------------
POLICY_MAPPINGS_it:
  113|  12.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  12.0k|        { \
  |  |   96|  12.0k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  12.0k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  12.0k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  12.0k|                -1,\
  116|  12.0k|                &tname##_item_tt,\
  117|  12.0k|                0,\
  118|  12.0k|                NULL,\
  119|  12.0k|                0,\
  120|  12.0k|                #tname \
  121|  12.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  12.0k|                }; \
  |  |  103|  12.0k|        return &local_it; \
  |  |  104|  12.0k|        }
  ------------------
OSSL_ATTRIBUTES_SYNTAX_it:
  113|     24|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     24|        { \
  |  |   96|     24|                static const ASN1_ITEM local_it = {
  ------------------
  114|     24|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     24|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     24|                -1,\
  116|     24|                &tname##_item_tt,\
  117|     24|                0,\
  118|     24|                NULL,\
  119|     24|                0,\
  120|     24|                #tname \
  121|     24|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     24|                }; \
  |  |  103|     24|        return &local_it; \
  |  |  104|     24|        }
  ------------------
SXNETID_it:
  166|  24.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  24.5k|        { \
  |  |   96|  24.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  24.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  24.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  24.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  24.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  24.5k|                tname##_seq_tt,\
  170|  24.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  24.5k|                NULL,\
  172|  24.5k|                sizeof(stname),\
  173|  24.5k|                #tname \
  174|  24.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  24.5k|                }; \
  |  |  103|  24.5k|        return &local_it; \
  |  |  104|  24.5k|        }
  ------------------
SXNET_it:
  166|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  11.5k|                tname##_seq_tt,\
  170|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  11.5k|                NULL,\
  172|  11.5k|                sizeof(stname),\
  173|  11.5k|                #tname \
  174|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
OSSL_USER_NOTICE_SYNTAX_it:
  113|     10|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     10|        { \
  |  |   96|     10|                static const ASN1_ITEM local_it = {
  ------------------
  114|     10|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|     10|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|     10|                -1,\
  116|     10|                &tname##_item_tt,\
  117|     10|                0,\
  118|     10|                NULL,\
  119|     10|                0,\
  120|     10|                #tname \
  121|     10|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     10|                }; \
  |  |  103|     10|        return &local_it; \
  |  |  104|     10|        }
  ------------------
X509_ATTRIBUTE_it:
  166|   161k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   161k|        { \
  |  |   96|   161k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   161k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   161k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   161k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   161k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   161k|                tname##_seq_tt,\
  170|   161k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   161k|                NULL,\
  172|   161k|                sizeof(stname),\
  173|   161k|                #tname \
  174|   161k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   161k|                }; \
  |  |  103|   161k|        return &local_it; \
  |  |  104|   161k|        }
  ------------------
X509_REVOKED_it:
  166|   117k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   117k|        { \
  |  |   96|   117k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   117k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   117k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   117k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   117k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   117k|                tname##_seq_tt,\
  170|   117k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   117k|                NULL,\
  172|   117k|                sizeof(stname),\
  173|   117k|                #tname \
  174|   117k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   117k|                }; \
  |  |  103|   117k|        return &local_it; \
  |  |  104|   117k|        }
  ------------------
X509_CRL_INFO_it:
  247|  73.0k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  73.0k|        { \
  |  |   96|  73.0k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  73.0k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  73.0k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  73.0k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  73.0k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  73.0k|                tname##_seq_tt,\
  251|  73.0k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  73.0k|                &tname##_aux,\
  253|  73.0k|                sizeof(stname),\
  254|  73.0k|                #tname \
  255|  73.0k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  73.0k|                }; \
  |  |  103|  73.0k|        return &local_it; \
  |  |  104|  73.0k|        }
  ------------------
X509_CRL_it:
  247|  47.6k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  47.6k|        { \
  |  |   96|  47.6k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  47.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  47.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  47.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  47.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  47.6k|                tname##_seq_tt,\
  251|  47.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  47.6k|                &tname##_aux,\
  253|  47.6k|                sizeof(stname),\
  254|  47.6k|                #tname \
  255|  47.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  47.6k|                }; \
  |  |  103|  47.6k|        return &local_it; \
  |  |  104|  47.6k|        }
  ------------------
X509_EXTENSION_it:
  166|   585k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   585k|        { \
  |  |   96|   585k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   585k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   585k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   585k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   585k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   585k|                tname##_seq_tt,\
  170|   585k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   585k|                NULL,\
  172|   585k|                sizeof(stname),\
  173|   585k|                #tname \
  174|   585k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   585k|                }; \
  |  |  103|   585k|        return &local_it; \
  |  |  104|   585k|        }
  ------------------
X509_EXTENSIONS_it:
  113|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  114|  11.5k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  11.5k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  115|  11.5k|                -1,\
  116|  11.5k|                &tname##_item_tt,\
  117|  11.5k|                0,\
  118|  11.5k|                NULL,\
  119|  11.5k|                0,\
  120|  11.5k|                #tname \
  121|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
X509_NAME_ENTRY_it:
  166|   992k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   992k|        { \
  |  |   96|   992k|                static const ASN1_ITEM local_it = {
  ------------------
  167|   992k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   992k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|   992k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   992k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|   992k|                tname##_seq_tt,\
  170|   992k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|   992k|                NULL,\
  172|   992k|                sizeof(stname),\
  173|   992k|                #tname \
  174|   992k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   992k|                }; \
  |  |  103|   992k|        return &local_it; \
  |  |  104|   992k|        }
  ------------------
X509_NAME_ENTRY_new:
  812|   124k|        { \
  813|   124k|                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   124k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  814|   124k|        } \
X509_NAME_ENTRY_free:
  816|   258k|        { \
  817|   258k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|   258k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|   258k|        }
X509_NAME_ENTRY_dup:
  855|  1.03k|        { \
  856|  1.03k|        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
  ------------------
  |  |  426|  1.03k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  857|  1.03k|        }
X509_NAME_it:
  775|   354k|        ASN1_ITEM_start(sname) \
  ------------------
  |  |   95|   354k|        { \
  |  |   96|   354k|                static const ASN1_ITEM local_it = {
  ------------------
  776|   354k|                ASN1_ITYPE_EXTERN, \
  ------------------
  |  |   84|   354k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  777|   354k|                tag, \
  778|   354k|                NULL, \
  779|   354k|                0, \
  780|   354k|                &fptrs, \
  781|   354k|                0, \
  782|   354k|                #sname \
  783|   354k|        ASN1_ITEM_end(sname)
  ------------------
  |  |  102|   354k|                }; \
  |  |  103|   354k|        return &local_it; \
  |  |  104|   354k|        }
  ------------------
i2d_X509_NAME:
  830|    110|        { \
  831|    110|                return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|    110|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  832|    110|        }
X509_NAME_free:
  816|  19.9k|        { \
  817|  19.9k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  19.9k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  19.9k|        }
X509_NAME_dup:
  855|    111|        { \
  856|    111|        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
  ------------------
  |  |  426|    111|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  857|    111|        }
x_name.c:X509_NAME_INTERNAL_it:
  124|  63.9k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  63.9k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  63.9k|        { \
  |  |  |  |   96|  63.9k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  125|  63.9k|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  63.9k|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  126|  63.9k|                -1,\
  127|  63.9k|                &tname##_item_tt,\
  128|  63.9k|                0,\
  129|  63.9k|                NULL,\
  130|  63.9k|                0,\
  131|  63.9k|                #tname \
  132|  63.9k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  63.9k|                }; \
  |  |  103|  63.9k|        return &local_it; \
  |  |  104|  63.9k|        }
  ------------------
x_name.c:X509_NAME_ENTRIES_it:
  124|  4.38M|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  4.38M|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  4.38M|        { \
  |  |  |  |   96|  4.38M|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  125|  4.38M|                ASN1_ITYPE_PRIMITIVE,\
  ------------------
  |  |   80|  4.38M|# define ASN1_ITYPE_PRIMITIVE            0x0
  ------------------
  126|  4.38M|                -1,\
  127|  4.38M|                &tname##_item_tt,\
  128|  4.38M|                0,\
  129|  4.38M|                NULL,\
  130|  4.38M|                0,\
  131|  4.38M|                #tname \
  132|  4.38M|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  4.38M|                }; \
  |  |  103|  4.38M|        return &local_it; \
  |  |  104|  4.38M|        }
  ------------------
X509_PUBKEY_it:
  775|   141k|        ASN1_ITEM_start(sname) \
  ------------------
  |  |   95|   141k|        { \
  |  |   96|   141k|                static const ASN1_ITEM local_it = {
  ------------------
  776|   141k|                ASN1_ITYPE_EXTERN, \
  ------------------
  |  |   84|   141k|# define ASN1_ITYPE_EXTERN               0x4
  ------------------
  777|   141k|                tag, \
  778|   141k|                NULL, \
  779|   141k|                0, \
  780|   141k|                &fptrs, \
  781|   141k|                0, \
  782|   141k|                #sname \
  783|   141k|        ASN1_ITEM_end(sname)
  ------------------
  |  |  102|   141k|                }; \
  |  |  103|   141k|        return &local_it; \
  |  |  104|   141k|        }
  ------------------
d2i_X509_PUBKEY:
  826|    660|        { \
  827|    660|                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
  ------------------
  |  |  426|    660|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  828|    660|        } \
X509_PUBKEY_free:
  816|  1.31k|        { \
  817|  1.31k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  1.31k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  1.31k|        }
x_pubkey.c:X509_PUBKEY_INTERNAL_it:
  178|  49.6k|        static_ASN1_ITEM_start(tname) \
  ------------------
  |  |   99|  49.6k|        static ASN1_ITEM_start(itname)
  |  |  ------------------
  |  |  |  |   95|  49.6k|        { \
  |  |  |  |   96|  49.6k|                static const ASN1_ITEM local_it = {
  |  |  ------------------
  ------------------
  179|  49.6k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  49.6k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  180|  49.6k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  49.6k|# define V_ASN1_SEQUENCE                 16
  ------------------
  181|  49.6k|                tname##_seq_tt,\
  182|  49.6k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  183|  49.6k|                NULL,\
  184|  49.6k|                sizeof(stname),\
  185|  49.6k|                #stname \
  186|  49.6k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  49.6k|                }; \
  |  |  103|  49.6k|        return &local_it; \
  |  |  104|  49.6k|        }
  ------------------
X509_REQ_INFO_it:
  247|  38.1k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  38.1k|        { \
  |  |   96|  38.1k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  38.1k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  38.1k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  38.1k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  38.1k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  38.1k|                tname##_seq_tt,\
  251|  38.1k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  38.1k|                &tname##_aux,\
  253|  38.1k|                sizeof(stname),\
  254|  38.1k|                #tname \
  255|  38.1k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  38.1k|                }; \
  |  |  103|  38.1k|        return &local_it; \
  |  |  104|  38.1k|        }
  ------------------
X509_REQ_it:
  247|  11.5k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  11.5k|        { \
  |  |   96|  11.5k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  11.5k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  11.5k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  11.5k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  11.5k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  11.5k|                tname##_seq_tt,\
  251|  11.5k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  11.5k|                &tname##_aux,\
  253|  11.5k|                sizeof(stname),\
  254|  11.5k|                #tname \
  255|  11.5k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  11.5k|                }; \
  |  |  103|  11.5k|        return &local_it; \
  |  |  104|  11.5k|        }
  ------------------
X509_CINF_it:
  247|  52.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  52.4k|        { \
  |  |   96|  52.4k|                static const ASN1_ITEM local_it = {
  ------------------
  248|  52.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  52.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|  52.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  52.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|  52.4k|                tname##_seq_tt,\
  251|  52.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|  52.4k|                &tname##_aux,\
  253|  52.4k|                sizeof(stname),\
  254|  52.4k|                #tname \
  255|  52.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  52.4k|                }; \
  |  |  103|  52.4k|        return &local_it; \
  |  |  104|  52.4k|        }
  ------------------
X509_it:
  247|   943k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|   943k|        { \
  |  |   96|   943k|                static const ASN1_ITEM local_it = {
  ------------------
  248|   943k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|   943k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  249|   943k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|   943k|# define V_ASN1_SEQUENCE                 16
  ------------------
  250|   943k|                tname##_seq_tt,\
  251|   943k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  252|   943k|                &tname##_aux,\
  253|   943k|                sizeof(stname),\
  254|   943k|                #tname \
  255|   943k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|   943k|                }; \
  |  |  103|   943k|        return &local_it; \
  |  |  104|   943k|        }
  ------------------
X509_free:
  816|  12.9k|        { \
  817|  12.9k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  12.9k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  12.9k|        }
X509_CERT_AUX_it:
  166|  36.4k|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|  36.4k|        { \
  |  |   96|  36.4k|                static const ASN1_ITEM local_it = {
  ------------------
  167|  36.4k|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|  36.4k|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|  36.4k|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|  36.4k|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|  36.4k|                tname##_seq_tt,\
  170|  36.4k|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|  36.4k|                NULL,\
  172|  36.4k|                sizeof(stname),\
  173|  36.4k|                #tname \
  174|  36.4k|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|  36.4k|                }; \
  |  |  103|  36.4k|        return &local_it; \
  |  |  104|  36.4k|        }
  ------------------
X509_CERT_AUX_free:
  816|  24.9k|        { \
  817|  24.9k|                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  426|  24.9k|# define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  818|  24.9k|        }
NAMING_AUTHORITY_it:
  166|     23|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     23|        { \
  |  |   96|     23|                static const ASN1_ITEM local_it = {
  ------------------
  167|     23|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     23|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     23|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     23|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     23|                tname##_seq_tt,\
  170|     23|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     23|                NULL,\
  172|     23|                sizeof(stname),\
  173|     23|                #tname \
  174|     23|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     23|                }; \
  |  |  103|     23|        return &local_it; \
  |  |  104|     23|        }
  ------------------
PROFESSION_INFO_it:
  166|      7|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      7|        { \
  |  |   96|      7|                static const ASN1_ITEM local_it = {
  ------------------
  167|      7|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      7|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      7|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      7|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      7|                tname##_seq_tt,\
  170|      7|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      7|                NULL,\
  172|      7|                sizeof(stname),\
  173|      7|                #tname \
  174|      7|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      7|                }; \
  |  |  103|      7|        return &local_it; \
  |  |  104|      7|        }
  ------------------
ADMISSIONS_it:
  166|     41|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     41|        { \
  |  |   96|     41|                static const ASN1_ITEM local_it = {
  ------------------
  167|     41|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     41|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     41|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     41|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     41|                tname##_seq_tt,\
  170|     41|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     41|                NULL,\
  172|     41|                sizeof(stname),\
  173|     41|                #tname \
  174|     41|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     41|                }; \
  |  |  103|     41|        return &local_it; \
  |  |  104|     41|        }
  ------------------
ADMISSION_SYNTAX_it:
  166|     34|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|     34|        { \
  |  |   96|     34|                static const ASN1_ITEM local_it = {
  ------------------
  167|     34|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|     34|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|     34|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|     34|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|     34|                tname##_seq_tt,\
  170|     34|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|     34|                NULL,\
  172|     34|                sizeof(stname),\
  173|     34|                #tname \
  174|     34|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|     34|                }; \
  |  |  103|     34|        return &local_it; \
  |  |  104|     34|        }
  ------------------
OSSL_BASIC_ATTR_CONSTRAINTS_it:
  166|      3|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      3|        { \
  |  |   96|      3|                static const ASN1_ITEM local_it = {
  ------------------
  167|      3|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      3|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      3|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      3|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      3|                tname##_seq_tt,\
  170|      3|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      3|                NULL,\
  172|      3|                sizeof(stname),\
  173|      3|                #tname \
  174|      3|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      3|                }; \
  |  |  103|      3|        return &local_it; \
  |  |  104|      3|        }
  ------------------
ISSUER_SIGN_TOOL_it:
  166|      1|        ASN1_ITEM_start(tname) \
  ------------------
  |  |   95|      1|        { \
  |  |   96|      1|                static const ASN1_ITEM local_it = {
  ------------------
  167|      1|                ASN1_ITYPE_SEQUENCE,\
  ------------------
  |  |   81|      1|# define ASN1_ITYPE_SEQUENCE             0x1
  ------------------
  168|      1|                V_ASN1_SEQUENCE,\
  ------------------
  |  |   74|      1|# define V_ASN1_SEQUENCE                 16
  ------------------
  169|      1|                tname##_seq_tt,\
  170|      1|                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
  171|      1|                NULL,\
  172|      1|                sizeof(stname),\
  173|      1|                #tname \
  174|      1|        ASN1_ITEM_end(tname)
  ------------------
  |  |  102|      1|                }; \
  |  |  103|      1|        return &local_it; \
  |  |  104|      1|        }
  ------------------

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|    }
encoder_meth.c:OSSL_FUNC_encoder_newctx:
   52|    115|    {                                                                   \
   53|    115|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|    115|    }
encoder_meth.c:OSSL_FUNC_encoder_freectx:
   52|    115|    {                                                                   \
   53|    115|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|    115|    }
encoder_meth.c:OSSL_FUNC_encoder_set_ctx_params:
   52|    100|    {                                                                   \
   53|    100|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|    100|    }
encoder_meth.c:OSSL_FUNC_encoder_settable_ctx_params:
   52|    100|    {                                                                   \
   53|    100|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|    100|    }
encoder_meth.c:OSSL_FUNC_encoder_does_selection:
   52|    104|    {                                                                   \
   53|    104|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|    104|    }
encoder_meth.c:OSSL_FUNC_encoder_encode:
   52|    115|    {                                                                   \
   53|    115|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|    115|    }
encoder_meth.c:OSSL_FUNC_encoder_import_object:
   52|    115|    {                                                                   \
   53|    115|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|    115|    }
encoder_meth.c:OSSL_FUNC_encoder_free_object:
   52|    115|    {                                                                   \
   53|    115|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|    115|    }
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|      3|    {                                                                   \
   53|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|      3|    }
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|      3|    {                                                                   \
   53|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|      3|    }
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|    }
evp_rand.c:OSSL_FUNC_rand_newctx:
   52|      6|    {                                                                   \
   53|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|      6|    }
evp_rand.c:OSSL_FUNC_rand_freectx:
   52|      6|    {                                                                   \
   53|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|      6|    }
evp_rand.c:OSSL_FUNC_rand_instantiate:
   52|      6|    {                                                                   \
   53|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|      6|    }
evp_rand.c:OSSL_FUNC_rand_uninstantiate:
   52|      6|    {                                                                   \
   53|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|      6|    }
evp_rand.c:OSSL_FUNC_rand_generate:
   52|      6|    {                                                                   \
   53|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|      6|    }
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|      6|    {                                                                   \
   53|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|      6|    }
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|      6|    {                                                                   \
   53|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|      6|    }
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|      6|    {                                                                   \
   53|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   54|      6|    }
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|    }

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

decoder_pkey.c:lh_DECODER_CACHE_ENTRY_new:
  317|      4|    { \
  318|      4|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      4|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      4|                                lh_##type##_doall_thunk, \
  321|      4|                                lh_##type##_doall_arg_thunk); \
  322|      4|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_hfn_thunk:
  243|  15.8k|    { \
  244|  15.8k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  15.8k|        return hfn_conv((const type *)data); \
  246|  15.8k|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_cfn_thunk:
  248|  15.6k|    { \
  249|  15.6k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  15.6k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  15.6k|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall_thunk:
  299|     79|    { \
  300|     79|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     79|        doall_conv((type *)node); \
  302|     79|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall:
  311|      4|    { \
  312|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      4|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_flush:
  259|      2|    { \
  260|      2|        OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \
  261|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_retrieve:
  274|  15.8k|    { \
  275|  15.8k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  15.8k|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_insert:
  264|     79|    { \
  265|     79|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     79|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_error:
  279|     79|    { \
  280|     79|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     79|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_type:
  196|  9.55k|    { \
  197|  9.55k|        return (OPENSSL_LHASH *)lh; \
  198|  9.55k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_hashfunc_type:
  206|      2|    { \
  207|      2|        return (OPENSSL_LH_HASHFUNC)hfn; \
  208|      2|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_compfunc_type:
  201|      2|    { \
  202|      2|        return (OPENSSL_LH_COMPFUNC)cmp; \
  203|      2|    } \
err.c:lh_ERR_STRING_DATA_hash_thunk:
  160|  9.54k|    { \
  161|  9.54k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  162|  9.54k|        return hfn_conv((const type *)data); \
  163|  9.54k|    } \
err.c:lh_ERR_STRING_DATA_comp_thunk:
  165|  6.15k|    { \
  166|  6.15k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  167|  6.15k|        return cfn_conv((const type *)da, (const type *)db); \
  168|  6.15k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  181|  9.40k|    { \
  182|  9.40k|        return ptr; \
  183|  9.40k|    } \
err.c:ossl_check_const_ERR_STRING_DATA_lh_plain_type:
  186|    140|    { \
  187|    140|        return ptr; \
  188|    140|    } \
core_namemap.c:lh_NAMENUM_ENTRY_num_items:
  284|  5.34k|    { \
  285|  5.34k|        return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
  286|  5.34k|    } \
core_namemap.c:lh_NAMENUM_ENTRY_doall_DOALL_NAMES_DATA:
  354|  5.34k|    { \
  355|  5.34k|        OPENSSL_LH_doall_arg_thunk((OPENSSL_LHASH *)lh, \
  356|  5.34k|                             lh_##type##_doall_##argtype##_thunk, \
  357|  5.34k|                             (OPENSSL_LH_DOALL_FUNCARG)fn, \
  358|  5.34k|                             (void *)arg); \
  359|  5.34k|    } \
core_namemap.c:lh_NAMENUM_ENTRY_doall_DOALL_NAMES_DATA_thunk:
  346|  1.60M|    { \
  347|  1.60M|        void (*fn_conv)(cbargtype *, argtype *) = (void (*)(cbargtype *, argtype *))fn; \
  348|  1.60M|        fn_conv((cbargtype *)node, (argtype *)arg); \
  349|  1.60M|    } \
core_namemap.c:lh_NAMENUM_ENTRY_retrieve:
  274|  69.7k|    { \
  275|  69.7k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  69.7k|    } \
core_namemap.c:lh_NAMENUM_ENTRY_insert:
  264|    309|    { \
  265|    309|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|    309|    } \
core_namemap.c:lh_NAMENUM_ENTRY_error:
  279|    309|    { \
  280|    309|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|    309|    } \
core_namemap.c:lh_NAMENUM_ENTRY_new:
  317|      4|    { \
  318|      4|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      4|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      4|                                lh_##type##_doall_thunk, \
  321|      4|                                lh_##type##_doall_arg_thunk); \
  322|      4|    } \
core_namemap.c:lh_NAMENUM_ENTRY_hfn_thunk:
  243|  70.0k|    { \
  244|  70.0k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  70.0k|        return hfn_conv((const type *)data); \
  246|  70.0k|    } \
core_namemap.c:lh_NAMENUM_ENTRY_cfn_thunk:
  248|  61.4k|    { \
  249|  61.4k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  61.4k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  61.4k|    } \
core_namemap.c:lh_NAMENUM_ENTRY_doall_thunk:
  299|    309|    { \
  300|    309|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|    309|        doall_conv((type *)node); \
  302|    309|    } \
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|      2|    { \
  318|      2|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      2|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      2|                                lh_##type##_doall_thunk, \
  321|      2|                                lh_##type##_doall_arg_thunk); \
  322|      2|    } \
o_names.c:lh_OBJ_NAME_hfn_thunk:
  243|  1.72k|    { \
  244|  1.72k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  1.72k|        return hfn_conv((const type *)data); \
  246|  1.72k|    } \
o_names.c:lh_OBJ_NAME_cfn_thunk:
  248|  1.18k|    { \
  249|  1.18k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  1.18k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  1.18k|    } \
o_names.c:lh_OBJ_NAME_doall_thunk:
  299|  1.08k|    { \
  300|  1.08k|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|  1.08k|        doall_conv((type *)node); \
  302|  1.08k|    } \
o_names.c:lh_OBJ_NAME_retrieve:
  274|    388|    { \
  275|    388|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    388|    } \
o_names.c:lh_OBJ_NAME_insert:
  264|    848|    { \
  265|    848|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|    848|    } \
o_names.c:lh_OBJ_NAME_error:
  279|    484|    { \
  280|    484|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|    484|    } \
o_names.c:lh_OBJ_NAME_delete:
  269|    484|    { \
  270|    484|        return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
  271|    484|    } \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL:
  354|      2|    { \
  355|      2|        OPENSSL_LH_doall_arg_thunk((OPENSSL_LHASH *)lh, \
  356|      2|                             lh_##type##_doall_##argtype##_thunk, \
  357|      2|                             (OPENSSL_LH_DOALL_FUNCARG)fn, \
  358|      2|                             (void *)arg); \
  359|      2|    } \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL_thunk:
  346|    484|    { \
  347|    484|        void (*fn_conv)(cbargtype *, argtype *) = (void (*)(cbargtype *, argtype *))fn; \
  348|    484|        fn_conv((cbargtype *)node, (argtype *)arg); \
  349|    484|    } \
o_names.c:lh_OBJ_NAME_get_down_load:
  289|      8|    { \
  290|      8|        return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
  291|      8|    } \
o_names.c:lh_OBJ_NAME_set_down_load:
  294|     14|    { \
  295|     14|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
  296|     14|    } \
o_names.c:lh_OBJ_NAME_doall:
  311|      8|    { \
  312|      8|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      8|    } \
o_names.c:lh_OBJ_NAME_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall:
  311|      2|    { \
  312|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_new:
  317|      4|    { \
  318|      4|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      4|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      4|                                lh_##type##_doall_thunk, \
  321|      4|                                lh_##type##_doall_arg_thunk); \
  322|      4|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_hfn_thunk:
  243|    320|    { \
  244|    320|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|    320|        return hfn_conv((const type *)data); \
  246|    320|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_cfn_thunk:
  248|    149|    { \
  249|    149|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|    149|        return cfn_conv((const type *)da, (const type *)db); \
  251|    149|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall_thunk:
  299|     57|    { \
  300|     57|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     57|        doall_conv((type *)node); \
  302|     57|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_retrieve:
  274|    263|    { \
  275|    263|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    263|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_insert:
  264|     57|    { \
  265|     57|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     57|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_error:
  279|     57|    { \
  280|     57|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     57|    } \
property.c:lh_QUERY_doall:
  311|    206|    { \
  312|    206|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|    206|    } \
property.c:lh_QUERY_free:
  254|     74|    { \
  255|     74|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|     74|    } \
property.c:lh_QUERY_new:
  317|     74|    { \
  318|     74|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|     74|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|     74|                                lh_##type##_doall_thunk, \
  321|     74|                                lh_##type##_doall_arg_thunk); \
  322|     74|    } \
property.c:lh_QUERY_hfn_thunk:
  243|  5.72k|    { \
  244|  5.72k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  5.72k|        return hfn_conv((const type *)data); \
  246|  5.72k|    } \
property.c:lh_QUERY_cfn_thunk:
  248|  5.71k|    { \
  249|  5.71k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  5.71k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  5.71k|    } \
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|    132|    { \
  285|    132|        return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \
  286|    132|    } \
property.c:lh_QUERY_flush:
  259|    132|    { \
  260|    132|        OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \
  261|    132|    } \
property.c:lh_QUERY_retrieve:
  274|  5.72k|    { \
  275|  5.72k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  5.72k|    } \
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|      8|    { \
  318|      8|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      8|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      8|                                lh_##type##_doall_thunk, \
  321|      8|                                lh_##type##_doall_arg_thunk); \
  322|      8|    } \
property_string.c:lh_PROPERTY_STRING_hfn_thunk:
  243|  78.2k|    { \
  244|  78.2k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  78.2k|        return hfn_conv((const type *)data); \
  246|  78.2k|    } \
property_string.c:lh_PROPERTY_STRING_cfn_thunk:
  248|  78.1k|    { \
  249|  78.1k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  78.1k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  78.1k|    } \
property_string.c:lh_PROPERTY_STRING_doall_thunk:
  299|     37|    { \
  300|     37|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     37|        doall_conv((type *)node); \
  302|     37|    } \
property_string.c:lh_PROPERTY_STRING_retrieve:
  274|  78.2k|    { \
  275|  78.2k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  78.2k|    } \
property_string.c:lh_PROPERTY_STRING_insert:
  264|     53|    { \
  265|     53|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     53|    } \
property_string.c:lh_PROPERTY_STRING_error:
  279|     53|    { \
  280|     53|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     53|    } \
store_register.c:lh_OSSL_STORE_LOADER_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \

OBJ_bsearch_ssl_cipher_id:
  143|    688|      { \
  144|    688|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  145|    688|                                        nm##_cmp_BSEARCH_CMP_FN); \
  146|    688|      } \
ssl_lib.c:ssl_cipher_id_cmp_BSEARCH_CMP_FN:
  137|  2.79k|      { \
  138|  2.79k|      type1 const *a = a_; \
  139|  2.79k|      type2 const *b = b_; \
  140|  2.79k|      return nm##_cmp(a,b); \
  141|  2.79k|      } \
ameth_lib.c:OBJ_bsearch_ameth:
  129|  10.3k|      { \
  130|  10.3k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  10.3k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  10.3k|      } \
ameth_lib.c:ameth_cmp_BSEARCH_CMP_FN:
  123|  37.1k|      { \
  124|  37.1k|      type1 const *a = a_; \
  125|  37.1k|      type2 const *b = b_; \
  126|  37.1k|      return nm##_cmp(a,b); \
  127|  37.1k|      } \
obj_dat.c:OBJ_bsearch_ln:
  129|     14|      { \
  130|     14|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|     14|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|     14|      } \
obj_dat.c:ln_cmp_BSEARCH_CMP_FN:
  123|    148|      { \
  124|    148|      type1 const *a = a_; \
  125|    148|      type2 const *b = b_; \
  126|    148|      return nm##_cmp(a,b); \
  127|    148|      } \
obj_dat.c:OBJ_bsearch_sn:
  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:sn_cmp_BSEARCH_CMP_FN:
  123|    162|      { \
  124|    162|      type1 const *a = a_; \
  125|    162|      type2 const *b = b_; \
  126|    162|      return nm##_cmp(a,b); \
  127|    162|      } \
obj_dat.c:OBJ_bsearch_obj:
  129|   827k|      { \
  130|   827k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|   827k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|   827k|      } \
obj_dat.c:obj_cmp_BSEARCH_CMP_FN:
  123|  8.36M|      { \
  124|  8.36M|      type1 const *a = a_; \
  125|  8.36M|      type2 const *b = b_; \
  126|  8.36M|      return nm##_cmp(a,b); \
  127|  8.36M|      } \
v3_lib.c:OBJ_bsearch_ext:
  129|  77.2k|      { \
  130|  77.2k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  77.2k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  77.2k|      } \
v3_lib.c:ext_cmp_BSEARCH_CMP_FN:
  123|   389k|      { \
  124|   389k|      type1 const *a = a_; \
  125|   389k|      type2 const *b = b_; \
  126|   389k|      return nm##_cmp(a,b); \
  127|   389k|      } \

ssl_ciph.c:ossl_check_SSL_COMP_sk_type:
   48|      2|    { \
   49|      2|        return (OPENSSL_STACK *)sk; \
   50|      2|    } \
ssl_ciph.c:ossl_check_SSL_COMP_type:
   40|      2|    { \
   41|      2|        return ptr; \
   42|      2|    } \
d2i_pr.c:ossl_check_const_ASN1_TYPE_sk_type:
   44|  28.8k|    { \
   45|  28.8k|        return (const OPENSSL_STACK *)sk; \
   46|  28.8k|    } \
d2i_pr.c:ossl_check_ASN1_TYPE_sk_type:
   48|  9.90k|    { \
   49|  9.90k|        return (OPENSSL_STACK *)sk; \
   50|  9.90k|    } \
d2i_pr.c:ossl_check_ASN1_TYPE_freefunc_type:
   60|  9.90k|    { \
   61|  9.90k|        return (OPENSSL_sk_freefunc)fr; \
   62|  9.90k|    }
tasn_dec.c:ossl_check_const_ASN1_VALUE_sk_type:
   44|  13.5k|    { \
   45|  13.5k|        return (const OPENSSL_STACK *)sk; \
   46|  13.5k|    } \
tasn_dec.c:ossl_check_ASN1_VALUE_sk_type:
   48|  7.49M|    { \
   49|  7.49M|        return (OPENSSL_STACK *)sk; \
   50|  7.49M|    } \
tasn_dec.c:ossl_check_ASN1_VALUE_type:
   40|  7.49M|    { \
   41|  7.49M|        return ptr; \
   42|  7.49M|    } \
tasn_enc.c:sk_const_ASN1_VALUE_num:
   70|  8.41M|    { \
   71|  8.41M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  8.41M|    } \
tasn_enc.c:sk_const_ASN1_VALUE_value:
   74|  7.66M|    { \
   75|  7.66M|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  7.66M|    } \
tasn_enc.c:sk_const_ASN1_VALUE_set:
  135|    329|    { \
  136|    329|        return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); \
  137|    329|    } \
tasn_fre.c:ossl_check_const_ASN1_VALUE_sk_type:
   44|  10.6M|    { \
   45|  10.6M|        return (const OPENSSL_STACK *)sk; \
   46|  10.6M|    } \
tasn_fre.c:ossl_check_ASN1_VALUE_sk_type:
   48|  2.38M|    { \
   49|  2.38M|        return (OPENSSL_STACK *)sk; \
   50|  2.38M|    } \
tasn_prn.c:sk_const_ASN1_VALUE_num:
   70|   108k|    { \
   71|   108k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|   108k|    } \
tasn_prn.c:sk_const_ASN1_VALUE_value:
   74|  85.5k|    { \
   75|  85.5k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  85.5k|    } \
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|     21|    { \
   83|     21|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|     21|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_push:
  111|    127|    { \
  112|    127|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|    127|    } \
decoder_lib.c:sk_OSSL_DECODER_new_null:
   82|     21|    { \
   83|     21|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|     21|    } \
decoder_lib.c:sk_OSSL_DECODER_push:
  111|    840|    { \
  112|    840|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|    840|    } \
decoder_lib.c:sk_OSSL_DECODER_num:
   70|     21|    { \
   71|     21|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|     21|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_num:
   70|  24.3k|    { \
   71|  24.3k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  24.3k|    } \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_value:
   74|   277k|    { \
   75|   277k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|   277k|    } \
decoder_lib.c:sk_OSSL_DECODER_value:
   74|  10.1k|    { \
   75|  10.1k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  10.1k|    } \
decoder_lib.c:sk_OSSL_DECODER_pop_free:
  127|     21|    { \
  128|     21|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|     21|    } \
decoder_meth.c:sk_OSSL_DECODER_INSTANCE_pop_free:
  127|  15.8k|    { \
  128|  15.8k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|  15.8k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_new_null:
   82|     79|    { \
   83|     79|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|     79|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_push:
  111|     41|    { \
  112|     41|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|     41|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_num:
   70|  3.61k|    { \
   71|  3.61k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  3.61k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_value:
   74|  4.87k|    { \
   75|  4.87k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  4.87k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_pop_free:
  127|  12.2k|    { \
  128|  12.2k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|  12.2k|    } \
decoder_pkey.c:sk_OSSL_DECODER_INSTANCE_deep_copy:
  165|  12.1k|    { \
  166|  12.1k|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  167|  12.1k|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  168|  12.1k|                                            (OPENSSL_sk_freefunc)freefunc); \
  169|  12.1k|    } \
decoder_pkey.c:sk_EVP_KEYMGMT_deep_copy:
  165|  12.1k|    { \
  166|  12.1k|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  167|  12.1k|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  168|  12.1k|                                            (OPENSSL_sk_freefunc)freefunc); \
  169|  12.1k|    } \
encoder_lib.c:sk_OSSL_ENCODER_INSTANCE_new_null:
   82|  3.39k|    { \
   83|  3.39k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|  3.39k|    } \
encoder_lib.c:sk_OSSL_ENCODER_INSTANCE_push:
  111|  38.0k|    { \
  112|  38.0k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|  38.0k|    } \
encoder_lib.c:sk_OSSL_ENCODER_INSTANCE_num:
   70|  11.7k|    { \
   71|  11.7k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  11.7k|    } \
encoder_lib.c:sk_OSSL_ENCODER_INSTANCE_value:
   74|  38.0k|    { \
   75|  38.0k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  38.0k|    } \
encoder_meth.c:sk_OSSL_ENCODER_INSTANCE_value:
   74|  38.0k|    { \
   75|  38.0k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  38.0k|    } \
encoder_meth.c:sk_OSSL_ENCODER_INSTANCE_pop_free:
  127|  3.45k|    { \
  128|  3.45k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|  3.45k|    } \
encoder_pkey.c:ossl_check_OPENSSL_CSTRING_type:
   40|  14.5k|    { \
   41|  14.5k|        return ptr; \
   42|  14.5k|    } \
encoder_pkey.c:ossl_check_OPENSSL_CSTRING_sk_type:
   48|  17.9k|    { \
   49|  17.9k|        return (OPENSSL_STACK *)sk; \
   50|  17.9k|    } \
encoder_pkey.c:ossl_check_const_OPENSSL_CSTRING_sk_type:
   44|   407k|    { \
   45|   407k|        return (const OPENSSL_STACK *)sk; \
   46|   407k|    } \
keymgmt_lib.c:sk_OP_CACHE_ELEM_pop_free:
  127|  11.6k|    { \
  128|  11.6k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|  11.6k|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_sk_type:
   48|  11.6k|    { \
   49|  11.6k|        return (OPENSSL_STACK *)sk; \
   50|  11.6k|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_freefunc_type:
   60|  11.6k|    { \
   61|  11.6k|        return (OPENSSL_sk_freefunc)fr; \
   62|  11.6k|    }
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|  3.58M|    { \
   71|  3.58M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  3.58M|    } \
ex_data.c:ossl_check_void_sk_type:
   48|  1.79M|    { \
   49|  1.79M|        return (OPENSSL_STACK *)sk; \
   50|  1.79M|    } \
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|    } \
param_build_set.c:sk_BIGNUM_const_num:
   70|  1.08k|    { \
   71|  1.08k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  1.08k|    } \
param_build_set.c:sk_BIGNUM_const_value:
   74|  5.33k|    { \
   75|  5.33k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  5.33k|    } \
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|      3|    { \
  128|      3|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      3|    } \
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|      4|    { \
   79|      4|        return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   80|      4|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_new_null:
   82|      4|    { \
   83|      4|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|      4|    } \
provider_core.c:sk_OSSL_PROVIDER_sort:
  151|      2|    { \
  152|      2|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  153|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_find:
  139|      4|    { \
  140|      4|        return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \
  141|      4|    } \
provider_core.c:sk_OSSL_PROVIDER_value:
   74|  41.7k|    { \
   75|  41.7k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  41.7k|    } \
provider_core.c:sk_INFOPAIR_deep_copy:
  165|      3|    { \
  166|      3|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  167|      3|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  168|      3|                                            (OPENSSL_sk_freefunc)freefunc); \
  169|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_push:
  111|      3|    { \
  112|      3|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_dup:
  159|  6.96k|    { \
  160|  6.96k|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  161|  6.96k|    } \
provider_core.c:sk_OSSL_PROVIDER_num:
   70|  6.96k|    { \
   71|  6.96k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  6.96k|    } \
provider_core.c:sk_OSSL_PROVIDER_free:
   94|  6.96k|    { \
   95|  6.96k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|  6.96k|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_num:
   70|      5|    { \
   71|      5|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      5|    } \
o_names.c:sk_NAME_FUNCS_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_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|     74|    { \
  128|     74|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|     74|    } \
property.c:sk_IMPLEMENTATION_new_null:
   82|     74|    { \
   83|     74|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|     74|    } \
property.c:sk_IMPLEMENTATION_num:
   70|  79.2k|    { \
   71|  79.2k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  79.2k|    } \
property.c:sk_IMPLEMENTATION_value:
   74|   787k|    { \
   75|   787k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|   787k|    } \
property.c:sk_IMPLEMENTATION_push:
  111|    206|    { \
  112|    206|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|    206|    } \
property.c:sk_ALGORITHM_new_reserve:
   86|  6.96k|    { \
   87|  6.96k|        return (STACK_OF(t1) *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); \
   88|  6.96k|    } \
property.c:sk_ALGORITHM_push:
  111|  78.2k|    { \
  112|  78.2k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|  78.2k|    } \
property.c:sk_ALGORITHM_num:
   70|  6.96k|    { \
   71|  6.96k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  6.96k|    } \
property.c:sk_ALGORITHM_value:
   74|  78.2k|    { \
   75|  78.2k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  78.2k|    } \
property.c:sk_ALGORITHM_free:
   94|  6.96k|    { \
   95|  6.96k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|  6.96k|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_new:
   78|    217|    { \
   79|    217|        return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   80|    217|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_push:
  111|    812|    { \
  112|    812|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|    812|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_num:
   70|    217|    { \
   71|    217|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|    217|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_sort:
  151|    217|    { \
  152|    217|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  153|    217|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_value:
   74|    812|    { \
   75|    812|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|    812|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_pop_free:
  127|    217|    { \
  128|    217|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|    217|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_sk_type:
   48|     57|    { \
   49|     57|        return (OPENSSL_STACK *)sk; \
   50|     57|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_type:
   40|     53|    { \
   41|     53|        return ptr; \
   42|     53|    } \
property_string.c:ossl_check_const_OPENSSL_CSTRING_sk_type:
   44|  69.1k|    { \
   45|  69.1k|        return (const OPENSSL_STACK *)sk; \
   46|  69.1k|    } \
rsa_ameth.c:sk_RSA_PRIME_INFO_num:
   70|  3.98k|    { \
   71|  3.98k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  3.98k|    } \
rsa_ameth.c:sk_RSA_PRIME_INFO_value:
   74|  3.89k|    { \
   75|  3.89k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  3.89k|    } \
rsa_backend.c:sk_BIGNUM_const_new_null:
   82|  1.12k|    { \
   83|  1.12k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|  1.12k|    } \
rsa_backend.c:sk_BIGNUM_const_free:
   94|  1.12k|    { \
   95|  1.12k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|  1.12k|    } \
rsa_lib.c:sk_RSA_PRIME_INFO_pop_free:
  127|  42.4k|    { \
  128|  42.4k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|  42.4k|    } \
rsa_lib.c:sk_RSA_PRIME_INFO_num:
   70|    973|    { \
   71|    973|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|    973|    } \
rsa_lib.c:sk_RSA_PRIME_INFO_value:
   74|  55.7k|    { \
   75|  55.7k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  55.7k|    } \
rsa_lib.c:sk_BIGNUM_const_push:
  111|   170k|    { \
  112|   170k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|   170k|    } \
rsa_mp.c:sk_RSA_PRIME_INFO_num:
   70|    588|    { \
   71|    588|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|    588|    } \
rsa_mp.c:sk_RSA_PRIME_INFO_value:
   74|  59.0k|    { \
   75|  59.0k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  59.0k|    } \
rsa_ossl.c:sk_RSA_PRIME_INFO_num:
   70|   111k|    { \
   71|   111k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|   111k|    } \
rsa_ossl.c:sk_RSA_PRIME_INFO_value:
   74|  68.7k|    { \
   75|  68.7k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  68.7k|    } \
ts_rsp_print.c:ossl_check_const_ASN1_UTF8STRING_sk_type:
   44|  14.1k|    { \
   45|  14.1k|        return (const OPENSSL_STACK *)sk; \
   46|  14.1k|    } \
ts_rsp_print.c:ossl_check_CONF_VALUE_sk_type:
   48|      2|    { \
   49|      2|        return (OPENSSL_STACK *)sk; \
   50|      2|    } \
ts_rsp_print.c:ossl_check_CONF_VALUE_freefunc_type:
   60|      2|    { \
   61|      2|        return (OPENSSL_sk_freefunc)fr; \
   62|      2|    }
t_x509.c:ossl_check_X509_sk_type:
   48|    463|    { \
   49|    463|        return (OPENSSL_STACK *)sk; \
   50|    463|    } \
t_x509.c:ossl_check_X509_freefunc_type:
   60|    463|    { \
   61|    463|        return (OPENSSL_sk_freefunc)fr; \
   62|    463|    }
v3_ac_tgt.c:ossl_check_const_OSSL_TARGETS_sk_type:
   44|     25|    { \
   45|     25|        return (const OPENSSL_STACK *)sk; \
   46|     25|    } \
v3_ac_tgt.c:ossl_check_const_OSSL_TARGET_sk_type:
   44|      6|    { \
   45|      6|        return (const OPENSSL_STACK *)sk; \
   46|      6|    } \
v3_cpols.c:ossl_check_const_POLICYINFO_sk_type:
   44|    275|    { \
   45|    275|        return (const OPENSSL_STACK *)sk; \
   46|    275|    } \
v3_crld.c:ossl_check_const_DIST_POINT_sk_type:
   44|  1.91k|    { \
   45|  1.91k|        return (const OPENSSL_STACK *)sk; \
   46|  1.91k|    } \
v3_crld.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   44|  2.18k|    { \
   45|  2.18k|        return (const OPENSSL_STACK *)sk; \
   46|  2.18k|    } \
v3_extku.c:ossl_check_const_ASN1_OBJECT_sk_type:
   44|    882|    { \
   45|    882|        return (const OPENSSL_STACK *)sk; \
   46|    882|    } \
v3_lib.c:ossl_check_const_X509_EXTENSION_sk_type:
   44|   293k|    { \
   45|   293k|        return (const OPENSSL_STACK *)sk; \
   46|   293k|    } \
v3_ncons.c:ossl_check_const_GENERAL_SUBTREE_sk_type:
   44|  9.80k|    { \
   45|  9.80k|        return (const OPENSSL_STACK *)sk; \
   46|  9.80k|    } \
v3_pmaps.c:ossl_check_const_POLICY_MAPPING_sk_type:
   44|    258|    { \
   45|    258|        return (const OPENSSL_STACK *)sk; \
   46|    258|    } \
v3_prn.c:ossl_check_const_CONF_VALUE_sk_type:
   44|  16.2k|    { \
   45|  16.2k|        return (const OPENSSL_STACK *)sk; \
   46|  16.2k|    } \
v3_prn.c:ossl_check_CONF_VALUE_sk_type:
   48|  30.9k|    { \
   49|  30.9k|        return (OPENSSL_STACK *)sk; \
   50|  30.9k|    } \
v3_prn.c:ossl_check_CONF_VALUE_freefunc_type:
   60|  30.9k|    { \
   61|  30.9k|        return (OPENSSL_sk_freefunc)fr; \
   62|  30.9k|    }
v3_san.c:ossl_check_const_GENERAL_NAME_sk_type:
   44|  8.22k|    { \
   45|  8.22k|        return (const OPENSSL_STACK *)sk; \
   46|  8.22k|    } \
v3_san.c:ossl_check_CONF_VALUE_sk_type:
   48|     88|    { \
   49|     88|        return (OPENSSL_STACK *)sk; \
   50|     88|    } \
v3_san.c:ossl_check_CONF_VALUE_freefunc_type:
   60|     88|    { \
   61|     88|        return (OPENSSL_sk_freefunc)fr; \
   62|     88|    }
v3_sda.c:ossl_check_const_X509_ATTRIBUTE_sk_type:
   44|     11|    { \
   45|     11|        return (const OPENSSL_STACK *)sk; \
   46|     11|    } \
v3_usernotice.c:ossl_check_const_USERNOTICE_sk_type:
   44|     16|    { \
   45|     16|        return (const OPENSSL_STACK *)sk; \
   46|     16|    } \
v3_utl.c:ossl_check_CONF_VALUE_type:
   40|  5.08k|    { \
   41|  5.08k|        return ptr; \
   42|  5.08k|    } \
v3_utl.c:ossl_check_CONF_VALUE_sk_type:
   48|  5.15k|    { \
   49|  5.15k|        return (OPENSSL_STACK *)sk; \
   50|  5.15k|    } \
v3_utl.c:ossl_check_const_GENERAL_NAME_sk_type:
   44|  1.70k|    { \
   45|  1.70k|        return (const OPENSSL_STACK *)sk; \
   46|  1.70k|    } \
x509_obj.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   44|  6.95k|    { \
   45|  6.95k|        return (const OPENSSL_STACK *)sk; \
   46|  6.95k|    } \
x509_v3.c:ossl_check_const_X509_EXTENSION_sk_type:
   44|   106k|    { \
   45|   106k|        return (const OPENSSL_STACK *)sk; \
   46|   106k|    } \
x509name.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   44|  24.2k|    { \
   45|  24.2k|        return (const OPENSSL_STACK *)sk; \
   46|  24.2k|    } \
x509name.c:ossl_check_X509_NAME_ENTRY_sk_type:
   48|  1.03k|    { \
   49|  1.03k|        return (OPENSSL_STACK *)sk; \
   50|  1.03k|    } \
x509name.c:ossl_check_X509_NAME_ENTRY_type:
   40|  1.03k|    { \
   41|  1.03k|        return ptr; \
   42|  1.03k|    } \
x_crl.c:ossl_check_GENERAL_NAMES_sk_type:
   48|  30.4k|    { \
   49|  30.4k|        return (OPENSSL_STACK *)sk; \
   50|  30.4k|    } \
x_crl.c:ossl_check_GENERAL_NAMES_freefunc_type:
   60|  29.4k|    { \
   61|  29.4k|        return (OPENSSL_sk_freefunc)fr; \
   62|  29.4k|    }
x_crl.c:ossl_check_const_X509_EXTENSION_sk_type:
   44|   102k|    { \
   45|   102k|        return (const OPENSSL_STACK *)sk; \
   46|   102k|    } \
x_crl.c:ossl_check_const_X509_REVOKED_sk_type:
   44|  49.0k|    { \
   45|  49.0k|        return (const OPENSSL_STACK *)sk; \
   46|  49.0k|    } \
x_crl.c:ossl_check_GENERAL_NAMES_type:
   40|  1.04k|    { \
   41|  1.04k|        return ptr; \
   42|  1.04k|    } \
x_crl.c:ossl_check_X509_REVOKED_compfunc_type:
   52|  2.30k|    { \
   53|  2.30k|        return (OPENSSL_sk_compfunc)cmp; \
   54|  2.30k|    } \
x_crl.c:ossl_check_X509_REVOKED_sk_type:
   48|  2.30k|    { \
   49|  2.30k|        return (OPENSSL_STACK *)sk; \
   50|  2.30k|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_sk_type:
   48|  2.26M|    { \
   49|  2.26M|        return (OPENSSL_STACK *)sk; \
   50|  2.26M|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_freefunc_type:
   60|  1.57M|    { \
   61|  1.57M|        return (OPENSSL_sk_freefunc)fr; \
   62|  1.57M|    }
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_num:
   70|  1.72M|    { \
   71|  1.72M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  1.72M|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_value:
   74|  1.69M|    { \
   75|  1.69M|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  1.69M|    } \
x_name.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   44|  2.22M|    { \
   45|  2.22M|        return (const OPENSSL_STACK *)sk; \
   46|  2.22M|    } \
x_name.c:ossl_check_X509_NAME_ENTRY_type:
   40|   371k|    { \
   41|   371k|        return ptr; \
   42|   371k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_new_null:
   82|  10.7k|    { \
   83|  10.7k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|  10.7k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_push:
  111|  53.7k|    { \
  112|  53.7k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|  53.7k|    } \
x_name.c:ossl_check_const_ASN1_VALUE_sk_type:
   44|   231k|    { \
   45|   231k|        return (const OPENSSL_STACK *)sk; \
   46|   231k|    } \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_pop_free:
  127|  33.9k|    { \
  128|  33.9k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|  33.9k|    } \
x_x509.c:ossl_check_IPAddressFamily_sk_type:
   48|  24.9k|    { \
   49|  24.9k|        return (OPENSSL_STACK *)sk; \
   50|  24.9k|    } \
x_x509.c:ossl_check_IPAddressFamily_freefunc_type:
   60|  24.9k|    { \
   61|  24.9k|        return (OPENSSL_sk_freefunc)fr; \
   62|  24.9k|    }
encode_key2text.c:sk_BIGNUM_const_new_null:
   82|  1.08k|    { \
   83|  1.08k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|  1.08k|    } \
encode_key2text.c:sk_BIGNUM_const_num:
   70|  28.5k|    { \
   71|  28.5k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  28.5k|    } \
encode_key2text.c:sk_BIGNUM_const_value:
   74|  85.4k|    { \
   75|  85.4k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|  85.4k|    } \
encode_key2text.c:sk_BIGNUM_const_free:
   94|  1.08k|    { \
   95|  1.08k|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|  1.08k|    } \
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|    } \
comp_methods.c:ossl_check_SSL_COMP_compfunc_type:
   52|      4|    { \
   53|      4|        return (OPENSSL_sk_compfunc)cmp; \
   54|      4|    } \
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_admis.c:ossl_check_const_ADMISSIONS_sk_type:
   44|      4|    { \
   45|      4|        return (const OPENSSL_STACK *)sk; \
   46|      4|    } \
v3_admis.c:ossl_check_const_PROFESSION_INFO_sk_type:
   44|      1|    { \
   45|      1|        return (const OPENSSL_STACK *)sk; \
   46|      1|    } \
v3_akid.c:ossl_check_CONF_VALUE_sk_type:
   48|      1|    { \
   49|      1|        return (OPENSSL_STACK *)sk; \
   50|      1|    } \
v3_akid.c:ossl_check_CONF_VALUE_freefunc_type:
   60|      1|    { \
   61|      1|        return (OPENSSL_sk_freefunc)fr; \
   62|      1|    }

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|   150M|{
   93|   150M|    if (c_bio_read_ex == NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 150M]
  ------------------
   94|      0|        return 0;
   95|   150M|    return c_bio_read_ex(bio, data, data_len, bytes_read);
   96|   150M|}
ossl_prov_bio_write_ex:
  100|  1.47M|{
  101|  1.47M|    if (c_bio_write_ex == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 1.47M]
  ------------------
  102|      0|        return 0;
  103|  1.47M|    return c_bio_write_ex(bio, data, data_len, written);
  104|  1.47M|}
ossl_prov_bio_up_ref:
  128|   195k|{
  129|   195k|    if (c_bio_up_ref == NULL)
  ------------------
  |  Branch (129:9): [True: 0, False: 195k]
  ------------------
  130|      0|        return 0;
  131|   195k|    return c_bio_up_ref(bio);
  132|   195k|}
ossl_prov_bio_free:
  135|   195k|{
  136|   195k|    if (c_bio_free == NULL)
  ------------------
  |  Branch (136:9): [True: 0, False: 195k]
  ------------------
  137|      0|        return 0;
  138|   195k|    return c_bio_free(bio);
  139|   195k|}
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|   195k|{
  228|   195k|    BIO *outbio;
  229|   195k|    BIO_METHOD *corebiometh = ossl_prov_ctx_get0_core_bio_method(provctx);
  230|       |
  231|   195k|    if (corebiometh == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 195k]
  ------------------
  232|      0|        return NULL;
  233|       |
  234|   195k|    if ((outbio = BIO_new(corebiometh)) == NULL)
  ------------------
  |  Branch (234:9): [True: 0, False: 195k]
  ------------------
  235|      0|        return NULL;
  236|   195k|    if (!ossl_prov_bio_up_ref(corebio)) {
  ------------------
  |  Branch (236:9): [True: 0, False: 195k]
  ------------------
  237|      0|        BIO_free(outbio);
  238|      0|        return NULL;
  239|      0|    }
  240|   195k|    BIO_set_data(outbio, corebio);
  241|   195k|    return outbio;
  242|   195k|}
bio_prov.c:bio_core_write_ex:
  172|  1.47M|{
  173|  1.47M|    return ossl_prov_bio_write_ex(BIO_get_data(bio), data, data_len, written);
  174|  1.47M|}
bio_prov.c:bio_core_read_ex:
  166|   150M|{
  167|   150M|    return ossl_prov_bio_read_ex(BIO_get_data(bio), data, data_len, bytes_read);
  168|   150M|}
bio_prov.c:bio_core_new:
  192|   195k|{
  193|   195k|    BIO_set_init(bio, 1);
  194|       |
  195|   195k|    return 1;
  196|   195k|}
bio_prov.c:bio_core_free:
  199|   195k|{
  200|   195k|    BIO_set_init(bio, 0);
  201|   195k|    ossl_prov_bio_free(BIO_get_data(bio));
  202|       |
  203|   195k|    return 1;
  204|   195k|}

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

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|  43.4k|{
   44|  43.4k|    if (ctx == NULL)
  ------------------
  |  Branch (44:9): [True: 0, False: 43.4k]
  ------------------
   45|      0|        return NULL;
   46|  43.4k|    return ctx->libctx;
   47|  43.4k|}
ossl_prov_ctx_get0_core_bio_method:
   57|   195k|{
   58|   195k|    if (ctx == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 195k]
  ------------------
   59|      0|        return NULL;
   60|   195k|    return ctx->corebiometh;
   61|   195k|}

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|  6.96k|{
  522|  6.96k|    *no_cache = 0;
  523|  6.96k|    switch (operation_id) {
  ------------------
  |  Branch (523:13): [True: 0, False: 6.96k]
  ------------------
  524|      3|    case OSSL_OP_DIGEST:
  ------------------
  |  |  275|      3|# define OSSL_OP_DIGEST                              1
  ------------------
  |  Branch (524:5): [True: 3, False: 6.96k]
  ------------------
  525|      3|        return deflt_digests;
  526|      0|    case OSSL_OP_CIPHER:
  ------------------
  |  |  276|      0|# define OSSL_OP_CIPHER                              2   /* Symmetric Ciphers */
  ------------------
  |  Branch (526:5): [True: 0, False: 6.96k]
  ------------------
  527|      0|        return exported_ciphers;
  528|      0|    case OSSL_OP_MAC:
  ------------------
  |  |  277|      0|# define OSSL_OP_MAC                                 3
  ------------------
  |  Branch (528:5): [True: 0, False: 6.96k]
  ------------------
  529|      0|        return deflt_macs;
  530|      0|    case OSSL_OP_KDF:
  ------------------
  |  |  278|      0|# define OSSL_OP_KDF                                 4
  ------------------
  |  Branch (530:5): [True: 0, False: 6.96k]
  ------------------
  531|      0|        return deflt_kdfs;
  532|      2|    case OSSL_OP_RAND:
  ------------------
  |  |  279|      2|# define OSSL_OP_RAND                                5
  ------------------
  |  Branch (532:5): [True: 2, False: 6.96k]
  ------------------
  533|      2|        return deflt_rands;
  534|     79|    case OSSL_OP_KEYMGMT:
  ------------------
  |  |  280|     79|# define OSSL_OP_KEYMGMT                            10
  ------------------
  |  Branch (534:5): [True: 79, False: 6.88k]
  ------------------
  535|     79|        return deflt_keymgmt;
  536|      0|    case OSSL_OP_KEYEXCH:
  ------------------
  |  |  281|      0|# define OSSL_OP_KEYEXCH                            11
  ------------------
  |  Branch (536:5): [True: 0, False: 6.96k]
  ------------------
  537|      0|        return deflt_keyexch;
  538|      0|    case OSSL_OP_SIGNATURE:
  ------------------
  |  |  282|      0|# define OSSL_OP_SIGNATURE                          12
  ------------------
  |  Branch (538:5): [True: 0, False: 6.96k]
  ------------------
  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: 6.96k]
  ------------------
  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: 6.96k]
  ------------------
  543|      0|        return deflt_asym_kem;
  544|  6.78k|    case OSSL_OP_ENCODER:
  ------------------
  |  |  286|  6.78k|# define OSSL_OP_ENCODER                            20
  ------------------
  |  Branch (544:5): [True: 6.78k, False: 184]
  ------------------
  545|  6.78k|        return deflt_encoder;
  546|    100|    case OSSL_OP_DECODER:
  ------------------
  |  |  287|    100|# define OSSL_OP_DECODER                            21
  ------------------
  |  Branch (546:5): [True: 100, False: 6.86k]
  ------------------
  547|    100|        return deflt_decoder;
  548|      0|    case OSSL_OP_STORE:
  ------------------
  |  |  288|      0|# define OSSL_OP_STORE                              22
  ------------------
  |  Branch (548:5): [True: 0, False: 6.96k]
  ------------------
  549|      0|        return deflt_store;
  550|  6.96k|    }
  551|      0|    return NULL;
  552|  6.96k|}

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

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|  5.71k|{
   44|  5.71k|    const OSSL_PARAM *p;
   45|  5.71k|    SHA_CTX *ctx = (SHA_CTX *)vctx;
   46|       |
   47|  5.71k|    if (ctx == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 5.71k]
  ------------------
   48|      0|        return 0;
   49|  5.71k|    if (params == NULL)
  ------------------
  |  Branch (49:9): [True: 5.71k, False: 0]
  ------------------
   50|  5.71k|        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|}

sha3_prov.c:generic_sha3_absorb:
  148|      2|{
  149|      2|    KECCAK1600_CTX *ctx = vctx;
  150|       |
  151|      2|    if (!(ctx->xof_state == XOF_STATE_INIT ||
  ------------------
  |  |   35|      4|#define XOF_STATE_INIT    0
  ------------------
  |  Branch (151:11): [True: 2, False: 0]
  ------------------
  152|      2|          ctx->xof_state == XOF_STATE_ABSORB))
  ------------------
  |  |   36|      0|#define XOF_STATE_ABSORB  1
  ------------------
  |  Branch (152:11): [True: 0, False: 0]
  ------------------
  153|      0|        return 0;
  154|      2|    ctx->xof_state = XOF_STATE_ABSORB;
  ------------------
  |  |   36|      2|#define XOF_STATE_ABSORB  1
  ------------------
  155|      2|    return SHA3_absorb(ctx->A, inp, len, ctx->block_size);
  156|      2|}
sha3_prov.c:generic_sha3_final:
  159|      2|{
  160|      2|    return ossl_sha3_final((KECCAK1600_CTX *)vctx, out, outlen);
  161|      2|}
sha3_prov.c:keccak_update:
   72|      2|{
   73|      2|    KECCAK1600_CTX *ctx = vctx;
   74|      2|    const size_t bsz = ctx->block_size;
   75|      2|    size_t num, rem;
   76|       |
   77|      2|    if (len == 0)
  ------------------
  |  Branch (77:9): [True: 0, False: 2]
  ------------------
   78|      0|        return 1;
   79|       |
   80|       |    /* Is there anything in the buffer already ? */
   81|      2|    if ((num = ctx->bufsz) != 0) {
  ------------------
  |  Branch (81:9): [True: 0, False: 2]
  ------------------
   82|       |        /* Calculate how much space is left in the buffer */
   83|      0|        rem = bsz - num;
   84|       |        /* If the new input does not fill the buffer then just add it */
   85|      0|        if (len < rem) {
  ------------------
  |  Branch (85:13): [True: 0, False: 0]
  ------------------
   86|      0|            memcpy(ctx->buf + num, inp, len);
   87|      0|            ctx->bufsz += len;
   88|      0|            return 1;
   89|      0|        }
   90|       |        /* otherwise fill up the buffer and absorb the buffer */
   91|      0|        memcpy(ctx->buf + num, inp, rem);
   92|       |        /* Update the input pointer */
   93|      0|        inp += rem;
   94|      0|        len -= rem;
   95|      0|        ctx->meth.absorb(ctx, ctx->buf, bsz);
   96|      0|        ctx->bufsz = 0;
   97|      0|    }
   98|       |    /* Absorb the input - rem = leftover part of the input < blocksize) */
   99|      2|    rem = ctx->meth.absorb(ctx, inp, len);
  100|       |    /* Copy the leftover bit of the input into the buffer */
  101|      2|    if (rem) {
  ------------------
  |  Branch (101:9): [True: 2, False: 0]
  ------------------
  102|      2|        memcpy(ctx->buf, inp + len - rem, rem);
  103|      2|        ctx->bufsz = rem;
  104|      2|    }
  105|      2|    return 1;
  106|      2|}
sha3_prov.c:keccak_final:
  110|      2|{
  111|      2|    int ret = 1;
  112|      2|    KECCAK1600_CTX *ctx = vctx;
  113|       |
  114|      2|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (114:9): [True: 0, False: 2]
  ------------------
  115|      0|        return 0;
  116|      2|    if (ctx->md_size == SIZE_MAX) {
  ------------------
  |  Branch (116:9): [True: 0, False: 2]
  ------------------
  117|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DIGEST_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)
  |  |  ------------------
  ------------------
  118|      0|        return 0;
  119|      0|    }
  120|      2|    if (outlen > 0)
  ------------------
  |  Branch (120:9): [True: 2, False: 0]
  ------------------
  121|      2|        ret = ctx->meth.final(ctx, out, ctx->md_size);
  122|       |
  123|      2|    *outl = ctx->md_size;
  124|      2|    return ret;
  125|      2|}
sha3_prov.c:keccak_freectx:
  531|      2|{
  532|      2|    KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx;
  533|       |
  534|      2|    OPENSSL_clear_free(ctx,  sizeof(*ctx));
  ------------------
  |  |  113|      2|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  535|      2|}
sha3_prov.c:keccak_init:
   57|      2|{
   58|      2|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (58:9): [True: 0, False: 2]
  ------------------
   59|      0|        return 0;
   60|       |    /* The newctx() handles most of the ctx fixed setup. */
   61|      2|    ossl_sha3_reset((KECCAK1600_CTX *)vctx);
   62|      2|    return 1;
   63|      2|}
sha3_prov.c:keccak_init_params:
   66|      2|{
   67|      2|    return keccak_init(vctx, NULL)
  ------------------
  |  Branch (67:12): [True: 2, False: 0]
  ------------------
   68|      2|            && shake_set_ctx_params(vctx, params);
  ------------------
  |  Branch (68:16): [True: 2, False: 0]
  ------------------
   69|      2|}
sha3_prov.c:shake_set_ctx_params:
  559|      4|{
  560|      4|    const OSSL_PARAM *p;
  561|      4|    KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx;
  562|       |
  563|      4|    if (ctx == NULL)
  ------------------
  |  Branch (563:9): [True: 0, False: 4]
  ------------------
  564|      0|        return 0;
  565|      4|    if (params == NULL)
  ------------------
  |  Branch (565:9): [True: 2, False: 2]
  ------------------
  566|      2|        return 1;
  567|       |
  568|      2|    p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_XOFLEN);
  ------------------
  |  |  206|      2|# define OSSL_DIGEST_PARAM_XOFLEN "xoflen"
  ------------------
  569|      2|    if (p != NULL && !OSSL_PARAM_get_size_t(p, &ctx->md_size)) {
  ------------------
  |  Branch (569:9): [True: 2, False: 0]
  |  Branch (569:22): [True: 0, False: 2]
  ------------------
  570|      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)
  |  |  ------------------
  ------------------
  571|      0|        return 0;
  572|      0|    }
  573|      2|    return 1;
  574|      2|}
sha3_prov.c:shake_256_newctx:
  478|      2|static void *name##_newctx(void *provctx)                                      \
  479|      2|{                                                                              \
  480|      2|    KECCAK1600_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 (480:27): [True: 2, False: 0]
  ------------------
  481|      2|                                                : NULL;                        \
  482|      2|                                                                               \
  483|      2|    if (ctx == NULL)                                                           \
  ------------------
  |  Branch (483:9): [True: 0, False: 2]
  ------------------
  484|      2|        return NULL;                                                           \
  485|      2|    ossl_keccak_init(ctx, pad, bitlen, mdlen);                                 \
  486|      2|    if (mdlen == 0)                                                            \
  ------------------
  |  Branch (486:9): [Folded - Ignored]
  ------------------
  487|      2|        ctx->md_size = SIZE_MAX;                                               \
  488|      2|    SHAKE_SET_MD(uname, typ)                                                   \
  ------------------
  |  |  459|      2|# define SHAKE_SET_MD(uname, typ) ctx->meth = shake_generic_md;
  ------------------
  489|      2|    return ctx;                                                                \
  490|      2|}

decode_der2key.c:PrivateKeyInfo_der2dh_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:der2key_newctx:
  129|   198k|{
  130|   198k|    struct der2key_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|   198k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   198k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   198k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  131|       |
  132|   198k|    if (ctx != NULL) {
  ------------------
  |  Branch (132:9): [True: 198k, False: 0]
  ------------------
  133|   198k|        ctx->provctx = provctx;
  134|   198k|        ctx->desc = desc;
  135|   198k|    }
  136|   198k|    return ctx;
  137|   198k|}
decode_der2key.c:dh_d2i_PKCS8:
  367|  15.5k|{
  368|  15.5k|    return der2key_decode_p8(der, der_len, ctx,
  369|  15.5k|                             (key_from_pkcs8_t *)ossl_dh_key_from_pkcs8);
  370|  15.5k|}
decode_der2key.c:der2key_decode_p8:
  105|  86.7k|{
  106|  86.7k|    PKCS8_PRIV_KEY_INFO *p8inf = NULL;
  107|  86.7k|    const X509_ALGOR *alg = NULL;
  108|  86.7k|    void *key = NULL;
  109|       |
  110|  86.7k|    if ((p8inf = d2i_PKCS8_PRIV_KEY_INFO(NULL, input_der, input_der_len)) != NULL
  ------------------
  |  Branch (110:9): [True: 982, False: 85.8k]
  ------------------
  111|  86.7k|        && PKCS8_pkey_get0(NULL, NULL, NULL, &alg, p8inf)
  ------------------
  |  Branch (111:12): [True: 982, False: 0]
  ------------------
  112|  86.7k|        && OBJ_obj2nid(alg->algorithm) == ctx->desc->evp_type)
  ------------------
  |  Branch (112:12): [True: 668, False: 314]
  ------------------
  113|    668|        key = key_from_pkcs8(p8inf, PROV_LIBCTX_OF(ctx->provctx), ctx->propq);
  ------------------
  |  |   29|    668|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  114|  86.7k|    PKCS8_PRIV_KEY_INFO_free(p8inf);
  115|       |
  116|  86.7k|    return key;
  117|  86.7k|}
decode_der2key.c:dh_adjust:
  377|     98|{
  378|     98|    ossl_dh_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|     98|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  379|     98|}
decode_der2key.c:der2key_freectx:
  162|   198k|{
  163|   198k|    struct der2key_ctx_st *ctx = vctx;
  164|       |
  165|   198k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|   198k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   198k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   198k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  166|   198k|}
decode_der2key.c:PrivateKeyInfo_der2dh_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:der2key_check_selection:
  170|  2.60k|{
  171|       |    /*
  172|       |     * The selections are kinda sorta "levels", i.e. each selection given
  173|       |     * here is assumed to include those following.
  174|       |     */
  175|  2.60k|    int checks[] = {
  176|  2.60k|        OSSL_KEYMGMT_SELECT_PRIVATE_KEY,
  ------------------
  |  |  567|  2.60k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  177|  2.60k|        OSSL_KEYMGMT_SELECT_PUBLIC_KEY,
  ------------------
  |  |  568|  2.60k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  178|  2.60k|        OSSL_KEYMGMT_SELECT_ALL_PARAMETERS
  ------------------
  |  |  574|  2.60k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  ------------------
  |  |  |  |  569|  2.60k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  |  |  575|  2.60k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  570|  2.60k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
  179|  2.60k|    };
  180|  2.60k|    size_t i;
  181|       |
  182|       |    /* The decoder implementations made here support guessing */
  183|  2.60k|    if (selection == 0)
  ------------------
  |  Branch (183:9): [True: 0, False: 2.60k]
  ------------------
  184|      0|        return 1;
  185|       |
  186|  4.38k|    for (i = 0; i < OSSL_NELEM(checks); i++) {
  ------------------
  |  |   14|  4.38k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (186:17): [True: 4.38k, False: 0]
  ------------------
  187|  4.38k|        int check1 = (selection & checks[i]) != 0;
  188|  4.38k|        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|  4.38k|        if (check1)
  ------------------
  |  Branch (194:13): [True: 2.60k, False: 1.78k]
  ------------------
  195|  2.60k|            return check2;
  196|  4.38k|    }
  197|       |
  198|       |    /* This should be dead code, but just to be safe... */
  199|      0|    return 0;
  200|  2.60k|}
decode_der2key.c:der2key_decode:
  205|   180k|{
  206|   180k|    struct der2key_ctx_st *ctx = vctx;
  207|   180k|    unsigned char *der = NULL;
  208|   180k|    const unsigned char *derp;
  209|   180k|    long der_len = 0;
  210|   180k|    void *key = NULL;
  211|   180k|    int ok = 0;
  212|       |
  213|   180k|    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|   180k|    if (selection == 0)
  ------------------
  |  Branch (222:9): [True: 0, False: 180k]
  ------------------
  223|      0|        selection = ctx->desc->selection_mask;
  224|   180k|    if ((selection & ctx->desc->selection_mask) == 0) {
  ------------------
  |  Branch (224:9): [True: 0, False: 180k]
  ------------------
  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|   180k|    ok = ossl_read_der(ctx->provctx, cin, &der, &der_len);
  230|   180k|    if (!ok)
  ------------------
  |  Branch (230:9): [True: 38.2k, False: 141k]
  ------------------
  231|  38.2k|        goto next;
  232|       |
  233|   141k|    ok = 0; /* Assume that we fail */
  234|       |
  235|   141k|    ERR_set_mark();
  236|   141k|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  567|   141k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (236:9): [True: 141k, False: 660]
  ------------------
  237|   141k|        derp = der;
  238|   141k|        if (ctx->desc->d2i_PKCS8 != NULL) {
  ------------------
  |  Branch (238:13): [True: 86.7k, False: 54.3k]
  ------------------
  239|  86.7k|            key = ctx->desc->d2i_PKCS8(NULL, &derp, der_len, ctx);
  240|  86.7k|            if (ctx->flag_fatal) {
  ------------------
  |  Branch (240:17): [True: 0, False: 86.7k]
  ------------------
  241|      0|                ERR_clear_last_mark();
  242|      0|                goto end;
  243|      0|            }
  244|  86.7k|        } else if (ctx->desc->d2i_private_key != NULL) {
  ------------------
  |  Branch (244:20): [True: 54.3k, False: 0]
  ------------------
  245|  54.3k|            key = ctx->desc->d2i_private_key(NULL, &derp, der_len);
  246|  54.3k|        }
  247|   141k|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (247:13): [True: 138k, False: 2.21k]
  |  Branch (247:28): [True: 138k, False: 0]
  ------------------
  248|   138k|            ERR_clear_last_mark();
  249|   138k|            goto next;
  250|   138k|        }
  251|   141k|    }
  252|  2.87k|    if (key == NULL && (selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
  ------------------
  |  |  568|    660|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (252:9): [True: 660, False: 2.21k]
  |  Branch (252:24): [True: 660, False: 0]
  ------------------
  253|    660|        derp = der;
  254|    660|        if (ctx->desc->d2i_PUBKEY != NULL)
  ------------------
  |  Branch (254:13): [True: 658, False: 2]
  ------------------
  255|    658|            key = ctx->desc->d2i_PUBKEY(NULL, &derp, der_len);
  256|      2|        else if (ctx->desc->d2i_public_key != NULL)
  ------------------
  |  Branch (256:18): [True: 2, False: 0]
  ------------------
  257|      2|            key = ctx->desc->d2i_public_key(NULL, &derp, der_len);
  258|    660|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (258:13): [True: 373, False: 287]
  |  Branch (258:28): [True: 373, False: 0]
  ------------------
  259|    373|            ERR_clear_last_mark();
  260|    373|            goto next;
  261|    373|        }
  262|    660|    }
  263|  2.49k|    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: 2.49k]
  |  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|  2.49k|    if (key == NULL)
  ------------------
  |  Branch (272:9): [True: 0, False: 2.49k]
  ------------------
  273|      0|        ERR_clear_last_mark();
  274|  2.49k|    else
  275|  2.49k|        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|  2.49k|    if (key != NULL
  ------------------
  |  Branch (284:9): [True: 2.49k, False: 0]
  ------------------
  285|  2.49k|        && ctx->desc->check_key != NULL
  ------------------
  |  Branch (285:12): [True: 1.78k, False: 713]
  ------------------
  286|  2.49k|        && !ctx->desc->check_key(key, ctx)) {
  ------------------
  |  Branch (286:12): [True: 591, False: 1.19k]
  ------------------
  287|    591|        ctx->desc->free_key(key);
  288|    591|        key = NULL;
  289|    591|    }
  290|       |
  291|  2.49k|    if (key != NULL && ctx->desc->adjust_key != NULL)
  ------------------
  |  Branch (291:9): [True: 1.90k, False: 591]
  |  Branch (291:24): [True: 1.90k, False: 0]
  ------------------
  292|  1.90k|        ctx->desc->adjust_key(key, ctx);
  293|       |
  294|   180k| next:
  295|       |    /*
  296|       |     * Indicated that we successfully decoded something, or not at all.
  297|       |     * Ending up "empty handed" is not an error.
  298|       |     */
  299|   180k|    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|   180k|    OPENSSL_free(der);
  ------------------
  |  |  115|   180k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   180k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   180k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  307|   180k|    der = NULL;
  308|       |
  309|   180k|    if (key != NULL) {
  ------------------
  |  Branch (309:9): [True: 1.90k, False: 178k]
  ------------------
  310|  1.90k|        OSSL_PARAM params[4];
  311|  1.90k|        int object_type = OSSL_OBJECT_PKEY;
  ------------------
  |  |   29|  1.90k|# define OSSL_OBJECT_PKEY               2 /* EVP_PKEY * */
  ------------------
  312|       |
  313|  1.90k|        params[0] =
  314|  1.90k|            OSSL_PARAM_construct_int(OSSL_OBJECT_PARAM_TYPE, &object_type);
  ------------------
  |  |  331|  1.90k|# define OSSL_OBJECT_PARAM_TYPE "type"
  ------------------
  315|  1.90k|        params[1] =
  316|  1.90k|            OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  328|  1.90k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  317|  1.90k|                                             (char *)ctx->desc->keytype_name,
  318|  1.90k|                                             0);
  319|       |        /* The address of the key becomes the octet string */
  320|  1.90k|        params[2] =
  321|  1.90k|            OSSL_PARAM_construct_octet_string(OSSL_OBJECT_PARAM_REFERENCE,
  ------------------
  |  |  330|  1.90k|# define OSSL_OBJECT_PARAM_REFERENCE "reference"
  ------------------
  322|  1.90k|                                              &key, sizeof(key));
  323|  1.90k|        params[3] = OSSL_PARAM_construct_end();
  324|       |
  325|  1.90k|        ok = data_cb(params, data_cbarg);
  326|  1.90k|    }
  327|       |
  328|   180k| end:
  329|   180k|    ctx->desc->free_key(key);
  330|   180k|    OPENSSL_free(der);
  ------------------
  |  |  115|   180k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|   180k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|   180k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  331|       |
  332|   180k|    return ok;
  333|   180k|}
decode_der2key.c:SubjectPublicKeyInfo_der2dh_newctx:
  762|     77|    {                                                                   \
  763|     77|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|     77|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dh_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:type_specific_params_der2dh_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:DH_der2dh_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2dhx_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2dhx_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dhx_newctx:
  762|     13|    {                                                                   \
  763|     13|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|     13|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dhx_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:type_specific_params_der2dhx_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:DHX_der2dhx_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2dsa_newctx:
  762|  11.4k|    {                                                                   \
  763|  11.4k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  11.4k|    }                                                                   \
decode_der2key.c:dsa_d2i_PKCS8:
  402|  7.99k|{
  403|  7.99k|    return der2key_decode_p8(der, der_len, ctx,
  404|  7.99k|                             (key_from_pkcs8_t *)ossl_dsa_key_from_pkcs8);
  405|  7.99k|}
decode_der2key.c:dsa_adjust:
  412|    605|{
  413|    605|    ossl_dsa_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|    605|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  414|    605|}
decode_der2key.c:PrivateKeyInfo_der2dsa_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dsa_newctx:
  762|     40|    {                                                                   \
  763|     40|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|     40|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2dsa_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:type_specific_der2dsa_newctx:
  762|  11.4k|    {                                                                   \
  763|  11.4k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  11.4k|    }                                                                   \
decode_der2key.c:type_specific_der2dsa_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:DSA_der2dsa_newctx:
  762|  11.4k|    {                                                                   \
  763|  11.4k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  11.4k|    }                                                                   \
decode_der2key.c:DSA_der2dsa_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ec_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:ec_d2i_PKCS8:
  427|  7.54k|{
  428|  7.54k|    return der2key_decode_p8(der, der_len, ctx,
  429|  7.54k|                             (key_from_pkcs8_t *)ossl_ec_key_from_pkcs8);
  430|  7.54k|}
decode_der2key.c:ec_check:
  436|  1.41k|{
  437|       |    /* We're trying to be clever by comparing two truths */
  438|       |
  439|  1.41k|    int sm2 = (EC_KEY_get_flags(key) & EC_FLAG_SM2_RANGE) != 0;
  ------------------
  |  |  962|  1.41k|#  define EC_FLAG_SM2_RANGE              0x0004
  ------------------
  440|       |
  441|  1.41k|    return sm2 == (ctx->desc->evp_type == EVP_PKEY_SM2);
  ------------------
  |  |   71|  1.41k|# define EVP_PKEY_SM2    NID_sm2
  |  |  ------------------
  |  |  |  | 1232|  1.41k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  442|  1.41k|}
decode_der2key.c:ec_adjust:
  445|    820|{
  446|    820|    ossl_ec_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|    820|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  447|    820|}
decode_der2key.c:PrivateKeyInfo_der2ec_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ec_newctx:
  762|    501|    {                                                                   \
  763|    501|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|    501|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ec_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2ec_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2ec_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:EC_der2ec_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:EC_der2ec_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2x25519_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:ecx_d2i_PKCS8:
  457|  32.3k|{
  458|  32.3k|    return der2key_decode_p8(der, der_len, ctx,
  459|  32.3k|                             (key_from_pkcs8_t *)ossl_ecx_key_from_pkcs8);
  460|  32.3k|}
decode_der2key.c:ecx_key_adjust:
  463|     10|{
  464|     10|    ossl_ecx_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|     10|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  465|     10|}
decode_der2key.c:PrivateKeyInfo_der2x25519_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x25519_newctx:
  762|      3|    {                                                                   \
  763|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|      3|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x25519_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2x448_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2x448_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x448_newctx:
  762|      4|    {                                                                   \
  763|      4|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|      4|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2x448_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed25519_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed25519_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
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|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed448_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2ed448_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed448_newctx:
  762|      3|    {                                                                   \
  763|      3|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|      3|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2ed448_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2sm2_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:sm2_d2i_PKCS8:
  516|  8.13k|{
  517|  8.13k|    return der2key_decode_p8(der, der_len, ctx,
  518|  8.13k|                             (key_from_pkcs8_t *)ossl_ec_key_from_pkcs8);
  519|  8.13k|}
decode_der2key.c:PrivateKeyInfo_der2sm2_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2sm2_newctx:
  762|    501|    {                                                                   \
  763|    501|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|    501|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2sm2_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2sm2_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:type_specific_no_pub_der2sm2_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2rsa_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:rsa_d2i_PKCS8:
  537|  15.1k|{
  538|  15.1k|    return der2key_decode_p8(der, der_len, ctx,
  539|  15.1k|                             (key_from_pkcs8_t *)ossl_rsa_key_from_pkcs8);
  540|  15.1k|}
decode_der2key.c:rsa_check:
  546|    374|{
  547|    374|    switch (RSA_test_flags(key, RSA_FLAG_TYPE_MASK)) {
  ------------------
  |  |  117|    374|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  |  Branch (547:13): [True: 0, False: 374]
  ------------------
  548|    371|    case RSA_FLAG_TYPE_RSA:
  ------------------
  |  |  118|    371|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  |  Branch (548:5): [True: 371, False: 3]
  ------------------
  549|    371|        return ctx->desc->evp_type == EVP_PKEY_RSA;
  ------------------
  |  |   60|    371|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|    371|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  550|      3|    case RSA_FLAG_TYPE_RSASSAPSS:
  ------------------
  |  |  119|      3|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (550:5): [True: 3, False: 371]
  ------------------
  551|      3|        return ctx->desc->evp_type == EVP_PKEY_RSA_PSS;
  ------------------
  |  |   62|      3|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      3|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  552|    374|    }
  553|       |
  554|       |    /* Currently unsupported RSA key type */
  555|      0|    return 0;
  556|    374|}
decode_der2key.c:rsa_adjust:
  559|    374|{
  560|    374|    ossl_rsa_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   29|    374|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  561|    374|}
decode_der2key.c:PrivateKeyInfo_der2rsa_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsa_newctx:
  762|     15|    {                                                                   \
  763|     15|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|     15|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsa_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:type_specific_keypair_der2rsa_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:type_specific_keypair_der2rsa_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:RSA_der2rsa_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:RSA_der2rsa_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2rsapss_newctx:
  762|  10.8k|    {                                                                   \
  763|  10.8k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|  10.8k|    }                                                                   \
decode_der2key.c:PrivateKeyInfo_der2rsapss_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsapss_newctx:
  762|      8|    {                                                                   \
  763|      8|        return der2key_newctx(provctx, &kind##_##keytype##_desc);       \
  764|      8|    }                                                                   \
decode_der2key.c:SubjectPublicKeyInfo_der2rsapss_does_selection:
  767|     79|    {                                                                   \
  768|     79|        return der2key_check_selection(selection,                       \
  769|     79|                                       &kind##_##keytype##_desc);       \
  770|     79|    }                                                                   \

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

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

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

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

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

encode_key2any.c:key2any_newctx:
  944|  30.8k|{
  945|  30.8k|    struct key2any_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|  30.8k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  30.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  30.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  946|       |
  947|  30.8k|    if (ctx != NULL) {
  ------------------
  |  Branch (947:9): [True: 30.8k, False: 0]
  ------------------
  948|  30.8k|        ctx->provctx = provctx;
  949|  30.8k|        ctx->save_parameters = 1;
  950|  30.8k|    }
  951|       |
  952|  30.8k|    return ctx;
  953|  30.8k|}
encode_key2any.c:key2any_freectx:
  956|  30.8k|{
  957|  30.8k|    struct key2any_ctx_st *ctx = vctx;
  958|       |
  959|  30.8k|    ossl_pw_clear_passphrase_data(&ctx->pwdata);
  960|  30.8k|    EVP_CIPHER_free(ctx->cipher);
  961|  30.8k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  30.8k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  30.8k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  30.8k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  962|  30.8k|}
encode_key2any.c:key2any_set_ctx_params:
  976|  30.8k|{
  977|  30.8k|    struct key2any_ctx_st *ctx = vctx;
  978|  30.8k|    OSSL_LIB_CTX *libctx = ossl_prov_ctx_get0_libctx(ctx->provctx);
  979|  30.8k|    const OSSL_PARAM *cipherp =
  980|  30.8k|        OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_CIPHER);
  ------------------
  |  |  230|  30.8k|# define OSSL_ENCODER_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  112|  30.8k|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  981|  30.8k|    const OSSL_PARAM *propsp =
  982|  30.8k|        OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_PROPERTIES);
  ------------------
  |  |  232|  30.8k|# define OSSL_ENCODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  117|  30.8k|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  983|  30.8k|    const OSSL_PARAM *save_paramsp =
  984|  30.8k|        OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_SAVE_PARAMETERS);
  ------------------
  |  |  233|  30.8k|# define OSSL_ENCODER_PARAM_SAVE_PARAMETERS "save-parameters"
  ------------------
  985|       |
  986|  30.8k|    if (cipherp != NULL) {
  ------------------
  |  Branch (986:9): [True: 0, False: 30.8k]
  ------------------
  987|      0|        const char *ciphername = NULL;
  988|      0|        const char *props = NULL;
  989|       |
  990|      0|        if (!OSSL_PARAM_get_utf8_string_ptr(cipherp, &ciphername))
  ------------------
  |  Branch (990:13): [True: 0, False: 0]
  ------------------
  991|      0|            return 0;
  992|      0|        if (propsp != NULL && !OSSL_PARAM_get_utf8_string_ptr(propsp, &props))
  ------------------
  |  Branch (992:13): [True: 0, False: 0]
  |  Branch (992:31): [True: 0, False: 0]
  ------------------
  993|      0|            return 0;
  994|       |
  995|      0|        EVP_CIPHER_free(ctx->cipher);
  996|      0|        ctx->cipher = NULL;
  997|      0|        ctx->cipher_intent = ciphername != NULL;
  998|      0|        if (ciphername != NULL
  ------------------
  |  Branch (998:13): [True: 0, False: 0]
  ------------------
  999|      0|            && ((ctx->cipher =
  ------------------
  |  Branch (999:16): [True: 0, False: 0]
  ------------------
 1000|      0|                 EVP_CIPHER_fetch(libctx, ciphername, props)) == NULL))
 1001|      0|            return 0;
 1002|      0|    }
 1003|       |
 1004|  30.8k|    if (save_paramsp != NULL) {
  ------------------
  |  Branch (1004:9): [True: 30.8k, False: 0]
  ------------------
 1005|  30.8k|        if (!OSSL_PARAM_get_int(save_paramsp, &ctx->save_parameters))
  ------------------
  |  Branch (1005:13): [True: 0, False: 30.8k]
  ------------------
 1006|      0|            return 0;
 1007|  30.8k|    }
 1008|  30.8k|    return 1;
 1009|  30.8k|}
encode_key2any.c:rsa_to_type_specific_keypair_der_does_selection:
 1267|    720|    {                                                                       \
 1268|    720|        return key2any_check_selection(selection,                           \
 1269|    720|                                       DO_##kind##_selection_mask);         \
 1270|    720|    }                                                                       \
encode_key2any.c:key2any_check_selection:
 1012|  61.7k|{
 1013|       |    /*
 1014|       |     * The selections are kinda sorta "levels", i.e. each selection given
 1015|       |     * here is assumed to include those following.
 1016|       |     */
 1017|  61.7k|    int checks[] = {
 1018|  61.7k|        OSSL_KEYMGMT_SELECT_PRIVATE_KEY,
  ------------------
  |  |  567|  61.7k|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
 1019|  61.7k|        OSSL_KEYMGMT_SELECT_PUBLIC_KEY,
  ------------------
  |  |  568|  61.7k|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
 1020|  61.7k|        OSSL_KEYMGMT_SELECT_ALL_PARAMETERS
  ------------------
  |  |  574|  61.7k|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  ------------------
  |  |  |  |  569|  61.7k|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  |  |  575|  61.7k|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  570|  61.7k|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
 1021|  61.7k|    };
 1022|  61.7k|    size_t i;
 1023|       |
 1024|       |    /* The decoder implementations made here support guessing */
 1025|  61.7k|    if (selection == 0)
  ------------------
  |  Branch (1025:9): [True: 0, False: 61.7k]
  ------------------
 1026|      0|        return 1;
 1027|       |
 1028|  61.7k|    for (i = 0; i < OSSL_NELEM(checks); i++) {
  ------------------
  |  |   14|  61.7k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1028:17): [True: 61.7k, False: 0]
  ------------------
 1029|  61.7k|        int check1 = (selection & checks[i]) != 0;
 1030|  61.7k|        int check2 = (selection_mask & checks[i]) != 0;
 1031|       |
 1032|       |        /*
 1033|       |         * If the caller asked for the currently checked bit(s), return
 1034|       |         * whether the decoder description says it's supported.
 1035|       |         */
 1036|  61.7k|        if (check1)
  ------------------
  |  Branch (1036:13): [True: 61.7k, False: 0]
  ------------------
 1037|  61.7k|            return check2;
 1038|  61.7k|    }
 1039|       |
 1040|       |    /* This should be dead code, but just to be safe... */
 1041|      0|    return 0;
 1042|  61.7k|}
encode_key2any.c:rsa_to_type_specific_keypair_der_encode:
 1278|    360|    {                                                                       \
 1279|    360|        /* We don't deal with abstract objects */                           \
 1280|    360|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1280:13): [True: 0, False: 360]
  ------------------
 1281|      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)
  |  |  ------------------
  ------------------
 1282|      0|            return 0;                                                       \
 1283|      0|        }                                                                   \
 1284|    360|        DO_##kind(impl, type, output)                                       \
 1285|    360|                                                                            \
 1286|    360|        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)
  |  |  ------------------
  ------------------
 1287|      0|        return 0;                                                           \
 1288|    360|    }                                                                       \
encode_key2any.c:key2any_encode:
 1051|  1.73k|{
 1052|  1.73k|    int ret = 0;
 1053|       |
 1054|  1.73k|    if (key == NULL) {
  ------------------
  |  Branch (1054:9): [True: 0, False: 1.73k]
  ------------------
 1055|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1056|  1.73k|    } else if (writer != NULL
  ------------------
  |  Branch (1056:16): [True: 1.73k, False: 0]
  ------------------
 1057|  1.73k|               && (checker == NULL || checker(key, type))) {
  ------------------
  |  Branch (1057:20): [True: 1.35k, False: 386]
  |  Branch (1057:39): [True: 386, False: 0]
  ------------------
 1058|  1.73k|        BIO *out = ossl_bio_new_from_core_bio(ctx->provctx, cout);
 1059|       |
 1060|  1.73k|        if (out != NULL
  ------------------
  |  Branch (1060:13): [True: 1.73k, False: 0]
  ------------------
 1061|  1.73k|            && (pwcb == NULL
  ------------------
  |  Branch (1061:17): [True: 0, False: 1.73k]
  ------------------
 1062|  1.73k|                || ossl_pw_set_ossl_passphrase_cb(&ctx->pwdata, pwcb, pwcbarg)))
  ------------------
  |  Branch (1062:20): [True: 1.73k, False: 0]
  ------------------
 1063|  1.73k|            ret =
 1064|  1.73k|                writer(out, key, type, pemname, key2paramstring, key2der, ctx);
 1065|       |
 1066|  1.73k|        BIO_free(out);
 1067|  1.73k|    } else {
 1068|      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)
  |  |  ------------------
  ------------------
 1069|      0|    }
 1070|  1.73k|    return ret;
 1071|  1.73k|}
encode_key2any.c:rsa_check_key_type:
  919|    361|{
  920|    361|    switch (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK)) {
  ------------------
  |  |  117|    361|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  |  Branch (920:13): [True: 0, False: 361]
  ------------------
  921|    360|    case RSA_FLAG_TYPE_RSA:
  ------------------
  |  |  118|    360|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  |  Branch (921:5): [True: 360, False: 1]
  ------------------
  922|    360|        return expected_type == EVP_PKEY_RSA;
  ------------------
  |  |   60|    360|# define EVP_PKEY_RSA    NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|    360|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  923|      1|    case RSA_FLAG_TYPE_RSASSAPSS:
  ------------------
  |  |  119|      1|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (923:5): [True: 1, False: 360]
  ------------------
  924|      1|        return expected_type == EVP_PKEY_RSA_PSS;
  ------------------
  |  |   62|      1|# define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      1|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  925|    361|    }
  926|       |
  927|       |    /* Currently unsupported RSA key type */
  928|      0|    return EVP_PKEY_NONE;
  ------------------
  |  |   59|      0|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|      0|#define NID_undef                       0
  |  |  ------------------
  ------------------
  929|    361|}
encode_key2any.c:key_to_type_specific_der_bio:
  377|  1.58k|{
  378|  1.58k|    unsigned char *der = NULL;
  379|  1.58k|    int derlen;
  380|  1.58k|    int ret;
  381|       |
  382|  1.58k|    if ((derlen = k2d(key, &der)) <= 0) {
  ------------------
  |  Branch (382:9): [True: 118, False: 1.46k]
  ------------------
  383|    118|        ERR_raise(ERR_LIB_PROV, ERR_R_PROV_LIB);
  ------------------
  |  |  401|    118|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    118|    (ERR_new(),                                                 \
  |  |  |  |  404|    118|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    118|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    118|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    118|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    118|     ERR_set_error)
  |  |  ------------------
  ------------------
  384|    118|        return 0;
  385|    118|    }
  386|       |
  387|  1.46k|    ret = BIO_write(out, der, derlen);
  388|  1.46k|    OPENSSL_free(der);
  ------------------
  |  |  115|  1.46k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.46k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.46k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  389|  1.46k|    return ret > 0;
  390|  1.58k|}
encode_key2any.c:prepare_rsa_params:
  837|      1|{
  838|      1|    const RSA_PSS_PARAMS_30 *pss = ossl_rsa_get0_pss_params_30((RSA *)rsa);
  839|       |
  840|      1|    *pstr = NULL;
  841|       |
  842|      1|    switch (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK)) {
  ------------------
  |  |  117|      1|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  |  Branch (842:13): [True: 0, False: 1]
  ------------------
  843|      0|    case RSA_FLAG_TYPE_RSA:
  ------------------
  |  |  118|      0|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  |  Branch (843:5): [True: 0, False: 1]
  ------------------
  844|       |        /* If plain RSA, the parameters shall be NULL */
  845|      0|        *pstrtype = V_ASN1_NULL;
  ------------------
  |  |   67|      0|# define V_ASN1_NULL                     5
  ------------------
  846|      0|        return 1;
  847|      1|    case RSA_FLAG_TYPE_RSASSAPSS:
  ------------------
  |  |  119|      1|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (847:5): [True: 1, False: 0]
  ------------------
  848|      1|        if (ossl_rsa_pss_params_30_is_unrestricted(pss)) {
  ------------------
  |  Branch (848:13): [True: 0, False: 1]
  ------------------
  849|      0|            *pstrtype = V_ASN1_UNDEF;
  ------------------
  |  |   60|      0|# define V_ASN1_UNDEF                    -1
  ------------------
  850|      0|            return 1;
  851|      1|        } else {
  852|      1|            ASN1_STRING *astr = NULL;
  853|      1|            WPACKET pkt;
  854|      1|            unsigned char *str = NULL;
  855|      1|            size_t str_sz = 0;
  856|      1|            int i;
  857|       |
  858|      3|            for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (858:25): [True: 2, False: 1]
  ------------------
  859|      2|                switch (i) {
  ------------------
  |  Branch (859:25): [True: 0, False: 2]
  ------------------
  860|      1|                case 0:
  ------------------
  |  Branch (860:17): [True: 1, False: 1]
  ------------------
  861|      1|                    if (!WPACKET_init_null_der(&pkt))
  ------------------
  |  Branch (861:25): [True: 0, False: 1]
  ------------------
  862|      0|                        goto err;
  863|      1|                    break;
  864|      1|                case 1:
  ------------------
  |  Branch (864:17): [True: 1, False: 1]
  ------------------
  865|      1|                    if ((str = OPENSSL_malloc(str_sz)) == NULL
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  |  Branch (865:25): [True: 0, False: 1]
  ------------------
  866|      1|                        || !WPACKET_init_der(&pkt, str, str_sz)) {
  ------------------
  |  Branch (866:28): [True: 0, False: 1]
  ------------------
  867|      0|                        WPACKET_cleanup(&pkt);
  868|      0|                        goto err;
  869|      0|                    }
  870|      1|                    break;
  871|      2|                }
  872|      2|                if (!ossl_DER_w_RSASSA_PSS_params(&pkt, -1, pss)
  ------------------
  |  Branch (872:21): [True: 0, False: 2]
  ------------------
  873|      2|                    || !WPACKET_finish(&pkt)
  ------------------
  |  Branch (873:24): [True: 0, False: 2]
  ------------------
  874|      2|                    || !WPACKET_get_total_written(&pkt, &str_sz)) {
  ------------------
  |  Branch (874:24): [True: 0, False: 2]
  ------------------
  875|      0|                    WPACKET_cleanup(&pkt);
  876|      0|                    goto err;
  877|      0|                }
  878|      2|                WPACKET_cleanup(&pkt);
  879|       |
  880|       |                /*
  881|       |                 * If no PSS parameters are going to be written, there's no
  882|       |                 * point going for another iteration.
  883|       |                 * This saves us from getting |str| allocated just to have it
  884|       |                 * immediately de-allocated.
  885|       |                 */
  886|      2|                if (str_sz == 0)
  ------------------
  |  Branch (886:21): [True: 0, False: 2]
  ------------------
  887|      0|                    break;
  888|      2|            }
  889|       |
  890|      1|            if ((astr = ASN1_STRING_new()) == NULL)
  ------------------
  |  Branch (890:17): [True: 0, False: 1]
  ------------------
  891|      0|                goto err;
  892|      1|            *pstrtype = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|      1|# define V_ASN1_SEQUENCE                 16
  ------------------
  893|      1|            ASN1_STRING_set0(astr, str, (int)str_sz);
  894|      1|            *pstr = astr;
  895|       |
  896|      1|            return 1;
  897|      0|         err:
  898|      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__
  |  |  ------------------
  ------------------
  899|      0|            return 0;
  900|      1|        }
  901|      1|    }
  902|       |
  903|       |    /* Currently unsupported RSA key type */
  904|      0|    return 0;
  905|      1|}
encode_key2any.c:dh_check_key_type:
  529|     25|{
  530|     25|    int type =
  531|     25|        DH_test_flags(dh, DH_FLAG_TYPE_DHX) ? EVP_PKEY_DHX : EVP_PKEY_DH;
  ------------------
  |  |  112|     25|#  define DH_FLAG_TYPE_DHX              0x1000
  ------------------
                      DH_test_flags(dh, DH_FLAG_TYPE_DHX) ? EVP_PKEY_DHX : EVP_PKEY_DH;
  ------------------
  |  |   69|     25|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5299|     25|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
                      DH_test_flags(dh, DH_FLAG_TYPE_DHX) ? EVP_PKEY_DHX : EVP_PKEY_DH;
  ------------------
  |  |   68|      0|# define EVP_PKEY_DH     NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|      0|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
  |  Branch (531:9): [True: 25, False: 0]
  ------------------
  532|       |
  533|     25|    return type == expected_type;
  534|     25|}
encode_key2any.c:dhx_to_type_specific_params_der_does_selection:
 1267|    300|    {                                                                       \
 1268|    300|        return key2any_check_selection(selection,                           \
 1269|    300|                                       DO_##kind##_selection_mask);         \
 1270|    300|    }                                                                       \
encode_key2any.c:dsa_to_type_specific_der_does_selection:
 1267|  1.20k|    {                                                                       \
 1268|  1.20k|        return key2any_check_selection(selection,                           \
 1269|  1.20k|                                       DO_##kind##_selection_mask);         \
 1270|  1.20k|    }                                                                       \
encode_key2any.c:dsa_to_type_specific_der_encode:
 1278|    604|    {                                                                       \
 1279|    604|        /* We don't deal with abstract objects */                           \
 1280|    604|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1280:13): [True: 0, False: 604]
  ------------------
 1281|      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)
  |  |  ------------------
  ------------------
 1282|      0|            return 0;                                                       \
 1283|      0|        }                                                                   \
 1284|    604|        DO_##kind(impl, type, output)                                       \
 1285|    604|                                                                            \
 1286|    604|        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)
  |  |  ------------------
  ------------------
 1287|      0|        return 0;                                                           \
 1288|    604|    }                                                                       \
encode_key2any.c:ec_to_type_specific_no_pub_der_does_selection:
 1267|  1.34k|    {                                                                       \
 1268|  1.34k|        return key2any_check_selection(selection,                           \
 1269|  1.34k|                                       DO_##kind##_selection_mask);         \
 1270|  1.34k|    }                                                                       \
encode_key2any.c:ec_to_type_specific_no_pub_der_encode:
 1278|    615|    {                                                                       \
 1279|    615|        /* We don't deal with abstract objects */                           \
 1280|    615|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1280:13): [True: 0, False: 615]
  ------------------
 1281|      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)
  |  |  ------------------
  ------------------
 1282|      0|            return 0;                                                       \
 1283|      0|        }                                                                   \
 1284|    615|        DO_##kind(impl, type, output)                                       \
 1285|    615|                                                                            \
 1286|    615|        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)
  |  |  ------------------
  ------------------
 1287|      0|        return 0;                                                           \
 1288|    615|    }                                                                       \
encode_key2any.c:prepare_ec_params:
  670|    118|{
  671|    118|    int curve_nid;
  672|    118|    const EC_GROUP *group = EC_KEY_get0_group(eckey);
  673|    118|    ASN1_OBJECT *params = NULL;
  674|       |
  675|    118|    if (group == NULL)
  ------------------
  |  Branch (675:9): [True: 0, False: 118]
  ------------------
  676|      0|        return 0;
  677|    118|    curve_nid = EC_GROUP_get_curve_name(group);
  678|    118|    if (curve_nid != NID_undef) {
  ------------------
  |  |   18|    118|#define NID_undef                       0
  ------------------
  |  Branch (678:9): [True: 72, False: 46]
  ------------------
  679|     72|        params = OBJ_nid2obj(curve_nid);
  680|     72|        if (params == NULL)
  ------------------
  |  Branch (680:13): [True: 0, False: 72]
  ------------------
  681|      0|            return 0;
  682|     72|    }
  683|       |
  684|    118|    if (curve_nid != NID_undef
  ------------------
  |  |   18|    236|#define NID_undef                       0
  ------------------
  |  Branch (684:9): [True: 72, False: 46]
  ------------------
  685|    118|        && (EC_GROUP_get_asn1_flag(group) & OPENSSL_EC_NAMED_CURVE)) {
  ------------------
  |  |   31|     72|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  |  Branch (685:12): [True: 72, False: 0]
  ------------------
  686|       |        /* The CHOICE came to namedCurve */
  687|     72|        if (OBJ_length(params) == 0) {
  ------------------
  |  Branch (687:13): [True: 0, False: 72]
  ------------------
  688|       |            /* Some curves might not have an associated OID */
  689|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_OID);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|            ASN1_OBJECT_free(params);
  691|      0|            return 0;
  692|      0|        }
  693|     72|        *pstr = params;
  694|     72|        *pstrtype = V_ASN1_OBJECT;
  ------------------
  |  |   68|     72|# define V_ASN1_OBJECT                   6
  ------------------
  695|     72|        return 1;
  696|     72|    } else {
  697|       |        /* The CHOICE came to ecParameters */
  698|     46|        return prepare_ec_explicit_params(eckey, pstr, pstrtype);
  699|     46|    }
  700|    118|}
encode_key2any.c:prepare_ec_explicit_params:
  644|     46|{
  645|     46|    ASN1_STRING *params = ASN1_STRING_new();
  646|       |
  647|     46|    if (params == NULL) {
  ------------------
  |  Branch (647:9): [True: 0, False: 46]
  ------------------
  648|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  649|      0|        return 0;
  650|      0|    }
  651|       |
  652|     46|    params->length = i2d_ECParameters(eckey, &params->data);
  653|     46|    if (params->length <= 0) {
  ------------------
  |  Branch (653:9): [True: 0, False: 46]
  ------------------
  654|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  655|      0|        ASN1_STRING_free(params);
  656|      0|        return 0;
  657|      0|    }
  658|       |
  659|     46|    *pstrtype = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|     46|# define V_ASN1_SEQUENCE                 16
  ------------------
  660|     46|    *pstr = params;
  661|     46|    return 1;
  662|     46|}
encode_key2any.c:sm2_to_type_specific_no_pub_der_does_selection:
 1267|     17|    {                                                                       \
 1268|     17|        return key2any_check_selection(selection,                           \
 1269|     17|                                       DO_##kind##_selection_mask);         \
 1270|     17|    }                                                                       \
encode_key2any.c:sm2_to_type_specific_no_pub_der_encode:
 1278|      8|    {                                                                       \
 1279|      8|        /* We don't deal with abstract objects */                           \
 1280|      8|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1280:13): [True: 0, False: 8]
  ------------------
 1281|      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)
  |  |  ------------------
  ------------------
 1282|      0|            return 0;                                                       \
 1283|      0|        }                                                                   \
 1284|      8|        DO_##kind(impl, type, output)                                       \
 1285|      8|                                                                            \
 1286|      8|        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)
  |  |  ------------------
  ------------------
 1287|      0|        return 0;                                                           \
 1288|      8|    }                                                                       \
encode_key2any.c:rsa_to_type_specific_keypair_pem_does_selection:
 1267|    720|    {                                                                       \
 1268|    720|        return key2any_check_selection(selection,                           \
 1269|    720|                                       DO_##kind##_selection_mask);         \
 1270|    720|    }                                                                       \
encode_key2any.c:dhx_to_type_specific_params_pem_does_selection:
 1267|    300|    {                                                                       \
 1268|    300|        return key2any_check_selection(selection,                           \
 1269|    300|                                       DO_##kind##_selection_mask);         \
 1270|    300|    }                                                                       \
encode_key2any.c:dsa_to_type_specific_pem_does_selection:
 1267|  1.20k|    {                                                                       \
 1268|  1.20k|        return key2any_check_selection(selection,                           \
 1269|  1.20k|                                       DO_##kind##_selection_mask);         \
 1270|  1.20k|    }                                                                       \
encode_key2any.c:ec_to_type_specific_no_pub_pem_does_selection:
 1267|  1.34k|    {                                                                       \
 1268|  1.34k|        return key2any_check_selection(selection,                           \
 1269|  1.34k|                                       DO_##kind##_selection_mask);         \
 1270|  1.34k|    }                                                                       \
encode_key2any.c:sm2_to_type_specific_no_pub_pem_does_selection:
 1267|     17|    {                                                                       \
 1268|     17|        return key2any_check_selection(selection,                           \
 1269|     17|                                       DO_##kind##_selection_mask);         \
 1270|     17|    }                                                                       \
encode_key2any.c:rsa_to_EncryptedPrivateKeyInfo_der_does_selection:
 1267|    720|    {                                                                       \
 1268|    720|        return key2any_check_selection(selection,                           \
 1269|    720|                                       DO_##kind##_selection_mask);         \
 1270|    720|    }                                                                       \
encode_key2any.c:key_to_p8info:
   83|    151|{
   84|       |    /* der, derlen store the key DER output and its length */
   85|    151|    unsigned char *der = NULL;
   86|    151|    int derlen;
   87|       |    /* The final PKCS#8 info */
   88|    151|    PKCS8_PRIV_KEY_INFO *p8info = NULL;
   89|       |
   90|    151|    if ((p8info = PKCS8_PRIV_KEY_INFO_new()) == NULL
  ------------------
  |  Branch (90:9): [True: 0, False: 151]
  ------------------
   91|    151|        || (derlen = k2d(key, &der)) <= 0
  ------------------
  |  Branch (91:12): [True: 118, False: 33]
  ------------------
   92|    151|        || !PKCS8_pkey_set0(p8info, OBJ_nid2obj(key_nid), 0,
  ------------------
  |  Branch (92:12): [True: 0, False: 33]
  ------------------
   93|    118|                            params_type, params, der, derlen)) {
   94|    118|        ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|    118|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    118|    (ERR_new(),                                                 \
  |  |  |  |  404|    118|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    118|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    118|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    118|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    118|     ERR_set_error)
  |  |  ------------------
  ------------------
   95|    118|        PKCS8_PRIV_KEY_INFO_free(p8info);
   96|    118|        OPENSSL_free(der);
  ------------------
  |  |  115|    118|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    118|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    118|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   97|    118|        p8info = NULL;
   98|    118|    }
   99|       |
  100|    151|    return p8info;
  101|    151|}
encode_key2any.c:free_asn1_data:
   69|    118|{
   70|    118|    switch (type) {
  ------------------
  |  Branch (70:13): [True: 0, False: 118]
  ------------------
   71|     72|    case V_ASN1_OBJECT:
  ------------------
  |  |   68|     72|# define V_ASN1_OBJECT                   6
  ------------------
  |  Branch (71:5): [True: 72, False: 46]
  ------------------
   72|     72|        ASN1_OBJECT_free(data);
   73|     72|        break;
   74|     46|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   74|     46|# define V_ASN1_SEQUENCE                 16
  ------------------
  |  Branch (74:5): [True: 46, False: 72]
  ------------------
   75|     46|        ASN1_STRING_free(data);
   76|     46|        break;
   77|    118|    }
   78|    118|}
encode_key2any.c:rsa_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1267|    720|    {                                                                       \
 1268|    720|        return key2any_check_selection(selection,                           \
 1269|    720|                                       DO_##kind##_selection_mask);         \
 1270|    720|    }                                                                       \
encode_key2any.c:rsa_to_PrivateKeyInfo_der_does_selection:
 1267|    720|    {                                                                       \
 1268|    720|        return key2any_check_selection(selection,                           \
 1269|    720|                                       DO_##kind##_selection_mask);         \
 1270|    720|    }                                                                       \
encode_key2any.c:key_to_pki_der_priv_bio:
  247|    151|{
  248|    151|    int ret = 0;
  249|    151|    void *str = NULL;
  250|    151|    int strtype = V_ASN1_UNDEF;
  ------------------
  |  |   60|    151|# define V_ASN1_UNDEF                    -1
  ------------------
  251|    151|    PKCS8_PRIV_KEY_INFO *p8info;
  252|       |
  253|    151|    if (ctx->cipher_intent)
  ------------------
  |  Branch (253:9): [True: 0, False: 151]
  ------------------
  254|      0|        return key_to_epki_der_priv_bio(out, key, key_nid, pemname,
  255|      0|                                        p2s, k2d, ctx);
  256|       |
  257|    151|    if (p2s != NULL && !p2s(key, key_nid, ctx->save_parameters,
  ------------------
  |  Branch (257:9): [True: 144, False: 7]
  |  Branch (257:24): [True: 0, False: 144]
  ------------------
  258|    144|                            &str, &strtype))
  259|      0|        return 0;
  260|       |
  261|    151|    p8info = key_to_p8info(key, key_nid, str, strtype, k2d);
  262|       |
  263|    151|    if (p8info != NULL)
  ------------------
  |  Branch (263:9): [True: 33, False: 118]
  ------------------
  264|     33|        ret = i2d_PKCS8_PRIV_KEY_INFO_bio(out, p8info);
  265|    118|    else
  266|    118|        free_asn1_data(strtype, str);
  267|       |
  268|    151|    PKCS8_PRIV_KEY_INFO_free(p8info);
  269|       |
  270|    151|    return ret;
  271|    151|}
encode_key2any.c:rsa_to_PrivateKeyInfo_pem_does_selection:
 1267|    720|    {                                                                       \
 1268|    720|        return key2any_check_selection(selection,                           \
 1269|    720|                                       DO_##kind##_selection_mask);         \
 1270|    720|    }                                                                       \
encode_key2any.c:rsa_to_SubjectPublicKeyInfo_der_does_selection:
 1267|  2.88k|    {                                                                       \
 1268|  2.88k|        return key2any_check_selection(selection,                           \
 1269|  2.88k|                                       DO_##kind##_selection_mask);         \
 1270|  2.88k|    }                                                                       \
encode_key2any.c:rsa_to_SubjectPublicKeyInfo_pem_does_selection:
 1267|  2.88k|    {                                                                       \
 1268|  2.88k|        return key2any_check_selection(selection,                           \
 1269|  2.88k|                                       DO_##kind##_selection_mask);         \
 1270|  2.88k|    }                                                                       \
encode_key2any.c:rsapss_to_EncryptedPrivateKeyInfo_der_does_selection:
 1267|      3|    {                                                                       \
 1268|      3|        return key2any_check_selection(selection,                           \
 1269|      3|                                       DO_##kind##_selection_mask);         \
 1270|      3|    }                                                                       \
encode_key2any.c:rsapss_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1267|      3|    {                                                                       \
 1268|      3|        return key2any_check_selection(selection,                           \
 1269|      3|                                       DO_##kind##_selection_mask);         \
 1270|      3|    }                                                                       \
encode_key2any.c:rsapss_to_PrivateKeyInfo_der_does_selection:
 1267|      3|    {                                                                       \
 1268|      3|        return key2any_check_selection(selection,                           \
 1269|      3|                                       DO_##kind##_selection_mask);         \
 1270|      3|    }                                                                       \
encode_key2any.c:rsapss_to_PrivateKeyInfo_der_encode:
 1278|      1|    {                                                                       \
 1279|      1|        /* We don't deal with abstract objects */                           \
 1280|      1|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1280:13): [True: 0, False: 1]
  ------------------
 1281|      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)
  |  |  ------------------
  ------------------
 1282|      0|            return 0;                                                       \
 1283|      0|        }                                                                   \
 1284|      1|        DO_##kind(impl, type, output)                                       \
 1285|      1|                                                                            \
 1286|      1|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1287|      0|        return 0;                                                           \
 1288|      1|    }                                                                       \
encode_key2any.c:rsapss_to_PrivateKeyInfo_pem_does_selection:
 1267|      3|    {                                                                       \
 1268|      3|        return key2any_check_selection(selection,                           \
 1269|      3|                                       DO_##kind##_selection_mask);         \
 1270|      3|    }                                                                       \
encode_key2any.c:rsapss_to_SubjectPublicKeyInfo_der_does_selection:
 1267|     12|    {                                                                       \
 1268|     12|        return key2any_check_selection(selection,                           \
 1269|     12|                                       DO_##kind##_selection_mask);         \
 1270|     12|    }                                                                       \
encode_key2any.c:rsapss_to_SubjectPublicKeyInfo_pem_does_selection:
 1267|     12|    {                                                                       \
 1268|     12|        return key2any_check_selection(selection,                           \
 1269|     12|                                       DO_##kind##_selection_mask);         \
 1270|     12|    }                                                                       \
encode_key2any.c:prepare_dh_params:
  445|     25|{
  446|     25|    ASN1_STRING *params = ASN1_STRING_new();
  447|       |
  448|     25|    if (params == NULL) {
  ------------------
  |  Branch (448:9): [True: 0, False: 25]
  ------------------
  449|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  450|      0|        return 0;
  451|      0|    }
  452|       |
  453|     25|    if (nid == EVP_PKEY_DHX)
  ------------------
  |  |   69|     25|# define EVP_PKEY_DHX    NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5299|     25|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (453:9): [True: 25, False: 0]
  ------------------
  454|     25|        params->length = i2d_DHxparams(dh, &params->data);
  455|      0|    else
  456|      0|        params->length = i2d_DHparams(dh, &params->data);
  457|       |
  458|     25|    if (params->length <= 0) {
  ------------------
  |  Branch (458:9): [True: 0, False: 25]
  ------------------
  459|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  460|      0|        ASN1_STRING_free(params);
  461|      0|        return 0;
  462|      0|    }
  463|     25|    params->type = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|     25|# define V_ASN1_SEQUENCE                 16
  ------------------
  464|       |
  465|     25|    *pstr = params;
  466|     25|    *pstrtype = V_ASN1_SEQUENCE;
  ------------------
  |  |   74|     25|# define V_ASN1_SEQUENCE                 16
  ------------------
  467|     25|    return 1;
  468|     25|}
encode_key2any.c:dh_pki_priv_to_der:
  492|     25|{
  493|     25|    const BIGNUM *bn = NULL;
  494|     25|    ASN1_INTEGER *priv_key = NULL;
  495|     25|    int ret;
  496|       |
  497|     25|    if ((bn = DH_get0_priv_key(dh)) == NULL) {
  ------------------
  |  Branch (497:9): [True: 0, False: 25]
  ------------------
  498|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  499|      0|        return 0;
  500|      0|    }
  501|     25|    if ((priv_key = BN_to_ASN1_INTEGER(bn, NULL)) == NULL) {
  ------------------
  |  Branch (501:9): [True: 0, False: 25]
  ------------------
  502|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_BN_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  503|      0|        return 0;
  504|      0|    }
  505|       |
  506|     25|    ret = i2d_ASN1_INTEGER(priv_key, pder);
  507|       |
  508|     25|    ASN1_STRING_clear_free(priv_key);
  509|     25|    return ret;
  510|     25|}
encode_key2any.c:dhx_to_EncryptedPrivateKeyInfo_der_does_selection:
 1267|     75|    {                                                                       \
 1268|     75|        return key2any_check_selection(selection,                           \
 1269|     75|                                       DO_##kind##_selection_mask);         \
 1270|     75|    }                                                                       \
encode_key2any.c:dhx_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1267|     75|    {                                                                       \
 1268|     75|        return key2any_check_selection(selection,                           \
 1269|     75|                                       DO_##kind##_selection_mask);         \
 1270|     75|    }                                                                       \
encode_key2any.c:dhx_to_PrivateKeyInfo_der_does_selection:
 1267|     75|    {                                                                       \
 1268|     75|        return key2any_check_selection(selection,                           \
 1269|     75|                                       DO_##kind##_selection_mask);         \
 1270|     75|    }                                                                       \
encode_key2any.c:dhx_to_PrivateKeyInfo_der_encode:
 1278|     25|    {                                                                       \
 1279|     25|        /* We don't deal with abstract objects */                           \
 1280|     25|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1280:13): [True: 0, False: 25]
  ------------------
 1281|      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)
  |  |  ------------------
  ------------------
 1282|      0|            return 0;                                                       \
 1283|      0|        }                                                                   \
 1284|     25|        DO_##kind(impl, type, output)                                       \
 1285|     25|                                                                            \
 1286|     25|        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)
  |  |  ------------------
  ------------------
 1287|      0|        return 0;                                                           \
 1288|     25|    }                                                                       \
encode_key2any.c:dhx_to_PrivateKeyInfo_pem_does_selection:
 1267|     75|    {                                                                       \
 1268|     75|        return key2any_check_selection(selection,                           \
 1269|     75|                                       DO_##kind##_selection_mask);         \
 1270|     75|    }                                                                       \
encode_key2any.c:dhx_to_SubjectPublicKeyInfo_der_does_selection:
 1267|    300|    {                                                                       \
 1268|    300|        return key2any_check_selection(selection,                           \
 1269|    300|                                       DO_##kind##_selection_mask);         \
 1270|    300|    }                                                                       \
encode_key2any.c:dhx_to_SubjectPublicKeyInfo_pem_does_selection:
 1267|    300|    {                                                                       \
 1268|    300|        return key2any_check_selection(selection,                           \
 1269|    300|                                       DO_##kind##_selection_mask);         \
 1270|    300|    }                                                                       \
encode_key2any.c:dsa_to_EncryptedPrivateKeyInfo_der_does_selection:
 1267|  1.20k|    {                                                                       \
 1268|  1.20k|        return key2any_check_selection(selection,                           \
 1269|  1.20k|                                       DO_##kind##_selection_mask);         \
 1270|  1.20k|    }                                                                       \
encode_key2any.c:dsa_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1267|  1.20k|    {                                                                       \
 1268|  1.20k|        return key2any_check_selection(selection,                           \
 1269|  1.20k|                                       DO_##kind##_selection_mask);         \
 1270|  1.20k|    }                                                                       \
encode_key2any.c:dsa_to_PrivateKeyInfo_der_does_selection:
 1267|  1.20k|    {                                                                       \
 1268|  1.20k|        return key2any_check_selection(selection,                           \
 1269|  1.20k|                                       DO_##kind##_selection_mask);         \
 1270|  1.20k|    }                                                                       \
encode_key2any.c:dsa_to_PrivateKeyInfo_pem_does_selection:
 1267|  1.20k|    {                                                                       \
 1268|  1.20k|        return key2any_check_selection(selection,                           \
 1269|  1.20k|                                       DO_##kind##_selection_mask);         \
 1270|  1.20k|    }                                                                       \
encode_key2any.c:dsa_to_SubjectPublicKeyInfo_der_does_selection:
 1267|  7.24k|    {                                                                       \
 1268|  7.24k|        return key2any_check_selection(selection,                           \
 1269|  7.24k|                                       DO_##kind##_selection_mask);         \
 1270|  7.24k|    }                                                                       \
encode_key2any.c:dsa_to_SubjectPublicKeyInfo_pem_does_selection:
 1267|  7.24k|    {                                                                       \
 1268|  7.24k|        return key2any_check_selection(selection,                           \
 1269|  7.24k|                                       DO_##kind##_selection_mask);         \
 1270|  7.24k|    }                                                                       \
encode_key2any.c:ec_to_EncryptedPrivateKeyInfo_der_does_selection:
 1267|  1.34k|    {                                                                       \
 1268|  1.34k|        return key2any_check_selection(selection,                           \
 1269|  1.34k|                                       DO_##kind##_selection_mask);         \
 1270|  1.34k|    }                                                                       \
encode_key2any.c:ec_pki_priv_to_der:
  712|    118|{
  713|    118|    EC_KEY *eckey = (EC_KEY *)veckey;
  714|    118|    unsigned int old_flags;
  715|    118|    int ret = 0;
  716|       |
  717|       |    /*
  718|       |     * For PKCS8 the curve name appears in the PKCS8_PRIV_KEY_INFO object
  719|       |     * as the pkeyalg->parameter field. (For a named curve this is an OID)
  720|       |     * The pkey field is an octet string that holds the encoded
  721|       |     * ECPrivateKey SEQUENCE with the optional parameters field omitted.
  722|       |     * We omit this by setting the EC_PKEY_NO_PARAMETERS flag.
  723|       |     */
  724|    118|    old_flags = EC_KEY_get_enc_flags(eckey); /* save old flags */
  725|    118|    EC_KEY_set_enc_flags(eckey, old_flags | EC_PKEY_NO_PARAMETERS);
  ------------------
  |  |  958|    118|#  define EC_PKEY_NO_PARAMETERS   0x001
  ------------------
  726|    118|    ret = i2d_ECPrivateKey(eckey, pder);
  727|    118|    EC_KEY_set_enc_flags(eckey, old_flags); /* restore old flags */
  728|    118|    return ret; /* return the length of the der encoded data */
  729|    118|}
encode_key2any.c:ec_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1267|  1.34k|    {                                                                       \
 1268|  1.34k|        return key2any_check_selection(selection,                           \
 1269|  1.34k|                                       DO_##kind##_selection_mask);         \
 1270|  1.34k|    }                                                                       \
encode_key2any.c:ec_to_PrivateKeyInfo_der_does_selection:
 1267|  1.34k|    {                                                                       \
 1268|  1.34k|        return key2any_check_selection(selection,                           \
 1269|  1.34k|                                       DO_##kind##_selection_mask);         \
 1270|  1.34k|    }                                                                       \
encode_key2any.c:ec_to_PrivateKeyInfo_der_encode:
 1278|    117|    {                                                                       \
 1279|    117|        /* We don't deal with abstract objects */                           \
 1280|    117|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1280:13): [True: 0, False: 117]
  ------------------
 1281|      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)
  |  |  ------------------
  ------------------
 1282|      0|            return 0;                                                       \
 1283|      0|        }                                                                   \
 1284|    117|        DO_##kind(impl, type, output)                                       \
 1285|    117|                                                                            \
 1286|    117|        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)
  |  |  ------------------
  ------------------
 1287|      0|        return 0;                                                           \
 1288|    117|    }                                                                       \
encode_key2any.c:ec_to_PrivateKeyInfo_pem_does_selection:
 1267|  1.34k|    {                                                                       \
 1268|  1.34k|        return key2any_check_selection(selection,                           \
 1269|  1.34k|                                       DO_##kind##_selection_mask);         \
 1270|  1.34k|    }                                                                       \
encode_key2any.c:ec_to_SubjectPublicKeyInfo_der_does_selection:
 1267|  4.04k|    {                                                                       \
 1268|  4.04k|        return key2any_check_selection(selection,                           \
 1269|  4.04k|                                       DO_##kind##_selection_mask);         \
 1270|  4.04k|    }                                                                       \
encode_key2any.c:ec_to_SubjectPublicKeyInfo_pem_does_selection:
 1267|  4.04k|    {                                                                       \
 1268|  4.04k|        return key2any_check_selection(selection,                           \
 1269|  4.04k|                                       DO_##kind##_selection_mask);         \
 1270|  4.04k|    }                                                                       \
encode_key2any.c:sm2_to_EncryptedPrivateKeyInfo_der_does_selection:
 1267|     17|    {                                                                       \
 1268|     17|        return key2any_check_selection(selection,                           \
 1269|     17|                                       DO_##kind##_selection_mask);         \
 1270|     17|    }                                                                       \
encode_key2any.c:sm2_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1267|     17|    {                                                                       \
 1268|     17|        return key2any_check_selection(selection,                           \
 1269|     17|                                       DO_##kind##_selection_mask);         \
 1270|     17|    }                                                                       \
encode_key2any.c:sm2_to_PrivateKeyInfo_der_does_selection:
 1267|     17|    {                                                                       \
 1268|     17|        return key2any_check_selection(selection,                           \
 1269|     17|                                       DO_##kind##_selection_mask);         \
 1270|     17|    }                                                                       \
encode_key2any.c:sm2_to_PrivateKeyInfo_der_encode:
 1278|      1|    {                                                                       \
 1279|      1|        /* We don't deal with abstract objects */                           \
 1280|      1|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1280:13): [True: 0, False: 1]
  ------------------
 1281|      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)
  |  |  ------------------
  ------------------
 1282|      0|            return 0;                                                       \
 1283|      0|        }                                                                   \
 1284|      1|        DO_##kind(impl, type, output)                                       \
 1285|      1|                                                                            \
 1286|      1|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1287|      0|        return 0;                                                           \
 1288|      1|    }                                                                       \
encode_key2any.c:sm2_to_PrivateKeyInfo_pem_does_selection:
 1267|     17|    {                                                                       \
 1268|     17|        return key2any_check_selection(selection,                           \
 1269|     17|                                       DO_##kind##_selection_mask);         \
 1270|     17|    }                                                                       \
encode_key2any.c:sm2_to_SubjectPublicKeyInfo_der_does_selection:
 1267|     34|    {                                                                       \
 1268|     34|        return key2any_check_selection(selection,                           \
 1269|     34|                                       DO_##kind##_selection_mask);         \
 1270|     34|    }                                                                       \
encode_key2any.c:sm2_to_SubjectPublicKeyInfo_pem_does_selection:
 1267|     34|    {                                                                       \
 1268|     34|        return key2any_check_selection(selection,                           \
 1269|     34|                                       DO_##kind##_selection_mask);         \
 1270|     34|    }                                                                       \
encode_key2any.c:ed25519_to_EncryptedPrivateKeyInfo_der_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:ecx_pki_priv_to_der:
  781|      7|{
  782|      7|    const ECX_KEY *ecxkey = vecxkey;
  783|      7|    ASN1_OCTET_STRING oct;
  784|      7|    int keybloblen;
  785|       |
  786|      7|    if (ecxkey == NULL || ecxkey->privkey == NULL) {
  ------------------
  |  Branch (786:9): [True: 0, False: 7]
  |  Branch (786:27): [True: 0, False: 7]
  ------------------
  787|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  788|      0|        return 0;
  789|      0|    }
  790|       |
  791|      7|    oct.data = ecxkey->privkey;
  792|      7|    oct.length = ecxkey->keylen;
  793|      7|    oct.flags = 0;
  794|       |
  795|      7|    keybloblen = i2d_ASN1_OCTET_STRING(&oct, pder);
  796|      7|    if (keybloblen < 0) {
  ------------------
  |  Branch (796:9): [True: 0, False: 7]
  ------------------
  797|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_ASN1_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  798|      0|        return 0;
  799|      0|    }
  800|       |
  801|      7|    return keybloblen;
  802|      7|}
encode_key2any.c:ed25519_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:ed25519_to_PrivateKeyInfo_der_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:ed25519_to_PrivateKeyInfo_der_encode:
 1278|      2|    {                                                                       \
 1279|      2|        /* We don't deal with abstract objects */                           \
 1280|      2|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1280:13): [True: 0, False: 2]
  ------------------
 1281|      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)
  |  |  ------------------
  ------------------
 1282|      0|            return 0;                                                       \
 1283|      0|        }                                                                   \
 1284|      2|        DO_##kind(impl, type, output)                                       \
 1285|      2|                                                                            \
 1286|      2|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1287|      0|        return 0;                                                           \
 1288|      2|    }                                                                       \
encode_key2any.c:ed25519_to_PrivateKeyInfo_pem_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:ed25519_to_SubjectPublicKeyInfo_der_does_selection:
 1267|     12|    {                                                                       \
 1268|     12|        return key2any_check_selection(selection,                           \
 1269|     12|                                       DO_##kind##_selection_mask);         \
 1270|     12|    }                                                                       \
encode_key2any.c:ed25519_to_SubjectPublicKeyInfo_pem_does_selection:
 1267|     12|    {                                                                       \
 1268|     12|        return key2any_check_selection(selection,                           \
 1269|     12|                                       DO_##kind##_selection_mask);         \
 1270|     12|    }                                                                       \
encode_key2any.c:ed448_to_EncryptedPrivateKeyInfo_der_does_selection:
 1267|      3|    {                                                                       \
 1268|      3|        return key2any_check_selection(selection,                           \
 1269|      3|                                       DO_##kind##_selection_mask);         \
 1270|      3|    }                                                                       \
encode_key2any.c:ed448_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1267|      3|    {                                                                       \
 1268|      3|        return key2any_check_selection(selection,                           \
 1269|      3|                                       DO_##kind##_selection_mask);         \
 1270|      3|    }                                                                       \
encode_key2any.c:ed448_to_PrivateKeyInfo_der_does_selection:
 1267|      3|    {                                                                       \
 1268|      3|        return key2any_check_selection(selection,                           \
 1269|      3|                                       DO_##kind##_selection_mask);         \
 1270|      3|    }                                                                       \
encode_key2any.c:ed448_to_PrivateKeyInfo_der_encode:
 1278|      1|    {                                                                       \
 1279|      1|        /* We don't deal with abstract objects */                           \
 1280|      1|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1280:13): [True: 0, False: 1]
  ------------------
 1281|      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)
  |  |  ------------------
  ------------------
 1282|      0|            return 0;                                                       \
 1283|      0|        }                                                                   \
 1284|      1|        DO_##kind(impl, type, output)                                       \
 1285|      1|                                                                            \
 1286|      1|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1287|      0|        return 0;                                                           \
 1288|      1|    }                                                                       \
encode_key2any.c:ed448_to_PrivateKeyInfo_pem_does_selection:
 1267|      3|    {                                                                       \
 1268|      3|        return key2any_check_selection(selection,                           \
 1269|      3|                                       DO_##kind##_selection_mask);         \
 1270|      3|    }                                                                       \
encode_key2any.c:ed448_to_SubjectPublicKeyInfo_der_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:ed448_to_SubjectPublicKeyInfo_pem_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:x25519_to_EncryptedPrivateKeyInfo_der_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:x25519_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:x25519_to_PrivateKeyInfo_der_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:x25519_to_PrivateKeyInfo_der_encode:
 1278|      2|    {                                                                       \
 1279|      2|        /* We don't deal with abstract objects */                           \
 1280|      2|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1280:13): [True: 0, False: 2]
  ------------------
 1281|      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)
  |  |  ------------------
  ------------------
 1282|      0|            return 0;                                                       \
 1283|      0|        }                                                                   \
 1284|      2|        DO_##kind(impl, type, output)                                       \
 1285|      2|                                                                            \
 1286|      2|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1287|      0|        return 0;                                                           \
 1288|      2|    }                                                                       \
encode_key2any.c:x25519_to_PrivateKeyInfo_pem_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:x25519_to_SubjectPublicKeyInfo_der_does_selection:
 1267|     12|    {                                                                       \
 1268|     12|        return key2any_check_selection(selection,                           \
 1269|     12|                                       DO_##kind##_selection_mask);         \
 1270|     12|    }                                                                       \
encode_key2any.c:x25519_to_SubjectPublicKeyInfo_pem_does_selection:
 1267|     12|    {                                                                       \
 1268|     12|        return key2any_check_selection(selection,                           \
 1269|     12|                                       DO_##kind##_selection_mask);         \
 1270|     12|    }                                                                       \
encode_key2any.c:x448_to_EncryptedPrivateKeyInfo_der_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:x448_to_EncryptedPrivateKeyInfo_pem_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:x448_to_PrivateKeyInfo_der_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:x448_to_PrivateKeyInfo_der_encode:
 1278|      2|    {                                                                       \
 1279|      2|        /* We don't deal with abstract objects */                           \
 1280|      2|        if (key_abstract != NULL) {                                         \
  ------------------
  |  Branch (1280:13): [True: 0, False: 2]
  ------------------
 1281|      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)
  |  |  ------------------
  ------------------
 1282|      0|            return 0;                                                       \
 1283|      0|        }                                                                   \
 1284|      2|        DO_##kind(impl, type, output)                                       \
 1285|      2|                                                                            \
 1286|      2|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);             \
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1287|      0|        return 0;                                                           \
 1288|      2|    }                                                                       \
encode_key2any.c:x448_to_PrivateKeyInfo_pem_does_selection:
 1267|      6|    {                                                                       \
 1268|      6|        return key2any_check_selection(selection,                           \
 1269|      6|                                       DO_##kind##_selection_mask);         \
 1270|      6|    }                                                                       \
encode_key2any.c:x448_to_SubjectPublicKeyInfo_der_does_selection:
 1267|     12|    {                                                                       \
 1268|     12|        return key2any_check_selection(selection,                           \
 1269|     12|                                       DO_##kind##_selection_mask);         \
 1270|     12|    }                                                                       \
encode_key2any.c:x448_to_SubjectPublicKeyInfo_pem_does_selection:
 1267|     12|    {                                                                       \
 1268|     12|        return key2any_check_selection(selection,                           \
 1269|     12|                                       DO_##kind##_selection_mask);         \
 1270|     12|    }                                                                       \
encode_key2any.c:rsa_to_RSA_der_does_selection:
 1267|    720|    {                                                                       \
 1268|    720|        return key2any_check_selection(selection,                           \
 1269|    720|                                       DO_##kind##_selection_mask);         \
 1270|    720|    }                                                                       \
encode_key2any.c:rsa_to_RSA_pem_does_selection:
 1267|    720|    {                                                                       \
 1268|    720|        return key2any_check_selection(selection,                           \
 1269|    720|                                       DO_##kind##_selection_mask);         \
 1270|    720|    }                                                                       \
encode_key2any.c:dhx_to_DHX_der_does_selection:
 1267|    300|    {                                                                       \
 1268|    300|        return key2any_check_selection(selection,                           \
 1269|    300|                                       DO_##kind##_selection_mask);         \
 1270|    300|    }                                                                       \
encode_key2any.c:dhx_to_DHX_pem_does_selection:
 1267|    300|    {                                                                       \
 1268|    300|        return key2any_check_selection(selection,                           \
 1269|    300|                                       DO_##kind##_selection_mask);         \
 1270|    300|    }                                                                       \
encode_key2any.c:dsa_to_DSA_der_does_selection:
 1267|  1.20k|    {                                                                       \
 1268|  1.20k|        return key2any_check_selection(selection,                           \
 1269|  1.20k|                                       DO_##kind##_selection_mask);         \
 1270|  1.20k|    }                                                                       \
encode_key2any.c:dsa_to_DSA_pem_does_selection:
 1267|  1.20k|    {                                                                       \
 1268|  1.20k|        return key2any_check_selection(selection,                           \
 1269|  1.20k|                                       DO_##kind##_selection_mask);         \
 1270|  1.20k|    }                                                                       \
encode_key2any.c:ec_to_EC_der_does_selection:
 1267|  1.34k|    {                                                                       \
 1268|  1.34k|        return key2any_check_selection(selection,                           \
 1269|  1.34k|                                       DO_##kind##_selection_mask);         \
 1270|  1.34k|    }                                                                       \
encode_key2any.c:ec_to_EC_pem_does_selection:
 1267|  1.34k|    {                                                                       \
 1268|  1.34k|        return key2any_check_selection(selection,                           \
 1269|  1.34k|                                       DO_##kind##_selection_mask);         \
 1270|  1.34k|    }                                                                       \
encode_key2any.c:rsa_to_PKCS1_der_does_selection:
 1267|    720|    {                                                                       \
 1268|    720|        return key2any_check_selection(selection,                           \
 1269|    720|                                       DO_##kind##_selection_mask);         \
 1270|    720|    }                                                                       \
encode_key2any.c:rsa_to_PKCS1_pem_does_selection:
 1267|    720|    {                                                                       \
 1268|    720|        return key2any_check_selection(selection,                           \
 1269|    720|                                       DO_##kind##_selection_mask);         \
 1270|    720|    }                                                                       \
encode_key2any.c:rsapss_to_PKCS1_der_does_selection:
 1267|      3|    {                                                                       \
 1268|      3|        return key2any_check_selection(selection,                           \
 1269|      3|                                       DO_##kind##_selection_mask);         \
 1270|      3|    }                                                                       \
encode_key2any.c:rsapss_to_PKCS1_pem_does_selection:
 1267|      3|    {                                                                       \
 1268|      3|        return key2any_check_selection(selection,                           \
 1269|      3|                                       DO_##kind##_selection_mask);         \
 1270|      3|    }                                                                       \
encode_key2any.c:dhx_to_X9_42_der_does_selection:
 1267|    300|    {                                                                       \
 1268|    300|        return key2any_check_selection(selection,                           \
 1269|    300|                                       DO_##kind##_selection_mask);         \
 1270|    300|    }                                                                       \
encode_key2any.c:dhx_to_X9_42_pem_does_selection:
 1267|    300|    {                                                                       \
 1268|    300|        return key2any_check_selection(selection,                           \
 1269|    300|                                       DO_##kind##_selection_mask);         \
 1270|    300|    }                                                                       \
encode_key2any.c:ec_to_X9_62_der_does_selection:
 1267|  1.34k|    {                                                                       \
 1268|  1.34k|        return key2any_check_selection(selection,                           \
 1269|  1.34k|                                       DO_##kind##_selection_mask);         \
 1270|  1.34k|    }                                                                       \
encode_key2any.c:ec_to_X9_62_pem_does_selection:
 1267|  1.34k|    {                                                                       \
 1268|  1.34k|        return key2any_check_selection(selection,                           \
 1269|  1.34k|                                       DO_##kind##_selection_mask);         \
 1270|  1.34k|    }                                                                       \

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

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

encode_key2text.c:key2text_newctx:
  788|  3.39k|{
  789|  3.39k|    return provctx;
  790|  3.39k|}
encode_key2text.c:key2text_freectx:
  793|  3.39k|{
  794|  3.39k|}
encode_key2text.c:key2text_encode:
  801|  1.62k|{
  802|  1.62k|    BIO *out = ossl_bio_new_from_core_bio(vctx, cout);
  803|  1.62k|    int ret;
  804|       |
  805|  1.62k|    if (out == NULL)
  ------------------
  |  Branch (805:9): [True: 0, False: 1.62k]
  ------------------
  806|      0|        return 0;
  807|       |
  808|  1.62k|    ret = key2text(out, key, selection);
  809|  1.62k|    BIO_free(out);
  810|       |
  811|  1.62k|    return ret;
  812|  1.62k|}
encode_key2text.c:dh_to_text:
  217|     25|{
  218|     25|    const DH *dh = key;
  219|     25|    const char *type_label = NULL;
  220|     25|    const BIGNUM *priv_key = NULL, *pub_key = NULL;
  221|     25|    const FFC_PARAMS *params = NULL;
  222|     25|    const BIGNUM *p = NULL;
  223|     25|    long length;
  224|       |
  225|     25|    if (out == NULL || dh == NULL) {
  ------------------
  |  Branch (225:9): [True: 0, False: 25]
  |  Branch (225:24): [True: 0, False: 25]
  ------------------
  226|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|        return 0;
  228|      0|    }
  229|       |
  230|     25|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  567|     25|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (230:9): [True: 25, False: 0]
  ------------------
  231|     25|        type_label = "DH Private-Key";
  232|      0|    else if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  568|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (232:14): [True: 0, False: 0]
  ------------------
  233|      0|        type_label = "DH Public-Key";
  234|      0|    else if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
  ------------------
  |  |  569|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (234:14): [True: 0, False: 0]
  ------------------
  235|      0|        type_label = "DH Parameters";
  236|       |
  237|     25|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  567|     25|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (237:9): [True: 25, False: 0]
  ------------------
  238|     25|        priv_key = DH_get0_priv_key(dh);
  239|     25|        if (priv_key == NULL) {
  ------------------
  |  Branch (239:13): [True: 0, False: 25]
  ------------------
  240|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  241|      0|            return 0;
  242|      0|        }
  243|     25|    }
  244|     25|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
  ------------------
  |  |  577|     25|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  567|     25|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  568|     25|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (244:9): [True: 25, False: 0]
  ------------------
  245|     25|        pub_key = DH_get0_pub_key(dh);
  246|     25|        if (pub_key == NULL) {
  ------------------
  |  Branch (246:13): [True: 0, False: 25]
  ------------------
  247|      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)
  |  |  ------------------
  ------------------
  248|      0|            return 0;
  249|      0|        }
  250|     25|    }
  251|     25|    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) {
  ------------------
  |  |  569|     25|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (251:9): [True: 25, False: 0]
  ------------------
  252|     25|        params = ossl_dh_get0_params((DH *)dh);
  253|     25|        if (params == NULL) {
  ------------------
  |  Branch (253:13): [True: 0, False: 25]
  ------------------
  254|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_PARAMETERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  255|      0|            return 0;
  256|      0|        }
  257|     25|    }
  258|       |
  259|     25|    p = DH_get0_p(dh);
  260|     25|    if (p == NULL) {
  ------------------
  |  Branch (260:9): [True: 0, False: 25]
  ------------------
  261|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|       |
  265|     25|    if (BIO_printf(out, "%s: (%d bit)\n", type_label, BN_num_bits(p)) <= 0)
  ------------------
  |  Branch (265:9): [True: 0, False: 25]
  ------------------
  266|      0|        return 0;
  267|     25|    if (priv_key != NULL
  ------------------
  |  Branch (267:9): [True: 25, False: 0]
  ------------------
  268|     25|        && !print_labeled_bignum(out, "private-key:", priv_key))
  ------------------
  |  Branch (268:12): [True: 0, False: 25]
  ------------------
  269|      0|        return 0;
  270|     25|    if (pub_key != NULL
  ------------------
  |  Branch (270:9): [True: 25, False: 0]
  ------------------
  271|     25|        && !print_labeled_bignum(out, "public-key:", pub_key))
  ------------------
  |  Branch (271:12): [True: 0, False: 25]
  ------------------
  272|      0|        return 0;
  273|     25|    if (params != NULL
  ------------------
  |  Branch (273:9): [True: 25, False: 0]
  ------------------
  274|     25|        && !ffc_params_to_text(out, params))
  ------------------
  |  Branch (274:12): [True: 0, False: 25]
  ------------------
  275|      0|        return 0;
  276|     25|    length = DH_get_length(dh);
  277|     25|    if (length > 0
  ------------------
  |  Branch (277:9): [True: 0, False: 25]
  ------------------
  278|     25|        && BIO_printf(out, "recommended-private-length: %ld bits\n",
  ------------------
  |  Branch (278:12): [True: 0, False: 0]
  ------------------
  279|      0|                      length) <= 0)
  280|      0|        return 0;
  281|       |
  282|     25|    return 1;
  283|     25|}
encode_key2text.c:print_labeled_bignum:
   53|  89.9k|{
   54|  89.9k|    int ret = 0, use_sep = 0;
   55|  89.9k|    char *hex_str = NULL, *p;
   56|  89.9k|    const char spaces[] = "    ";
   57|  89.9k|    const char *post_label_spc = " ";
   58|       |
   59|  89.9k|    const char *neg = "";
   60|  89.9k|    int bytes;
   61|       |
   62|  89.9k|    if (bn == NULL)
  ------------------
  |  Branch (62:9): [True: 0, False: 89.9k]
  ------------------
   63|      0|        return 0;
   64|  89.9k|    if (label == NULL) {
  ------------------
  |  Branch (64:9): [True: 83.6k, False: 6.36k]
  ------------------
   65|  83.6k|        label = "";
   66|  83.6k|        post_label_spc = "";
   67|  83.6k|    }
   68|       |
   69|  89.9k|    if (BN_is_zero(bn))
  ------------------
  |  Branch (69:9): [True: 40.1k, False: 49.8k]
  ------------------
   70|  40.1k|        return BIO_printf(out, "%s%s0\n", label, post_label_spc);
   71|       |
   72|  49.8k|    if (BN_num_bytes(bn) <= BN_BYTES) {
  ------------------
  |  |  189|  49.8k|# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
  ------------------
                  if (BN_num_bytes(bn) <= BN_BYTES) {
  ------------------
  |  |   38|  49.8k|#  define BN_BYTES        8
  ------------------
  |  Branch (72:9): [True: 45.7k, False: 4.12k]
  ------------------
   73|  45.7k|        BN_ULONG *words = bn_get_words(bn);
  ------------------
  |  |   37|  45.7k|#  define BN_ULONG        unsigned long
  ------------------
   74|       |
   75|  45.7k|        if (BN_is_negative(bn))
  ------------------
  |  Branch (75:13): [True: 11, False: 45.7k]
  ------------------
   76|     11|            neg = "-";
   77|       |
   78|  45.7k|        return BIO_printf(out, "%s%s%s" BN_FMTu " (%s0x" BN_FMTx ")\n",
   79|  45.7k|                          label, post_label_spc, neg, words[0], neg, words[0]);
   80|  45.7k|    }
   81|       |
   82|  4.12k|    hex_str = BN_bn2hex(bn);
   83|  4.12k|    if (hex_str == NULL)
  ------------------
  |  Branch (83:9): [True: 0, False: 4.12k]
  ------------------
   84|      0|        return 0;
   85|       |
   86|  4.12k|    p = hex_str;
   87|  4.12k|    if (*p == '-') {
  ------------------
  |  Branch (87:9): [True: 1, False: 4.12k]
  ------------------
   88|      1|        ++p;
   89|      1|        neg = " (Negative)";
   90|      1|    }
   91|  4.12k|    if (BIO_printf(out, "%s%s\n", label, neg) <= 0)
  ------------------
  |  Branch (91:9): [True: 0, False: 4.12k]
  ------------------
   92|      0|        goto err;
   93|       |
   94|       |    /* Keep track of how many bytes we have printed out so far */
   95|  4.12k|    bytes = 0;
   96|       |
   97|  4.12k|    if (BIO_printf(out, "%s", spaces) <= 0)
  ------------------
  |  Branch (97:9): [True: 0, False: 4.12k]
  ------------------
   98|      0|        goto err;
   99|       |
  100|       |    /* Add a leading 00 if the top bit is set */
  101|  4.12k|    if (*p >= '8') {
  ------------------
  |  Branch (101:9): [True: 1.50k, False: 2.62k]
  ------------------
  102|  1.50k|        if (BIO_printf(out, "%02x", 0) <= 0)
  ------------------
  |  Branch (102:13): [True: 0, False: 1.50k]
  ------------------
  103|      0|            goto err;
  104|  1.50k|        ++bytes;
  105|  1.50k|        use_sep = 1;
  106|  1.50k|    }
  107|  1.17M|    while (*p != '\0') {
  ------------------
  |  Branch (107:12): [True: 1.16M, False: 4.12k]
  ------------------
  108|       |        /* Do a newline after every 15 hex bytes + add the space indent */
  109|  1.16M|        if ((bytes % 15) == 0 && bytes > 0) {
  ------------------
  |  Branch (109:13): [True: 78.4k, False: 1.09M]
  |  Branch (109:34): [True: 75.8k, False: 2.62k]
  ------------------
  110|  75.8k|            if (BIO_printf(out, ":\n%s", spaces) <= 0)
  ------------------
  |  Branch (110:17): [True: 0, False: 75.8k]
  ------------------
  111|      0|                goto err;
  112|  75.8k|            use_sep = 0; /* The first byte on the next line doesn't have a : */
  113|  75.8k|        }
  114|  1.16M|        if (BIO_printf(out, "%s%c%c", use_sep ? ":" : "",
  ------------------
  |  Branch (114:13): [True: 0, False: 1.16M]
  |  Branch (114:39): [True: 1.09M, False: 78.4k]
  ------------------
  115|  1.16M|                       tolower(p[0]), tolower(p[1])) <= 0)
  116|      0|            goto err;
  117|  1.16M|        ++bytes;
  118|  1.16M|        p += 2;
  119|  1.16M|        use_sep = 1;
  120|  1.16M|    }
  121|  4.12k|    if (BIO_printf(out, "\n") <= 0)
  ------------------
  |  Branch (121:9): [True: 0, False: 4.12k]
  ------------------
  122|      0|        goto err;
  123|  4.12k|    ret = 1;
  124|  4.12k|err:
  125|  4.12k|    OPENSSL_free(hex_str);
  ------------------
  |  |  115|  4.12k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.12k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.12k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  126|  4.12k|    return ret;
  127|  4.12k|}
encode_key2text.c:ffc_params_to_text:
  162|    629|{
  163|    629|    if (ffc->nid != NID_undef) {
  ------------------
  |  |   18|    629|#define NID_undef                       0
  ------------------
  |  Branch (163:9): [True: 0, False: 629]
  ------------------
  164|      0|#ifndef OPENSSL_NO_DH
  165|      0|        const DH_NAMED_GROUP *group = ossl_ffc_uid_to_dh_named_group(ffc->nid);
  166|      0|        const char *name = ossl_ffc_named_group_get_name(group);
  167|       |
  168|      0|        if (name == NULL)
  ------------------
  |  Branch (168:13): [True: 0, False: 0]
  ------------------
  169|      0|            goto err;
  170|      0|        if (BIO_printf(out, "GROUP: %s\n", name) <= 0)
  ------------------
  |  Branch (170:13): [True: 0, False: 0]
  ------------------
  171|      0|            goto err;
  172|      0|        return 1;
  173|       |#else
  174|       |        /* How could this be? We should not have a nid in a no-dh build. */
  175|       |        goto err;
  176|       |#endif
  177|      0|    }
  178|       |
  179|    629|    if (!print_labeled_bignum(out, "P:   ", ffc->p))
  ------------------
  |  Branch (179:9): [True: 0, False: 629]
  ------------------
  180|      0|        goto err;
  181|    629|    if (ffc->q != NULL) {
  ------------------
  |  Branch (181:9): [True: 629, False: 0]
  ------------------
  182|    629|        if (!print_labeled_bignum(out, "Q:   ", ffc->q))
  ------------------
  |  Branch (182:13): [True: 0, False: 629]
  ------------------
  183|      0|            goto err;
  184|    629|    }
  185|    629|    if (!print_labeled_bignum(out, "G:   ", ffc->g))
  ------------------
  |  Branch (185:9): [True: 0, False: 629]
  ------------------
  186|      0|        goto err;
  187|    629|    if (ffc->j != NULL) {
  ------------------
  |  Branch (187:9): [True: 15, False: 614]
  ------------------
  188|     15|        if (!print_labeled_bignum(out, "J:   ", ffc->j))
  ------------------
  |  Branch (188:13): [True: 0, False: 15]
  ------------------
  189|      0|            goto err;
  190|     15|    }
  191|    629|    if (ffc->seed != NULL) {
  ------------------
  |  Branch (191:9): [True: 0, False: 629]
  ------------------
  192|      0|        if (!print_labeled_buf(out, "SEED:", ffc->seed, ffc->seedlen))
  ------------------
  |  Branch (192:13): [True: 0, False: 0]
  ------------------
  193|      0|            goto err;
  194|      0|    }
  195|    629|    if (ffc->gindex != -1) {
  ------------------
  |  Branch (195:9): [True: 0, False: 629]
  ------------------
  196|      0|        if (BIO_printf(out, "gindex: %d\n", ffc->gindex) <= 0)
  ------------------
  |  Branch (196:13): [True: 0, False: 0]
  ------------------
  197|      0|            goto err;
  198|      0|    }
  199|    629|    if (ffc->pcounter != -1) {
  ------------------
  |  Branch (199:9): [True: 0, False: 629]
  ------------------
  200|      0|        if (BIO_printf(out, "pcounter: %d\n", ffc->pcounter) <= 0)
  ------------------
  |  Branch (200:13): [True: 0, False: 0]
  ------------------
  201|      0|            goto err;
  202|      0|    }
  203|    629|    if (ffc->h != 0) {
  ------------------
  |  Branch (203:9): [True: 0, False: 629]
  ------------------
  204|      0|        if (BIO_printf(out, "h: %d\n", ffc->h) <= 0)
  ------------------
  |  Branch (204:13): [True: 0, False: 0]
  ------------------
  205|      0|            goto err;
  206|      0|    }
  207|    629|    return 1;
  208|      0|err:
  209|      0|    return 0;
  210|    629|}
encode_key2text.c:print_labeled_buf:
  135|  1.10k|{
  136|  1.10k|    size_t i;
  137|       |
  138|  1.10k|    if (BIO_printf(out, "%s\n", label) <= 0)
  ------------------
  |  Branch (138:9): [True: 0, False: 1.10k]
  ------------------
  139|      0|        return 0;
  140|       |
  141|  41.4k|    for (i = 0; i < buflen; i++) {
  ------------------
  |  Branch (141:17): [True: 40.3k, False: 1.10k]
  ------------------
  142|  40.3k|        if ((i % LABELED_BUF_PRINT_WIDTH) == 0) {
  ------------------
  |  |  130|  40.3k|#define LABELED_BUF_PRINT_WIDTH    15
  ------------------
  |  Branch (142:13): [True: 3.09k, False: 37.2k]
  ------------------
  143|  3.09k|            if (i > 0 && BIO_printf(out, "\n") <= 0)
  ------------------
  |  Branch (143:17): [True: 1.99k, False: 1.10k]
  |  Branch (143:26): [True: 0, False: 1.99k]
  ------------------
  144|      0|                return 0;
  145|  3.09k|            if (BIO_printf(out, "    ") <= 0)
  ------------------
  |  Branch (145:17): [True: 0, False: 3.09k]
  ------------------
  146|      0|                return 0;
  147|  3.09k|        }
  148|       |
  149|  40.3k|        if (BIO_printf(out, "%02x%s", buf[i],
  ------------------
  |  Branch (149:13): [True: 0, False: 40.3k]
  ------------------
  150|  40.3k|                                 (i == buflen - 1) ? "" : ":") <= 0)
  ------------------
  |  Branch (150:34): [True: 1.10k, False: 39.2k]
  ------------------
  151|      0|            return 0;
  152|  40.3k|    }
  153|  1.10k|    if (BIO_printf(out, "\n") <= 0)
  ------------------
  |  Branch (153:9): [True: 0, False: 1.10k]
  ------------------
  154|      0|        return 0;
  155|       |
  156|  1.10k|    return 1;
  157|  1.10k|}
encode_key2text.c:dhx2text_encode:
  837|     25|    {                                                                   \
  838|     25|        /* We don't deal with abstract objects */                       \
  839|     25|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (839:13): [True: 0, False: 25]
  ------------------
  840|      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)
  |  |  ------------------
  ------------------
  841|      0|            return 0;                                                   \
  842|      0|        }                                                               \
  843|     25|        return key2text_encode(vctx, key, selection, cout,              \
  844|     25|                               type##_to_text, cb, cbarg);              \
  845|     25|    }                                                                   \
encode_key2text.c:dsa2text_encode:
  837|    604|    {                                                                   \
  838|    604|        /* We don't deal with abstract objects */                       \
  839|    604|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (839:13): [True: 0, False: 604]
  ------------------
  840|      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)
  |  |  ------------------
  ------------------
  841|      0|            return 0;                                                   \
  842|      0|        }                                                               \
  843|    604|        return key2text_encode(vctx, key, selection, cout,              \
  844|    604|                               type##_to_text, cb, cbarg);              \
  845|    604|    }                                                                   \
encode_key2text.c:dsa_to_text:
  293|    604|{
  294|    604|    const DSA *dsa = key;
  295|    604|    const char *type_label = NULL;
  296|    604|    const BIGNUM *priv_key = NULL, *pub_key = NULL;
  297|    604|    const FFC_PARAMS *params = NULL;
  298|    604|    const BIGNUM *p = NULL;
  299|       |
  300|    604|    if (out == NULL || dsa == NULL) {
  ------------------
  |  Branch (300:9): [True: 0, False: 604]
  |  Branch (300:24): [True: 0, False: 604]
  ------------------
  301|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  302|      0|        return 0;
  303|      0|    }
  304|       |
  305|    604|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  567|    604|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (305:9): [True: 604, False: 0]
  ------------------
  306|    604|        type_label = "Private-Key";
  307|      0|    else if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  568|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (307:14): [True: 0, False: 0]
  ------------------
  308|      0|        type_label = "Public-Key";
  309|      0|    else if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
  ------------------
  |  |  569|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (309:14): [True: 0, False: 0]
  ------------------
  310|      0|        type_label = "DSA-Parameters";
  311|       |
  312|    604|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  567|    604|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (312:9): [True: 604, False: 0]
  ------------------
  313|    604|        priv_key = DSA_get0_priv_key(dsa);
  314|    604|        if (priv_key == NULL) {
  ------------------
  |  Branch (314:13): [True: 0, False: 604]
  ------------------
  315|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  316|      0|            return 0;
  317|      0|        }
  318|    604|    }
  319|    604|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
  ------------------
  |  |  577|    604|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  567|    604|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  568|    604|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (319:9): [True: 604, False: 0]
  ------------------
  320|    604|        pub_key = DSA_get0_pub_key(dsa);
  321|    604|        if (pub_key == NULL) {
  ------------------
  |  Branch (321:13): [True: 0, False: 604]
  ------------------
  322|      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)
  |  |  ------------------
  ------------------
  323|      0|            return 0;
  324|      0|        }
  325|    604|    }
  326|    604|    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) {
  ------------------
  |  |  569|    604|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (326:9): [True: 604, False: 0]
  ------------------
  327|    604|        params = ossl_dsa_get0_params((DSA *)dsa);
  328|    604|        if (params == NULL) {
  ------------------
  |  Branch (328:13): [True: 0, False: 604]
  ------------------
  329|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_PARAMETERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  330|      0|            return 0;
  331|      0|        }
  332|    604|    }
  333|       |
  334|    604|    p = DSA_get0_p(dsa);
  335|    604|    if (p == NULL) {
  ------------------
  |  Branch (335:9): [True: 0, False: 604]
  ------------------
  336|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  337|      0|        return 0;
  338|      0|    }
  339|       |
  340|    604|    if (BIO_printf(out, "%s: (%d bit)\n", type_label, BN_num_bits(p)) <= 0)
  ------------------
  |  Branch (340:9): [True: 0, False: 604]
  ------------------
  341|      0|        return 0;
  342|    604|    if (priv_key != NULL
  ------------------
  |  Branch (342:9): [True: 604, False: 0]
  ------------------
  343|    604|        && !print_labeled_bignum(out, "priv:", priv_key))
  ------------------
  |  Branch (343:12): [True: 0, False: 604]
  ------------------
  344|      0|        return 0;
  345|    604|    if (pub_key != NULL
  ------------------
  |  Branch (345:9): [True: 604, False: 0]
  ------------------
  346|    604|        && !print_labeled_bignum(out, "pub: ", pub_key))
  ------------------
  |  Branch (346:12): [True: 0, False: 604]
  ------------------
  347|      0|        return 0;
  348|    604|    if (params != NULL
  ------------------
  |  Branch (348:9): [True: 604, False: 0]
  ------------------
  349|    604|        && !ffc_params_to_text(out, params))
  ------------------
  |  Branch (349:12): [True: 0, False: 604]
  ------------------
  350|      0|        return 0;
  351|       |
  352|    604|    return 1;
  353|    604|}
encode_key2text.c:ec2text_encode:
  837|    615|    {                                                                   \
  838|    615|        /* We don't deal with abstract objects */                       \
  839|    615|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (839:13): [True: 0, False: 615]
  ------------------
  840|      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)
  |  |  ------------------
  ------------------
  841|      0|            return 0;                                                   \
  842|      0|        }                                                               \
  843|    615|        return key2text_encode(vctx, key, selection, cout,              \
  844|    615|                               type##_to_text, cb, cbarg);              \
  845|    615|    }                                                                   \
encode_key2text.c:ec_to_text:
  492|    623|{
  493|    623|    const EC_KEY *ec = key;
  494|    623|    const char *type_label = NULL;
  495|    623|    unsigned char *priv = NULL, *pub = NULL;
  496|    623|    size_t priv_len = 0, pub_len = 0;
  497|    623|    const EC_GROUP *group;
  498|    623|    int ret = 0;
  499|       |
  500|    623|    if (out == NULL || ec == NULL) {
  ------------------
  |  Branch (500:9): [True: 0, False: 623]
  |  Branch (500:24): [True: 0, False: 623]
  ------------------
  501|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  502|      0|        return 0;
  503|      0|    }
  504|       |
  505|    623|    if ((group = EC_KEY_get0_group(ec)) == NULL) {
  ------------------
  |  Branch (505:9): [True: 0, False: 623]
  ------------------
  506|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  507|      0|        return 0;
  508|      0|    }
  509|       |
  510|    623|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  567|    623|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (510:9): [True: 623, False: 0]
  ------------------
  511|    623|        type_label = "Private-Key";
  512|      0|    else if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  568|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (512:14): [True: 0, False: 0]
  ------------------
  513|      0|        type_label = "Public-Key";
  514|      0|    else if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
  ------------------
  |  |  569|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (514:14): [True: 0, False: 0]
  ------------------
  515|      0|        if (EC_GROUP_get_curve_name(group) != NID_sm2)
  ------------------
  |  | 1232|      0|#define NID_sm2         1172
  ------------------
  |  Branch (515:13): [True: 0, False: 0]
  ------------------
  516|      0|            type_label = "EC-Parameters";
  517|       |
  518|    623|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  567|    623|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (518:9): [True: 623, False: 0]
  ------------------
  519|    623|        const BIGNUM *priv_key = EC_KEY_get0_private_key(ec);
  520|       |
  521|    623|        if (priv_key == NULL) {
  ------------------
  |  Branch (521:13): [True: 0, False: 623]
  ------------------
  522|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  523|      0|            goto err;
  524|      0|        }
  525|    623|        priv_len = EC_KEY_priv2buf(ec, &priv);
  526|    623|        if (priv_len == 0)
  ------------------
  |  Branch (526:13): [True: 112, False: 511]
  ------------------
  527|    112|            goto err;
  528|    623|    }
  529|    511|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
  ------------------
  |  |  577|    511|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  567|    511|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  568|    511|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (529:9): [True: 511, False: 0]
  ------------------
  530|    511|        const EC_POINT *pub_pt = EC_KEY_get0_public_key(ec);
  531|       |
  532|    511|        if (pub_pt == NULL) {
  ------------------
  |  Branch (532:13): [True: 0, False: 511]
  ------------------
  533|      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)
  |  |  ------------------
  ------------------
  534|      0|            goto err;
  535|      0|        }
  536|       |
  537|    511|        pub_len = EC_KEY_key2buf(ec, EC_KEY_get_conv_form(ec), &pub, NULL);
  538|    511|        if (pub_len == 0)
  ------------------
  |  Branch (538:13): [True: 6, False: 505]
  ------------------
  539|      6|            goto err;
  540|    511|    }
  541|       |
  542|    505|    if (type_label != NULL
  ------------------
  |  Branch (542:9): [True: 505, False: 0]
  ------------------
  543|    505|        && BIO_printf(out, "%s: (%d bit)\n", type_label,
  ------------------
  |  Branch (543:12): [True: 0, False: 505]
  ------------------
  544|    505|                      EC_GROUP_order_bits(group)) <= 0)
  545|      0|        goto err;
  546|    505|    if (priv != NULL
  ------------------
  |  Branch (546:9): [True: 505, False: 0]
  ------------------
  547|    505|        && !print_labeled_buf(out, "priv:", priv, priv_len))
  ------------------
  |  Branch (547:12): [True: 0, False: 505]
  ------------------
  548|      0|        goto err;
  549|    505|    if (pub != NULL
  ------------------
  |  Branch (549:9): [True: 505, False: 0]
  ------------------
  550|    505|        && !print_labeled_buf(out, "pub:", pub, pub_len))
  ------------------
  |  Branch (550:12): [True: 0, False: 505]
  ------------------
  551|      0|        goto err;
  552|    505|    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
  ------------------
  |  |  569|    505|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (552:9): [True: 505, False: 0]
  ------------------
  553|    505|        ret = ec_param_to_text(out, group, ossl_ec_key_get_libctx(ec));
  554|    623|err:
  555|    623|    OPENSSL_clear_free(priv, priv_len);
  ------------------
  |  |  113|    623|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    623|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    623|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  556|    623|    OPENSSL_free(pub);
  ------------------
  |  |  115|    623|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    623|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    623|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  557|    623|    return ret;
  558|    505|}
encode_key2text.c:ec_param_to_text:
  471|    505|{
  472|    505|    if (EC_GROUP_get_asn1_flag(group) & OPENSSL_EC_NAMED_CURVE) {
  ------------------
  |  |   31|    505|# define OPENSSL_EC_NAMED_CURVE     0x001
  ------------------
  |  Branch (472:9): [True: 442, False: 63]
  ------------------
  473|    442|        const char *curve_name;
  474|    442|        int curve_nid = EC_GROUP_get_curve_name(group);
  475|       |
  476|       |        /* Explicit parameters */
  477|    442|        if (curve_nid == NID_undef)
  ------------------
  |  |   18|    442|#define NID_undef                       0
  ------------------
  |  Branch (477:13): [True: 0, False: 442]
  ------------------
  478|      0|            return 0;
  479|       |
  480|    442|        if (BIO_printf(out, "%s: %s\n", "ASN1 OID", OBJ_nid2sn(curve_nid)) <= 0)
  ------------------
  |  Branch (480:13): [True: 0, False: 442]
  ------------------
  481|      0|            return 0;
  482|       |
  483|    442|        curve_name = EC_curve_nid2nist(curve_nid);
  484|    442|        return (curve_name == NULL
  ------------------
  |  Branch (484:17): [True: 208, False: 234]
  ------------------
  485|    442|                || BIO_printf(out, "%s: %s\n", "NIST CURVE", curve_name) > 0);
  ------------------
  |  Branch (485:20): [True: 234, False: 0]
  ------------------
  486|    442|    } else {
  487|     63|        return ec_param_explicit_to_text(out, group, libctx);
  488|     63|    }
  489|    505|}
encode_key2text.c:ec_param_explicit_to_text:
  430|     63|{
  431|     63|    int ret = 0, tmp_nid;
  432|     63|    BN_CTX *ctx = NULL;
  433|     63|    const BIGNUM *order = NULL, *cofactor = NULL;
  434|     63|    const unsigned char *seed;
  435|     63|    size_t seed_len = 0;
  436|       |
  437|     63|    ctx = BN_CTX_new_ex(libctx);
  438|     63|    if (ctx == NULL)
  ------------------
  |  Branch (438:9): [True: 0, False: 63]
  ------------------
  439|      0|        return 0;
  440|     63|    BN_CTX_start(ctx);
  441|       |
  442|     63|    tmp_nid = EC_GROUP_get_field_type(group);
  443|     63|    order = EC_GROUP_get0_order(group);
  444|     63|    if (order == NULL)
  ------------------
  |  Branch (444:9): [True: 0, False: 63]
  ------------------
  445|      0|        goto err;
  446|       |
  447|     63|    seed = EC_GROUP_get0_seed(group);
  448|     63|    if (seed != NULL)
  ------------------
  |  Branch (448:9): [True: 14, False: 49]
  ------------------
  449|     14|        seed_len = EC_GROUP_get_seed_len(group);
  450|     63|    cofactor = EC_GROUP_get0_cofactor(group);
  451|       |
  452|       |    /* print the 'short name' of the field type */
  453|     63|    if (BIO_printf(out, "Field Type: %s\n", OBJ_nid2sn(tmp_nid)) <= 0
  ------------------
  |  Branch (453:9): [True: 0, False: 63]
  ------------------
  454|     63|        || !ec_param_explicit_curve_to_text(out, group, ctx)
  ------------------
  |  Branch (454:12): [True: 0, False: 63]
  ------------------
  455|     63|        || !ec_param_explicit_gen_to_text(out, group, ctx)
  ------------------
  |  Branch (455:12): [True: 0, False: 63]
  ------------------
  456|     63|        || !print_labeled_bignum(out, "Order: ", order)
  ------------------
  |  Branch (456:12): [True: 0, False: 63]
  ------------------
  457|     63|        || (cofactor != NULL
  ------------------
  |  Branch (457:13): [True: 63, False: 0]
  ------------------
  458|     63|            && !print_labeled_bignum(out, "Cofactor: ", cofactor))
  ------------------
  |  Branch (458:16): [True: 0, False: 63]
  ------------------
  459|     63|        || (seed != NULL
  ------------------
  |  Branch (459:13): [True: 14, False: 49]
  ------------------
  460|     63|            && !print_labeled_buf(out, "Seed:", seed, seed_len)))
  ------------------
  |  Branch (460:16): [True: 0, False: 14]
  ------------------
  461|      0|        goto err;
  462|     63|    ret = 1;
  463|     63|err:
  464|     63|    BN_CTX_end(ctx);
  465|     63|    BN_CTX_free(ctx);
  466|     63|    return ret;
  467|     63|}
encode_key2text.c:ec_param_explicit_curve_to_text:
  363|     63|{
  364|     63|    const char *plabel = "Prime:";
  365|     63|    BIGNUM *p = NULL, *a = NULL, *b = NULL;
  366|       |
  367|     63|    p = BN_CTX_get(ctx);
  368|     63|    a = BN_CTX_get(ctx);
  369|     63|    b = BN_CTX_get(ctx);
  370|     63|    if (b == NULL
  ------------------
  |  Branch (370:9): [True: 0, False: 63]
  ------------------
  371|     63|        || !EC_GROUP_get_curve(group, p, a, b, ctx))
  ------------------
  |  Branch (371:12): [True: 0, False: 63]
  ------------------
  372|      0|        return 0;
  373|       |
  374|     63|    if (EC_GROUP_get_field_type(group) == NID_X9_62_characteristic_two_field) {
  ------------------
  |  |  156|     63|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (374:9): [True: 0, False: 63]
  ------------------
  375|      0|        int basis_type = EC_GROUP_get_basis_type(group);
  376|       |
  377|       |        /* print the 'short name' of the base type OID */
  378|      0|        if (basis_type == NID_undef
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (378:13): [True: 0, False: 0]
  ------------------
  379|      0|            || BIO_printf(out, "Basis Type: %s\n", OBJ_nid2sn(basis_type)) <= 0)
  ------------------
  |  Branch (379:16): [True: 0, False: 0]
  ------------------
  380|      0|            return 0;
  381|      0|        plabel = "Polynomial:";
  382|      0|    }
  383|     63|    return print_labeled_bignum(out, plabel, p)
  ------------------
  |  Branch (383:12): [True: 63, False: 0]
  ------------------
  384|     63|        && print_labeled_bignum(out, "A:   ", a)
  ------------------
  |  Branch (384:12): [True: 63, False: 0]
  ------------------
  385|     63|        && print_labeled_bignum(out, "B:   ", b);
  ------------------
  |  Branch (385:12): [True: 63, False: 0]
  ------------------
  386|     63|}
encode_key2text.c:ec_param_explicit_gen_to_text:
  390|     63|{
  391|     63|    int ret;
  392|     63|    size_t buflen;
  393|     63|    point_conversion_form_t form;
  394|     63|    const EC_POINT *point = NULL;
  395|     63|    const char *glabel = NULL;
  396|     63|    unsigned char *buf = NULL;
  397|       |
  398|     63|    form = EC_GROUP_get_point_conversion_form(group);
  399|     63|    point = EC_GROUP_get0_generator(group);
  400|       |
  401|     63|    if (point == NULL)
  ------------------
  |  Branch (401:9): [True: 0, False: 63]
  ------------------
  402|      0|        return 0;
  403|       |
  404|     63|    switch (form) {
  405|     61|    case POINT_CONVERSION_COMPRESSED:
  ------------------
  |  Branch (405:5): [True: 61, False: 2]
  ------------------
  406|     61|       glabel = "Generator (compressed):";
  407|     61|       break;
  408|      1|    case POINT_CONVERSION_UNCOMPRESSED:
  ------------------
  |  Branch (408:5): [True: 1, False: 62]
  ------------------
  409|      1|        glabel = "Generator (uncompressed):";
  410|      1|        break;
  411|      1|    case POINT_CONVERSION_HYBRID:
  ------------------
  |  Branch (411:5): [True: 1, False: 62]
  ------------------
  412|      1|        glabel = "Generator (hybrid):";
  413|      1|        break;
  414|      0|    default:
  ------------------
  |  Branch (414:5): [True: 0, False: 63]
  ------------------
  415|      0|        return 0;
  416|     63|    }
  417|       |
  418|     63|    buflen = EC_POINT_point2buf(group, point, form, &buf, ctx);
  419|     63|    if (buflen == 0)
  ------------------
  |  Branch (419:9): [True: 0, False: 63]
  ------------------
  420|      0|        return 0;
  421|       |
  422|     63|    ret = print_labeled_buf(out, glabel, buf, buflen);
  423|     63|    OPENSSL_clear_free(buf, buflen);
  ------------------
  |  |  113|     63|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     63|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     63|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  424|     63|    return ret;
  425|     63|}
encode_key2text.c:sm22text_encode:
  837|      8|    {                                                                   \
  838|      8|        /* We don't deal with abstract objects */                       \
  839|      8|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (839:13): [True: 0, False: 8]
  ------------------
  840|      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)
  |  |  ------------------
  ------------------
  841|      0|            return 0;                                                   \
  842|      0|        }                                                               \
  843|      8|        return key2text_encode(vctx, key, selection, cout,              \
  844|      8|                               type##_to_text, cb, cbarg);              \
  845|      8|    }                                                                   \
encode_key2text.c:ed255192text_encode:
  837|      2|    {                                                                   \
  838|      2|        /* We don't deal with abstract objects */                       \
  839|      2|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (839:13): [True: 0, False: 2]
  ------------------
  840|      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)
  |  |  ------------------
  ------------------
  841|      0|            return 0;                                                   \
  842|      0|        }                                                               \
  843|      2|        return key2text_encode(vctx, key, selection, cout,              \
  844|      2|                               type##_to_text, cb, cbarg);              \
  845|      2|    }                                                                   \
encode_key2text.c:ecx_to_text:
  571|      7|{
  572|      7|    const ECX_KEY *ecx = key;
  573|      7|    const char *type_label = NULL;
  574|       |
  575|      7|    if (out == NULL || ecx == NULL) {
  ------------------
  |  Branch (575:9): [True: 0, False: 7]
  |  Branch (575:24): [True: 0, False: 7]
  ------------------
  576|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  577|      0|        return 0;
  578|      0|    }
  579|       |
  580|      7|    switch (ecx->type) {
  ------------------
  |  Branch (580:13): [True: 0, False: 7]
  ------------------
  581|      2|    case ECX_KEY_TYPE_X25519:
  ------------------
  |  Branch (581:5): [True: 2, False: 5]
  ------------------
  582|      2|        type_label = "X25519";
  583|      2|        break;
  584|      2|    case ECX_KEY_TYPE_X448:
  ------------------
  |  Branch (584:5): [True: 2, False: 5]
  ------------------
  585|      2|        type_label = "X448";
  586|      2|        break;
  587|      2|    case ECX_KEY_TYPE_ED25519:
  ------------------
  |  Branch (587:5): [True: 2, False: 5]
  ------------------
  588|      2|        type_label = "ED25519";
  589|      2|        break;
  590|      1|    case ECX_KEY_TYPE_ED448:
  ------------------
  |  Branch (590:5): [True: 1, False: 6]
  ------------------
  591|      1|        type_label = "ED448";
  592|      1|        break;
  593|      7|    }
  594|       |
  595|      7|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  567|      7|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (595:9): [True: 7, False: 0]
  ------------------
  596|      7|        if (ecx->privkey == NULL) {
  ------------------
  |  Branch (596:13): [True: 0, False: 7]
  ------------------
  597|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  598|      0|            return 0;
  599|      0|        }
  600|       |
  601|      7|        if (BIO_printf(out, "%s Private-Key:\n", type_label) <= 0)
  ------------------
  |  Branch (601:13): [True: 0, False: 7]
  ------------------
  602|      0|            return 0;
  603|      7|        if (!print_labeled_buf(out, "priv:", ecx->privkey, ecx->keylen))
  ------------------
  |  Branch (603:13): [True: 0, False: 7]
  ------------------
  604|      0|            return 0;
  605|      7|    } else if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
  ------------------
  |  |  568|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (605:16): [True: 0, False: 0]
  ------------------
  606|       |        /* ecx->pubkey is an array, not a pointer... */
  607|      0|        if (!ecx->haspubkey) {
  ------------------
  |  Branch (607:13): [True: 0, False: 0]
  ------------------
  608|      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)
  |  |  ------------------
  ------------------
  609|      0|            return 0;
  610|      0|        }
  611|       |
  612|      0|        if (BIO_printf(out, "%s Public-Key:\n", type_label) <= 0)
  ------------------
  |  Branch (612:13): [True: 0, False: 0]
  ------------------
  613|      0|            return 0;
  614|      0|    }
  615|       |
  616|      7|    if (!print_labeled_buf(out, "pub:", ecx->pubkey, ecx->keylen))
  ------------------
  |  Branch (616:9): [True: 0, False: 7]
  ------------------
  617|      0|        return 0;
  618|       |
  619|      7|    return 1;
  620|      7|}
encode_key2text.c:ed4482text_encode:
  837|      1|    {                                                                   \
  838|      1|        /* We don't deal with abstract objects */                       \
  839|      1|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (839:13): [True: 0, False: 1]
  ------------------
  840|      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)
  |  |  ------------------
  ------------------
  841|      0|            return 0;                                                   \
  842|      0|        }                                                               \
  843|      1|        return key2text_encode(vctx, key, selection, cout,              \
  844|      1|                               type##_to_text, cb, cbarg);              \
  845|      1|    }                                                                   \
encode_key2text.c:x255192text_encode:
  837|      2|    {                                                                   \
  838|      2|        /* We don't deal with abstract objects */                       \
  839|      2|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (839:13): [True: 0, False: 2]
  ------------------
  840|      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)
  |  |  ------------------
  ------------------
  841|      0|            return 0;                                                   \
  842|      0|        }                                                               \
  843|      2|        return key2text_encode(vctx, key, selection, cout,              \
  844|      2|                               type##_to_text, cb, cbarg);              \
  845|      2|    }                                                                   \
encode_key2text.c:x4482text_encode:
  837|      2|    {                                                                   \
  838|      2|        /* We don't deal with abstract objects */                       \
  839|      2|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (839:13): [True: 0, False: 2]
  ------------------
  840|      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)
  |  |  ------------------
  ------------------
  841|      0|            return 0;                                                   \
  842|      0|        }                                                               \
  843|      2|        return key2text_encode(vctx, key, selection, cout,              \
  844|      2|                               type##_to_text, cb, cbarg);              \
  845|      2|    }                                                                   \
encode_key2text.c:rsa2text_encode:
  837|    360|    {                                                                   \
  838|    360|        /* We don't deal with abstract objects */                       \
  839|    360|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (839:13): [True: 0, False: 360]
  ------------------
  840|      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)
  |  |  ------------------
  ------------------
  841|      0|            return 0;                                                   \
  842|      0|        }                                                               \
  843|    360|        return key2text_encode(vctx, key, selection, cout,              \
  844|    360|                               type##_to_text, cb, cbarg);              \
  845|    360|    }                                                                   \
encode_key2text.c:rsa_to_text:
  631|    361|{
  632|    361|    const RSA *rsa = key;
  633|    361|    const char *type_label = "RSA key";
  634|    361|    const char *modulus_label = NULL;
  635|    361|    const char *exponent_label = NULL;
  636|    361|    const BIGNUM *rsa_d = NULL, *rsa_n = NULL, *rsa_e = NULL;
  637|    361|    STACK_OF(BIGNUM_const) *factors = NULL;
  ------------------
  |  |   31|    361|# define STACK_OF(type) struct stack_st_##type
  ------------------
  638|    361|    STACK_OF(BIGNUM_const) *exps = NULL;
  ------------------
  |  |   31|    361|# define STACK_OF(type) struct stack_st_##type
  ------------------
  639|    361|    STACK_OF(BIGNUM_const) *coeffs = NULL;
  ------------------
  |  |   31|    361|# define STACK_OF(type) struct stack_st_##type
  ------------------
  640|    361|    int primes;
  641|    361|    const RSA_PSS_PARAMS_30 *pss_params = ossl_rsa_get0_pss_params_30((RSA *)rsa);
  642|    361|    int ret = 0;
  643|       |
  644|    361|    if (out == NULL || rsa == NULL) {
  ------------------
  |  Branch (644:9): [True: 0, False: 361]
  |  Branch (644:24): [True: 0, False: 361]
  ------------------
  645|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   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|        goto err;
  647|      0|    }
  648|       |
  649|    361|    factors = sk_BIGNUM_const_new_null();
  650|    361|    exps = sk_BIGNUM_const_new_null();
  651|    361|    coeffs = sk_BIGNUM_const_new_null();
  652|       |
  653|    361|    if (factors == NULL || exps == NULL || coeffs == NULL) {
  ------------------
  |  Branch (653:9): [True: 0, False: 361]
  |  Branch (653:28): [True: 0, False: 361]
  |  Branch (653:44): [True: 0, False: 361]
  ------------------
  654|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  655|      0|        goto err;
  656|      0|    }
  657|       |
  658|    361|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  567|    361|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (658:9): [True: 361, False: 0]
  ------------------
  659|    361|        type_label = "Private-Key";
  660|    361|        modulus_label = "modulus:";
  661|    361|        exponent_label = "publicExponent:";
  662|    361|    } else if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
  ------------------
  |  |  568|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (662:16): [True: 0, False: 0]
  ------------------
  663|      0|        type_label = "Public-Key";
  664|      0|        modulus_label = "Modulus:";
  665|      0|        exponent_label = "Exponent:";
  666|      0|    }
  667|       |
  668|    361|    RSA_get0_key(rsa, &rsa_n, &rsa_e, &rsa_d);
  669|    361|    ossl_rsa_get0_all_params((RSA *)rsa, factors, exps, coeffs);
  670|    361|    primes = sk_BIGNUM_const_num(factors);
  671|       |
  672|    361|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  567|    361|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (672:9): [True: 361, False: 0]
  ------------------
  673|    361|        if (BIO_printf(out, "%s: (%d bit, %d primes)\n",
  ------------------
  |  Branch (673:13): [True: 0, False: 361]
  ------------------
  674|    361|                       type_label, BN_num_bits(rsa_n), primes) <= 0)
  675|      0|            goto err;
  676|    361|    } else {
  677|      0|        if (BIO_printf(out, "%s: (%d bit)\n",
  ------------------
  |  Branch (677:13): [True: 0, False: 0]
  ------------------
  678|      0|                       type_label, BN_num_bits(rsa_n)) <= 0)
  679|      0|            goto err;
  680|      0|    }
  681|       |
  682|    361|    if (!print_labeled_bignum(out, modulus_label, rsa_n))
  ------------------
  |  Branch (682:9): [True: 0, False: 361]
  ------------------
  683|      0|        goto err;
  684|    361|    if (!print_labeled_bignum(out, exponent_label, rsa_e))
  ------------------
  |  Branch (684:9): [True: 0, False: 361]
  ------------------
  685|      0|        goto err;
  686|    361|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  567|    361|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (686:9): [True: 361, False: 0]
  ------------------
  687|    361|        int i;
  688|       |
  689|    361|        if (!print_labeled_bignum(out, "privateExponent:", rsa_d))
  ------------------
  |  Branch (689:13): [True: 0, False: 361]
  ------------------
  690|      0|            goto err;
  691|    361|        if (!print_labeled_bignum(out, "prime1:",
  ------------------
  |  Branch (691:13): [True: 0, False: 361]
  ------------------
  692|    361|                                  sk_BIGNUM_const_value(factors, 0)))
  693|      0|            goto err;
  694|    361|        if (!print_labeled_bignum(out, "prime2:",
  ------------------
  |  Branch (694:13): [True: 0, False: 361]
  ------------------
  695|    361|                                  sk_BIGNUM_const_value(factors, 1)))
  696|      0|            goto err;
  697|    361|        if (!print_labeled_bignum(out, "exponent1:",
  ------------------
  |  Branch (697:13): [True: 0, False: 361]
  ------------------
  698|    361|                                  sk_BIGNUM_const_value(exps, 0)))
  699|      0|            goto err;
  700|    361|        if (!print_labeled_bignum(out, "exponent2:",
  ------------------
  |  Branch (700:13): [True: 0, False: 361]
  ------------------
  701|    361|                                  sk_BIGNUM_const_value(exps, 1)))
  702|      0|            goto err;
  703|    361|        if (!print_labeled_bignum(out, "coefficient:",
  ------------------
  |  Branch (703:13): [True: 0, False: 361]
  ------------------
  704|    361|                                  sk_BIGNUM_const_value(coeffs, 0)))
  705|      0|            goto err;
  706|  28.2k|        for (i = 2; i < sk_BIGNUM_const_num(factors); i++) {
  ------------------
  |  Branch (706:21): [True: 27.8k, False: 361]
  ------------------
  707|  27.8k|            if (BIO_printf(out, "prime%d:", i + 1) <= 0)
  ------------------
  |  Branch (707:17): [True: 0, False: 27.8k]
  ------------------
  708|      0|                goto err;
  709|  27.8k|            if (!print_labeled_bignum(out, NULL,
  ------------------
  |  Branch (709:17): [True: 0, False: 27.8k]
  ------------------
  710|  27.8k|                                      sk_BIGNUM_const_value(factors, i)))
  711|      0|                goto err;
  712|  27.8k|            if (BIO_printf(out, "exponent%d:", i + 1) <= 0)
  ------------------
  |  Branch (712:17): [True: 0, False: 27.8k]
  ------------------
  713|      0|                goto err;
  714|  27.8k|            if (!print_labeled_bignum(out, NULL,
  ------------------
  |  Branch (714:17): [True: 0, False: 27.8k]
  ------------------
  715|  27.8k|                                      sk_BIGNUM_const_value(exps, i)))
  716|      0|                goto err;
  717|  27.8k|            if (BIO_printf(out, "coefficient%d:", i + 1) <= 0)
  ------------------
  |  Branch (717:17): [True: 0, False: 27.8k]
  ------------------
  718|      0|                goto err;
  719|  27.8k|            if (!print_labeled_bignum(out, NULL,
  ------------------
  |  Branch (719:17): [True: 0, False: 27.8k]
  ------------------
  720|  27.8k|                                      sk_BIGNUM_const_value(coeffs, i - 1)))
  721|      0|                goto err;
  722|  27.8k|        }
  723|    361|    }
  724|       |
  725|    361|    if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0) {
  ------------------
  |  |  570|    361|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  ------------------
  |  Branch (725:9): [True: 361, False: 0]
  ------------------
  726|    361|        switch (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK)) {
  ------------------
  |  |  117|    361|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  |  Branch (726:17): [True: 0, False: 361]
  ------------------
  727|    360|        case RSA_FLAG_TYPE_RSA:
  ------------------
  |  |  118|    360|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  |  Branch (727:9): [True: 360, False: 1]
  ------------------
  728|    360|            if (!ossl_rsa_pss_params_30_is_unrestricted(pss_params)) {
  ------------------
  |  Branch (728:17): [True: 0, False: 360]
  ------------------
  729|      0|                if (BIO_printf(out, "(INVALID PSS PARAMETERS)\n") <= 0)
  ------------------
  |  Branch (729:21): [True: 0, False: 0]
  ------------------
  730|      0|                    goto err;
  731|      0|            }
  732|    360|            break;
  733|    360|        case RSA_FLAG_TYPE_RSASSAPSS:
  ------------------
  |  |  119|      1|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (733:9): [True: 1, False: 360]
  ------------------
  734|      1|            if (ossl_rsa_pss_params_30_is_unrestricted(pss_params)) {
  ------------------
  |  Branch (734:17): [True: 0, False: 1]
  ------------------
  735|      0|                if (BIO_printf(out, "No PSS parameter restrictions\n") <= 0)
  ------------------
  |  Branch (735:21): [True: 0, False: 0]
  ------------------
  736|      0|                    goto err;
  737|      1|            } else {
  738|      1|                int hashalg_nid = ossl_rsa_pss_params_30_hashalg(pss_params);
  739|      1|                int maskgenalg_nid =
  740|      1|                    ossl_rsa_pss_params_30_maskgenalg(pss_params);
  741|      1|                int maskgenhashalg_nid =
  742|      1|                    ossl_rsa_pss_params_30_maskgenhashalg(pss_params);
  743|      1|                int saltlen = ossl_rsa_pss_params_30_saltlen(pss_params);
  744|      1|                int trailerfield =
  745|      1|                    ossl_rsa_pss_params_30_trailerfield(pss_params);
  746|       |
  747|      1|                if (BIO_printf(out, "PSS parameter restrictions:\n") <= 0)
  ------------------
  |  Branch (747:21): [True: 0, False: 1]
  ------------------
  748|      0|                    goto err;
  749|      1|                if (BIO_printf(out, "  Hash Algorithm: %s%s\n",
  ------------------
  |  Branch (749:21): [True: 0, False: 1]
  ------------------
  750|      1|                               ossl_rsa_oaeppss_nid2name(hashalg_nid),
  751|      1|                               (hashalg_nid == NID_sha1
  ------------------
  |  | 2312|      1|#define NID_sha1                64
  ------------------
  |  Branch (751:33): [True: 1, False: 0]
  ------------------
  752|      1|                                ? " (default)" : "")) <= 0)
  753|      0|                    goto err;
  754|      1|                if (BIO_printf(out, "  Mask Algorithm: %s with %s%s\n",
  ------------------
  |  Branch (754:21): [True: 0, False: 1]
  ------------------
  755|      1|                               ossl_rsa_mgf_nid2name(maskgenalg_nid),
  756|      1|                               ossl_rsa_oaeppss_nid2name(maskgenhashalg_nid),
  757|      1|                               (maskgenalg_nid == NID_mgf1
  ------------------
  |  |  573|      2|#define NID_mgf1                911
  ------------------
  |  Branch (757:33): [True: 1, False: 0]
  ------------------
  758|      1|                                && maskgenhashalg_nid == NID_sha1
  ------------------
  |  | 2312|      1|#define NID_sha1                64
  ------------------
  |  Branch (758:36): [True: 1, False: 0]
  ------------------
  759|      1|                                ? " (default)" : "")) <= 0)
  760|      0|                    goto err;
  761|      1|                if (BIO_printf(out, "  Minimum Salt Length: %d%s\n",
  ------------------
  |  Branch (761:21): [True: 0, False: 1]
  ------------------
  762|      1|                               saltlen,
  763|      1|                               (saltlen == 20 ? " (default)" : "")) <= 0)
  ------------------
  |  Branch (763:33): [True: 1, False: 0]
  ------------------
  764|      0|                    goto err;
  765|      1|                if (BIO_printf(out, "  Trailer Field: 0x%x%s\n",
  ------------------
  |  Branch (765:21): [True: 0, False: 1]
  ------------------
  766|      1|                               trailerfield,
  767|      1|                               (trailerfield == 1 ? " (default)" : "")) <= 0)
  ------------------
  |  Branch (767:33): [True: 1, False: 0]
  ------------------
  768|      0|                    goto err;
  769|      1|            }
  770|      1|            break;
  771|    361|        }
  772|    361|    }
  773|       |
  774|    361|    ret = 1;
  775|    361| err:
  776|    361|    sk_BIGNUM_const_free(factors);
  777|    361|    sk_BIGNUM_const_free(exps);
  778|    361|    sk_BIGNUM_const_free(coeffs);
  779|    361|    return ret;
  780|    361|}
encode_key2text.c:rsapss2text_encode:
  837|      1|    {                                                                   \
  838|      1|        /* We don't deal with abstract objects */                       \
  839|      1|        if (key_abstract != NULL) {                                     \
  ------------------
  |  Branch (839:13): [True: 0, False: 1]
  ------------------
  840|      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)
  |  |  ------------------
  ------------------
  841|      0|            return 0;                                                   \
  842|      0|        }                                                               \
  843|      1|        return key2text_encode(vctx, key, selection, cout,              \
  844|      1|                               type##_to_text, cb, cbarg);              \
  845|      1|    }                                                                   \

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

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|  5.71k|static void *name##_newctx(void *prov_ctx)                                     \
   56|  5.71k|{                                                                              \
   57|  5.71k|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|  5.71k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.71k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.71k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 5.71k, False: 0]
  ------------------
   58|  5.71k|    return ctx;                                                                \
   59|  5.71k|}                                                                              \
sha2_prov.c:sha1_internal_final:
   41|  5.71k|                                 size_t outsz)                                 \
   42|  5.71k|{                                                                              \
   43|  5.71k|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 5.71k, False: 0]
  |  Branch (43:35): [True: 5.71k, False: 0]
  |  Branch (43:56): [True: 5.71k, False: 0]
  ------------------
   44|  5.71k|        *outl = dgstsize;                                                      \
   45|  5.71k|        return 1;                                                              \
   46|  5.71k|    }                                                                          \
   47|  5.71k|    return 0;                                                                  \
   48|  5.71k|}
sha2_prov.c:sha1_freectx:
   60|  5.71k|static void name##_freectx(void *vctx)                                         \
   61|  5.71k|{                                                                              \
   62|  5.71k|    CTX *ctx = (CTX *)vctx;                                                    \
   63|  5.71k|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|  5.71k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  5.71k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  5.71k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|  5.71k|}                                                                              \
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|  5.71k|static int name##_internal_init(void *ctx, const OSSL_PARAM params[])          \
  105|  5.71k|{                                                                              \
  106|  5.71k|    return ossl_prov_is_running()                                              \
  ------------------
  |  Branch (106:12): [True: 5.71k, False: 0]
  ------------------
  107|  5.71k|           && init(ctx)                                                        \
  ------------------
  |  Branch (107:15): [True: 5.71k, False: 0]
  ------------------
  108|  5.71k|           && set_ctx_params(ctx, params);                                     \
  ------------------
  |  Branch (108:15): [True: 5.71k, False: 0]
  ------------------
  109|  5.71k|}                                                                              \
sha2_prov.c:sha224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha256_192_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_newctx:
   55|      4|static void *name##_newctx(void *prov_ctx)                                     \
   56|      4|{                                                                              \
   57|      4|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 4, False: 0]
  ------------------
   58|      4|    return ctx;                                                                \
   59|      4|}                                                                              \
sha2_prov.c:sha512_internal_final:
   41|      4|                                 size_t outsz)                                 \
   42|      4|{                                                                              \
   43|      4|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 4, False: 0]
  |  Branch (43:35): [True: 4, False: 0]
  |  Branch (43:56): [True: 4, False: 0]
  ------------------
   44|      4|        *outl = dgstsize;                                                      \
   45|      4|        return 1;                                                              \
   46|      4|    }                                                                          \
   47|      4|    return 0;                                                                  \
   48|      4|}
sha2_prov.c:sha512_freectx:
   60|      4|static void name##_freectx(void *vctx)                                         \
   61|      4|{                                                                              \
   62|      4|    CTX *ctx = (CTX *)vctx;                                                    \
   63|      4|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|      4|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|      4|}                                                                              \
sha2_prov.c:sha512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_internal_init:
   91|      4|                                ossl_unused const OSSL_PARAM params[])         \
   92|      4|{                                                                              \
   93|      4|    return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (93:12): [True: 4, False: 0]
  |  Branch (93:38): [True: 4, False: 0]
  ------------------
   94|      4|}                                                                              \
sha2_prov.c:sha512_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:shake_128_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:shake_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_kmac_128_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_kmac_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sm3_prov.c:sm3_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}

dh_kmgmt.c:dh_load:
  821|     98|{
  822|     98|    DH *dh = NULL;
  823|       |
  824|     98|    if (ossl_prov_is_running() && reference_sz == sizeof(dh)) {
  ------------------
  |  Branch (824:9): [True: 98, False: 0]
  |  Branch (824:35): [True: 98, False: 0]
  ------------------
  825|       |        /* The contents of the reference is the address to our object */
  826|     98|        dh = *(DH **)reference;
  827|       |        /* We grabbed, so we detach it */
  828|     98|        *(DH **)reference = NULL;
  829|     98|        return dh;
  830|     98|    }
  831|      0|    return NULL;
  832|     98|}
dh_kmgmt.c:dh_freedata:
  126|     98|{
  127|     98|    DH_free(keydata);
  128|     98|}
dh_kmgmt.c:dh_get_params:
  316|     98|{
  317|     98|    DH *dh = key;
  318|     98|    OSSL_PARAM *p;
  319|       |
  320|     98|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  333|     98|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (320:9): [True: 98, False: 0]
  ------------------
  321|     98|        && !OSSL_PARAM_set_int(p, DH_bits(dh)))
  ------------------
  |  Branch (321:12): [True: 0, False: 98]
  ------------------
  322|      0|        return 0;
  323|     98|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  447|     98|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (323:9): [True: 98, False: 0]
  ------------------
  324|     98|        && !OSSL_PARAM_set_int(p, DH_security_bits(dh)))
  ------------------
  |  Branch (324:12): [True: 0, False: 98]
  ------------------
  325|      0|        return 0;
  326|     98|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  387|     98|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (326:9): [True: 98, False: 0]
  ------------------
  327|     98|        && !OSSL_PARAM_set_int(p, DH_size(dh)))
  ------------------
  |  Branch (327:12): [True: 0, False: 98]
  ------------------
  328|      0|        return 0;
  329|     98|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL) {
  ------------------
  |  |  363|     98|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
  |  Branch (329:9): [True: 0, False: 98]
  ------------------
  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|     98|    return ossl_dh_params_todata(dh, NULL, params)
  ------------------
  |  Branch (338:12): [True: 98, False: 0]
  ------------------
  339|     98|        && ossl_dh_key_todata(dh, NULL, params, 1);
  ------------------
  |  Branch (339:12): [True: 98, False: 0]
  ------------------
  340|     98|}
dh_kmgmt.c:dh_has:
  131|     25|{
  132|     25|    const DH *dh = keydata;
  133|     25|    int ok = 1;
  134|       |
  135|     25|    if (!ossl_prov_is_running() || dh == NULL)
  ------------------
  |  Branch (135:9): [True: 0, False: 25]
  |  Branch (135:36): [True: 0, False: 25]
  ------------------
  136|      0|        return 0;
  137|     25|    if ((selection & DH_POSSIBLE_SELECTIONS) == 0)
  ------------------
  |  |   52|     25|    (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
  |  |  ------------------
  |  |  |  |  577|     25|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  567|     25|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  568|     25|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
  |  |  ------------------
  |  |  |  |  569|     25|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  ------------------
  |  Branch (137:9): [True: 0, False: 25]
  ------------------
  138|      0|        return 1; /* the selection is not missing */
  139|       |
  140|     25|    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  568|     25|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (140:9): [True: 0, False: 25]
  ------------------
  141|      0|        ok = ok && (DH_get0_pub_key(dh) != NULL);
  ------------------
  |  Branch (141:14): [True: 0, False: 0]
  |  Branch (141:20): [True: 0, False: 0]
  ------------------
  142|     25|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  567|     25|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (142:9): [True: 25, False: 0]
  ------------------
  143|     25|        ok = ok && (DH_get0_priv_key(dh) != NULL);
  ------------------
  |  Branch (143:14): [True: 25, False: 0]
  |  Branch (143:20): [True: 25, False: 0]
  ------------------
  144|     25|    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
  ------------------
  |  |  569|     25|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (144:9): [True: 0, False: 25]
  ------------------
  145|      0|        ok = ok && (DH_get0_p(dh) != NULL && DH_get0_g(dh) != NULL);
  ------------------
  |  Branch (145:14): [True: 0, False: 0]
  |  Branch (145:21): [True: 0, False: 0]
  |  Branch (145:46): [True: 0, False: 0]
  ------------------
  146|     25|    return ok;
  147|     25|}

dsa_kmgmt.c:dsa_load:
  658|    605|{
  659|    605|    DSA *dsa = NULL;
  660|       |
  661|    605|    if (ossl_prov_is_running() && reference_sz == sizeof(dsa)) {
  ------------------
  |  Branch (661:9): [True: 605, False: 0]
  |  Branch (661:35): [True: 605, False: 0]
  ------------------
  662|       |        /* The contents of the reference is the address to our object */
  663|    605|        dsa = *(DSA **)reference;
  664|       |        /* We grabbed, so we detach it */
  665|    605|        *(DSA **)reference = NULL;
  666|    605|        return dsa;
  667|    605|    }
  668|      0|    return NULL;
  669|    605|}
dsa_kmgmt.c:dsa_freedata:
  125|    605|{
  126|    605|    DSA_free(keydata);
  127|    605|}
dsa_kmgmt.c:dsa_get_params:
  312|    605|{
  313|    605|    DSA *dsa = key;
  314|    605|    OSSL_PARAM *p;
  315|       |
  316|    605|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  333|    605|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (316:9): [True: 605, False: 0]
  ------------------
  317|    605|        && !OSSL_PARAM_set_int(p, DSA_bits(dsa)))
  ------------------
  |  Branch (317:12): [True: 0, False: 605]
  ------------------
  318|      0|        return 0;
  319|    605|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  447|    605|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (319:9): [True: 605, False: 0]
  ------------------
  320|    605|        && !OSSL_PARAM_set_int(p, DSA_security_bits(dsa)))
  ------------------
  |  Branch (320:12): [True: 0, False: 605]
  ------------------
  321|      0|        return 0;
  322|    605|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  387|    605|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (322:9): [True: 605, False: 0]
  ------------------
  323|    605|        && !OSSL_PARAM_set_int(p, DSA_size(dsa)))
  ------------------
  |  Branch (323:12): [True: 0, False: 605]
  ------------------
  324|      0|        return 0;
  325|    605|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  335|    605|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (325:9): [True: 0, False: 605]
  ------------------
  326|    605|        && !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|    605|    return ossl_ffc_params_todata(ossl_dsa_get0_params(dsa), NULL, params)
  ------------------
  |  Branch (328:12): [True: 605, False: 0]
  ------------------
  329|    605|           && dsa_key_todata(dsa, NULL, params, 1);
  ------------------
  |  Branch (329:15): [True: 605, False: 0]
  ------------------
  330|    605|}
dsa_kmgmt.c:dsa_key_todata:
   99|    605|{
  100|    605|    const BIGNUM *priv = NULL, *pub = NULL;
  101|       |
  102|    605|    if (dsa == NULL)
  ------------------
  |  Branch (102:9): [True: 0, False: 605]
  ------------------
  103|      0|        return 0;
  104|       |
  105|    605|    DSA_get0_key(dsa, &pub, &priv);
  106|    605|    if (include_private
  ------------------
  |  Branch (106:9): [True: 605, False: 0]
  ------------------
  107|    605|        && priv != NULL
  ------------------
  |  Branch (107:12): [True: 604, False: 1]
  ------------------
  108|    605|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PRIV_KEY, priv))
  ------------------
  |  |  391|    604|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  |  Branch (108:12): [True: 0, False: 604]
  ------------------
  109|      0|        return 0;
  110|    605|    if (pub != NULL
  ------------------
  |  Branch (110:9): [True: 605, False: 0]
  ------------------
  111|    605|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PUB_KEY, pub))
  ------------------
  |  |  393|    605|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  |  Branch (111:12): [True: 0, False: 605]
  ------------------
  112|      0|        return 0;
  113|       |
  114|    605|    return 1;
  115|    605|}
dsa_kmgmt.c:dsa_has:
  130|    604|{
  131|    604|    const DSA *dsa = keydata;
  132|    604|    int ok = 1;
  133|       |
  134|    604|    if (!ossl_prov_is_running() || dsa == NULL)
  ------------------
  |  Branch (134:9): [True: 0, False: 604]
  |  Branch (134:36): [True: 0, False: 604]
  ------------------
  135|      0|        return 0;
  136|    604|    if ((selection & DSA_POSSIBLE_SELECTIONS) == 0)
  ------------------
  |  |   50|    604|    (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
  |  |  ------------------
  |  |  |  |  577|    604|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  567|    604|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  568|    604|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
  |  |  ------------------
  |  |  |  |  569|    604|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  ------------------
  |  Branch (136:9): [True: 0, False: 604]
  ------------------
  137|      0|        return 1; /* the selection is not missing */
  138|       |
  139|    604|    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  568|    604|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (139:9): [True: 0, False: 604]
  ------------------
  140|      0|        ok = ok && (DSA_get0_pub_key(dsa) != NULL);
  ------------------
  |  Branch (140:14): [True: 0, False: 0]
  |  Branch (140:20): [True: 0, False: 0]
  ------------------
  141|    604|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  567|    604|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (141:9): [True: 604, False: 0]
  ------------------
  142|    604|        ok = ok && (DSA_get0_priv_key(dsa) != NULL);
  ------------------
  |  Branch (142:14): [True: 604, False: 0]
  |  Branch (142:20): [True: 604, False: 0]
  ------------------
  143|    604|    if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
  ------------------
  |  |  569|    604|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  ------------------
  |  Branch (143:9): [True: 0, False: 604]
  ------------------
  144|      0|        ok = ok && (DSA_get0_p(dsa) != NULL && DSA_get0_g(dsa) != NULL);
  ------------------
  |  Branch (144:14): [True: 0, False: 0]
  |  Branch (144:21): [True: 0, False: 0]
  |  Branch (144:48): [True: 0, False: 0]
  ------------------
  145|    604|    return ok;
  146|    604|}

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

ecx_kmgmt.c:x25519_get_params:
  322|      2|{
  323|      2|    return ecx_get_params(key, params, X25519_BITS, X25519_SECURITY_BITS,
  ------------------
  |  |   33|      2|#  define X25519_BITS           253
  ------------------
                  return ecx_get_params(key, params, X25519_BITS, X25519_SECURITY_BITS,
  ------------------
  |  |   34|      2|#  define X25519_SECURITY_BITS  128
  ------------------
  324|      2|                          X25519_KEYLEN);
  ------------------
  |  |   26|      2|#  define X25519_KEYLEN         32
  ------------------
  325|      2|}
ecx_kmgmt.c:ecx_get_params:
  287|     10|{
  288|     10|    ECX_KEY *ecx = key;
  289|     10|    OSSL_PARAM *p;
  290|       |
  291|     10|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  333|     10|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (291:9): [True: 10, False: 0]
  ------------------
  292|     10|        && !OSSL_PARAM_set_int(p, bits))
  ------------------
  |  Branch (292:12): [True: 0, False: 10]
  ------------------
  293|      0|        return 0;
  294|     10|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  447|     10|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (294:9): [True: 10, False: 0]
  ------------------
  295|     10|        && !OSSL_PARAM_set_int(p, secbits))
  ------------------
  |  Branch (295:12): [True: 0, False: 10]
  ------------------
  296|      0|        return 0;
  297|     10|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  387|     10|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (297:9): [True: 10, False: 0]
  ------------------
  298|     10|        && !OSSL_PARAM_set_int(p, size))
  ------------------
  |  Branch (298:12): [True: 0, False: 10]
  ------------------
  299|      0|        return 0;
  300|     10|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL
  ------------------
  |  |  363|     10|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
  |  Branch (300:9): [True: 0, False: 10]
  ------------------
  301|     10|            && (ecx->type == ECX_KEY_TYPE_X25519
  ------------------
  |  Branch (301:17): [True: 0, False: 0]
  ------------------
  302|      0|                || ecx->type == ECX_KEY_TYPE_X448)) {
  ------------------
  |  Branch (302:20): [True: 0, False: 0]
  ------------------
  303|      0|        if (!OSSL_PARAM_set_octet_string(p, ecx->pubkey, ecx->keylen))
  ------------------
  |  Branch (303:13): [True: 0, False: 0]
  ------------------
  304|      0|            return 0;
  305|      0|    }
  306|       |
  307|     10|    return key_to_params(ecx, NULL, params, 1);
  308|     10|}
ecx_kmgmt.c:key_to_params:
  215|     10|{
  216|     10|    if (key == NULL)
  ------------------
  |  Branch (216:9): [True: 0, False: 10]
  ------------------
  217|      0|        return 0;
  218|       |
  219|     10|    if (!ossl_param_build_set_octet_string(tmpl, params,
  ------------------
  |  Branch (219:9): [True: 0, False: 10]
  ------------------
  220|     10|                                           OSSL_PKEY_PARAM_PUB_KEY,
  ------------------
  |  |  393|     10|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  221|     10|                                           key->pubkey, key->keylen))
  222|      0|        return 0;
  223|       |
  224|     10|    if (include_private
  ------------------
  |  Branch (224:9): [True: 10, False: 0]
  ------------------
  225|     10|        && key->privkey != NULL
  ------------------
  |  Branch (225:12): [True: 7, False: 3]
  ------------------
  226|     10|        && !ossl_param_build_set_octet_string(tmpl, params,
  ------------------
  |  Branch (226:12): [True: 0, False: 7]
  ------------------
  227|      7|                                              OSSL_PKEY_PARAM_PRIV_KEY,
  ------------------
  |  |  391|      7|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  228|      7|                                              key->privkey, key->keylen))
  229|      0|        return 0;
  230|       |
  231|     10|    return 1;
  232|     10|}
ecx_kmgmt.c:ecx_has:
  127|      7|{
  128|      7|    const ECX_KEY *key = keydata;
  129|      7|    int ok = 0;
  130|       |
  131|      7|    if (ossl_prov_is_running() && key != NULL) {
  ------------------
  |  Branch (131:9): [True: 7, False: 0]
  |  Branch (131:35): [True: 7, False: 0]
  ------------------
  132|       |        /*
  133|       |         * ECX keys always have all the parameters they need (i.e. none).
  134|       |         * Therefore we always return with 1, if asked about parameters.
  135|       |         */
  136|      7|        ok = 1;
  137|       |
  138|      7|        if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  568|      7|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (138:13): [True: 0, False: 7]
  ------------------
  139|      0|            ok = ok && key->haspubkey;
  ------------------
  |  Branch (139:18): [True: 0, False: 0]
  |  Branch (139:24): [True: 0, False: 0]
  ------------------
  140|       |
  141|      7|        if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  567|      7|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (141:13): [True: 7, False: 0]
  ------------------
  142|      7|            ok = ok && key->privkey != NULL;
  ------------------
  |  Branch (142:18): [True: 7, False: 0]
  |  Branch (142:24): [True: 7, False: 0]
  ------------------
  143|      7|    }
  144|      7|    return ok;
  145|      7|}
ecx_kmgmt.c:ecx_load:
  831|     10|{
  832|     10|    ECX_KEY *key = NULL;
  833|       |
  834|     10|    if (ossl_prov_is_running() && reference_sz == sizeof(key)) {
  ------------------
  |  Branch (834:9): [True: 10, False: 0]
  |  Branch (834:35): [True: 10, False: 0]
  ------------------
  835|       |        /* The contents of the reference is the address to our object */
  836|     10|        key = *(ECX_KEY **)reference;
  837|       |        /* We grabbed, so we detach it */
  838|     10|        *(ECX_KEY **)reference = NULL;
  839|     10|        return key;
  840|     10|    }
  841|      0|    return NULL;
  842|     10|}
ecx_kmgmt.c:x448_get_params:
  328|      3|{
  329|      3|    return ecx_get_params(key, params, X448_BITS, X448_SECURITY_BITS,
  ------------------
  |  |   36|      3|#  define X448_BITS             448
  ------------------
                  return ecx_get_params(key, params, X448_BITS, X448_SECURITY_BITS,
  ------------------
  |  |   37|      3|#  define X448_SECURITY_BITS    224
  ------------------
  330|      3|                          X448_KEYLEN);
  ------------------
  |  |   27|      3|#  define X448_KEYLEN           56
  ------------------
  331|      3|}
ecx_kmgmt.c:ed25519_get_params:
  334|      3|{
  335|      3|    return ecx_get_params(key, params, ED25519_BITS, ED25519_SECURITY_BITS,
  ------------------
  |  |   39|      3|#  define ED25519_BITS          256
  ------------------
                  return ecx_get_params(key, params, ED25519_BITS, ED25519_SECURITY_BITS,
  ------------------
  |  |   41|      3|#  define ED25519_SECURITY_BITS 128
  ------------------
  |  Branch (335:12): [True: 3, False: 0]
  ------------------
  336|      3|                          ED25519_SIGSIZE)
  ------------------
  |  |   42|      3|#  define ED25519_SIGSIZE       64
  ------------------
  337|      3|        && ed_get_params(key, params);
  ------------------
  |  Branch (337:12): [True: 3, False: 0]
  ------------------
  338|      3|}
ecx_kmgmt.c:ed_get_params:
  311|      5|{
  312|      5|    OSSL_PARAM *p;
  313|       |
  314|      5|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (314:9): [True: 0, False: 5]
  ------------------
  315|      5|                               OSSL_PKEY_PARAM_MANDATORY_DIGEST)) != NULL
  ------------------
  |  |  385|      5|# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
  ------------------
  316|      5|        && !OSSL_PARAM_set_utf8_string(p, ""))
  ------------------
  |  Branch (316:12): [True: 0, False: 0]
  ------------------
  317|      0|        return 0;
  318|      5|    return 1;
  319|      5|}
ecx_kmgmt.c:ed448_get_params:
  341|      2|{
  342|      2|    return ecx_get_params(key, params, ED448_BITS, ED448_SECURITY_BITS,
  ------------------
  |  |   44|      2|#  define ED448_BITS            456
  ------------------
                  return ecx_get_params(key, params, ED448_BITS, ED448_SECURITY_BITS,
  ------------------
  |  |   46|      2|#  define ED448_SECURITY_BITS   224
  ------------------
  |  Branch (342:12): [True: 2, False: 0]
  ------------------
  343|      2|                          ED448_SIGSIZE)
  ------------------
  |  |   47|      2|#  define ED448_SIGSIZE         114
  ------------------
  344|      2|        && ed_get_params(key, params);
  ------------------
  |  Branch (344:12): [True: 2, False: 0]
  ------------------
  345|      2|}

rsa_kmgmt.c:rsa_load:
  673|    371|{
  674|    371|    return common_load(reference, reference_sz, RSA_FLAG_TYPE_RSA);
  ------------------
  |  |  118|    371|# define RSA_FLAG_TYPE_RSA             0x0000
  ------------------
  675|    371|}
rsa_kmgmt.c:common_load:
  655|    374|{
  656|    374|    RSA *rsa = NULL;
  657|       |
  658|    374|    if (ossl_prov_is_running() && reference_sz == sizeof(rsa)) {
  ------------------
  |  Branch (658:9): [True: 374, False: 0]
  |  Branch (658:35): [True: 374, False: 0]
  ------------------
  659|       |        /* The contents of the reference is the address to our object */
  660|    374|        rsa = *(RSA **)reference;
  661|       |
  662|    374|        if (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK) != expected_rsa_type)
  ------------------
  |  |  117|    374|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  |  Branch (662:13): [True: 0, False: 374]
  ------------------
  663|      0|            return NULL;
  664|       |
  665|       |        /* We grabbed, so we detach it */
  666|    374|        *(RSA **)reference = NULL;
  667|    374|        return rsa;
  668|    374|    }
  669|      0|    return NULL;
  670|    374|}
rsa_kmgmt.c:rsa_freedata:
  111|    374|{
  112|    374|    RSA_free(keydata);
  113|    374|}
rsa_kmgmt.c:rsa_get_params:
  331|    374|{
  332|    374|    RSA *rsa = key;
  333|    374|    const RSA_PSS_PARAMS_30 *pss_params = ossl_rsa_get0_pss_params_30(rsa);
  334|    374|    int rsa_type = RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK);
  ------------------
  |  |  117|    374|# define RSA_FLAG_TYPE_MASK            0xF000
  ------------------
  335|    374|    OSSL_PARAM *p;
  336|    374|    int empty = RSA_get0_n(rsa) == NULL;
  337|       |
  338|    374|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  333|    374|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (338:9): [True: 374, False: 0]
  ------------------
  339|    374|        && (empty || !OSSL_PARAM_set_int(p, RSA_bits(rsa))))
  ------------------
  |  Branch (339:13): [True: 0, False: 374]
  |  Branch (339:22): [True: 0, False: 374]
  ------------------
  340|      0|        return 0;
  341|    374|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  447|    374|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (341:9): [True: 374, False: 0]
  ------------------
  342|    374|        && (empty || !OSSL_PARAM_set_int(p, RSA_security_bits(rsa))))
  ------------------
  |  Branch (342:13): [True: 0, False: 374]
  |  Branch (342:22): [True: 0, False: 374]
  ------------------
  343|      0|        return 0;
  344|    374|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  387|    374|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (344:9): [True: 374, False: 0]
  ------------------
  345|    374|        && (empty || !OSSL_PARAM_set_int(p, RSA_size(rsa))))
  ------------------
  |  Branch (345:13): [True: 0, False: 374]
  |  Branch (345:22): [True: 0, False: 374]
  ------------------
  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|    374|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  335|    374|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (352:9): [True: 0, False: 374]
  ------------------
  353|    374|        && (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|    374|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (363:9): [True: 0, False: 374]
  ------------------
  364|    374|                               OSSL_PKEY_PARAM_MANDATORY_DIGEST)) != NULL
  ------------------
  |  |  385|    374|# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
  ------------------
  365|    374|        && rsa_type == RSA_FLAG_TYPE_RSASSAPSS
  ------------------
  |  |  119|    374|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (365:12): [True: 0, False: 0]
  ------------------
  366|    374|        && !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|    374|    return (rsa_type != RSA_FLAG_TYPE_RSASSAPSS
  ------------------
  |  |  119|    748|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  |  Branch (373:13): [True: 371, False: 3]
  ------------------
  374|    374|            || ossl_rsa_pss_params_30_todata(pss_params, NULL, params))
  ------------------
  |  Branch (374:16): [True: 3, False: 0]
  ------------------
  375|    374|        && ossl_rsa_todata(rsa, NULL, params, 1);
  ------------------
  |  Branch (375:12): [True: 374, False: 0]
  ------------------
  376|    374|}
rsa_kmgmt.c:rsa_has:
  116|    361|{
  117|    361|    const RSA *rsa = keydata;
  118|    361|    int ok = 1;
  119|       |
  120|    361|    if (rsa == NULL || !ossl_prov_is_running())
  ------------------
  |  Branch (120:9): [True: 0, False: 361]
  |  Branch (120:24): [True: 0, False: 361]
  ------------------
  121|      0|        return 0;
  122|    361|    if ((selection & RSA_POSSIBLE_SELECTIONS) == 0)
  ------------------
  |  |   57|    361|    (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  577|    361|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  567|    361|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  568|    361|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  570|    361|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
  |  Branch (122:9): [True: 0, False: 361]
  ------------------
  123|      0|        return 1; /* the selection is not missing */
  124|       |
  125|       |    /* OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS are always available even if empty */
  126|    361|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
  ------------------
  |  |  577|    361|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  567|    361|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  568|    361|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (126:9): [True: 361, False: 0]
  ------------------
  127|    361|        ok = ok && (RSA_get0_n(rsa) != NULL);
  ------------------
  |  Branch (127:14): [True: 361, False: 0]
  |  Branch (127:20): [True: 361, False: 0]
  ------------------
  128|    361|    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
  ------------------
  |  |  568|    361|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (128:9): [True: 0, False: 361]
  ------------------
  129|      0|        ok = ok && (RSA_get0_e(rsa) != NULL);
  ------------------
  |  Branch (129:14): [True: 0, False: 0]
  |  Branch (129:20): [True: 0, False: 0]
  ------------------
  130|    361|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  567|    361|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (130:9): [True: 361, False: 0]
  ------------------
  131|    361|        ok = ok && (RSA_get0_d(rsa) != NULL);
  ------------------
  |  Branch (131:14): [True: 361, False: 0]
  |  Branch (131:20): [True: 361, False: 0]
  ------------------
  132|    361|    return ok;
  133|    361|}
rsa_kmgmt.c:rsapss_load:
  678|      3|{
  679|      3|    return common_load(reference, reference_sz, RSA_FLAG_TYPE_RSASSAPSS);
  ------------------
  |  |  119|      3|# define RSA_FLAG_TYPE_RSASSAPSS       0x1000
  ------------------
  680|      3|}

ossl_prov_drbg_nonce_ctx_new:
  282|      4|{
  283|      4|    PROV_DRBG_NONCE_GLOBAL *dngbl = OPENSSL_zalloc(sizeof(*dngbl));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  284|       |
  285|      4|    if (dngbl == NULL)
  ------------------
  |  Branch (285:9): [True: 0, False: 4]
  ------------------
  286|      0|        return NULL;
  287|       |
  288|      4|    dngbl->rand_nonce_lock = CRYPTO_THREAD_lock_new();
  289|      4|    if (dngbl->rand_nonce_lock == NULL) {
  ------------------
  |  Branch (289:9): [True: 0, False: 4]
  ------------------
  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|      4|    return dngbl;
  295|      4|}
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|}

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_lock:
  220|      1|{
  221|      1|    return 1;
  222|      1|}
seed_src.c:seed_src_unlock:
  225|      1|{
  226|      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|}
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|}

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

ssl_sort_cipher_list:
 3306|      2|{
 3307|      2|    qsort(tls13_ciphers, TLS13_NUM_CIPHERS, sizeof(tls13_ciphers[0]),
  ------------------
  |  |   24|      2|#define TLS13_NUM_CIPHERS       OSSL_NELEM(tls13_ciphers)
  |  |  ------------------
  |  |  |  |   14|      2|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3308|      2|          cipher_compare);
 3309|      2|    qsort(ssl3_ciphers, SSL3_NUM_CIPHERS, sizeof(ssl3_ciphers[0]),
  ------------------
  |  |   25|      2|#define SSL3_NUM_CIPHERS        OSSL_NELEM(ssl3_ciphers)
  |  |  ------------------
  |  |  |  |   14|      2|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3310|      2|          cipher_compare);
 3311|      2|    qsort(ssl3_scsvs, SSL3_NUM_SCSVS, sizeof(ssl3_scsvs[0]), cipher_compare);
  ------------------
  |  |   26|      2|#define SSL3_NUM_SCSVS          OSSL_NELEM(ssl3_scsvs)
  |  |  ------------------
  |  |  |  |   14|      2|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3312|      2|}
ssl3_get_cipher_by_id:
 4170|    411|{
 4171|    411|    SSL_CIPHER c;
 4172|    411|    const SSL_CIPHER *cp;
 4173|       |
 4174|    411|    c.id = id;
 4175|    411|    cp = OBJ_bsearch_ssl_cipher_id(&c, tls13_ciphers, TLS13_NUM_CIPHERS);
  ------------------
  |  |   24|    411|#define TLS13_NUM_CIPHERS       OSSL_NELEM(tls13_ciphers)
  |  |  ------------------
  |  |  |  |   14|    411|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 4176|    411|    if (cp != NULL)
  ------------------
  |  Branch (4176:9): [True: 143, False: 268]
  ------------------
 4177|    143|        return cp;
 4178|    268|    cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS);
  ------------------
  |  |   25|    268|#define SSL3_NUM_CIPHERS        OSSL_NELEM(ssl3_ciphers)
  |  |  ------------------
  |  |  |  |   14|    268|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 4179|    268|    if (cp != NULL)
  ------------------
  |  Branch (4179:9): [True: 259, False: 9]
  ------------------
 4180|    259|        return cp;
 4181|      9|    return OBJ_bsearch_ssl_cipher_id(&c, ssl3_scsvs, SSL3_NUM_SCSVS);
  ------------------
  |  |   26|      9|#define SSL3_NUM_SCSVS          OSSL_NELEM(ssl3_scsvs)
  |  |  ------------------
  |  |  |  |   14|      9|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  |  |  ------------------
  ------------------
 4182|    268|}
s3_lib.c:cipher_compare:
 3296|  1.94k|{
 3297|  1.94k|    const SSL_CIPHER *ap = (const SSL_CIPHER *)a;
 3298|  1.94k|    const SSL_CIPHER *bp = (const SSL_CIPHER *)b;
 3299|       |
 3300|  1.94k|    if (ap->id == bp->id)
  ------------------
  |  Branch (3300:9): [True: 0, False: 1.94k]
  ------------------
 3301|      0|        return 0;
 3302|  1.94k|    return ap->id < bp->id ? -1 : 1;
  ------------------
  |  Branch (3302:12): [True: 1.25k, False: 694]
  ------------------
 3303|  1.94k|}

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

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

ossl_err_load_SSL_strings:
  623|      2|{
  624|      2|#ifndef OPENSSL_NO_ERR
  625|      2|    if (ERR_reason_error_string(SSL_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (625:9): [True: 2, False: 0]
  ------------------
  626|      2|        ERR_load_strings_const(SSL_str_reasons);
  627|      2|#endif
  628|      2|    return 1;
  629|      2|}

OPENSSL_init_ssl:
   69|    465|{
   70|    465|    static int stoperrset = 0;
   71|       |
   72|    465|    if (stopped) {
  ------------------
  |  Branch (72:9): [True: 0, False: 465]
  ------------------
   73|      0|        if (!stoperrset) {
  ------------------
  |  Branch (73:13): [True: 0, False: 0]
  ------------------
   74|       |            /*
   75|       |             * We only ever set this once to avoid getting into an infinite
   76|       |             * loop where the error system keeps trying to init and fails so
   77|       |             * sets an error etc
   78|       |             */
   79|      0|            stoperrset = 1;
   80|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   81|      0|        }
   82|      0|        return 0;
   83|      0|    }
   84|       |
   85|    465|    opts |= OPENSSL_INIT_ADD_ALL_CIPHERS
  ------------------
  |  |  464|    465|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
   86|    465|         |  OPENSSL_INIT_ADD_ALL_DIGESTS;
  ------------------
  |  |  465|    465|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
   87|    465|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   88|    465|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG) == 0)
  ------------------
  |  |  469|    465|# define OPENSSL_INIT_NO_LOAD_CONFIG         0x00000080L
  ------------------
  |  Branch (88:9): [True: 465, False: 0]
  ------------------
   89|    465|        opts |= OPENSSL_INIT_LOAD_CONFIG;
  ------------------
  |  |  468|    465|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
   90|    465|#endif
   91|       |
   92|    465|    if (!OPENSSL_init_crypto(opts, settings))
  ------------------
  |  Branch (92:9): [True: 0, False: 465]
  ------------------
   93|      0|        return 0;
   94|       |
   95|    465|    if (!RUN_ONCE(&ssl_base, ossl_init_ssl_base))
  ------------------
  |  |  130|    465|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 465, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (95:9): [True: 0, False: 465]
  ------------------
   96|      0|        return 0;
   97|       |
   98|    465|    if ((opts & OPENSSL_INIT_NO_LOAD_SSL_STRINGS)
  ------------------
  |  | 2766|    465|# define OPENSSL_INIT_NO_LOAD_SSL_STRINGS    0x00100000L
  ------------------
  |  Branch (98:9): [True: 0, False: 465]
  ------------------
   99|    465|        && !RUN_ONCE_ALT(&ssl_strings, ossl_init_no_load_ssl_strings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (99:12): [True: 0, False: 0]
  ------------------
  100|    465|                         ossl_init_load_ssl_strings))
  101|      0|        return 0;
  102|       |
  103|    465|    if ((opts & OPENSSL_INIT_LOAD_SSL_STRINGS)
  ------------------
  |  | 2767|    465|# define OPENSSL_INIT_LOAD_SSL_STRINGS       0x00200000L
  ------------------
  |  Branch (103:9): [True: 465, False: 0]
  ------------------
  104|    465|        && !RUN_ONCE(&ssl_strings, ossl_init_load_ssl_strings))
  ------------------
  |  |  130|    465|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 465, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (104:12): [True: 0, False: 465]
  ------------------
  105|      0|        return 0;
  106|       |
  107|    465|    return 1;
  108|    465|}
ssl_init.c:ossl_init_ssl_base:
   25|      2|{
   26|      2|#ifndef OPENSSL_NO_COMP
   27|      2|    OSSL_TRACE(INIT, "ossl_init_ssl_base: "
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   28|      2|               "SSL_COMP_get_compression_methods()\n");
   29|       |    /*
   30|       |     * This will initialise the built-in compression algorithms. The value
   31|       |     * returned is a STACK_OF(SSL_COMP), but that can be discarded safely
   32|       |     */
   33|      2|    SSL_COMP_get_compression_methods();
   34|      2|#endif
   35|      2|    ssl_sort_cipher_list();
   36|      2|    OSSL_TRACE(INIT, "ossl_init_ssl_base: SSL_add_ssl_module()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   37|      2|    ssl_base_inited = 1;
   38|      2|    return 1;
   39|      2|}
ssl_init.c:ossl_init_load_ssl_strings:
   44|      2|{
   45|       |    /*
   46|       |     * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time
   47|       |     * pulling in all the error strings during static linking
   48|       |     */
   49|      2|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
   50|      2|    OSSL_TRACE(INIT, "ossl_init_load_ssl_strings: ossl_err_load_SSL_strings()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   51|      2|    ossl_err_load_SSL_strings();
   52|      2|#endif
   53|      2|    return 1;
   54|      2|}

ssl_cipher_id_cmp:
 3192|  2.79k|{
 3193|  2.79k|    if (a->id > b->id)
  ------------------
  |  Branch (3193:9): [True: 803, False: 1.99k]
  ------------------
 3194|    803|        return 1;
 3195|  1.99k|    if (a->id < b->id)
  ------------------
  |  Branch (3195:9): [True: 1.58k, False: 403]
  ------------------
 3196|  1.58k|        return -1;
 3197|    403|    return 0;
 3198|  1.99k|}
ssl_protocol_to_string:
 4820|    393|{
 4821|    393|    switch (version) {
 4822|      5|    case TLS1_3_VERSION:
  ------------------
  |  |   27|      5|# define TLS1_3_VERSION                  0x0304
  ------------------
  |  Branch (4822:5): [True: 5, False: 388]
  ------------------
 4823|      5|        return "TLSv1.3";
 4824|       |
 4825|     38|    case TLS1_2_VERSION:
  ------------------
  |  |   26|     38|# define TLS1_2_VERSION                  0x0303
  ------------------
  |  Branch (4825:5): [True: 38, False: 355]
  ------------------
 4826|     38|        return "TLSv1.2";
 4827|       |
 4828|     34|    case TLS1_1_VERSION:
  ------------------
  |  |   25|     34|# define TLS1_1_VERSION                  0x0302
  ------------------
  |  Branch (4828:5): [True: 34, False: 359]
  ------------------
 4829|     34|        return "TLSv1.1";
 4830|       |
 4831|     14|    case TLS1_VERSION:
  ------------------
  |  |   24|     14|# define TLS1_VERSION                    0x0301
  ------------------
  |  Branch (4831:5): [True: 14, False: 379]
  ------------------
 4832|     14|        return "TLSv1";
 4833|       |
 4834|      2|    case SSL3_VERSION:
  ------------------
  |  |   23|      2|# define SSL3_VERSION                    0x0300
  ------------------
  |  Branch (4834:5): [True: 2, False: 391]
  ------------------
 4835|      2|        return "SSLv3";
 4836|       |
 4837|      2|    case DTLS1_BAD_VER:
  ------------------
  |  |   30|      2|# define DTLS1_BAD_VER                   0x0100
  ------------------
  |  Branch (4837:5): [True: 2, False: 391]
  ------------------
 4838|      2|        return "DTLSv0.9";
 4839|       |
 4840|      4|    case DTLS1_VERSION:
  ------------------
  |  |   28|      4|# define DTLS1_VERSION                   0xFEFF
  ------------------
  |  Branch (4840:5): [True: 4, False: 389]
  ------------------
 4841|      4|        return "DTLSv1";
 4842|       |
 4843|      3|    case DTLS1_2_VERSION:
  ------------------
  |  |   29|      3|# define DTLS1_2_VERSION                 0xFEFD
  ------------------
  |  Branch (4843:5): [True: 3, False: 390]
  ------------------
 4844|      3|        return "DTLSv1.2";
 4845|       |
 4846|    291|    default:
  ------------------
  |  Branch (4846:5): [True: 291, False: 102]
  ------------------
 4847|    291|        return "unknown";
 4848|    393|    }
 4849|    393|}

ssl_session_calculate_timeout:
   48|    860|{
   49|    860|    ss->calc_timeout = ossl_time_add(ss->time, ss->timeout);
   50|    860|}
SSL_SESSION_new:
  102|    463|{
  103|    463|    SSL_SESSION *ss;
  104|       |
  105|    463|    if (!OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL))
  ------------------
  |  | 2767|    463|# define OPENSSL_INIT_LOAD_SSL_STRINGS       0x00200000L
  ------------------
  |  Branch (105:9): [True: 0, False: 463]
  ------------------
  106|      0|        return NULL;
  107|       |
  108|    463|    ss = OPENSSL_zalloc(sizeof(*ss));
  ------------------
  |  |  104|    463|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    463|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    463|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  109|    463|    if (ss == NULL)
  ------------------
  |  Branch (109:9): [True: 0, False: 463]
  ------------------
  110|      0|        return NULL;
  111|       |
  112|    463|    ss->ext.max_fragment_len_mode = TLSEXT_max_fragment_length_UNSPECIFIED;
  ------------------
  |  |  235|    463|# define TLSEXT_max_fragment_length_UNSPECIFIED 255
  ------------------
  113|    463|    ss->verify_result = 1;      /* avoid 0 (= X509_V_OK) just in case */
  114|       |   /* 5 minute timeout by default */
  115|    463|    ss->timeout = ossl_seconds2time(60 * 5 + 4);
  ------------------
  |  |   41|    463|#define ossl_seconds2time(s) ossl_ticks2time((s) * OSSL_TIME_SECOND)
  |  |  ------------------
  |  |  |  |   30|    463|# define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  ------------------
  ------------------
  116|    463|    ss->time = ossl_time_now();
  117|    463|    ssl_session_calculate_timeout(ss);
  118|    463|    if (!CRYPTO_NEW_REF(&ss->references, 1)) {
  ------------------
  |  Branch (118:9): [True: 0, False: 463]
  ------------------
  119|      0|        OPENSSL_free(ss);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  120|      0|        return NULL;
  121|      0|    }
  122|       |
  123|    463|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data)) {
  ------------------
  |  |  230|    463|# define CRYPTO_EX_INDEX_SSL_SESSION      2
  ------------------
  |  Branch (123:9): [True: 0, False: 463]
  ------------------
  124|      0|        CRYPTO_FREE_REF(&ss->references);
  125|      0|        OPENSSL_free(ss);
  ------------------
  |  |  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|        return NULL;
  127|      0|    }
  128|    463|    return ss;
  129|    463|}
SSL_SESSION_free:
  841|  11.5k|{
  842|  11.5k|    int i;
  843|       |
  844|  11.5k|    if (ss == NULL)
  ------------------
  |  Branch (844:9): [True: 11.0k, False: 463]
  ------------------
  845|  11.0k|        return;
  846|    463|    CRYPTO_DOWN_REF(&ss->references, &i);
  847|    463|    REF_PRINT_COUNT("SSL_SESSION", ss);
  ------------------
  |  |  289|    463|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|    463|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|    463|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|    463|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  848|    463|    if (i > 0)
  ------------------
  |  Branch (848:9): [True: 0, False: 463]
  ------------------
  849|      0|        return;
  850|    463|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  281|    463|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 463]
  |  |  ------------------
  ------------------
  851|       |
  852|    463|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data);
  ------------------
  |  |  230|    463|# define CRYPTO_EX_INDEX_SSL_SESSION      2
  ------------------
  853|       |
  854|    463|    OPENSSL_cleanse(ss->master_key, sizeof(ss->master_key));
  855|    463|    OPENSSL_cleanse(ss->session_id, sizeof(ss->session_id));
  856|    463|    X509_free(ss->peer);
  857|    463|    EVP_PKEY_free(ss->peer_rpk);
  858|    463|    OSSL_STACK_OF_X509_free(ss->peer_chain);
  859|    463|    OPENSSL_free(ss->ext.hostname);
  ------------------
  |  |  115|    463|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    463|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    463|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  860|    463|    OPENSSL_free(ss->ext.tick);
  ------------------
  |  |  115|    463|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    463|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    463|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  861|    463|#ifndef OPENSSL_NO_PSK
  862|    463|    OPENSSL_free(ss->psk_identity_hint);
  ------------------
  |  |  115|    463|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    463|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    463|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  863|    463|    OPENSSL_free(ss->psk_identity);
  ------------------
  |  |  115|    463|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    463|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    463|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  864|    463|#endif
  865|    463|#ifndef OPENSSL_NO_SRP
  866|    463|    OPENSSL_free(ss->srp_username);
  ------------------
  |  |  115|    463|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    463|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    463|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  867|    463|#endif
  868|    463|    OPENSSL_free(ss->ext.alpn_selected);
  ------------------
  |  |  115|    463|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    463|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    463|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  869|    463|    OPENSSL_free(ss->ticket_appdata);
  ------------------
  |  |  115|    463|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    463|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    463|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  870|    463|    CRYPTO_FREE_REF(&ss->references);
  871|    463|    OPENSSL_clear_free(ss, sizeof(*ss));
  ------------------
  |  |  113|    463|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    463|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    463|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  872|    463|}

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

